生产派工显示组件描述错误,刷新叫料信息重复问题处理

master
Leon 3 years ago
parent 40fd19d945
commit 57c54d171e

@ -51,8 +51,6 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
@Autowired @Autowired
private CallItemService callItemService; private CallItemService callItemService;
@Autowired @Autowired
private NwaUserService nwaUserService;
@Autowired
private UserGroupMapper userGroupMapper; private UserGroupMapper userGroupMapper;
@Override @Override
@ -244,58 +242,49 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
@Override @Override
public void refreshCallItem(String site, String user, List<CallItem> callItemList) { public void refreshCallItem(String site, String user, List<CallItem> callItemList) {
LocalDateTime nowDate = LocalDateTime.now();
if (callItemList == null || callItemList.size() <= 0) { if (callItemList == null || callItemList.size() <= 0) {
return; return;
} }
List<SfcDispatchDto> sfcDispatchList = new ArrayList<>(); List<SfcDispatchDto> sfcDispatchList = new ArrayList<>();
for (CallItem callItem: callItemList) { for (CallItem callItem: callItemList) {
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto(); SfcDispatchDto sfcDispatchDto = new SfcDispatchDto();
sfcDispatchDto.setHandle(callItem.getSfcDispatchBo()); sfcDispatchDto.setHandle(callItem.getSfcDispatchBo());
sfcDispatchList.add(sfcDispatchDto); sfcDispatchList.add(sfcDispatchDto);
} }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//删除原来的数据
callItemMapper.deleteDispatchCallItem(sfcDispatchList);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<CallItem> list = callItemMapper.selectDispatchCallItem(sfcDispatchList); List<CallItem> list = callItemMapper.selectDispatchCallItem(sfcDispatchList);
if (list == null || list.size() <= 0) { if (list == null || list.size() <= 0) {
return; return;
} }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LocalDateTime nowDate = LocalDateTime.now();
List<CallItem> addList = new ArrayList<>(); List<CallItem> addList = new ArrayList<>();
List<CallItem> modList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
CallItem callItem = list.get(i); CallItem callItem = list.get(i);
String handle = callItem.getHandle();
BigDecimal reqQty = callItem.getRequiredQty(); BigDecimal reqQty = callItem.getRequiredQty();
if (reqQty.compareTo(BigDecimal.ZERO) == 1) { if (reqQty.compareTo(BigDecimal.ZERO) == 1) {
if (StringUtil.isBlank(handle)) { String component = StringUtil.trimHandle(callItem.getComponentBo());
String component = StringUtil.trimHandle(callItem.getComponentBo()); String callItemNo = callItem.getSfc() + callItem.getStepId() + component;
String callItemNo = callItem.getSfc() + callItem.getStepId() + component;
callItem.setCallItemNo(callItemNo);
callItem.setCallItemNo(callItemNo); callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, callItemNo));
callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, callItemNo)); callItem.setCallType(Constants.CALL_TYPE_MATERIAL);
callItem.setCallType(Constants.CALL_TYPE_MATERIAL); callItem.setStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setStatus(Constants.CALL_ITEM_STATUS_NEW); callItem.setCreateUser(user);
callItem.setCreateUser(user); callItem.setCreatedDateTime(nowDate);
callItem.setCreatedDateTime(nowDate); callItem.setModifyUser(user);
callItem.setModifyUser(user); callItem.setModifiedDateTime(nowDate);
callItem.setModifiedDateTime(nowDate); addList.add(callItem);
addList.add(callItem);
} else {
callItem.setRequiredQty(callItem.getIssueQty());
callItem.setModifyUser(user);
callItem.setModifiedDateTime(nowDate);
modList.add(callItem);
}
} }
} }
if (addList != null && addList.size() > 0) { if (addList != null && addList.size() > 0) {
this.saveBatch(addList); this.saveBatch(addList);
} }
if (modList != null && modList.size() > 0) {
this.updateBatchById(modList);
}
} }
@Override @Override

@ -686,6 +686,7 @@
CASE WHEN CC.VALUE = '9' THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO, CASE WHEN CC.VALUE = '9' THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO,
WR.WORK_CENTER RESOURCE_WORK_CENTER, MAX(CP.ITEM) COMPONENT, MAX(CT.DESCRIPTION) COMPONENT_DESCRIPTION, MAX(C3.VALUE) TEXTURE, MAX(C4.VALUE) MAT_SPEC WR.WORK_CENTER RESOURCE_WORK_CENTER, MAX(CP.ITEM) COMPONENT, MAX(CT.DESCRIPTION) COMPONENT_DESCRIPTION, MAX(C3.VALUE) TEXTURE, MAX(C4.VALUE) MAT_SPEC
FROM Z_SFC_DISPATCH SD FROM Z_SFC_DISPATCH SD
INNER JOIN SFC SC ON SC.SITE = SD.SITE AND SC.SFC = SD.SFC
LEFT JOIN RESRCE RS ON SD.SITE = RS.SITE AND SD.RESRCE = RS.RESRCE LEFT JOIN RESRCE RS ON SD.SITE = RS.SITE AND SD.RESRCE = RS.RESRCE
INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'WORK_ORDER' LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'WORK_ORDER'
@ -695,7 +696,8 @@
LEFT JOIN CUSTOM_FIELDS CC ON CC.HANDLE = IM.HANDLE AND CC.ATTRIBUTE = 'ACCESSORY_TYPE' LEFT JOIN CUSTOM_FIELDS CC ON CC.HANDLE = IM.HANDLE AND CC.ATTRIBUTE = 'ACCESSORY_TYPE'
INNER JOIN OPERATION O ON O.SITE = SD.SITE AND O.OPERATION = SD.OPERATION AND O.CURRENT_REVISION = 'true' INNER JOIN OPERATION O ON O.SITE = SD.SITE AND O.OPERATION = SD.OPERATION AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = 'zh' LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = 'zh'
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SO.BOM_BO INNER JOIN SFC_BOM SB ON SB.SFC_BO = SC.HANDLE
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO
LEFT JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO LEFT JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh' LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh'
LEFT JOIN CUSTOM_FIELDS C3 ON C3.HANDLE = CP.HANDLE AND C3.ATTRIBUTE = 'TEXTTURE' LEFT JOIN CUSTOM_FIELDS C3 ON C3.HANDLE = CP.HANDLE AND C3.ATTRIBUTE = 'TEXTTURE'

@ -323,7 +323,6 @@
<select id="findAllUser" resultMap="BaseResultMap"> <select id="findAllUser" resultMap="BaseResultMap">
SELECT USER_NAME, FULL_NAME SELECT USER_NAME, FULL_NAME
FROM Z_NWA_USER FROM Z_NWA_USER
WHERE SITE = #{site}
</select> </select>
<insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.NwaUser"> <insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.NwaUser">

Loading…
Cancel
Save