diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java index 443e0b62..dcb03f33 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java @@ -71,6 +71,19 @@ public class AbnormalBillController { return R.ok(result); } + /** + * 拆分弹出框 + * + * @return + */ + @ResponseBody + @GetMapping("getQCAbnormal") + public R getQCAbnormal(){ + List result; + result = abnormalBillService.getQCAbnormal(); + return R.ok(result); + } + /** * 分页查询数据 * diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillLogController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillLogController.java index 368d81ad..8b69a27c 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillLogController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillLogController.java @@ -166,7 +166,7 @@ public class AbnormalBillLogController { } - @GetMapping("saveAndUpdate") + @GetMapping("/saveAndUpdate") public R saveAndUpdate(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose, @RequestParam List ncGroupAndNcCodes, diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalPlanController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalPlanController.java index b9a683ba..e35eea12 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalPlanController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalPlanController.java @@ -1,16 +1,15 @@ package com.foreverwin.mesnac.anomaly.controller; -import com.foreverwin.modular.core.util.R; -import com.foreverwin.modular.core.util.FrontPage; -import com.foreverwin.modular.core.util.CommonMethods; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springframework.web.bind.annotation.RequestMapping; +import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto; +import com.foreverwin.mesnac.anomaly.model.AbnormalPlan; +import com.foreverwin.mesnac.anomaly.service.AbnormalPlanService; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import com.foreverwin.mesnac.anomaly.service.AbnormalPlanService; -import com.foreverwin.mesnac.anomaly.model.AbnormalPlan; import java.util.List; /** @@ -69,7 +68,7 @@ public class AbnormalPlanController { queryWrapper.lambda().and(wrapper -> wrapper .like(AbnormalPlan::getHandle, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getSite, frontPage.getGlobalQuery()) - .or().like(AbnormalPlan::getAbnormalBillBo, frontPage.getGlobalQuery()) + .or().like(AbnormalPlan::getAbnormalNo, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getStatus, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getWorkCenter, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getAbnormalMethod, frontPage.getGlobalQuery()) @@ -77,6 +76,7 @@ public class AbnormalPlanController { .or().like(AbnormalPlan::getResrce, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getItemBo, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getProcessor, frontPage.getGlobalQuery()) + .or().like(AbnormalPlan::getSendUserGroup, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getClosedUser, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getCreatedUser, frontPage.getGlobalQuery()) .or().like(AbnormalPlan::getModifiedUser, frontPage.getGlobalQuery()) @@ -127,4 +127,15 @@ public class AbnormalPlanController { public R removeByIds(List ids){ return R.ok(abnormalPlanService.removeByIds(ids)); } + + @GetMapping("/findAbnormalPlan") + public R findAbnormalPlan(AbnormalPlanDto abnormalPlanDto){ + return R.ok(abnormalPlanService.findAbnormalPlan(abnormalPlanDto)); + } + + @GetMapping("/processes") + public R processes(List abnormalPlanList){ + abnormalPlanService.processes(abnormalPlanList); + return R.ok(); + } } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/dto/AbnormalPlanDto.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/dto/AbnormalPlanDto.java new file mode 100644 index 00000000..811f6dc1 --- /dev/null +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/dto/AbnormalPlanDto.java @@ -0,0 +1,67 @@ +package com.foreverwin.mesnac.anomaly.dto; + +import com.foreverwin.mesnac.anomaly.model.AbnormalPlan; + +import java.time.LocalDateTime; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-07 + */ +public class AbnormalPlanDto extends AbnormalPlan { + + private String itemDescription; + + private String fullName; + + private LocalDateTime startDateTime; + + private LocalDateTime endDateTime; + + private String resrceDescription; + + public String getItemDescription() { + return itemDescription; + } + + public void setItemDescription(String itemDescription) { + this.itemDescription = itemDescription; + } + + public String getFullName() { + return fullName; + } + + public LocalDateTime getStartDateTime() { + return startDateTime; + } + + public void setStartDateTime(LocalDateTime startDateTime) { + this.startDateTime = startDateTime; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + + public LocalDateTime getEndDateTime() { + return endDateTime; + } + + public void setEndDateTime(LocalDateTime endDateTime) { + this.endDateTime = endDateTime; + } + + public String getResrceDescription() { + return resrceDescription; + } + + public void setResrceDescription(String resrceDescription) { + this.resrceDescription = resrceDescription; + } + + +} diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalBillDisposeMapper.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalBillDisposeMapper.java index 426d30ab..c5efb797 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalBillDisposeMapper.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalBillDisposeMapper.java @@ -21,10 +21,10 @@ public interface AbnormalBillDisposeMapper extends BaseMapper { Integer findAbnormalMethodBySFC(@Param("site")String site,@Param("sfc")String sfc); List findScrapDtoBySfc(@Param("site")String site, @Param("sfc")String sfc); + + List getQCAbnormalList(@Param("site") String site); } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalPlanMapper.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalPlanMapper.java index 503ae4d3..5272166e 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalPlanMapper.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalPlanMapper.java @@ -1,12 +1,16 @@ package com.foreverwin.mesnac.anomaly.mapper; -import com.foreverwin.mesnac.anomaly.model.AbnormalPlan; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto; +import com.foreverwin.mesnac.anomaly.model.AbnormalPlan; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

- * Mapper 接口 + * 计划异常待办事项 Mapper 接口 *

* * @author zjw @@ -15,4 +19,5 @@ import org.springframework.stereotype.Repository; @Repository public interface AbnormalPlanMapper extends BaseMapper { + List findAbnormalPlan(@Param("locale") String locale, @Param("abnormalPlanDto")AbnormalPlan abnormalPlanDto); } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/AbnormalPlan.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/AbnormalPlan.java index d718d623..fb910ae5 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/AbnormalPlan.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/AbnormalPlan.java @@ -1,18 +1,17 @@ package com.foreverwin.mesnac.anomaly.model; -import java.io.Serializable; - +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableField; + import java.io.Serializable; -import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; /** *

- * + * 计划异常待办事项 *

* * @author zjw @@ -38,8 +37,8 @@ public class AbnormalPlan extends Model { /** * 异常单号 */ - @TableField("ABNORMAL_BILL_BO") - private String abnormalBillBo; + @TableField("ABNORMAL_NO") + private String abnormalNo; /** * 状态 */ @@ -81,10 +80,15 @@ public class AbnormalPlan extends Model { @TableField("PROCESSOR") private String processor; /** - * 处理时间 + * 发送用户组 */ - @TableField("PROCESS_DATE_TIME") - private LocalDateTime processDateTime; + @TableField("SEND_USER_GROUP") + private String sendUserGroup; + /** + * 发送时间和处理时间 + */ + @TableField("SEND_DATE_TIME") + private LocalDateTime sendDateTime; /** * 闭环人员 */ @@ -133,12 +137,12 @@ public class AbnormalPlan extends Model { this.site = site; } - public String getAbnormalBillBo() { - return abnormalBillBo; + public String getAbnormalNo() { + return abnormalNo; } - public void setAbnormalBillBo(String abnormalBillBo) { - this.abnormalBillBo = abnormalBillBo; + public void setAbnormalNo(String abnormalNo) { + this.abnormalNo = abnormalNo; } public String getStatus() { @@ -205,12 +209,20 @@ public class AbnormalPlan extends Model { this.processor = processor; } - public LocalDateTime getProcessDateTime() { - return processDateTime; + public String getSendUserGroup() { + return sendUserGroup; } - public void setProcessDateTime(LocalDateTime processDateTime) { - this.processDateTime = processDateTime; + public void setSendUserGroup(String sendUserGroup) { + this.sendUserGroup = sendUserGroup; + } + + public LocalDateTime getSendDateTime() { + return sendDateTime; + } + + public void setSendDateTime(LocalDateTime sendDateTime) { + this.sendDateTime = sendDateTime; } public String getClosedUser() { @@ -265,7 +277,7 @@ public static final String HANDLE = "HANDLE"; public static final String SITE = "SITE"; -public static final String ABNORMAL_BILL_BO = "ABNORMAL_BILL_BO"; +public static final String ABNORMAL_NO = "ABNORMAL_NO"; public static final String STATUS = "STATUS"; @@ -283,7 +295,9 @@ public static final String QTY = "QTY"; public static final String PROCESSOR = "PROCESSOR"; -public static final String PROCESS_DATE_TIME = "PROCESS_DATE_TIME"; +public static final String SEND_USER_GROUP = "SEND_USER_GROUP"; + +public static final String SEND_DATE_TIME = "SEND_DATE_TIME"; public static final String CLOSED_USER = "CLOSED_USER"; @@ -308,7 +322,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; return "AbnormalPlan{" + "handle = " + handle + ", site = " + site + - ", abnormalBillBo = " + abnormalBillBo + + ", abnormalNo = " + abnormalNo + ", status = " + status + ", workCenter = " + workCenter + ", abnormalMethod = " + abnormalMethod + @@ -317,7 +331,8 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; ", itemBo = " + itemBo + ", qty = " + qty + ", processor = " + processor + - ", processDateTime = " + processDateTime + + ", sendUserGroup = " + sendUserGroup + + ", sendDateTime = " + sendDateTime + ", closedUser = " + closedUser + ", closedDateTime = " + closedDateTime + ", createdUser = " + createdUser + diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java index 98b7b028..49aaccda 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java @@ -134,4 +134,5 @@ public interface AbnormalBillService extends IService { */ String formatMessage(AbnormalBill abnormalBill,String messageType, String site); + List getQCAbnormal(); } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalPlanService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalPlanService.java index 401eff8b..674daf00 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalPlanService.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalPlanService.java @@ -3,6 +3,9 @@ package com.foreverwin.mesnac.anomaly.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto; +import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto; +import com.foreverwin.mesnac.anomaly.model.AbnormalBill; +import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose; import com.foreverwin.mesnac.anomaly.model.AbnormalPlan; import com.foreverwin.modular.core.util.FrontPage; @@ -11,7 +14,7 @@ import java.util.List; /** *

- * 服务类 + * 计划异常待办事项 服务类 *

* * @author zjw @@ -29,4 +32,10 @@ public interface AbnormalPlanService extends IService { List selectList(AbnormalPlan abnormalPlan); void saveAbnormalPlan(AbnormalBillDisposeDto abnormalBillDisposeDto, LocalDateTime now); + + void saveAbnormalPlan(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose, LocalDateTime now); + + List findAbnormalPlan(AbnormalPlanDto abnormalPlanDto); + + void processes(List abnormalPlanList); } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java index aa3b9edb..82fe750d 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java @@ -9,10 +9,7 @@ import com.foreverwin.mesnac.anomaly.model.AbnormalBill; import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose; import com.foreverwin.mesnac.anomaly.model.AbnormalBillLog; import com.foreverwin.mesnac.anomaly.model.AbnormalNcCode; -import com.foreverwin.mesnac.anomaly.service.AbnormalBillDisposeService; -import com.foreverwin.mesnac.anomaly.service.AbnormalBillLogService; -import com.foreverwin.mesnac.anomaly.service.AbnormalBillService; -import com.foreverwin.mesnac.anomaly.service.AbnormalNcCodeService; +import com.foreverwin.mesnac.anomaly.service.*; import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.util.StringUtil; @@ -69,6 +66,9 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, AbnormalBillLog abnormalBillLog) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -163,6 +163,7 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl messageMap = new HashMap<>(); //根据车间找到对应车间的描述 - WorkCenter workCenter = workCenterMapper.findWorkCenterDescriptionByWorkCenter(site, abnormalBill.getWorkCenter(), locale); - //根据资源找到对应的产线的描述 - WorkCenter line = null; - if(StringUtil.isBlank(abnormalBill.getResrce())){ - line = workCenterMapper.findWorkCenterDescriptionByResrce(HandleEnum.RESOURCE.getHandle(site, abnormalBill.getResrce()), locale); - } - - //项目号 - ShopOrderDto projectNo = shopOrderMapper.findByShopOrderBo(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBill.getShopOrder())); - //物料 - Item _item = itemMapper.selectById(locale, abnormalBill.getItemBo()); - String item = ""; - if(_item != null){ - item = _item.getItem() + "/" + _item.getDescription(); - } - if(workCenter != null && !StringUtil.isBlank(workCenter.getDescription())){ - messageMap.put("WORKCENTER",workCenter.getDescription()); - } - if(line != null && !StringUtil.isBlank(line.getDescription())){ - messageMap.put("WORKCENTER_LIN",line.getDescription()); - } - if(projectNo != null && !StringUtil.isBlank(projectNo.getItemNumber())){ - messageMap.put("PROJECT",projectNo.getItemNumber()); - } - if(!StringUtil.isBlank(abnormalBill.getWorkCenter())){ - messageMap.put("SHOPORDER",abnormalBill.getWorkCenter()); - } - messageMap.put("ITEM",item); +// WorkCenter workCenter = workCenterMapper.findWorkCenterDescriptionByWorkCenter(site, abnormalBill.getWorkCenter(), locale); +// //根据资源找到对应的产线的描述 +// WorkCenter line = null; +// if(StringUtil.isBlank(abnormalBill.getResrce())){ +// line = workCenterMapper.findWorkCenterDescriptionByResrce(HandleEnum.RESOURCE.getHandle(site, abnormalBill.getResrce()), locale); +// } +// +// //项目号 +// ShopOrderDto projectNo = shopOrderMapper.findByShopOrderBo(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBill.getShopOrder())); +// //物料 +// Item _item = itemMapper.selectById(locale, abnormalBill.getItemBo()); +// String item = ""; +// if(_item != null){ +// item = _item.getItem() + "/" + _item.getDescription(); +// } +// if(workCenter != null && !StringUtil.isBlank(workCenter.getDescription())){ +// messageMap.put("WORKCENTER",workCenter.getDescription()); +// } +// if(line != null && !StringUtil.isBlank(line.getDescription())){ +// messageMap.put("WORKCENTER_LIN",line.getDescription()); +// } +// if(projectNo != null && !StringUtil.isBlank(projectNo.getItemNumber())){ +// messageMap.put("PROJECT",projectNo.getItemNumber()); +// } +// if(!StringUtil.isBlank(abnormalBill.getWorkCenter())){ +// messageMap.put("SHOPORDER",abnormalBill.getWorkCenter()); +// } +// messageMap.put("ITEM",item); //格式化之后的消息 return StringUtils.format(body, messageMap); } - - - + @Override + public List getQCAbnormal() { + return abnormalBillMapper.getQCAbnormalList(CommonMethods.getSite()); + } @Override diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalPlanServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalPlanServiceImpl.java index 919feb95..e89e2101 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalPlanServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalPlanServiceImpl.java @@ -4,22 +4,34 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto; +import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto; import com.foreverwin.mesnac.anomaly.mapper.AbnormalPlanMapper; +import com.foreverwin.mesnac.anomaly.model.AbnormalBill; +import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose; import com.foreverwin.mesnac.anomaly.model.AbnormalPlan; import com.foreverwin.mesnac.anomaly.service.AbnormalPlanService; import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.enums.HandleEnum; +import com.foreverwin.mesnac.common.mapper.MessageMapper; +import com.foreverwin.mesnac.common.model.Message; +import com.foreverwin.mesnac.common.service.MessageService; +import com.foreverwin.mesnac.common.util.ActiveMQUtil; +import com.foreverwin.mesnac.meapi.model.NwaUser; +import com.foreverwin.mesnac.meapi.service.NwaUserService; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.util.List; +import java.util.UUID; + /** *

- * 服务实现类 + * 计划异常待办事项 服务实现类 *

* * @author zjw @@ -33,6 +45,19 @@ public class AbnormalPlanServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, AbnormalPlan abnormalPlan) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -47,15 +72,16 @@ public class AbnormalPlanServiceImpl extends ServiceImpl findAbnormalPlan(AbnormalPlanDto abnormalPlanDto) { + String site = CommonMethods.getSite(); + String locale = LocaleContextHolder.getLocale().getLanguage(); + abnormalPlanDto.setSite(site); + return abnormalPlanMapper.findAbnormalPlan(locale,abnormalPlanDto); + } + + @Override + public void processes(List abnormalPlanList) { + String site = CommonMethods.getSite(); + LocalDateTime now = LocalDateTime.now(); + String user = CommonMethods.getUser(); + for (AbnormalPlan abnormalPlan : abnormalPlanList){ + Message message = new Message(); + String uuid = UUID.randomUUID().toString(); + message.setHandle(uuid); + message.setSite(site); + message.setObjectBo(HandleEnum.ABNORMAL_PLAN.getHandle(site,abnormalPlan.getAbnormalNo())); + message.setMessageType(Constants.ABNORMAL_MESSAGE_PLAN); + + //设置消息格式content,没做 + + + message.setSendUserGroup(abnormalPlan.getSendUserGroup()); + message.setGrade(Double.parseDouble("1.0")); + message.setResponseDateTime(now); + message.setNode("PLAN"); + //设置为Y,则不进入计时器 + message.setStatus("Y"); + + + + + message.setCreatedUser(user); + message.setCreatedDateTime(now); + message.setModifiedUser(user); + message.setModifiedDateTime(now); + + //发送消息 + List nwaUsers = nwaUserService.checkUserGroup(site,message.getSendUserGroup()); + StringBuilder sendUsers = new StringBuilder(); + for (int i = 0; i < nwaUsers.size(); i++) { + if(i == (nwaUsers.size() - 1)){ + sendUsers.append(nwaUsers.get(i)); + }else{ + sendUsers.append(nwaUsers.get(i)).append("|"); + } + } + activeMQUtil.wechatSendMessage(sendUsers.toString(),message.getContent()); + //保存 + messageService.saveOrUpdate(message); + } + } + } \ No newline at end of file diff --git a/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml b/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml index eee42d28..b2311ab6 100644 --- a/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml +++ b/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml @@ -633,14 +633,14 @@ FROM Z_ABNORMAL_BILL ZAB LEFT JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZAB.HANDLE = ZABD.ABNORMAL_BILL_BO INNER JOIN ITEM I ON I.HANDLE = ZAB.ITEM_BO - LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{language} + LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{locale} INNER JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZAB.SHOP_ORDER AND SO.SITE = ZAB.SITE LEFT JOIN CUSTOM_FIELDS WORKORDER ON WORKORDER.HANDLE = SO.HANDLE AND WORKORDER."ATTRIBUTE" = 'WORK_ORDER' LEFT JOIN CUSTOM_FIELDS ITEMNUMBER ON ITEMNUMBER.HANDLE = SO.HANDLE AND ITEMNUMBER."ATTRIBUTE" = 'ITEM_NUMBER' LEFT JOIN CUSTOM_FIELDS PRODUCTCATEGORY ON PRODUCTCATEGORY.HANDLE = SO.HANDLE AND PRODUCTCATEGORY."ATTRIBUTE" = 'PRODUCT_CATEGORY' LEFT JOIN CUSTOM_FIELDS "MAP" ON "MAP".HANDLE = SO.HANDLE AND "MAP"."ATTRIBUTE" = 'MAP' LEFT JOIN Z_ABNORMAL_NC_CODE ZANC ON ZAB.HANDLE = ZANC.ABNORMAL_BILL_BO - LEFT JOIN NC_CODE_T NCT ON ('NCCodeBO:' || ZAB.SITE || ',' || ZANC.NC_CODE) = NCT.NC_CODE_BO AND NCT.LOCALE = #{language} + LEFT JOIN NC_CODE_T NCT ON ('NCCodeBO:' || ZAB.SITE || ',' || ZANC.NC_CODE) = NCT.NC_CODE_BO AND NCT.LOCALE = #{locale} LEFT JOIN Z_NWA_USER NWA ON NWA.USER_NAME = ZAB.PB_USER AND NWA.SITE = ZAB.SITE LEFT JOIN NC_GROUP NG ON NG.NC_GROUP = ZANC.NC_CODE_GROUP AND NG.SITE = ZAB.SITE LEFT JOIN ROUTER R ON SUBSTR(R.HANDLE,1,INSTR(R.HANDLE,',',-1)-1) = SUBSTR(ZABD.ROUTER_BO,1,INSTR(ZABD.ROUTER_BO,',',-1)-1) AND R.CURRENT_REVISION = 'true' diff --git a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml index f1081577..e84dfa1e 100644 --- a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml +++ b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml @@ -983,11 +983,8 @@ + diff --git a/anomaly/src/main/resources/mapper/AbnormalPlanMapper.xml b/anomaly/src/main/resources/mapper/AbnormalPlanMapper.xml index 40c3bd1b..6e7af945 100644 --- a/anomaly/src/main/resources/mapper/AbnormalPlanMapper.xml +++ b/anomaly/src/main/resources/mapper/AbnormalPlanMapper.xml @@ -6,7 +6,7 @@ - + @@ -15,7 +15,8 @@ - + + @@ -26,9 +27,15 @@ - HANDLE, SITE, ABNORMAL_BILL_BO, STATUS, WORK_CENTER, ABNORMAL_METHOD, SHOP_ORDER, RESRCE, ITEM_BO, QTY, PROCESSOR, PROCESS_DATE_TIME, CLOSED_USER, CLOSED_DATE_TIME, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME + HANDLE, SITE, ABNORMAL_NO, STATUS, WORK_CENTER, ABNORMAL_METHOD, SHOP_ORDER, RESRCE, ITEM_BO, QTY, PROCESSOR, SEND_USER_GROUP, SEND_DATE_TIME, CLOSED_USER, CLOSED_DATE_TIME, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME + + + + + + + SELECT ZAP.ABNORMAL_NO ABNORMAL_NO ,ZAP.ABNORMAL_METHOD ABNORMAL_METHOD , + ZAP.SHOP_ORDER SHOP_ORDER ,R.DESCRIPTION RESRCE_DESCRIPTION,ZAP.STATUS STATUS , + IT.DESCRIPTION ITEM_DESCRIPTION,ZAP.QTY QTY ,ZNU.FULL_NAME FULL_NAME + FROM Z_ABNORMAL_PLAN ZAP + LEFT JOIN RESRCE R ON R.RESRCE = ZAP.RESRCE AND R.SITE = ZAP.SITE + LEFT JOIN ITEM_T IT ON IT.ITEM_BO = ZAP.ITEM_BO AND IT.LOCALE = #{locale} + LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAP.PROCESSOR AND ZNU.SITE = ZAP.SITE + + ZAP.SITE =#{abnormalPlanDto.site} + + AND ZAP.WORK_CENTER = #{abnormalPlanDto.workCenter} + + + AND ZAP.RESRCE =#{abnormalPlanDto.resrce} + + + AND ZAP.SHOP_ORDER = #{abnormalPlanDto.shopOrder} + + + AND ZAP.ABNORMAL_NO = #{abnormalPlanDto.abnormalNo} + + + AND ZAP.STATUS = #{abnormalPlanDto.status} + + + AND ZAP.ABNORMAL_METHOD = #{abnormalPlanDto.abnormalMethod} + + + AND ZAP.CLOSED_DATE_TIME >= #{abnormalPlanDto.startDateTime} + + + AND ZAP.CLOSED_DATE_TIME <= #{abnormalPlanDto.endDateTime} + + + + diff --git a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java index a31535a0..8fb9ff3c 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java @@ -143,6 +143,7 @@ public interface Constants { String ABNORMAL_MESSAGE_QUALITY = "QCYC";//质量异常消息类型 String ABNORMAL_MESSAGE_OTHER = "OTYC";//其他异常消息类型 String ABNORMAL_MESSAGE_RESOURCE = "RSYC";//设备异常消息类型 + String ABNORMAL_MESSAGE_PLAN = "PLYC";//计划异常待办事项 /** * 异常节点 @@ -160,6 +161,8 @@ public interface Constants { String PRINT_TYPE_INV = "INV"; // 在制品标签 String PRINT_TYPE_SFC = "SFC"; + // 余料标签 + String PRINT_TYPE_EXM = "EXM"; /** * 刀具状态,Y-使用,N-报废/删除 @@ -170,8 +173,8 @@ public interface Constants { /** * 异常计划表的状态 */ - String UNTREATED = "UNTREATED"; //未处理 - String PROCESSED = "PROCESSED"; //已处理 + String UNTREATED = "UN"; //未处理 + String PROCESSED = "PR"; //已处理 } diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java index 11a53c8a..6f50e552 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.json.JSONString; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.dto.LabelPrintDto; import com.foreverwin.mesnac.common.model.PrintLog; @@ -60,35 +61,38 @@ public class PrintLogServiceImpl extends ServiceImpl i @Override public void labelPrint(String site, String user, List printList) { - List labelPrintDtoList = new ArrayList<>(); + // 获取printParam,并拼接为json格式字符串 + StringBuffer stringBuffer = new StringBuffer("["); for (PrintLog printLog : printList) { - LabelPrintDto labelPrintDto = new LabelPrintDto(); - labelPrintDto.setPrinter(printLog.getPrintName()); - labelPrintDto.setPrintTemplate(printLog.getPrintTemplate()); - labelPrintDto.setItem(printLog.getItem()); - labelPrintDto.setItemDescription(printLog.getItemDescription()); - labelPrintDtoList.add(labelPrintDto); + String printParam = printLog.getPrintParam(); + stringBuffer.append(printParam.replace("[","").replace("]","")).append(","); } - String post = HttpUtil.post(printServer, JSON.toJSONString(labelPrintDtoList), 30000); + StringBuffer append = stringBuffer.deleteCharAt(stringBuffer.length() - 1).append("]"); + List list= JSONArray.parseArray(append.toString(), LabelPrintDto.class); + // 打印机、打印模板 + for (int i = 0; i < list.size(); i++) { + list.get(i).setPrinter(printList.get(i).getPrintName()); + list.get(i).setPrintTemplate(printList.get(i).getPrintTemplate()); + } + String post = HttpUtil.post(printServer, JSON.toJSONString(list), 60000); /** * {"msg":"打印成功","code":0} * {"msg":"打印失败","code":500} * 根据返回值,更新打印机信息-printName及打印是否成功信息isPrint */ JSONObject jsonObject = JSONObject.parseObject(post); - String code = jsonObject.getString("code"); - if (code == null){ - + Integer code = jsonObject.getInteger("code"); + String msg = jsonObject.getString("msg"); + if (code == 500){ + throw BusinessException.build(msg); } + // 更新打印记录:是否已打印、使用的打印机、打印次数 List printLogList = new ArrayList<>(); - if (post.indexOf("500") != -1){ - throw BusinessException.build("打印失败!"); - } for (PrintLog printLog : printList) { PrintLog printLogOne = new PrintLog(); printLogOne.setHandle(printLog.getHandle()); printLogOne.setIsPrint("true"); - // 更新日志 + printLogOne.setPrintNum(printLog.getPrintNum()+1); if (printLog.getCategory().equals(Constants.PRINT_TYPE_INV)){ printLogOne.setPrintName(printLog.getPrintName()); } diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java index a5602c51..d8091ca0 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java @@ -33,8 +33,6 @@ import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import com.sap.me.messaging.MessageTypeBOHandle; import com.sap.me.user.UserGroupBOHandle; -import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.ActiveMQConnectionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.i18n.LocaleContextHolder; @@ -42,7 +40,6 @@ import org.springframework.jms.core.JmsMessagingTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.jms.ConnectionFactory; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.*; @@ -68,9 +65,8 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl getInventoryData(String site, String inventory) { @@ -181,5 +191,37 @@ public class SurplusReturnServiceImpl extends ServiceImpl inventoryAssyDataList = inventoryAssyDataService.selectList(inventoryAssyData); + if (inventoryAssyDataList.size() != 1){ + throw BusinessException.build("未正确找到当前批次的供应商!"); + } + String dataAttr = inventoryAssyDataList.get(0).getDataAttr(); + + // 记录打印参数:物料、物料编码、供应商、批次号 + LabelPrintDto labelPrintDto = new LabelPrintDto(); + labelPrintDto.setItem(inventoryModel.getItemBo().split(",")[1]); + labelPrintDto.setItemDescription(inventoryModel.getDescription()); + labelPrintDto.setSupplier(dataAttr); + labelPrintDto.setBatch(surplusInventory); + + printLog.setPrintParam(JSON.toJSONString(labelPrintDto)); + printLog.setInventory(surplusInventory); + printLog.setItemBo(inventoryModel.getItemBo()); + printLog.setCreateUser(user); + printLog.setCreatedDateTime(dateTime); + printLogService.save(printLog); } } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/dto/SfcDto.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/dto/SfcDto.java index a4b9a04e..054c851a 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/dto/SfcDto.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/dto/SfcDto.java @@ -14,12 +14,21 @@ public class SfcDto extends Sfc { private String resrce; private String workCenter; private String dispatchNo; + private String abnormalNo; private String stepId; private String plannedStartDate; private String plannedCompDate; //工作令号 private String workOrder; + public String getAbnormalNo() { + return abnormalNo; + } + + public void setAbnormalNo(String abnormalNo) { + this.abnormalNo = abnormalNo; + } + public String getWorkOrder() { return workOrder; } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/SfcScrapController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/SfcScrapController.java index b2bde6c1..907a4fda 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/controller/SfcScrapController.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/SfcScrapController.java @@ -139,8 +139,6 @@ public class SfcScrapController { */ @GetMapping("/getScrapDtoBysfc") public R getScrapDtoBysfc(String site,String sfc){ - - return R.ok(anomalyService.getScrapDtoBysfc(site,sfc)); } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/dto/SplitSfcDto.java b/production/src/main/java/com/foreverwin/mesnac/production/dto/SplitSfcDto.java index e17af61a..404e152e 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/dto/SplitSfcDto.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/dto/SplitSfcDto.java @@ -6,6 +6,15 @@ public class SplitSfcDto extends SplitSfc { private String ncCode; private String routerBo; private String ncQty; + private String abnormalNo; + + public String getAbnormalNo() { + return abnormalNo; + } + + public void setAbnormalNo(String abnormalNo) { + this.abnormalNo = abnormalNo; + } public String getNcCode() { return ncCode; diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java index 578cb5a1..14a6e95c 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java @@ -212,9 +212,11 @@ public class SfcScrapServiceImpl extends ServiceImpl i Map wordMap = sfcScrapMapper.generatorWord(site,locale ,shopOrder, sfc); wordMap.put("SCRAP_MARK","线下质量贴红色标签"); wordMap.put("OPERATOR",user); - wordMap.put("GF",(wordMap.get("TYPE").contains("GF"))? "✔": ""); - wordMap.put("LF",(wordMap.get("TYPE").contains("LF"))? "✔": ""); - wordMap.put("OT",(wordMap.get("TYPE").contains("QT"))? "✔": ""); + if(!StringUtil.isBlank(wordMap.get("TYPE"))){ + wordMap.put("GF",(wordMap.get("TYPE").contains("GF"))? "✔": ""); + wordMap.put("LF",(wordMap.get("TYPE").contains("LF"))? "✔": ""); + wordMap.put("OT",(wordMap.get("TYPE").contains("QT"))? "✔": ""); + } wordMap.put("OPINION","报废"); wordMap.put("YEAR",year + ""); wordMap.put("MONTH",month + ""); diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java index a7d5f1f1..f307a1a1 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java @@ -8,10 +8,14 @@ import com.foreverwin.mesnac.common.service.SfcDispatchCommonService; import com.foreverwin.mesnac.common.util.ExceptionUtil; import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.meapi.dto.SfcDto; +import com.foreverwin.mesnac.meapi.model.Router; +import com.foreverwin.mesnac.meapi.service.RouterService; import com.foreverwin.mesnac.meapi.service.ShopOrderService; import com.foreverwin.mesnac.production.dto.SplitSfcDto; +import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.production.mapper.SplitSfcMapper; import com.foreverwin.mesnac.production.model.SplitSfc; +import com.foreverwin.mesnac.production.model.StepOperation; import com.foreverwin.mesnac.production.service.SplitSfcService; import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.meext.MEServices; @@ -50,6 +54,10 @@ public class SplitSfcServiceImpl extends ServiceImpl i private SfcDispatchCommonService sfcDispatchCommonService; @Autowired private ShopOrderService shopOrderService; + @Autowired + private RouterService routerService; + @Autowired + private SfcCrossMapper sfcCrossMapper; @Override public IPage selectPage(FrontPage frontPage, SplitSfc splitSfc) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -77,9 +85,10 @@ public class SplitSfcServiceImpl extends ServiceImpl i //查询质量异常记录数量 SplitSfcDto sfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation); if (sfcDto==null){ - throw new BaseException("未找到方案确认的质量异常"); + throw new BaseException("未找到闭环关闭的质量异常"); } sfcData.setQty(Double.valueOf(sfcDto.getNcQty())); + sfcData.setAbnormalNo(sfcDto.getAbnormalNo()); return sfcData; } @Override @@ -133,6 +142,8 @@ public class SplitSfcServiceImpl extends ServiceImpl i splitSfc.setCreatedDateTime(LocalDateTime.now()); save(splitSfc); String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo(); + Router routerBySfcBo = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfc)); + sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),sfc, sfcData.getShopOrder(),routerBySfcBo.getHandle()); return splitSfc; } catch (Exception e) { ExceptionUtil.throwException(e); @@ -194,6 +205,11 @@ public class SplitSfcServiceImpl extends ServiceImpl i stepIdentifier.setStepId(sfcData.getStepId()); stepIdentifier.setOperationId(sfcData.getOperation()); productionContext.setStepIdentifier(stepIdentifier); + List resourceBySfc = sfcCrossMapper.getResourceBySfc(site, sfc); + if (resourceBySfc.isEmpty()){ + throw new BaseException("产品不在工作中"); + } + productionContext.setResourceRef(resourceBySfc.get(0).getResourceBo()); createNCRequest.setProdCtx(productionContext); createNCRequest.setNcCodeRef(HandleEnum.NC_CODE.getHandle(site,splitNcCode[0])); ncProductionService.createNC(createNCRequest); diff --git a/production/src/main/resources/mapper/SfcCrossMapper.xml b/production/src/main/resources/mapper/SfcCrossMapper.xml index 3afd8656..b3798e1d 100644 --- a/production/src/main/resources/mapper/SfcCrossMapper.xml +++ b/production/src/main/resources/mapper/SfcCrossMapper.xml @@ -78,14 +78,13 @@ diff --git a/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/InspectionTaskManageServiceImpl.java b/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/InspectionTaskManageServiceImpl.java index 505533ca..2bfdee69 100644 --- a/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/InspectionTaskManageServiceImpl.java +++ b/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/InspectionTaskManageServiceImpl.java @@ -1,6 +1,7 @@ package com.foreverwin.mesnac.quality.service.impl; import com.foreverwin.mesnac.common.constant.Constants; +import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.model.InspectionTask; import com.foreverwin.mesnac.common.model.InspectionTaskDetail; import com.foreverwin.mesnac.common.service.InspectionTaskDetailService; @@ -114,6 +115,12 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ throw BusinessException.build("任务【" +taskNo+ "】不是新建状态,不允许执行合格操作"); } + List inspectionItemDetailList = this.getInspectionTaskDetail(HandleEnum.INSPECTION_TASK.getHandle(taskNo)); + if (inspectionItemDetailList != null || inspectionItemDetailList.size() > 0) { + throw BusinessException.build("检验任务:"+taskNo+"有检验项目,不允许执行合格操作"); + } + + //修改数据 InspectionTask inspectionTask = new InspectionTask(); inspectionTask.setHandle(request.getHandle()); diff --git a/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java b/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java index 38f8365d..3a65bd63 100644 --- a/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java +++ b/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java @@ -147,6 +147,9 @@ public class SelfReportServiceImpl extends ServiceImpl