diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java index 016a8940..db299b69 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java @@ -127,7 +127,11 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) { return AjaxResult.error("请先添加领用任务物资明细"); } - + // 根据单号查询此单号是否已经存在 + List codeInfo = tmTaskMapper.selectLeaseApplyInfoByTaskNo(leaseApplyRequestVo.getLeaseApplyInfo().getCode()); + if (CollectionUtil.isNotEmpty(codeInfo)) { + return AjaxResult.error("此业务单号已经存在,请叉掉后重新提交"); + } LeaseApplyInfo leaseApplyInfo = leaseApplyRequestVo.getLeaseApplyInfo(); SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); Date nowDate = DateUtils.getNowDate(); @@ -465,6 +469,10 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { } if(!deptName.equals("")){ int thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_LEASE_APPLY.getTaskTypeId()); + int lzThisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId()); + if (StringUtils.isBlank(leaseDeptInfo.getCompanySX())) { + thisMonthMaxOrder = Math.max(thisMonthMaxOrder, lzThisMonthMaxOrder); + } taskCode = genderTaskCodeTwo(thisMonthMaxOrder,leaseDeptInfo.getCompanySX()); leaseDeptInfo.setTaskCode(taskCode); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java index d0c3f738..5186f812 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java @@ -3,6 +3,7 @@ package com.bonus.material.task.mapper; import java.util.Date; import java.util.List; +import com.bonus.common.biz.domain.lease.LeaseApplyInfo; import com.bonus.common.biz.domain.lease.LeaseOutDetails; import com.bonus.material.back.domain.BackApplyInfo; import com.bonus.material.basic.domain.BmUnit; @@ -137,4 +138,11 @@ public interface TmTaskMapper { * @return */ BmUnit selectBmUnitInfo(BackApplyInfo backApplyInfo); + + /** + * 根据任务编号查询任务信息 + * @param code + * @return + */ + List selectLeaseApplyInfoByTaskNo(String code); } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index c21c0934..1f0a74e0 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -392,8 +392,8 @@ case tt.task_status when 0 then '待审核' when 6 then '审核中' - when 3 then '已驳回' - when 2 then '已完成' + when 3 then '已完成' + when 2 then '已驳回' when 5 then '待提交' end as taskStatusName, IFNULL(sum(lad.pre_num),0) as preCountNum, diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml index 1eb7536d..7892892b 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml @@ -215,4 +215,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE unit_id = #{unitId} + + \ No newline at end of file