重置评分的

This commit is contained in:
guoshengxiong 2024-05-21 13:56:38 +08:00
parent 7a9419d0a9
commit 9ebba8bc8e
4 changed files with 25 additions and 2 deletions

View File

@ -81,8 +81,8 @@ public class WorkerInfoController {
@OperLog(operModul = "劳务管理", operType = "编辑劳务人员", operDesc = "编辑劳务人员信息") @OperLog(operModul = "劳务管理", operType = "编辑劳务人员", operDesc = "编辑劳务人员信息")
@ApiOperation(value = "编辑劳务人员信息", notes = "编辑劳务人员信息", httpMethod = "PUT") @ApiOperation(value = "编辑劳务人员信息", notes = "编辑劳务人员信息", httpMethod = "PUT")
@RequestMapping(method = {RequestMethod.POST, RequestMethod.PUT}, value = "/updateById") @RequestMapping(method = {RequestMethod.POST, RequestMethod.PUT}, value = "/updateById")
public Result<WorkerInfo> updateById(@RequestBody WorkerInfo workerInfo) { public Result edit(@RequestBody WorkerInfo workerInfo) {
workerInfoService.updateById(workerInfo); workerInfoService.edit(workerInfo);
return Result.ok(); return Result.ok();
} }

View File

@ -148,4 +148,6 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
* @param map * @param map
*/ */
void updateScoreSendAuth(HashMap<String, Object> map); void updateScoreSendAuth(HashMap<String, Object> map);
void edit(WorkerInfo workerInfo);
} }

View File

@ -2172,6 +2172,18 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
projectUfaceConfigService.updateWorkerInfo(workerInfo, workerInfo); projectUfaceConfigService.updateWorkerInfo(workerInfo, workerInfo);
} }
@Override
public void edit(WorkerInfo workerInfo) {
WorkerInfo old = baseMapper.selectById(workerInfo.getId());
if (old == null) {
throw new OpenAlertException("未找到该记录");
}
updateById(workerInfo);
if (NumberUtils.eq(workerInfo.getSafeScore(), 100D)) {
projectUfaceConfigService.updateWorkerInfo(workerInfo, workerInfo);
}
}
/** /**
* 真正递归的方法 * 真正递归的方法
* *

View File

@ -83,6 +83,15 @@ public class NumberUtils {
return b1 != null && b2 != null && b1 < b2; return b1 != null && b2 != null && b1 < b2;
} }
/**
* 等于
*
* @return
*/
public static boolean eq(Double b1, Double b2) {
return b1 != null && b2 != null && b1.equals(b2);
}
/** /**
* description: 使用 String.format 格式化数字实现左侧补 0 * description: 使用 String.format 格式化数字实现左侧补 0
* *