Merge remote-tracking branch 'origin/master'

master
zpl 3 years ago
commit 2b99ad1016

@ -0,0 +1,49 @@
package com.foreverwin.mesnac.anomaly.controller;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-08-23
*/
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.anomaly.service.ReportService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/REPORT")
public class Report {
@Autowired
public ReportService reportService;
@PostMapping("/findIntegrationLog")
public R findIntegrationLog(@RequestBody IntegrationLog integration){
try{
return R.ok(reportService.findIntegrationLog(integration));
}catch(Exception e){
return R.failed(e.getMessage());
}
}
@PostMapping("/partsManufacturing")
public R partsManufacturing(@RequestBody PartsManufacturing PartsManufacturing){
try{
return R.ok(reportService.partsManufacturing(PartsManufacturing));
}catch(Exception e){
return R.failed(e.getMessage());
}
}
@GetMapping("/surplusReturnTable")
public R surplusReturnTable(String item,String itemDescription){
try{
return R.ok(reportService.surplusReturnTable(item,itemDescription));
}catch(Exception e){
return R.failed(e.getMessage());
}
}
}

@ -0,0 +1,65 @@
package com.foreverwin.mesnac.anomaly.dto;
import java.time.LocalDateTime;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-08-23
*/
public class PartsManufacturing {
private String itemNumber;
private String shopOrder;
private String item;
private String itemDescription;
private LocalDateTime startDateTime;
private LocalDateTime endDateTime;
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getItemDescription() {
return itemDescription;
}
public void setItemDescription(String itemDescription) {
this.itemDescription = itemDescription;
}
public LocalDateTime getStartDateTime() {
return startDateTime;
}
public void setStartDateTime(LocalDateTime startDateTime) {
this.startDateTime = startDateTime;
}
public LocalDateTime getEndDateTime() {
return endDateTime;
}
public void setEndDateTime(LocalDateTime endDateTime) {
this.endDateTime = endDateTime;
}
}

@ -0,0 +1,26 @@
package com.foreverwin.mesnac.anomaly.mapper;
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-08-23
*/
@Repository
public interface ReportMapper {
List<Map<String,Object>> findIntegrationLog(@Param("integration") IntegrationLog integration);
List<Map<String, Object>> partsManufacturing(@Param("site")String site,@Param("locale")String locale, @Param("partsManufacturing") PartsManufacturing partsManufacturing);
List<Map<String,Object>> surplusReturnTable(@Param("site")String site, @Param("locale")String locale,
@Param("item")String item, @Param("itemDescription")String itemDescription);
}

@ -38,4 +38,6 @@ public interface AbnormalPlanService extends IService<AbnormalPlan> {
List<AbnormalPlanDto> findAbnormalPlan(AbnormalPlanDto abnormalPlanDto);
void processes(List<AbnormalPlan> abnormalPlanList);
void sendMessage(AbnormalBill abnormalBill,AbnormalPlan abnormalPlan);
}

@ -0,0 +1,20 @@
package com.foreverwin.mesnac.anomaly.service;
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import java.util.List;
import java.util.Map;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-08-23
*/
public interface ReportService {
List<Map<String,Object>> findIntegrationLog(IntegrationLog integration);
List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing);
List<Map<String, Object>> surplusReturnTable(String item, String itemDescription);
}

@ -273,6 +273,18 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalNcCodeService.saveOrUpdateBatch(abnormalNcCodes);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
this.saveOrUpdate(abnormalBill);
/**
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
* XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX
*/
//发送消息
if(Constants.NEW.equals(abnormalBill.getStatus())){
this.anomalyCreatedAndSendMessage(abnormalBill,null);
@ -585,12 +597,18 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
/**
* SFC sfc
* SFC sfcsfc
*
*
*/
if(StringUtil.isBlank(abnormalBill.getSfc()) && !Constants.ABNORMAL_RESRCE.equals(abnormalBill.getType())) {
throw BusinessException.build("产品条码不能为空");
if(Constants.ABNORMAL_QUALITY.equals(abnormalBill.getType())){
if(StringUtil.isBlank(abnormalBill.getItemBo())){
throw BusinessException.build("物料编号不能为空");
}
}else{
throw BusinessException.build("产品条码不能为空");
}
}
@ -659,11 +677,13 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
status.add(Constants.PROGRAM_CONFIRM);
status.add(Constants.CANCEL);
status.add(Constants.SHUT_DOWN);
List<AbnormalBill> abnormalBillList = abnormalBillMapper.findCountBySfc(abnormalBill.getSite(), abnormalBill.getType(), abnormalBill.getSfc(), status);
String abnormalType = abnormalBill.getType().equals(Constants.ABNORMAL_QUALITY) ? "质量异常" :
abnormalBill.getType().equals(Constants.ABNORMAL_OTHER) ? "其他异常" : "设备异常" ;
if(abnormalBillList.size() >= 1 ){
throw BusinessException.build(abnormalType + "有未处理完成的产品条码SFC");
if(!StringUtil.isBlank(abnormalBill.getSfc())) {
List<AbnormalBill> abnormalBillList = abnormalBillMapper.findCountBySfc(abnormalBill.getSite(), abnormalBill.getType(), abnormalBill.getSfc(), status);
String abnormalType = abnormalBill.getType().equals(Constants.ABNORMAL_QUALITY) ? "质量异常" :
abnormalBill.getType().equals(Constants.ABNORMAL_OTHER) ? "其他异常" : "设备异常";
if (abnormalBillList.size() >= 1) {
throw BusinessException.build(abnormalType + "有未处理完成的产品条码SFC");
}
}
@ -779,18 +799,33 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(StringUtil.isBlank(abnormalBillDispose.getAbnormalMethod())){
throw BusinessException.build("转维修时方案分类必须填写");
}
abnormalBill.setHandle(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
abnormalBillDispose.setHandle(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("abnormalBill",abnormalBillMapper.selectById(abnormalBill.getHandle()));
hashMap.put("abnormalBillDispose",abnormalBillDisposeMapper.selectById(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo())));
return hashMap;
}
@Override
public void anomalyReveseRepairShutDown(String abnormalNo){
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
AbnormalBill abnormalBill = getById(HandleEnum.ABNORMAL_BILL.getHandle(site, abnormalNo));
if(!Constants.RESPONSE.equals(abnormalBill.getStatus())){
throw new BaseException("状态不在响应中,请重新检索");
}
abnormalBill.setHandle(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
abnormalBill.setStatus(Constants.SHUT_DOWN);
AbnormalBillDispose abnormalBillDispose = abnormalBillDisposeMapper.selectById(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site, abnormalBill.getAbnormalNo()));
abnormalBillDispose.setResolveUser(user);
abnormalBillDispose.setResolveDateTime(now);
abnormalBillDispose.setHandle(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("abnormalBill",abnormalBillMapper.selectById(abnormalBill.getHandle()));
hashMap.put("abnormalBillDispose",abnormalBillDisposeMapper.selectById(abnormalBillDispose.getHandle()));
return hashMap;
}
@Override
@ -980,9 +1015,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//发送消息
if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode())){
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site,abnormalMessage.getSendUserGroup());
if(nwaUsers != null && nwaUsers.size() <= 0){
throw new BaseException("消息发送失败,发送的用户组下面没有用户");
}
StringBuilder sendUsers = new StringBuilder();
for (int i = 0; i < nwaUsers.size(); i++) {
if(i == (nwaUsers.size() - 1)){
sendUsers.append(nwaUsers.get(i).getUserName());
@ -1050,7 +1086,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
messageMap.put("shutDown",AnomalyConstant.ShutDown.msg(messageContent.getShutDown()));
//判断该异常单的状态是否是纠防确认
if(Constants.CORRECTION_CONFIRM.equals(messageContent.getStatus())){
if(Constants.CORRECTION_CONFIRM.equals(messageContent.getStatus()) || Constants.SHUT_DOWN.equals(messageContent.getStatus())){
DataField dataField = new DataField();
dataField.setSite(site);
@ -1091,7 +1127,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
messageMap.put("dutyCauseDescription",messageContent.getDutyCauseDescription());
}
if(Constants.PROGRAM_CONFIRM.equals(messageContent.getStatus())){
if(Constants.PROGRAM_CONFIRM.equals(messageContent.getStatus()) || Constants.SHUT_DOWN.equals(messageContent.getStatus())){
messageMap.put("abnormalMethod",AnomalyConstant.AnomalyMethod.msg(messageContent.getAbnormalMethod()));
messageMap.put("resolveRemark",messageContent.getResolveRemark());
messageMap.put("router",messageContent.getRouterDescription());
@ -1120,7 +1156,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(this.jgProductionIsScrap(site,sfc)){
throw new BaseException("该产品条码的异常方案不是报废");
}
return abnormalBillMapper.findScrapDtoBySfc(site, sfc);
List<ScrapDto> scrapDtoBySfc = abnormalBillMapper.findScrapDtoBySfc(site, sfc);
return scrapDtoBySfc;
}

@ -16,8 +16,13 @@ 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.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.model.UserGroup;
import com.foreverwin.mesnac.meapi.service.NwaUserService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.CommonMethods;
@ -28,7 +33,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
/**
* <p>
@ -67,6 +75,9 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
@Autowired
private AbnormalBillDisposeMapper abnormalBillDisposeMapper;
@Autowired
private UserGroupMapper userGroupMapper;
@Override
public IPage<AbnormalPlan> selectPage(FrontPage<AbnormalPlan> frontPage, AbnormalPlan abnormalPlan) {
@ -98,7 +109,9 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
abnormalPlan.setShopOrder(abnormalBillDisposeDto.getShopOrder());
abnormalPlan.setResrce(abnormalBillDisposeDto.getResrce());
abnormalPlan.setItemBo(abnormalBillDisposeDto.getItemBo());
abnormalPlan.setQty(Long.parseLong(abnormalBillDisposeDto.getNcQty()));
if(!StringUtil.isBlank(abnormalBillDisposeDto.getNcQty())){
abnormalPlan.setQty(Long.parseLong(abnormalBillDisposeDto.getNcQty()));
}
//没有处理人和处理时间
// abnormalPlan.setProcessor();
abnormalPlan.setClosedUser(user);
@ -138,11 +151,14 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
String site = CommonMethods.getSite();
LocalDateTime now = LocalDateTime.now();
String user = CommonMethods.getUser();
List<AbnormalPlan> abnormalPlans = new ArrayList<>();
List<AbnormalBill> abnormalBills = new ArrayList<>();
for (AbnormalPlan abnormalPlan : abnormalPlanList){
AbnormalBill abnormalBill = abnormalBillMapper.selectById(HandleEnum.ABNORMAL_BILL.getHandle(site, abnormalPlan.getAbnormalNo()));
AbnormalBillDispose abnormalBillDispose = abnormalBillDisposeMapper.selectById(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site, abnormalPlan.getAbnormalNo()));
//发送消息
// abnormalBillService.anomalyCreatedAndSendMessage(abnormalBill,abnormalBillDispose);
//设置handle
abnormalPlan.setHandle(HandleEnum.ABNORMAL_PLAN.getHandle(site,abnormalPlan.getAbnormalNo()));
if(Constants.PROCESSED.equals(abnormalPlan.getStatus())){
throw new BaseException("异常单:"+abnormalPlan.getAbnormalNo()+"已经处理,不能再次处理");
}
@ -152,11 +168,66 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
abnormalPlan.setProcessor(user);
//设置发送时间
abnormalPlan.setSendDateTime(now);
//设置handle
abnormalPlan.setHandle(HandleEnum.ABNORMAL_PLAN.getHandle(site,abnormalPlan.getAbnormalNo()));
//更新
this.saveOrUpdate(abnormalPlan);
abnormalPlans.add(abnormalPlan);
abnormalBills.add(abnormalBill);
}
//发送消息
for(int i = 0; i < abnormalBills.size() && i < abnormalPlans.size(); i++) {
this.sendMessage(abnormalBills.get(i),abnormalPlans.get(i));
}
//更新
this.saveOrUpdateBatch(abnormalPlans);
}
@Override
public void sendMessage(AbnormalBill abnormalBill, AbnormalPlan abnormalPlan) {
//创建一个消息记录表
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
Message message = new Message();
message.setHandle(UUID.randomUUID().toString());
message.setSite(site);
message.setObjectBo(abnormalPlan.getHandle());
message.setType(Constants.ABNORMAL_PLAN);
message.setMessageType(Constants.ABNORMAL_MESSAGE_PLAN);
message.setSendUserGroup(abnormalPlan.getSendUserGroup());
//格式化消息内容
String messageContent = abnormalBillService.formatMessage(abnormalBill, message.getMessageType(), site);
message.setContent(messageContent);
message.setResponseDateTime(now);
UserGroup customFieldByGroup = userGroupMapper.getCustomFieldByGroup(site, message.getSendUserGroup());
//得到升级的时间和等级
if(customFieldByGroup != null && !StringUtil.isBlank(customFieldByGroup.getMessageNoticeTime())){
message.setUpDateTime(message.getResponseDateTime().plusMinutes(Integer.parseInt(customFieldByGroup.getMessageNoticeTime())));
}
if(customFieldByGroup != null && !StringUtil.isBlank(customFieldByGroup.getMessageNoticeLevel())) {
message.setGrade(Double.parseDouble(customFieldByGroup.getMessageNoticeLevel()));
}
message.setStatus("Y");
message.setCreatedUser(user);
message.setCreatedDateTime(now);
message.setModifiedUser(user);
message.setModifiedDateTime(now);
//发送消息
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site,message.getSendUserGroup());
if(nwaUsers != null && nwaUsers.size() <= 0){
throw new BaseException("消息发送失败,发送的用户组下面没有用户");
}
StringBuilder sendUsers = new StringBuilder();
for (int i = 0; i < Objects.requireNonNull(nwaUsers).size(); i++) {
if(i == (nwaUsers.size() - 1)){
sendUsers.append(nwaUsers.get(i).getUserName());
}else{
sendUsers.append(nwaUsers.get(i).getUserName()).append("|");
}
}
activeMQUtil.wechatSendMessage(sendUsers.toString(),message.getContent());
messageService.saveOrUpdate(message);
}
}

@ -0,0 +1,58 @@
package com.foreverwin.mesnac.anomaly.service.impl;
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.anomaly.mapper.ReportMapper;
import com.foreverwin.mesnac.anomaly.service.ReportService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.modular.core.util.CommonMethods;
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.util.List;
import java.util.Map;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-08-23
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class ReportServiceImpl implements ReportService {
@Autowired
private ReportMapper reportMapper;
/**
*
* @param integration
* @return
*/
@Override
public List<Map<String,Object>> findIntegrationLog(IntegrationLog integration) {
String site = CommonMethods.getSite();
integration.setSite(site);
return reportMapper.findIntegrationLog(integration);
}
/**
*
* @param partsManufacturing
* @return
*/
@Override
public List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing) {
String site = CommonMethods.getSite();
String locale = LocaleContextHolder.getLocale().getLanguage();
return reportMapper.partsManufacturing(site,locale,partsManufacturing);
}
@Override
public List<Map<String, Object>> surplusReturnTable(String item, String itemDescription) {
String locale = LocaleContextHolder.getLocale().getLanguage();
String site = CommonMethods.getSite();
return reportMapper.surplusReturnTable(site,locale,item,itemDescription);
}
}

@ -1091,7 +1091,7 @@
SELECT S.SFC SFC,
S2.STATUS STATUS,
SUBSTR(SS.OPERATION_BO ,INSTR(SS.OPERATION_BO ,',',1)+1,(INSTR(SS.OPERATION_BO ,'#',1)-1)-(INSTR(SS.OPERATION_BO ,',',1)+1)) || '/' || SS.STEP_ID OPERATION,
ZSD2.RESRCE RESRCE,ZSD.SHOP_ORDER SHOP_ORDER,
ZSD2.RESRCE RESRCE,ZSD2.SHOP_ORDER SHOP_ORDER,
CASE WHEN I.ITEM != 'NULL' THEN I.ITEM || '/' || I.REVISION END ITEM,
CASE WHEN R.ROUTER != 'NULL' THEN R.ROUTER || '/' || R.REVISION END ROUTER ,
CASE WHEN B.BOM != 'NULL' THEN B.BOM || '/' || B.REVISION END BOM,
@ -1102,14 +1102,13 @@
FROM SFC S
INNER JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE
INNER JOIN SFC_ROUTER ST ON ST.SFC_ROUTING_BO = SR.HANDLE
INNER JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = ST.HANDLE AND (SS.QTY_IN_QUEUE > 0 OR SS.QTY_IN_WORK > 0)
INNER JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = ST.HANDLE/* AND (SS.QTY_IN_QUEUE > 0 OR SS.QTY_IN_WORK > 0)*/
INNER JOIN STATUS S2 ON S2.HANDLE = S.STATUS_BO
INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.DISPATCH_NO = S.SFC || '-' || SS.STEP_ID
LEFT JOIN Z_SFC_DISPATCH ZSD2 ON ZSD2.DISPATCH_NO = S.SFC || '-' || SS.STEP_ID
AND ZSD2.DISPATCH_STATUS IN ('START','COMPLETE')
LEFT JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZSD.SHOP_ORDER AND SO.SITE = S.SITE
AND ZSD2.DISPATCH_STATUS IN ('START','COMPLETE')
LEFT JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZSD2.SHOP_ORDER AND SO.SITE = S.SITE
LEFT JOIN ITEM I ON I.HANDLE = SO.PLANNED_ITEM_BO
LEFT JOIN ROUTER R ON R.HANDLE = ZSD.ROUTER_BO
LEFT JOIN ROUTER R ON R.HANDLE = ZSD2.ROUTER_BO
LEFT JOIN Z_SFC_SCRAP ZSS ON ZSS.SFC = S.SFC AND ZSS.SITE = S.SITE
LEFT JOIN BOM B ON B.HANDLE = SO.PLANNED_BOM_BO
INNER JOIN ( SELECT * FROM Z_ABNORMAL_BILL_VIEW ZABV WHERE ZABV.HANDLE = (SELECT MAX(HANDLE) FROM Z_ABNORMAL_BILL_VIEW ZABV2

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.anomaly.mapper.ReportMapper">
<select id="findIntegrationLog" resultType="map">
SELECT INTEGRATION_TYPE, CATEGORY, INTEGRATION_WAY,STATUS,REQUEST_DATE_TIME,TO_CHAR(RESULT_MESSAGE) RESULT_MESSAGE,TO_CHAR(PARAM) PARAM
FROM Z_INTEGRATION_LOG
<where>
SITE = #{integration.site}
<if test="integration.integrationType != null and integration.integrationType != ''">
AND INTEGRATION_TYPE = #{integration.integrationType}
</if>
<if test="integration.integrationWay != null and integration.integrationWay != ''">
AND INTEGRATION_WAY = #{integration.integrationWay}
</if>
<if test="integration.status != null and integration.status != ''">
AND STATUS = #{integration.status}
</if>
<if test="integration.startDateTime != null">
AND REQUEST_DATE_TIME &gt;= #{integration.startDateTime}
</if>
<if test="integration.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= #{integration.endDateTime}
</if>
<if test="integration.param != null and integration.param != ''">
AND PARAM LIKE '%${integration.param}%'
</if>
</where>
ORDER BY REQUEST_DATE_TIME DESC
</select>
<select id="partsManufacturing" resultType="Map">
SELECT CF.VALUE ITEM_NUMBER,ZSD.SHOP_ORDER SHOP_ORDER,I.ITEM ITEM,IT.DESCRIPTION ITEM_DESCRIPTION,SO.QTY_TO_BUILD SHOP_ORDER_QTY , ZSD.OPERATION ,OT.DESCRIPTION OPERATION_DESCRIPTION,
ZNU.FULL_NAME OPERATION_USER,ZSD.SFC SFC,ZSD.DISPATCH_STATUS ,
ZSD.EARLIEST_START_DATE EARLIEST_START_DATE,ZSD.LATEST_END_DATE LATEST_END_DATE,
ZSD.ACTUAL_START_DATE ACTUAL_START_DATE,ZSD.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE
FROM SFC S
INNER JOIN SHOP_ORDER SO ON SO.HANDLE = S.SHOP_ORDER_BO
INNER JOIN ITEM I ON I.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{locale}
INNER JOIN Z_SFC_DISPATCH ZSD ON S.SFC = ZSD.SFC AND S.SITE = ZSD.SITE
AND ZSD.DISPATCH_SEQ = (
SELECT MAX(ZSD2.DISPATCH_SEQ) FROM Z_SFC_DISPATCH ZSD2 WHERE S.SFC = ZSD2.SFC AND S.SITE = ZSD2.SITE
)
INNER JOIN OPERATION O ON O.OPERATION = ZSD.OPERATION AND O.SITE = S.SITE AND O.CURRENT_REVISION = 'true'
INNER JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = #{locale}
INNER JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZSD.EMPLOYEE
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = S.SHOP_ORDER_BO AND CF."ATTRIBUTE" = 'ITEM_NUMBER'
<where>
S.SITE = #{site}
<if test="partsManufacturing != null">
<if test="partsManufacturing.itemNumber != null and partsManufacturing.itemNumber != ''">
AND CF.VALUE LIKE '%${partsManufacturing.itemNumber}%'
</if>
<if test="partsManufacturing.shopOrder != null and partsManufacturing.shopOrder != ''">
AND ZSD.SHOP_ORDER LIKE '%${partsManufacturing.shopOrder}%'
</if>
<if test="partsManufacturing.item != null and partsManufacturing.item != ''">
AND I.ITEM LIKE '%${partsManufacturing.item}%'
</if>
<if test="partsManufacturing.itemDescription != null and partsManufacturing.itemDescription != ''">
AND IT.DESCRIPTION LIKE '%${partsManufacturing.itemDescription}%'
</if>
<if test="partsManufacturing.startDateTime != null">
AND ZSD.ACTUAL_START_DATE &gt;= #{partsManufacturing.startDateTime}
</if>
<if test="partsManufacturing.endDateTime != null">
AND ZSD.ACTUAL_COMPLETE_DATE &lt;= #{partsManufacturing.endDateTime}
</if>
</if>
</where>
</select>
<select id="surplusReturnTable" resultType="map">
SELECT ZSR.INVENTORY INVENTORY,ZSR.ITEM_BO ITEM_BO,IT.DESCRIPTION ITEM_DESCRIPTION,ZSR.LENGHT LENGHT,
ZSR.WIDTH WIDTH,ZSR.NUMBERS NUMBERS,ZSR.QTY QTY,ZSR.CREATED_DATE_TIME CREATED_DATE_TIME
FROM
Z_SURPLUS_RETURN ZSR
INNER JOIN ITEM I ON I.HANDLE = ZSR.ITEM_BO
INNER JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE
<where>
ZSR.SITE = #{site}
<if test="item != null and item != ''">
AND I.ITEM LIKE '%${item}%'
</if>
<if test="itemDescription != null and itemDescription != ''">
AND IT.DESCRIPTION LIKE '%${itemDescription}%'
</if>
</where>
</select>
</mapper>

@ -124,6 +124,7 @@ public interface Constants {
String ABNORMAL_QUALITY = "Z";
String ABNORMAL_OTHER = "Q";
String ABNORMAL_RESRCE = "S";
String ABNORMAL_PLAN = "P";
/**
*

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.common.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.foreverwin.mesnac.common.model.ExcelColumn;
import java.io.Serializable;
@ -171,6 +172,11 @@ public class SfcDispatchDto implements Serializable{
* -
*/
private String itemNumber;
/**实际时间**/
private LocalDateTime actualStartDate;
private LocalDateTime actualCompleteDate;
/**
*
*/
@ -566,6 +572,22 @@ public class SfcDispatchDto implements Serializable{
this.itemNumber = itemNumber;
}
public LocalDateTime getActualStartDate() {
return actualStartDate;
}
public void setActualStartDate(LocalDateTime actualStartDate) {
this.actualStartDate = actualStartDate;
}
public LocalDateTime getActualCompleteDate() {
return actualCompleteDate;
}
public void setActualCompleteDate(LocalDateTime actualCompleteDate) {
this.actualCompleteDate = actualCompleteDate;
}
public String getComponent() {
return component;
}

@ -37,4 +37,6 @@ public interface AnomalyService {
*/
List<ScrapDto> getScrapDtoBysfc(String site, String sfc);
void anomalyReveseRepairShutDown(String abnormalNo);
}

@ -38,8 +38,8 @@ ws:
ftp:
host: 172.16.251.165
port: 21
username:
password:
username: mesftp
password: mesnac1@3
#打印服务
print:

@ -1,16 +1,12 @@
package com.foreverwin.mesnac.dispatch.controller;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.service.SfcDispatchService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
@ -303,4 +299,6 @@ public class SfcDispatchController {
return R.ok(result);
}
}

@ -1,21 +1,14 @@
package com.foreverwin.mesnac.dispatch.controller;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.service.SurplusReturnService;
import com.foreverwin.modular.core.exception.BusinessException;
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.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.dispatch.service.SurplusReturnService;
import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**

@ -141,7 +141,11 @@ public class UserResourceController {
@ResponseBody
@GetMapping("/findAll")
public R findAll(UserResourceDto userResourceDto){
return R.ok(userResourceService.findAll(userResourceDto));
try {
return R.ok(userResourceService.findAll(userResourceDto));
} catch (Exception e) {
return R.failed(e.getMessage());
}
}
@PostMapping("/saveAll")

@ -1,8 +1,8 @@
package com.foreverwin.mesnac.dispatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -48,4 +48,5 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
SfcDispatchDto findResrceBySfc(@Param("sfcDispatch")SfcDispatchDto sfcDispatch, @Param("site") String site, @Param("array") String[] array);
SfcDispatchDto findSfcDispatchBySfc(@Param("site")String site, @Param("dto")SfcDispatchDto sfcDispatch);
}

@ -1,7 +1,7 @@
package com.foreverwin.mesnac.dispatch.mapper;
import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -26,4 +26,5 @@ public interface SurplusReturnMapper extends BaseMapper<SurplusReturn> {
* @return
*/
Map<String, Object> selectInventoryData(@Param("inventoryBo") String inventoryBo);
}
}

@ -1,16 +1,14 @@
package com.foreverwin.mesnac.dispatch.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.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
@ -92,6 +90,9 @@ public class SurplusReturn extends Model<SurplusReturn> {
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
@TableField(exist = false)
private String itemDescription;
public String getHandle() {
return handle;
@ -197,7 +198,15 @@ public class SurplusReturn extends Model<SurplusReturn> {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public String getItemDescription() {
return itemDescription;
}
public void setItemDescription(String itemDescription) {
this.itemDescription = itemDescription;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";

@ -1,9 +1,8 @@
package com.foreverwin.mesnac.dispatch.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -110,4 +109,6 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
* @return
*/
Map<String, Object> ganttList(String site, SfcDispatchDto sfcDispatchDto);
}

@ -1,7 +1,8 @@
package com.foreverwin.mesnac.dispatch.service;
import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import java.math.BigDecimal;
import java.util.Map;

@ -18,14 +18,10 @@ import com.foreverwin.mesnac.dispatch.dto.WorkCenterWorkTimeDTO;
import com.foreverwin.mesnac.dispatch.mapper.SfcDispatchMapper;
import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.mesnac.dispatch.model.UserResource;
import com.foreverwin.mesnac.dispatch.service.*;
import com.foreverwin.mesnac.meapi.dto.WorkCenterLinkDTO;
import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.foreverwin.mesnac.meapi.model.UserGroup;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BaseException;
@ -37,7 +33,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import sun.awt.geom.AreaOp;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@ -61,8 +56,12 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
@Autowired
private SfcService sfcService;
@Autowired
private ResrceService resrceService;
@Autowired
private RouterService routerService;
@Autowired
private NwaUserService nwaUserService;
@Autowired
private ResrceService resourceService;
@Autowired
private CallItemService callItemService;
@ -371,6 +370,15 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
//派工更新清单
List<SfcDispatch> list = new ArrayList<>();
//如果导入-查询所有用户
Map<String, List<NwaUser>> userMap = new HashMap<>();
if (DispatchStatusEnum.IMPORT.getCode().equals(type)) {
List<NwaUser> nwaUserList = nwaUserService.findAllUser(site);
if (nwaUserList != null && nwaUserList.size() > 0) {
userMap = nwaUserList.stream().collect(Collectors.groupingBy(NwaUser::getFullName));
}
}
int seq = 0;
//状态标识,表示本次派工成功或是失败
Boolean flag = true;
@ -385,24 +393,6 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
String dispatchNo = sfcDispatchDto.getDispatchNo();
String resourceType = sfcDispatchDto.getResourceType();
//派工保存
if (DispatchStatusEnum.SAVE.getCode().equals(type)) {
//校验派工状态
String originalStatus = sfcDispatchDto.getDispatchStatus();
if (!DispatchStatusEnum.NEW.getCode().equals(originalStatus)) {
flag = false;
message.append(seq++ % 3 == 0 ? "\n" : "| |");
message.append("派工单[" + dispatchNo + "]的派工状态不是新建,不允许保存");
continue;
}
//时间
if (Constants.USER_GROUP_ZJH.equals(sfcDispatchDto.getRole())) {
sfcDispatchDto.setEarliestStartDate(sfcDispatchDto.getPlannedStartDate());
sfcDispatchDto.setLatestEndDate(sfcDispatchDto.getPlannedCompDate());
}
}
//派工导入
if (DispatchStatusEnum.IMPORT.getCode().equals(type)) {
String handle = HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo);
@ -427,8 +417,71 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
sfcDispatch.setHandle(handle);
//是否导入
sfcDispatch.setIsImport(Constants.BOOL_TRUE);
//导入的是人员名称-查找人员编号,设备
String employee = "";
String employeeDescription = sfcDispatchDto.getEmployee();
if (StringUtil.notBlank(employeeDescription)) {
String _employeeDescription;
String []employeeDescriptionArray = employeeDescription.split(",");
String []employeeArray = new String[employeeDescriptionArray.length];
for (int i = 0; i < employeeDescriptionArray.length; i++) {
_employeeDescription = employeeDescriptionArray[i];
List<NwaUser> _list = userMap.get(_employeeDescription);
if (_list != null && _list.size() > 0) {
String userName = _list.get(0).getUserName();
employee += (i == 0) ? userName : "," + userName;
employeeArray[i] = userName;
}
}
//查询匹配的设备
List<Resrce> emResourceList = resrceService.getResourceListByUT(site, resourceType, employeeArray);
if (emResourceList != null && emResourceList.size() > 0) {
resource = emResourceList.get(0).getResrce();
}
}
//派工人员赋值
sfcDispatch.setIsDispatch("true");
sfcDispatch.setResrce(resource);
sfcDispatch.setEmployee(employee);
sfcDispatch.setEmployeeDescription(employeeDescription);
sfcDispatch.setRemark(sfcDispatchDto.getRemark());
sfcDispatch.setBlankingSize(sfcDispatchDto.getBlankingSize());
sfcDispatch.setPlannedStartDate(sfcDispatchDto.getPlannedStartDate());
sfcDispatch.setPlannedCompDate(sfcDispatchDto.getPlannedCompDate());
sfcDispatch.setEarliestStartDate(sfcDispatchDto.getEarliestStartDate());
sfcDispatch.setLatestEndDate(sfcDispatchDto.getLatestEndDate());
list.add(sfcDispatch);
continue;
}
//派工保存
if (DispatchStatusEnum.SAVE.getCode().equals(type)) {
//校验派工状态
String originalStatus = sfcDispatchDto.getDispatchStatus();
if (!DispatchStatusEnum.NEW.getCode().equals(originalStatus)) {
flag = false;
message.append(seq++ % 3 == 0 ? "\n" : "| |");
message.append("派工单[" + dispatchNo + "]的派工状态不是新建,不允许保存");
continue;
}
//时间
if (Constants.USER_GROUP_ZJH.equals(sfcDispatchDto.getRole())) {
sfcDispatchDto.setEarliestStartDate(sfcDispatchDto.getPlannedStartDate());
sfcDispatchDto.setLatestEndDate(sfcDispatchDto.getPlannedCompDate());
}
}
//派工发布
if (DispatchStatusEnum.RELEASE.getCode().equals(type)) {
//校验派工状态
@ -486,13 +539,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
//派工人员为多个(只要一个匹配)
String [] employeeArray = new String[1];
if (!employees.contains(",")) {
employeeArray[0] = employees;
} else {
employeeArray = employees.split(",");
}
String []employeeArray = employees.split(",");
Boolean isMatch = false;
for (int m = 0; m < employeeArray.length; m++) {
String employee = employeeArray[m];
@ -722,4 +769,6 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
return result;
}
}

@ -1,7 +1,7 @@
package com.foreverwin.mesnac.dispatch.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.dto.LabelPrintDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
@ -10,26 +10,24 @@ import com.foreverwin.mesnac.common.service.PrintLogService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.NumberUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.mapper.SurplusReturnMapper;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import com.foreverwin.mesnac.dispatch.service.SurplusInventoryService;
import com.foreverwin.mesnac.dispatch.service.SurplusReturnService;
import com.foreverwin.mesnac.meapi.model.Inventory;
import com.foreverwin.mesnac.meapi.model.InventoryAssyData;
import com.foreverwin.mesnac.meapi.service.InventoryAssyDataService;
import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import com.foreverwin.mesnac.dispatch.mapper.SurplusReturnMapper;
import com.foreverwin.mesnac.dispatch.service.SurplusReturnService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.modular.core.util.CommonMethods;
import com.sap.me.inventory.InventoryServiceInterface;
import com.sap.me.inventory.InventorySplitRequest;
import com.sap.me.inventory.NewSplitInventory;
import org.springframework.stereotype.Service;
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.math.BigDecimal;
@ -226,4 +224,6 @@ public class SurplusReturnServiceImpl extends ServiceImpl<SurplusReturnMapper, S
printLog.setCreatedDateTime(dateTime);
printLogService.save(printLog);
}
}

@ -758,7 +758,7 @@
) WIP
LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.DISPATCH_SEQ = WIP.BEFORE_SEQ
LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ
ORDER BY WIP.SHOP_ORDER
ORDER BY WIP.SHOP_ORDER, WIP.SFC, TO_NUMBER(WIP.DISPATCH_SEQ)
</select>
<update id="updateSfcDispatchStatus" >
@ -800,4 +800,5 @@
<if test="dto.resrce!=null"> AND RESRCE=#{dto.resrce}</if>
<if test="dto.handle!=null"> AND HANDLE=#{dto.handle}</if>
</select>
</mapper>

@ -17,6 +17,7 @@
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
</resultMap>
<!-- 通用查询结果列 -->
@ -456,4 +457,5 @@
LEFT JOIN CUSTOM_FIELDS CS2 ON CS2.HANDLE = IM.HANDLE AND CS2.ATTRIBUTE = 'PER_SQUARE_METER'
WHERE IV.HANDLE = #{inventoryBo}
</select>
</mapper>

@ -1,10 +1,17 @@
package com.foreverwin.mesnac.equip.service.impl;
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.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.equip.mapper.ResourceRepairTaskMapper;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import com.foreverwin.mesnac.equip.model.ResourceRepairTask;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
import com.foreverwin.mesnac.equip.service.ResourceRepairTaskService;
import com.foreverwin.mesnac.meapi.dto.NcCodeDto;
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
import com.foreverwin.mesnac.meapi.model.DataField;
@ -16,19 +23,16 @@ import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.model.ResourceRepairTask;
import com.foreverwin.mesnac.equip.mapper.ResourceRepairTaskMapper;
import com.foreverwin.mesnac.equip.service.ResourceRepairTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
/**
* <p>
@ -60,6 +64,8 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
private NwaUserMapper nwaUserMapper;
@Autowired
private DataFieldListService dataFieldListService;
@Autowired
private AnomalyService anomalyService;
@Override
public HashMap<String, Object> init() {
@ -133,6 +139,10 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
if (reportUser == null){
throw BusinessException.build("提报人不能为空!!!");
}
//调用方法,关闭异常单的状态
anomalyService.anomalyReveseRepairShutDown(resourceRepairTask.getObjectBo());
resourceRepairTask.setCreateUser(reportUser);
resourceRepairTask.setCreatedDateTime(LocalDateTime.now());
resourceRepairTaskService.save(resourceRepairTask);

@ -1,12 +1,8 @@
package com.foreverwin.mesnac.integration.controller;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -21,9 +17,5 @@ public class IntegrationLogController {
@Autowired
private IntegrationLogService integrationLogService;
@PostMapping("/findIntegrationLog")
public R findIntegrationLog(@RequestBody IntegrationLog integration){
return R.ok(integrationLogService.findIntegrationLog(integration));
}
}

@ -1,12 +1,9 @@
package com.foreverwin.mesnac.integration.mapper;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -18,5 +15,4 @@ import java.util.List;
@Repository
public interface IntegrationLogMapper extends BaseMapper<IntegrationLog> {
List<IntegrationLog> findIntegrationLog(@Param("integration") IntegrationLog integration);
}

@ -3,8 +3,6 @@ package com.foreverwin.mesnac.integration.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import java.util.List;
/**
* <p>
*
@ -17,5 +15,4 @@ public interface IntegrationLogService extends IService<IntegrationLog> {
void saveIntegrationLog(IntegrationLog integrationLog);
List<IntegrationLog> findIntegrationLog(IntegrationLog integration);
}

@ -4,14 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
@ -34,10 +31,5 @@ public class IntegrationLogServiceImpl extends ServiceImpl<IntegrationLogMapper,
integrationLogMapper.insert(integrationLog);
}
@Override
public List<IntegrationLog> findIntegrationLog(IntegrationLog integration) {
String site = CommonMethods.getSite();
integration.setSite(site);
return integrationLogMapper.findIntegrationLog(integration);
}
}

@ -462,30 +462,4 @@
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="findIntegrationLog" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INTEGRATION_LOG
<where>
SITE = #{integration.site}
<if test="integration.integrationType != null and integration.integrationType != ''">
AND INTEGRATION_TYPE = #{integration.integrationType}
</if>
<if test="integration.integrationWay != null and integration.integrationWay != ''">
AND INTEGRATION_WAY = #{integration.integrationWay}
</if>
<if test="integration.status != null and integration.status != ''">
AND STATUS = #{integration.status}
</if>
<if test="integration.startDateTime != null">
AND REQUEST_DATE_TIME &gt;= #{integration.startDateTime}
</if>
<if test="integration.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= #{integration.endDateTime}
</if>
<if test="integration.param != null and integration.param != ''">
AND PARAM LIKE '%${integration.param}%'
</if>
</where>
ORDER BY REQUEST_DATE_TIME DESC
</select>
</mapper>

@ -149,11 +149,10 @@ public class NwaUserController {
/**
*
* @param user
* @return
*/
@GetMapping("findAllUser")
public R findAllUser(){
return R.ok(nwaUserService.findAllUser());
return R.ok(nwaUserService.findAllUser(CommonMethods.getSite()));
}
}

@ -178,14 +178,7 @@ public class ResrceController {
List<Resrce> result;
try {
String site = CommonMethods.getSite();
String [] userArray = new String[1];
if (StringUtils.notBlank(user)) {
if (user.contains(",")) {
userArray = user.split(",");
} else {
userArray[0] = user;
}
}
String []userArray = user.split(",");
result = resrceService.getResourceListByUT(site, resourceType, userArray);
} catch (Exception e) {
return R.failed(e.getMessage());

@ -19,7 +19,7 @@ import java.util.List;
public interface NwaUserMapper extends BaseMapper<NwaUser> {
NwaUser findUserByUserName(@Param("site")String site, @Param("user")String user);
List<NwaUser> findAllUser(@Param("site")String site);;
List<NwaUser> findAllUser(@Param("site")String site);
List<NwaUser> selectAllByUserGroups(@Param("site")String site,@Param("list")List<String> list);

@ -28,7 +28,7 @@ public interface NwaUserService extends IService<NwaUser> {
NwaUser findUserByUserName(String id);
List<NwaUser> findAllUser();
List<NwaUser> findAllUser(String site);
/**

@ -58,8 +58,7 @@ public class NwaUserServiceImpl extends ServiceImpl<NwaUserMapper, NwaUser> impl
}
@Override
public List<NwaUser> findAllUser() {
String site = CommonMethods.getSite();
public List<NwaUser> findAllUser(String site) {
return nwaUserMapper.findAllUser(site);
}

@ -455,7 +455,7 @@
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT item,IT.description,revision
SELECT I.HANDLE,item,IT.description,revision
FROM ITEM I
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = 'zh'
<where>

@ -321,7 +321,7 @@
</if>
</select>
<select id="findAllUser" resultMap="BaseResultMap">
SELECT USER_NAME,FULL_NAME
SELECT USER_NAME, FULL_NAME
FROM Z_NWA_USER
WHERE SITE = #{site}
</select>

@ -669,7 +669,8 @@
SELECT PREZSD.EMPLOYEE_DESCRIPTION,CASE WHEN TO_NUMBER(zsd.DISPATCH_SEQ)=1 THEN NULL
WHEN SS.STEP_SEQUENCE>TO_NUMBER(zsd.DISPATCH_SEQ)-1 THEN '完成'
ELSE '未完成' END LAST_OPERATION_STATUS,
S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S
S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION,S.ITEM_BO,S.SHOP_ORDER_BO
FROM SFC S
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.ITEM_BO AND IT.LOCALE=#{locale}
JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE
LEFT JOIN Z_SFC_DISPATCH PREZSD ON zsd.SFC=PREZSD.SFC AND PREZSD.DISPATCH_SEQ=TO_NUMBER(zsd.DISPATCH_SEQ)-1

@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -76,9 +77,16 @@ public class PodTemplateController {
if (StringUtil.isBlank(resrce)) {
throw new BaseException("资源不能为空");
}
for (SfcDto sfcDto : sfcDtoList) {
podTemplateService.sfcComplete(sfcDto,resrce);
ArrayList<String> sfcList = new ArrayList<>();
try {
for (SfcDto sfcDto : sfcDtoList) {
String completeSfc = podTemplateService.sfcComplete(sfcDto, resrce);
sfcList.add(completeSfc);
}
}catch (Exception e){
return R.failed(sfcList,e.getMessage());
}
return R.ok();
}

@ -16,7 +16,7 @@ public interface PodTemplateService {
void sfcStart(Map<String, Object> map);
void sfcComplete(SfcDto sfcDto, String resrce);
String sfcComplete(SfcDto sfcDto, String resrce);
void sendErp(String sfc, String stepId, BigDecimal qty, BigDecimal scrapQty, BigDecimal workHour);

@ -237,7 +237,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
@Override
public void sfcComplete(SfcDto sfcDto, String resrce) {
public String sfcComplete(SfcDto sfcDto, String resrce) {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
@ -309,6 +309,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
return sfc;
}

Loading…
Cancel
Save