From a46a0b8a347879e11044f74bedaf8ac0ec861abd Mon Sep 17 00:00:00 2001
From: zpl
Date: Mon, 9 Aug 2021 08:23:31 +0800
Subject: [PATCH 1/9] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mesnac/common/constant/Constants.java | 2 +
.../service/impl/PrintLogServiceImpl.java | 19 ++++++++-
.../impl/SurplusReturnServiceImpl.java | 40 ++++++++++++++++++-
3 files changed, 59 insertions(+), 2 deletions(-)
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 31e2ec81..1b000e8b 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
@@ -160,6 +160,8 @@ public interface Constants {
String PRINT_TYPE_INV = "INV";
// 在制品标签
String PRINT_TYPE_SFC = "SFC";
+ // 余料标签
+ String PRINT_TYPE_EXM = "EXM";
/**
* 刀具状态,Y-使用,N-报废/删除
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..d1f4a09e 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
@@ -61,14 +61,31 @@ public class PrintLogServiceImpl extends ServiceImpl i
@Override
public void labelPrint(String site, String user, List printList) {
List labelPrintDtoList = new ArrayList<>();
+ StringBuffer stringBuffer = new StringBuffer("");
for (PrintLog printLog : printList) {
LabelPrintDto labelPrintDto = new LabelPrintDto();
+ // 打印机名称、打印模板
labelPrintDto.setPrinter(printLog.getPrintName());
labelPrintDto.setPrintTemplate(printLog.getPrintTemplate());
+ // {"ITEM":"500100010001","INVENTORY":"500100010001*20210721","ITEM_DESC":"测试物料","SUPPLIER":"BA002"}
+ // 打印参数:物料编号、物料描述、供应商、批次号
+ String printParam = printLog.getPrintParam();
+ JSONObject jsonObject = JSONObject.parseObject(printParam);
+ String item = jsonObject.getString("ITEM");
+ String item_desc = jsonObject.getString("ITEM_DESC");
+ String supplier = jsonObject.getString("SUPPLIER");
+ String inventory = jsonObject.getString("INVENTORY");
+ labelPrintDto.setItem(item);
+ labelPrintDto.setItemDescription(item_desc);
+ labelPrintDto.setSupplier(supplier);
+ labelPrintDto.setBatch(inventory);
+ /*
labelPrintDto.setItem(printLog.getItem());
- labelPrintDto.setItemDescription(printLog.getItemDescription());
+ labelPrintDto.setItemDescription(printLog.getItemDescription());*/
labelPrintDtoList.add(labelPrintDto);
+ stringBuffer.append(printParam).append(",");
}
+ String jsonList = JSON.toJSONString(labelPrintDtoList);
String post = HttpUtil.post(printServer, JSON.toJSONString(labelPrintDtoList), 30000);
/**
* {"msg":"打印成功","code":0}
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SurplusReturnServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SurplusReturnServiceImpl.java
index b1a578b6..8f25066c 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SurplusReturnServiceImpl.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SurplusReturnServiceImpl.java
@@ -1,12 +1,17 @@
package com.foreverwin.mesnac.dispatch.service.impl;
+import com.alibaba.fastjson.JSONObject;
+import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
+import com.foreverwin.mesnac.common.model.PrintLog;
+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.model.SurplusInventory;
import com.foreverwin.mesnac.dispatch.service.SurplusInventoryService;
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;
@@ -51,7 +56,10 @@ public class SurplusReturnServiceImpl extends ServiceImpl getInventoryData(String site, String inventory) {
@@ -181,5 +189,35 @@ public class SurplusReturnServiceImpl extends ServiceImpl inventoryAssyDataList = inventoryAssyDataService.selectList(inventoryAssyData);
+ if (inventoryAssyDataList.size() == 1){
+ jsonObject.put("SUPPLIER", inventoryAssyDataList.get(0).getDataAttr()); // 供应商
+ }else {
+ throw BusinessException.build("未正确找到当前批次的供应商!");
+ }
+ jsonObject.put("INVENTORY", surplusInventory); // 批次号
+ printLog.setPrintParam(jsonObject.toString());
+ printLog.setInventory(surplusInventory);
+ printLog.setItemBo(inventoryModel.getItemBo());
+ //printLog.setIsPrint("false");
+ printLog.setCreateUser(user);
+ printLog.setCreatedDateTime(dateTime);
+ printLogService.save(printLog);
}
}
\ No newline at end of file
From 85ac05b4416ebe06e9fb60826efa88069c72ee81 Mon Sep 17 00:00:00 2001
From: philip <244793088@qq.com>
Date: Mon, 9 Aug 2021 08:43:32 +0800
Subject: [PATCH 2/9] =?UTF-8?q?=E6=8B=86=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../anomaly/controller/AbnormalBillController.java | 13 +++++++++++++
.../mesnac/anomaly/mapper/AbnormalBillMapper.java | 2 ++
.../mesnac/anomaly/service/AbnormalBillService.java | 1 +
.../service/impl/AbnormalBillServiceImpl.java | 7 ++++---
.../main/resources/mapper/AbnormalBillMapper.xml | 6 ++++++
.../com/foreverwin/mesnac/meapi/dto/SfcDto.java | 9 +++++++++
.../mesnac/production/dto/SplitSfcDto.java | 9 +++++++++
.../service/impl/SplitSfcServiceImpl.java | 7 +++++++
.../src/main/resources/mapper/SplitSfcMapper.xml | 2 +-
9 files changed, 52 insertions(+), 4 deletions(-)
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/mapper/AbnormalBillMapper.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalBillMapper.java
index 3919dda4..35743388 100644
--- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalBillMapper.java
+++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/AbnormalBillMapper.java
@@ -35,4 +35,6 @@ public interface AbnormalBillMapper 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/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/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java
index f06e58e2..75b67e09 100644
--- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java
+++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java
@@ -1023,9 +1023,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl getQCAbnormal() {
+ return abnormalBillMapper.getQCAbnormalList(CommonMethods.getSite());
+ }
@Override
diff --git a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml
index f1081577..c5e00002 100644
--- a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml
+++ b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml
@@ -1013,4 +1013,10 @@
+
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/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/SplitSfcServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java
index a7d5f1f1..733692ec 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,6 +8,8 @@ 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.SplitSfcMapper;
@@ -50,6 +52,8 @@ public class SplitSfcServiceImpl extends ServiceImpl i
private SfcDispatchCommonService sfcDispatchCommonService;
@Autowired
private ShopOrderService shopOrderService;
+ @Autowired
+ private RouterService routerService;
@Override
public IPage selectPage(FrontPage frontPage, SplitSfc splitSfc) {
QueryWrapper queryWrapper = new QueryWrapper<>();
@@ -80,6 +84,7 @@ public class SplitSfcServiceImpl extends ServiceImpl i
throw new BaseException("未找到方案确认的质量异常");
}
sfcData.setQty(Double.valueOf(sfcDto.getNcQty()));
+ sfcData.setAbnormalNo(sfcDto.getAbnormalNo());
return sfcData;
}
@Override
@@ -133,6 +138,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);
diff --git a/production/src/main/resources/mapper/SplitSfcMapper.xml b/production/src/main/resources/mapper/SplitSfcMapper.xml
index 66587280..97450c53 100644
--- a/production/src/main/resources/mapper/SplitSfcMapper.xml
+++ b/production/src/main/resources/mapper/SplitSfcMapper.xml
@@ -378,7 +378,7 @@
WHERE S.HANDLE=#{handle}
From e54bc409d5fdd33eff864cf5d957dca0187a2e2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com>
Date: Mon, 9 Aug 2021 10:26:24 +0800
Subject: [PATCH 3/9] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=BC=82=E5=B8=B8?=
=?UTF-8?q?=E5=BE=85=E5=8A=9E=E4=BA=8B=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/AbnormalPlanController.java | 25 +++-
.../mesnac/anomaly/dto/AbnormalPlanDto.java | 67 ++++++++++
.../mapper/AbnormalBillDisposeMapper.java | 4 +-
.../anomaly/mapper/AbnormalPlanMapper.java | 9 +-
.../mesnac/anomaly/model/AbnormalPlan.java | 63 +++++----
.../anomaly/service/AbnormalPlanService.java | 7 +-
.../service/impl/AbnormalBillServiceImpl.java | 66 ++++-----
.../service/impl/AbnormalPlanServiceImpl.java | 85 +++++++++++-
.../mapper/AbnormalBillDisposeMapper.xml | 4 +-
.../resources/mapper/AbnormalPlanMapper.xml | 126 +++++++++++++-----
.../mesnac/common/constant/Constants.java | 5 +-
.../impl/InspectionTaskManageServiceImpl.java | 7 +
12 files changed, 359 insertions(+), 109 deletions(-)
create mode 100644 anomaly/src/main/java/com/foreverwin/mesnac/anomaly/dto/AbnormalPlanDto.java
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
- * 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/AbnormalPlanService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalPlanService.java
index 401eff8b..5dbe9d17 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,7 @@ 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.AbnormalPlan;
import com.foreverwin.modular.core.util.FrontPage;
@@ -11,7 +12,7 @@ import java.util.List;
/**
*
- * 服务类
+ * 计划异常待办事项 服务类
*
*
* @author zjw
@@ -29,4 +30,8 @@ public interface AbnormalPlanService extends IService {
List selectList(AbnormalPlan abnormalPlan);
void saveAbnormalPlan(AbnormalBillDisposeDto abnormalBillDisposeDto, 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/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java
index f06e58e2..367ab9a3 100644
--- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java
+++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java
@@ -20,7 +20,6 @@ import com.foreverwin.mesnac.common.service.AnomalyService;
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.dto.ShopOrderDto;
import com.foreverwin.mesnac.meapi.mapper.*;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
@@ -915,7 +914,7 @@ public class AbnormalBillServiceImpl 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);
}
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..e99f39a9 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,32 @@ 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.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 +43,19 @@ public class AbnormalPlanServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, AbnormalPlan abnormalPlan) {
QueryWrapper queryWrapper = new QueryWrapper<>();
@@ -47,15 +70,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/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
+
+
+
+
+
+
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 cd42cc40..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
@@ -34,7 +34,6 @@ import com.foreverwin.modular.core.util.FrontPage;
import com.sap.me.messaging.MessageTypeBOHandle;
import com.sap.me.user.UserGroupBOHandle;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.jms.core.JmsMessagingTemplate;
@@ -67,10 +66,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl i
private ShopOrderService shopOrderService;
@Autowired
private RouterService routerService;
+ @Autowired
+ private SfcCrossMapper sfcCrossMapper;
@Override
public IPage selectPage(FrontPage frontPage, SplitSfc splitSfc) {
QueryWrapper queryWrapper = new QueryWrapper<>();
@@ -81,7 +85,7 @@ 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());
@@ -201,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 @@
- select siw.RESOURCE_BO
-from sfc as sfc
- inner join sfc_routing as sri on sfc.handle = sri.sfc_bo
- inner join sfc_router as srt on sri.handle = srt.sfc_routing_bo
- inner join sfc_step as sep on srt.handle = sep.sfc_router_bo
+ select siw.RESOURCE_BO
+ from sfc sfc
+ inner join sfc_routing sri on sfc.handle = sri.sfc_bo
+ inner join sfc_router srt on sri.handle = srt.sfc_routing_bo AND srt.IN_USE = 'true'
+ inner join sfc_step sep on srt.handle = sep.sfc_router_bo
INNER JOIN SFC_IN_WORK siw ON sep.HANDLE = siw.SFC_STEP_BO
-WHERE sfc.site = #{site} and
- sfc.SFC = #{sfc}
+ WHERE sfc.site = #{site} and sfc.SFC = #{sfc}
SELECT SO.SHOP_ORDER, SO_CF.VALUE ITEM_NUMBER, SO_CF2.VALUE WORK_ORDER,I.ITEM, IT.DESCRIPTION ITEM_DESC,
diff --git a/production/src/main/resources/mapper/SplitSfcMapper.xml b/production/src/main/resources/mapper/SplitSfcMapper.xml
index 97450c53..235a0d55 100644
--- a/production/src/main/resources/mapper/SplitSfcMapper.xml
+++ b/production/src/main/resources/mapper/SplitSfcMapper.xml
@@ -380,7 +380,7 @@
SELECT zab.NC_QTY,zsbd.ROUTER_BO,zab.NC_CODE,zab.ABNORMAL_NO FROM Z_ABNORMAL_BILL zab
JOIN Z_ABNORMAL_BILL_DISPOSE zsbd ON zab.HANDLE=ZSBD.ABNORMAL_BILL_BO
- WHERE ZAB.SFC=#{sfc} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='F' AND zab."TYPE"='Z' AND zsbd.ABNORMAL_METHOD='F'
+ WHERE ZAB.SFC=#{sfc} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='G' AND zab."TYPE"='Z' AND (zsbd.ABNORMAL_METHOD='F' OR zsbd.ABNORMAL_METHOD='C')
From ce7a6062661ef916fbb727975deac03a50c5bf09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com>
Date: Mon, 9 Aug 2021 16:59:13 +0800
Subject: [PATCH 9/9] =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=8A=A5=E5=BA=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
anomaly/src/main/resources/mapper/AbnormalBillMapper.xml | 7 ++-----
.../mesnac/production/controller/SfcScrapController.java | 2 --
.../production/service/impl/SfcScrapServiceImpl.java | 8 +++++---
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml
index ef463532..e84dfa1e 100644
--- a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml
+++ b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml
@@ -983,11 +983,8 @@
- SELECT S.SFC SFC, CASE WHEN S2.STATUS = '401' THEN '新建'
- WHEN S2.STATUS = '402' THEN '排队'
- WHEN S2.STATUS = '403' THEN '活动'
- WHEN S2.STATUS = '407' THEN '报废'
- END STATUS,
+ 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,
ZSD.RESRCE RESRCE,ZSD.SHOP_ORDER SHOP_ORDER,
CASE WHEN I.ITEM != 'NULL' THEN I.ITEM || '/' || I.REVISION END ITEM,
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/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 + "");