From da85424227a6bd94491ad322defd0503550c316e Mon Sep 17 00:00:00 2001 From: Ledo Date: Sun, 16 Feb 2025 12:33:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=A3=85=E9=85=8D=E6=8A=A5?= =?UTF-8?q?=E5=B7=A5=E5=BE=85=E5=8A=9E=20=E8=AE=BE=E8=AE=A1=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E5=AE=8C=E6=88=90=E6=9B=B4=E6=94=B9=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bdgzsomthing/bdgzsomthingMapper.java | 1 + .../ProcessDesignServiceImpl.java | 55 +++++++++++++++---- .../taskdispatch/TaskDispatchServiceImpl.java | 13 +++++ .../bdgzsomthing/bdgzsomthingMapper.xml | 6 ++ 4 files changed, 65 insertions(+), 10 deletions(-) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/bdgzsomthing/bdgzsomthingMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/bdgzsomthing/bdgzsomthingMapper.java index 04c8c6a..0c7c700 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/bdgzsomthing/bdgzsomthingMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/bdgzsomthing/bdgzsomthingMapper.java @@ -114,6 +114,7 @@ public interface bdgzsomthingMapper extends BaseMapperX { List selecteqintq(bdgzsomthingDO qcObject); List selecteqintone(bdgzsomthingDO qcObject); bdgzsomthingDO selecteqintzq(bdgzsomthingDO qcObject); + List selecteqintAttr12IsNull(@Param("attr3")String attr3,@Param("things")String things); void updateYnAndAttr4(@Param("id")String id,@Param("attr4")String attr4,@Param("yn")String yn); int deleteByIdNew(@Param("id") Long id); int deleteByIdNew1(@Param("id") Long id); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java index 7562523..0bf5e5c 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java @@ -1,18 +1,23 @@ package com.chanko.yunxi.mes.module.heli.service.processdesign; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.generator.IFill; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; import com.chanko.yunxi.mes.framework.common.util.object.ObjectUtils; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils; import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.ProcessDesignPageReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.ProcessDesignProgressPageReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.ProcessDesignSaveReqSubVO; import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.ProcessDesignSaveReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.ZjBgMasterLinePageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress.ProcessDesignProgressDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign.ProcessDesignMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign.ProcessDesignProgressMapper; import com.chanko.yunxi.mes.module.heli.enums.ProcessDesignTypeEnum; @@ -46,8 +51,8 @@ public class ProcessDesignServiceImpl implements ProcessDesignService { private ProcessDesignMapper processDesignMapper; @Resource private ProcessDesignProgressMapper processDesignProgressMapper; - - + @Resource + private bdgzsomthingMapper bdgzsomthingMapper; @Override public PageResult getProcessPage(ProcessDesignProgressPageReqVO pageReqVO) { return processDesignProgressMapper.selectPage(pageReqVO); @@ -56,19 +61,18 @@ public class ProcessDesignServiceImpl implements ProcessDesignService { public Long updateBaoGong(ProcessDesignSaveReqSubVO reqVO){ //先取出主ID下的所有报工百分比判断不能报工不能超过100 ProcessDesignProgressDO processDesignProgressDOS = processDesignProgressMapper.selectSumJinDu(reqVO.getZid()); - BigDecimal value1 = reqVO.getProgress(); - BigDecimal threshold = new BigDecimal("100"); + BigDecimal newProgress = reqVO.getProgress(); + BigDecimal OVER_PROGRESS_VALUE = new BigDecimal("100"); if(processDesignProgressDOS != null){ //相加判断是否大于100,大于时返回前端并给用户提示 - BigDecimal value2 = processDesignProgressDOS.getProgress(); - BigDecimal sum = value1.add(value2); + BigDecimal beforeProgress = processDesignProgressDOS.getProgress(); - if (value1.compareTo(threshold) > 0) { + if (newProgress.compareTo(OVER_PROGRESS_VALUE) > 0) { //大于100时不执行,并返回给用户,提示设计进度不能超过100 throw exception(TASK_REPORT_PARAMS_ERRORJD); } else { - if(processDesignProgressDOS.getProgress().compareTo(value1)>0){ + if(beforeProgress.compareTo(newProgress)>0){ throw exception(TASK_REPORT_PARAMS_ERRORSJBG); }else{ //反之插入数据库数据 @@ -79,12 +83,28 @@ public class ProcessDesignServiceImpl implements ProcessDesignService { if (reqVO.getRemark() != null && !reqVO.getRemark().trim().equals("")){ processDesignProgressDO.setRemark(reqVO.getRemark()); } - processDesignProgressMapper.insert(processDesignProgressDO); + if (newProgress.compareTo(OVER_PROGRESS_VALUE) == 0){ + //如果进度为100%,要删除待办提醒 + //1.查询父项拿到设计图纸类型 + ProcessDesignDO processDesignDO = processDesignMapper.selectById(reqVO.getZid()); + String designType = getDesignType(processDesignDO.getProcessDesignType().split("BLUEPRINT_")[1]); + + //2.查询待办是否有这个待办 + List bdgzsomthingDOList = bdgzsomthingMapper.selecteqintAttr12IsNull(processDesignDO.getPlanCode(), designType); + //如果有就更新待办 + if (CollUtil.isNotEmpty(bdgzsomthingDOList)){ + for (bdgzsomthingDO bdgzsomthingDO : bdgzsomthingDOList) { + bdgzsomthingDO.setAttr4("1"); + bdgzsomthingDO.setAttr12("0"); + bdgzsomthingMapper.updateById(bdgzsomthingDO); + } + } + } } } }else{ - if(value1.compareTo(threshold) > 0){ + if(newProgress.compareTo(OVER_PROGRESS_VALUE) > 0){ throw exception(TASK_REPORT_PARAMS_ERRORJD); }else{ //反之插入数据库数据 @@ -101,6 +121,21 @@ public class ProcessDesignServiceImpl implements ProcessDesignService { return null; } + + public String getDesignType(String type){ + if (type.equals("2D")){ + return "2D设计"; + }else if (type.equals("3D")){ + return "3D设计"; + }else if (type.equals("WORKBLANK")){ + return "毛坯设计"; + }else if (type.equals("FOUNDRY_TECHNOLOGY")){ + //铸造工艺 + return "铸造工艺设计"; + }else { + return""; + } + } @Override public Long updateBaoGong(Long zid, BigDecimal progress, String imageLink,String remark){ //先取出主ID下的所有报工百分比判断不能报工不能超过100 diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java index b7db35a..466d381 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java @@ -11,6 +11,7 @@ import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*; import com.chanko.yunxi.mes.module.heli.controller.admin.ygjx.vo.YgjxPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuserdetail.FpUserDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; @@ -18,6 +19,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumber import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.equipmanufacture.EquipManufactureMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.fpuserdetail.FpUserDetailMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper; @@ -81,6 +83,8 @@ public class TaskDispatchServiceImpl implements TaskDispatchService { private ZjPgMasterService zjPgMasterService; @Resource private PgMasterService pgMasterService; + @Resource + private bdgzsomthingMapper bdgzsomthingMapper; @Override @Transactional(rollbackFor = Exception.class) public Long createTaskDispatch(TaskDispatchSaveReqVO createReqVO) { @@ -515,6 +519,15 @@ public class TaskDispatchServiceImpl implements TaskDispatchService { } } } + //看待办 + List bdgzsomthingDOList = bdgzsomthingMapper.selecteqintAttr12IsNull(taskDispatchDO.getCode(), "任务单"); + if (CollUtil.isNotEmpty(bdgzsomthingDOList)){ + for (bdgzsomthingDO bdgzsomthingDO : bdgzsomthingDOList) { + bdgzsomthingDO.setAttr4("1"); + bdgzsomthingDO.setAttr12("0"); + bdgzsomthingMapper.updateById(bdgzsomthingDO); + } + } if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && isBomDetailProductionOver){ pgMasterService.insertPgList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getBomDetailId()); }else if (taskDispatchDO.getDispatchType().equals("ASSEMBLE") && isProjectSubAssembleOver){ diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/bdgzsomthing/bdgzsomthingMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/bdgzsomthing/bdgzsomthingMapper.xml index dfe255d..7170b7e 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/bdgzsomthing/bdgzsomthingMapper.xml +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/bdgzsomthing/bdgzsomthingMapper.xml @@ -98,6 +98,12 @@ resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO"> select * from dbzz_table where things=#{things} and (attr12='1' or attr12 is null ) and dborgz =#{dborgz} and attr4='0' +