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.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<CallItem> callItemList) {
public R callOrConfirmItemPda(@RequestBody Map<String,Object> 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("叫料成功");
}

@ -45,9 +45,9 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
* @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<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);

@ -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;
/**
* <p>
@ -78,11 +79,8 @@ public interface CallItemService extends IService<CallItem> {
/**
* 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;
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<CallItemMapper, CallItem> 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<NwaUser> 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<CallItemMapper, CallItem> i
}
@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();
List<String> 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

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

Loading…
Cancel
Save