生产叫料修改

master
zpl 3 years ago
parent 4b7fd655c4
commit 7980402005

@ -162,11 +162,15 @@ public class CallItemController {
try {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
callItemService.callOrConfirmItemPda(site, user, callItemList.get(0).getCallStatus() ,callItemList);
String status = callItemList.get(0).getStatus();
callItemService.callOrConfirmItemPda(site, user, status ,callItemList);
if (status.equals("802")){
return R.ok("叫料成功");
}
return R.ok("确认到料成功");
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok("叫料成功");
}
@ -230,9 +234,7 @@ public class CallItemController {
@PostMapping("/refreshCallItemPda")
public R refreshCallItemPda(@RequestBody List<CallItem> callItemList) {
try {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
callItemService.refreshCallItemPda(site, user, callItemList);
callItemService.refreshCallItemPda(callItemList);
} catch (Exception e) {
return R.failed(e.getMessage());
}

@ -49,7 +49,7 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
*/
void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);
void findRefreshCallItemPda(@Param("list") List<String> list);
List<CallItem> findRefreshCallItemPda(@Param("list") List<String> list);
void updateCallItemStatusByCallItemNo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);

@ -114,11 +114,9 @@ public interface CallItemService extends IService<CallItem> {
/**
* PDA
* @param site
* @param user
* @param callItemList
*/
void refreshCallItemPda(String site, String user, List<CallItem> callItemList);
void refreshCallItemPda(List<CallItem> callItemList);
/**
*

@ -39,6 +39,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
@Autowired
private CallItemMapper callItemMapper;
@Autowired
private CallItemService callItemService;
@Override
public void sfcDispatchCallItem(String site, String user, List<SfcDispatchDto> sfcDispatchList) {
@ -271,8 +273,31 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
}
@Override
public void refreshCallItemPda(String site, String user, List<CallItem> callItemList) {
public void refreshCallItemPda(List<CallItem> callItemList) {
List<CallItem> callItems = new ArrayList<>();
List<String> list = new ArrayList<>();
for (CallItem callItem:callItemList) {
String handle = callItem.getHandle();
list.add(handle);
CallItem call = new CallItem();
call.setHandle(handle);
callItems.add(call);
}
List<CallItem> itemList = callItemMapper.findRefreshCallItemPda(list);
Boolean bl = false;
for (int i = 0; i < callItemList.size(); i++) {
BigDecimal oldQty = callItemList.get(i).getRequiredQty();
BigDecimal newQty = itemList.get(i).getRequiredQty();
if (oldQty.compareTo(newQty) == -1){
callItems.get(i).setStatus(Constants.CALL_ITEM_STATUS_NEW);
callItems.get(i).setRequiredQty(newQty);
bl = true;
}
}
if (bl){
callItemService.updateBatchById(callItems);
}
}
@Override

@ -834,7 +834,7 @@
</update>
<update id="updateCallItemStatusByHandle">
UPDATE Z_CALL_ITEM SET CALL_STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
WHERE HANDLE IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item}
@ -979,7 +979,7 @@
</select>
<select id="findCallItemInfoList" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.RESRCE ,CF.VALUE SHOP_ORDER ,CI.REQUIRED_QTY , CI.CALL_STATUS,
SELECT CI.HANDLE ,CI.RESRCE ,CF.VALUE SHOP_ORDER ,CI.REQUIRED_QTY , CI.STATUS,
B.BOM AS ITEM, B.DESCRIPTION ITEM_DESCRIPTION ,
SD.WORK_CENTER , WCT.DESCRIPTION AS WORK_CENTER_DESCRIPTION, SD.BLANKING_SIZE, SD.REMARK, SD.PLANNED_START_DATE,
I.ITEM AS COMPONENT ,IT.DESCRIPTION AS COMPONENT_DESCRIPTION
@ -1016,18 +1016,15 @@
</select>
<select id="findRefreshCallItemPda" resultMap="FullResultMap">
SELECT CI.HANDLE ,CI.SFC ,CI.COMPONENT_BO ,BC.QTY REQUIRED_QTY, CF.VALUE STEP_ID
--BC.BOM_BO , CI.STEP_ID ,
FROM Z_CALL_ITEM CI
LEFT JOIN SFC S ON S.SFC = CI.SFC
LEFT JOIN SFC_BOM SB ON SB.SFC_BO = S.HANDLE
LEFT JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO AND BC.COMPONENT_GBO = CI.COMPONENT_BO
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = CI.STEP_ID
WHERE HANDLE IN
(
<foreach item="item" index="index" collection="coll" separator=",">
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item}
</foreach>
)
</select>
</mapper>

Loading…
Cancel
Save