Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit d189b36130

@ -18,6 +18,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
@ -153,24 +154,18 @@ public class CallItemController {
/** /**
* pda * pda
* @param callItemList * @param
* @return * @return
*/ */
@ResponseBody @ResponseBody
@PostMapping("/callOrConfirmItemPda") @PostMapping("/callOrConfirmItemPda")
public R callOrConfirmItemPda(@RequestBody List<CallItem> callItemList) { public R callOrConfirmItemPda(@RequestBody Map<String,Object> map) {
try { try {
String site = CommonMethods.getSite(); callItemService.callOrConfirmItemPda(map);
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("确认到料成功");
} catch (Exception e) { } catch (Exception e) {
return R.failed(e.getMessage()); return R.failed(e.getMessage());
} }
return R.ok("叫料成功");
} }

@ -45,9 +45,9 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
* @param status * @param status
* @param user * @param user
* @param dateTime * @param dateTime
* @param list * @param callItem
*/ */
void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list); void updateCallItemStatusByCallItem(@Param("site") String site, @Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("callItem") CallItem callItem);
List<CallItem> findRefreshCallItemPda(@Param("list") List<String> list); List<CallItem> findRefreshCallItemPda(@Param("list") List<String> list);

@ -5,6 +5,7 @@ import com.foreverwin.mesnac.dispatch.dto.IssueItemDto;
import com.foreverwin.mesnac.dispatch.model.CallItem; import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
@ -78,11 +79,8 @@ public interface CallItemService extends IService<CallItem> {
/** /**
* PDA * PDA
* @param site
* @param user
* @param callItemList
*/ */
void callOrConfirmItemPda(String site, String user, String status ,List<CallItem> callItemList); void callOrConfirmItemPda(Map<String,Object> map);
/** /**
* *

@ -1,5 +1,7 @@
package com.foreverwin.mesnac.dispatch.service.impl; 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.constant.Constants;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto; import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.enums.HandleEnum;
@ -150,12 +152,13 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
String user = CommonMethods.getUser(); String user = CommonMethods.getUser();
NwaUser byId = nwaUserService.getById(HandleEnum.USER.getHandle(site, user)); NwaUser byId = nwaUserService.getById(HandleEnum.USER.getHandle(site, user));
String language = LocaleContextHolder.getLocale().getLanguage(); String language = LocaleContextHolder.getLocale().getLanguage();
callItem.setCallType(Constants.CALL_TYPE_MATERIAL);
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site, "CJ_ZR,ADMINISTRATORS"); List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site, "CJ_ZR,ADMINISTRATORS");
if (nwaUsers.contains(byId)){ 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 @Override
public void callItem(String site, String user, List<CallItem> callItemList) { public void callItem(String site, String user, List<CallItem> callItemList) {
@ -173,13 +176,19 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
} }
@Override @Override
public void callOrConfirmItemPda(String site, String user,String status ,List<CallItem> callItemList) { public void callOrConfirmItemPda(Map<String,Object> map) {
String user = CommonMethods.getUser();
String site = CommonMethods.getSite();
String status = (String) map.get("status");
List<CallItem> callItemList = (List<CallItem>) map.get("callItemList");
String parse = JSON.toJSONString(callItemList);
List<CallItem> callItems = JSONObject.parseArray(parse, CallItem.class);
CallItem callItem1 = callItems.get(0);
LocalDateTime dateTime = LocalDateTime.now(); LocalDateTime dateTime = LocalDateTime.now();
List<String> list = new ArrayList<>(); for (CallItem callItem : callItems) {
for (CallItem callItem : callItemList) { callItemMapper.updateCallItemStatusByCallItem(site,status, user, dateTime, callItem);
list.add(callItem.getHandle());
} }
callItemMapper.updateCallItemStatusByHandle(status, user, dateTime, list);
} }
@Override @Override

@ -833,12 +833,10 @@
</foreach> </foreach>
</update> </update>
<update id="updateCallItemStatusByHandle"> <update id="updateCallItemStatusByCallItem">
UPDATE Z_CALL_ITEM SET 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 WHERE SITE = #{site} AND STATUS = #{callItem.status} AND SHOP_ORDER = #{callItem.shopOrder}
<foreach item="item" collection="list" separator="," open="(" close=")" index=""> AND COMPONENT_BO = #{callItem.componentBo}
#{item}
</foreach>
</update> </update>
<update id="updateCallItemStatusByCallItemNo"> <update id="updateCallItemStatusByCallItemNo">
@ -980,14 +978,12 @@
<select id="findCallItemListPda" resultMap="FullResultMap"> <select id="findCallItemListPda" resultMap="FullResultMap">
SELECT MML.* , ZSD.PLANNED_START_DATE FROM SELECT MML.* , ZSD.PLANNED_START_DATE FROM
( ( SELECT ZCI.SITE, CF.VALUE WORK_ORDER, ZCI.STATUS ,WC.WORK_CENTER, WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
SELECT ZCI.SITE, CF.VALUE WORK_ORDER, WC.WORK_CENTER, WCT.DESCRIPTION WORK_CENTER_DESCRIPTION, ZCI.SHOP_ORDER , ZCI.RESRCE,
ZCI.SHOP_ORDER , IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,ZCI.COMPONENT_BO ,
IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION, ZSD.BLANKING_SIZE,
CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION, MIN(ZSD.PLANNED_START_DATE) ,
ZSD.BLANKING_SIZE, /*MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/
ZCI.RESRCE, ZCI.CALL_TYPE,
/*MIN(SO.PLANNED_START_DATE) ,*/
SUM(ZCI.REQUIRED_QTY) REQUIRED_QTY SUM(ZCI.REQUIRED_QTY) REQUIRED_QTY
FROM Z_CALL_ITEM ZCI FROM Z_CALL_ITEM ZCI
INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.HANDLE = ZCI.SFC_DISPATCH_BO INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.HANDLE = ZCI.SFC_DISPATCH_BO
@ -1000,19 +996,18 @@
INNER JOIN ITEM CP ON CP.HANDLE = ZCI.COMPONENT_BO INNER JOIN ITEM CP ON CP.HANDLE = ZCI.COMPONENT_BO
INNER JOIN ITEM_T ITT ON ITT.ITEM_BO = CP.HANDLE AND ITT.LOCALE = #{local} INNER JOIN ITEM_T ITT ON ITT.ITEM_BO = CP.HANDLE AND ITT.LOCALE = #{local}
WHERE ZCI.SITE = #{site} WHERE ZCI.SITE = #{site}
GROUP BY ZCI.SITE, CF.VALUE, WC.WORK_CENTER, IM.ITEM, ZSD.BLANKING_SIZE, CP.ITEM, ZCI.RESRCE, ZCI.CALL_TYPE,ZCI.SHOP_ORDER , <if test="callItem.callType != null and callItem.callType != ''">
WCT.DESCRIPTION ,IT.DESCRIPTION , ITT.DESCRIPTION AND ZCI.CALL_TYPE = #{callItem.callType}
ORDER BY CF.VALUE ,ZCI.RESRCE, IM.ITEM ) MML </if>
INNER JOIN <if test="user != null and user != ''">
( SELECT ZSD.BLANKING_SIZE ,ZSD.RESRCE ,ZSD.WORK_CENTER ,ZSD.SHOP_ORDER , AND '%' ||#{user} || '%' LIKE ZSD.EMPLOYEE
MIN(ZSD.PLANNED_START_DATE) PLANNED_START_DATE </if>
FROM WIP.Z_SFC_DISPATCH ZSD GROUP BY ZCI.SITE, CF.VALUE, ZCI.STATUS ,WC.WORK_CENTER, IM.ITEM, ZSD.BLANKING_SIZE, CP.ITEM, ZCI.RESRCE, ZCI.CALL_TYPE,ZCI.SHOP_ORDER ,ZCI.COMPONENT_BO ,
WHERE ZSD.SITE = #{site} WCT.DESCRIPTION ,IT.DESCRIPTION , ITT.DESCRIPTION ) MML
<if test="user != null and user != ''">AND ZSD.EMPLOYEE LIKE #{user}</if> LEFT JOIN
GROUP BY ZSD.WORK_CENTER ,ZSD.BLANKING_SIZE ,ZSD.SHOP_ORDER ,ZSD.RESRCE ( SELECT MIN(ZSD.PLANNED_START_DATE) PLANNED_START_DATE,SHOP_ORDER FROM Z_SFC_DISPATCH zsd WHERE ZSD.SITE = #{site} GROUP BY ZSD.SHOP_ORDER) ZSD
) ZSD ON ZSD.SHOP_ORDER = MML.SHOP_ORDER
ON ZSD.SHOP_ORDER = MML.SHOP_ORDER AND ZSD.BLANKING_SIZE = MML.BLANKING_SIZE WHERE MML.SITE = #{site}
AND ZSD.RESRCE = MML.RESRCE AND ZSD.WORK_CENTER = MML.WORK_CENTER
<if test="callItem.workCenter != null and callItem.workCenter != ''"> <if test="callItem.workCenter != null and callItem.workCenter != ''">
AND MML.WORK_CENTER = #{callItem.workCenter} AND MML.WORK_CENTER = #{callItem.workCenter}
</if> </if>

Loading…
Cancel
Save