diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java index 8884e705..453117ab 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java @@ -18,6 +18,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Map; /** * @@ -153,24 +154,18 @@ public class CallItemController { /** * 生产叫料pda - * @param callItemList + * @param * @return */ @ResponseBody @PostMapping("/callOrConfirmItemPda") - public R callOrConfirmItemPda(@RequestBody List callItemList) { + public R callOrConfirmItemPda(@RequestBody Map map) { try { - String site = CommonMethods.getSite(); - String user = CommonMethods.getUser(); - String status = callItemList.get(0).getStatus(); - callItemService.callOrConfirmItemPda(site, user, status ,callItemList); - if (status.equals("802")){ - return R.ok("叫料成功"); - } - return R.ok("确认到料成功"); + callItemService.callOrConfirmItemPda(map); } catch (Exception e) { return R.failed(e.getMessage()); } + return R.ok("叫料成功"); } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java index 671da5b1..0e3e1ef9 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java @@ -45,9 +45,9 @@ public interface CallItemMapper extends BaseMapper { * @param status * @param user * @param dateTime - * @param list + * @param callItem */ - void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); + void updateCallItemStatusByCallItem(@Param("site") String site, @Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("callItem") CallItem callItem); List findRefreshCallItemPda(@Param("list") List list); diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java index cb8a3921..12aad5f9 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java @@ -5,6 +5,7 @@ import com.foreverwin.mesnac.dispatch.dto.IssueItemDto; import com.foreverwin.mesnac.dispatch.model.CallItem; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; +import java.util.Map; /** *

@@ -78,11 +79,8 @@ public interface CallItemService extends IService { /** * 叫料PDA - * @param site - * @param user - * @param callItemList */ - void callOrConfirmItemPda(String site, String user, String status ,List callItemList); + void callOrConfirmItemPda(Map map); /** * 确认到料 diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java index ae10765a..d95a9b63 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java @@ -1,5 +1,7 @@ package com.foreverwin.mesnac.dispatch.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.dto.SfcDispatchDto; import com.foreverwin.mesnac.common.enums.HandleEnum; @@ -150,11 +152,12 @@ public class CallItemServiceImpl extends ServiceImpl i String user = CommonMethods.getUser(); NwaUser byId = nwaUserService.getById(HandleEnum.USER.getHandle(site, user)); String language = LocaleContextHolder.getLocale().getLanguage(); + callItem.setCallType(Constants.CALL_TYPE_MATERIAL); List nwaUsers = nwaUserService.checkUserGroup(site, "CJ_ZR,ADMINISTRATORS"); if (nwaUsers.contains(byId)){ - return callItemMapper.findCallItemListPda(site,language,user,callItem); + return callItemMapper.findCallItemListPda(site,language,null,callItem); } - return callItemMapper.findCallItemListPda(site,language,null,callItem); + return callItemMapper.findCallItemListPda(site,language,user,callItem); } @Override @@ -173,13 +176,19 @@ public class CallItemServiceImpl extends ServiceImpl i } @Override - public void callOrConfirmItemPda(String site, String user,String status ,List callItemList) { + public void callOrConfirmItemPda(Map map) { + String user = CommonMethods.getUser(); + String site = CommonMethods.getSite(); + String status = (String) map.get("status"); + List callItemList = (List) map.get("callItemList"); + String parse = JSON.toJSONString(callItemList); + List callItems = JSONObject.parseArray(parse, CallItem.class); + CallItem callItem1 = callItems.get(0); LocalDateTime dateTime = LocalDateTime.now(); - List list = new ArrayList<>(); - for (CallItem callItem : callItemList) { - list.add(callItem.getHandle()); + for (CallItem callItem : callItems) { + callItemMapper.updateCallItemStatusByCallItem(site,status, user, dateTime, callItem); } - callItemMapper.updateCallItemStatusByHandle(status, user, dateTime, list); + } @Override diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index 38f4021e..2ff0a06c 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -833,12 +833,10 @@ - + UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime} - WHERE HANDLE IN - - #{item} - + WHERE SITE = #{site} AND STATUS = #{callItem.status} AND SHOP_ORDER = #{callItem.shopOrder} + AND COMPONENT_BO = #{callItem.componentBo} @@ -979,15 +977,13 @@