bug 修改
This commit is contained in:
parent
bd5fd02da7
commit
c363ec49f1
|
|
@ -246,7 +246,7 @@ public class DispatchCarServiceImpl implements DispatchCarService{
|
|||
String roleName = loginUser.getRoleName();
|
||||
String status = data.getStatus(); // 前端传入:2=驳回,其它=通过
|
||||
String remark = data.getRemark();
|
||||
|
||||
CarNeedPlanVo carNeedPlanVo = mapper.getPlanInfo(data);
|
||||
CarPlanOutVo vo = mapper.getCarPlanOut(data); // 当前记录
|
||||
String currentStatus = vo.getStatus();
|
||||
|
||||
|
|
@ -256,13 +256,37 @@ public class DispatchCarServiceImpl implements DispatchCarService{
|
|||
return ServerResponse.createErroe("无权审核或状态不匹配,请刷新后重试");
|
||||
}
|
||||
|
||||
// 更新数据
|
||||
data.setStatus(targetStatus);
|
||||
int updated = mapper.updateDispatchData(data);
|
||||
if (updated <= 0) {
|
||||
return ServerResponse.createErroe("审核操作失败,请稍后重试");
|
||||
}
|
||||
|
||||
// 获取剩余未审核记录
|
||||
List<CarPlanOutVo> auditList = mapper.getAuditListNew(data);
|
||||
|
||||
if ("2".equals(status)) {
|
||||
// 驳回逻辑:如果没有其他待审核,计划状态置为9(驳回),否则0(待审核)
|
||||
carNeedPlanVo.setStatus(ListHelpUtil.isEmpty(auditList) ? 9 : 0);
|
||||
} else {
|
||||
// 通过逻辑
|
||||
if (isThirdLevelApprover(roleName)) {
|
||||
// 娄强通过后,更新调度数据
|
||||
int dispatchNum = carNeedPlanVo.getDispatchNum();
|
||||
carNeedPlanVo.setDispatchDay(DateTimeHelper.getNowDay());
|
||||
carNeedPlanVo.setDispatchNum(dispatchNum + vo.getDispatchNum());
|
||||
|
||||
// 如果没有其他待审核记录,状态置为1(完成调度),否则2(继续审核)
|
||||
carNeedPlanVo.setStatus(ListHelpUtil.isEmpty(auditList) ? 1 : 2);
|
||||
} else if (isSecondLevelApprover(roleName)) {
|
||||
// 分管领导通过后,如果没有其他待审核记录,状态置为2(待调度),否则0(继续审核)
|
||||
carNeedPlanVo.setStatus(ListHelpUtil.isEmpty(auditList) ? 2 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新计划信息
|
||||
mapper.updateCarPlanInfo(carNeedPlanVo);
|
||||
|
||||
// 写操作记录
|
||||
String uptime = recordService.getUpTimes("out-" + data.getId(), Integer.parseInt(targetStatus));
|
||||
recordService.addRecord("out-" + data.getId(), targetStatus, "2", "3", remark, uptime);
|
||||
|
|
@ -276,18 +300,15 @@ public class DispatchCarServiceImpl implements DispatchCarService{
|
|||
|
||||
private String determineNextStatus(String roleName, String currentStatus, String actionStatus) {
|
||||
if ("2".equals(actionStatus)) {
|
||||
// 驳回统一到状态9
|
||||
if (isSecondLevelApprover(roleName) && "1".equals(currentStatus)) return "9";
|
||||
if (isThirdLevelApprover(roleName) && "2".equals(currentStatus)) return "9";
|
||||
} else {
|
||||
// 通过流转到下一状态
|
||||
if (isSecondLevelApprover(roleName) && "0".equals(currentStatus)) return "1";
|
||||
if (isThirdLevelApprover(roleName) && "1".equals(currentStatus)) return "2";
|
||||
}
|
||||
return null; // 不符合条件
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private boolean isSecondLevelApprover(String roleName) {
|
||||
return "雷治明".equals(roleName) || "黄廉飞".equals(roleName)
|
||||
|| "刘晓".equals(roleName) || "张杰".equals(roleName);
|
||||
|
|
@ -299,6 +320,7 @@ public class DispatchCarServiceImpl implements DispatchCarService{
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param data
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ public class UserAuthenticationProvider implements AuthenticationProvider {
|
|||
if (userInfo == null) {
|
||||
throw new UsernameNotFoundException("用户名不存在");
|
||||
}
|
||||
//密码加密
|
||||
/* //密码加密
|
||||
String daya= Md5Utils.createPwdEncrypt(userName,password.toUpperCase(),userInfo.getSalt());
|
||||
if(!Md5Utils.validatePasswordBast64(daya, userInfo.getPassword())){
|
||||
throw new BadCredentialsException("密码不正确");
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// 我们还要判断密码是否正确,这里我们的密码使用BCryptPasswordEncoder进行加密的
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@
|
|||
<select id="getAuditListNew" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVo">
|
||||
select id,status,type
|
||||
FROM car_plan_out
|
||||
WHERE apply_id=#{planId} AND (status=0 or status=3)
|
||||
WHERE apply_id=#{planId} AND (status=0 or status=1)
|
||||
</select>
|
||||
<select id="getPlanInfo" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||
select dispatch_num dispatchNum,id,need_num needNum
|
||||
|
|
|
|||
Loading…
Reference in New Issue