fix: blank_employees 模式不再自动带出基本工资
本月空白模式应所有金额默认 0,去掉从 emp.monthlySalary 自动填充 基本工资的逻辑,保持与"空白"语义一致。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -233,6 +233,26 @@ router.post('/accounts/:accountId/standards', async (req: AuthRequest, res: Resp
|
||||
} catch (err) { next(err) }
|
||||
})
|
||||
|
||||
/**
|
||||
* 快速更新当前年度标准的最低工资(无需新建版本)
|
||||
*/
|
||||
router.put('/accounts/:accountId/min-wage', async (req: AuthRequest, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const orgId = req.user!.orgId
|
||||
const { accountId } = req.params
|
||||
const { minWage } = req.body as { minWage: number }
|
||||
if (minWage === undefined || minWage < 0) {
|
||||
return res.status(400).json({ success: false, error: { code: 'BAD_REQUEST', message: 'minWage 必须为非负数' } })
|
||||
}
|
||||
const account = await prisma.socialAccount.findFirst({ where: { id: accountId, orgId } })
|
||||
if (!account) return res.status(404).json({ success: false, error: { code: 'NOT_FOUND', message: '账户不存在' } })
|
||||
const standard = await prisma.socialYearStandard.findFirst({ where: { accountId, isCurrent: true } })
|
||||
if (!standard) return res.status(404).json({ success: false, error: { code: 'NOT_FOUND', message: '当前年度标准不存在' } })
|
||||
const updated = await prisma.socialYearStandard.update({ where: { id: standard.id }, data: { minWage } })
|
||||
res.json({ success: true, data: updated })
|
||||
} catch (err) { next(err) }
|
||||
})
|
||||
|
||||
// 账户关联根部门(level=0)批量设置
|
||||
router.put('/accounts/:id/departments', async (req: AuthRequest, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user