Merge remote-tracking branch 'origin/master'

master
philip 3 years ago
commit 25f55926cd

@ -182,6 +182,8 @@ public class SfcDispatchDto implements Serializable{
*/
private String component;
private String componentDescription;
private String texture;
private String matSpec;
private String isCompleted;
private BigDecimal completedQty;
private String resourceWorkCenter;
@ -604,6 +606,22 @@ public class SfcDispatchDto implements Serializable{
this.componentDescription = componentDescription;
}
public String getTexture() {
return texture;
}
public void setTexture(String texture) {
this.texture = texture;
}
public String getMatSpec() {
return matSpec;
}
public void setMatSpec(String matSpec) {
this.matSpec = matSpec;
}
public String getIsCompleted() {
return isCompleted;
}

@ -39,18 +39,13 @@ public class CallItemController {
* @return
*/
@ResponseBody
@PostMapping("/findCallItemList")
public R findCallItemList(@RequestBody CallItem callItem){
@GetMapping("/findCallItemList")
public R findCallItemList(@RequestParam(required = false) Map paramMap){
List<CallItem> result;
try {
callItem.setSite(CommonMethods.getSite());
if (callItem.getStartFromDate_S() != null) {
callItem.setStartFromDate(DateUtil.parse(callItem.getStartFromDate_S()));
}
if (callItem.getStartToDate_S() != null) {
callItem.setStartToDate(DateUtil.parse(callItem.getStartToDate_S()));
}
result = callItemService.findCallItemList(callItem);
String site = CommonMethods.getSite();
paramMap.put("site", site);
result = callItemService.findCallItemList(paramMap);
} catch (Exception e) {
return R.failed(e.getMessage());
}

@ -1,14 +1,11 @@
package com.foreverwin.mesnac.dispatch.controller;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.service.SfcDispatchService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;

@ -4,12 +4,12 @@ import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.dto.IssueItemDto;
import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -30,7 +30,7 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
List<CallItem> selectCallItemAndType(@Param("sfcDispatchBo") String sfcDispatchBo);
List<CallItem> findCallItemList(CallItem callItem);
List<CallItem> findCallItemList(Map paramMap);
List<CallItem> findCallItemDetailList(CallItem callItem);
@ -51,6 +51,8 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
List<CallItem> findRefreshCallItemPda(@Param("list") List<String> list);
void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<CallItem> list);
void updateCallItemStatusByCallItemNo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);
void refreshRequiredTime(@Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);

@ -37,9 +37,9 @@ public interface CallItemService extends IService<CallItem> {
/**
*
*
* @param callItem
* @param paramMap
*/
List<CallItem> findCallItemList(CallItem callItem);
List<CallItem> findCallItemList(Map paramMap);
/**
*

@ -137,8 +137,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
}
@Override
public List<CallItem> findCallItemList(CallItem callItem) {
return callItemMapper.findCallItemList(callItem);
public List<CallItem> findCallItemList(Map paramMap) {
return callItemMapper.findCallItemList(paramMap);
}
@Override
@ -174,13 +174,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
return;
}
//派工单号集合
List<String> dispatchBoList = new ArrayList<>();
for (CallItem callItem : callItemList) {
dispatchBoList.add(callItem.getSfcDispatchBo());
}
this.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_CALLED, user, dispatchBoList);
LocalDateTime nowDate = LocalDateTime.now();
callItemMapper.updateCallItemStatusByHandle(Constants.CALL_ITEM_STATUS_CALLED, user, nowDate, callItemList);
}
@Override

@ -39,6 +39,10 @@
<result column="WORK_CENTER" property="workCenter" />
<result column="DISPATCH_NO" property="dispatchNo" />
<result column="DISPATCH_QTY" property="dispatchQty" />
<result column="COMPONENT" property="component" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" />
<result column="TEXTURE" property="texture" />
<result column="SPEC" property="spec" />
<result column="RESOURCE_TYPE" property="resourceType" />
<result column="BLANKING_SIZE" property="blankingSize" />
<result column="RESOURCE_DESCRIPTION" property="resourceDescription" />
@ -640,14 +644,14 @@
<select id="findCallItemList" resultMap="FullResultMap">
SELECT *
FROM (
SELECT ZCI.SITE, CF.VALUE WORK_ORDER, CS.VALUE ITEM_NUMBER, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION ITEM_DESCRIPTION, ZSD.BLANKING_SIZE,
SELECT ZCI.HANDLE, ZCI.SITE, CF.VALUE WORK_ORDER, CS.VALUE ITEM_NUMBER, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION ITEM_DESCRIPTION, ZSD.BLANKING_SIZE,
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION OPERATION_DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
CASE WHEN VP.NEWS = '1' AND VP.CALLES = '0' AND VP.ISSUED = '0' THEN 'NONE'
WHEN VP.NEWS = '0' AND (VP.CALLES = '1' OR VP.ISSUED = '1') THEN 'ALL'
ELSE 'PART' END CALL_STATUS,
CASE WHEN (VP.NEWS = '1' OR VP.CALLES = '1') AND VP.ISSUED = '0' THEN 'NONE'
WHEN VP.NEWS = '0' AND VP.CALLES = '0' AND VP.ISSUED = '1' THEN 'ALL'
ELSE 'ALL' END ISSUE_STATUS
ELSE 'ALL' END ISSUE_STATUS, CP.ITEM COMPONENT, CT.DESCRIPTION COMPONENT_DESCRIPTION, C3.VALUE TEXTURE, C4.VALUE SPEC
FROM Z_SFC_DISPATCH ZSD
INNER JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE AND ZSD.SHOP_ORDER = SO.SHOP_ORDER
@ -656,6 +660,9 @@
INNER JOIN ITEM IT ON IT.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T ITT ON ITT.ITEM_BO = IT.HANDLE AND ITT.LOCALE = 'zh'
INNER JOIN ITEM CP ON CP.HANDLE = ZCI.COMPONENT_BO
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 C4 ON C4.HANDLE = CP.HANDLE AND C4.ATTRIBUTE = 'MAT_SPEC'
INNER JOIN OPERATION OP ON OP.SITE = ZCI.SITE AND OP.OPERATION = ZCI.OPERATION AND OP.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OPT ON OPT.OPERATION_BO = OP.HANDLE AND OPT.LOCALE = 'zh'
LEFT JOIN (
@ -692,15 +699,18 @@
<if test="component != null and component != ''">
AND CP.ITEM = #{component}
</if>
<if test="texture != null and texture != ''">
AND C3.VALUE LIKE '%'||#{texture}||'%'
</if>
<if test="matSpec != null and matSpec != ''">
AND C4.VALUE LIKE '%'||#{matSpec}||'%'
</if>
<if test="startFromDate != null">
AND ZSD.PLANNED_START_DATE >= #{startFromDate}
</if>
<if test="startToDate != null">
AND ZSD.PLANNED_START_DATE &lt;= #{startToDate}
</if>
GROUP BY ZCI.SITE, CF.VALUE, CS.VALUE, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION, ZSD.BLANKING_SIZE,
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
VP.NEWS, VP.CALLES, VP.ISSUED, VP.CANCELED
)
WHERE 1= 1
<if test="callStatus != null and callStatus != ''">
@ -830,6 +840,14 @@
ORDER BY ZSD.SFC, ZSD.STEP_ID, ZCI.CALL_TYPE
</select>
<update id="updateCallItemStatusByHandle">
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
WHERE STATUS != '804' AND HANDLE IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.handle}
</foreach>
</update>
<update id="updateCallItemStatusByDispatchBo">
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
WHERE STATUS != '804' AND SFC_DISPATCH_BO IN

@ -65,6 +65,9 @@
<result column="SHOP_ORDER_TYPE" property="shopOrderType" />
<result column="ITEM_DESCRIPTION" property="itemDescription" />
<result column="COMPONENT" property="component" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" />
<result column="TEXTURE" property="texture" />
<result column="MAT_SPEC" property="matSpec" />
<result column="COMPLETED_QTY" property="completedQty" />
<result column="RESOURCE_DESCRIPTION" property="resourceDescription" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" />
@ -676,12 +679,12 @@
WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布'
END AS STATUS_NAME, 'ADMINISTRATOR' AS ROLE
FROM (
SELECT DISTINCT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SELECT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION RESOURCE_DESCRIPTION,
CASE WHEN SD.DISPATCH_STATUS = 'COMPLETE' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE,
WR.WORK_CENTER RESOURCE_WORK_CENTER
CASE WHEN IM.LOT_SIZE = 1 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
FROM Z_SFC_DISPATCH SD
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
@ -692,8 +695,10 @@
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'
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SO.BOM_BO
INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
LEFT JOIN ITEM_T CPT ON CPT.ITEM_BO = CP.HANDLE AND CPT.LOCALE = 'zh'
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 CUSTOM_FIELDS C3 ON C3.HANDLE = CP.HANDLE AND C3.ATTRIBUTE = 'TEXTTURE'
LEFT JOIN CUSTOM_FIELDS C4 ON C4.HANDLE = CP.HANDLE AND C4.ATTRIBUTE = 'MAT_SPEC'
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = 'ResourceBO:' || SD.SITE || ',' || SD.RESRCE
LEFT JOIN WORK_CENTER WR ON WR.HANDLE = WCM.WORK_CENTER_BO
WHERE SD.SITE = #{site}
@ -733,17 +738,23 @@
<if test="turnOperation != null and turnOperation != ''">
AND SD.TURN_OPERATION = #{turnOperation}
</if>
<if test="isDispatch != null and isDispatch != ''">
AND SD.IS_DISPATCH = #{isDispatch}
</if>
<if test="blankingSize != null and blankingSize != ''">
AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%'
</if>
<if test="component != null and component != ''">
AND CP.ITEM = #{component}
</if>
<if test="componentDescription != null and componentDescription != ''">
AND CPT.DESCRIPTION LIKE '%' || #{componentDescription} || '%'
AND CT.DESCRIPTION LIKE '%' || #{componentDescription} || '%'
</if>
<if test="isDispatch != null and isDispatch != ''">
AND SD.IS_DISPATCH = #{isDispatch}
<if test="texture != null and texture != ''">
AND C3.VALUE LIKE '%'|| #{texture} ||'%'
</if>
<if test="blankingSize != null and blankingSize != ''">
AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%'
<if test="matSpec != null and matSpec != ''">
AND C4.VALUE LIKE '%'|| #{matSpec}|| '%'
</if>
<if test="startFromDate != null">
AND SO.PLANNED_START_DATE >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD')
@ -757,6 +768,11 @@
<if test="completeToDate != null">
AND SO.PLANNED_COMP_DATE &lt;= TO_DATE(#{completeToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
GROUP BY SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE, C1.VALUE, IM.HANDLE, IM.ITEM, IT.DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION,
SD.DISPATCH_STATUS, SD.DISPATCH_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
IM.LOT_SIZE, SD.TURN_OPERATION, SD.BLANKING_SIZE, WR.WORK_CENTER
) WIP
LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.DISPATCH_SEQ = WIP.BEFORE_SEQ
LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ

Loading…
Cancel
Save