生产装配报工待办
设计代办完成更改状态
This commit is contained in:
parent
ddcd521075
commit
da85424227
@ -114,6 +114,7 @@ public interface bdgzsomthingMapper extends BaseMapperX<bdgzsomthingDO> {
|
||||
List<bdgzsomthingDO> selecteqintq(bdgzsomthingDO qcObject);
|
||||
List<bdgzsomthingDO> selecteqintone(bdgzsomthingDO qcObject);
|
||||
bdgzsomthingDO selecteqintzq(bdgzsomthingDO qcObject);
|
||||
List<bdgzsomthingDO> 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);
|
||||
|
@ -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<ProcessDesignProgressDO> 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<bdgzsomthingDO> 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
|
||||
|
@ -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<bdgzsomthingDO> 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){
|
||||
|
@ -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'
|
||||
</select>
|
||||
<select id="selecteqintAttr12IsNull"
|
||||
parameterType="String"
|
||||
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
|
||||
select * from dbzz_table where things like concat('%',#{things},'%') and attr3 = #{attr3} and (attr12 is null or attr12 = '1')
|
||||
|
||||
</select>
|
||||
<select id="selecteqintq"
|
||||
parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO"
|
||||
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
|
||||
|
Loading…
Reference in New Issue
Block a user