Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit 631c4ad3e0

@ -41,6 +41,8 @@ public class LabelPrintDto implements Serializable {
private String sfc;
//数量
private BigDecimal qty;
// 特定打印的数量
private BigDecimal sfcQty;
//下料尺寸
private String blankingSize;
//下道工序
@ -168,6 +170,14 @@ public class LabelPrintDto implements Serializable {
this.qty = qty;
}
public BigDecimal getSfcQty() {
return sfcQty;
}
public void setSfcQty(BigDecimal sfcQty) {
this.sfcQty = sfcQty;
}
public String getBlankingSize() {
return blankingSize;
}

@ -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;
}

@ -2,6 +2,8 @@ package com.foreverwin.mesnac.common.service;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import java.math.BigDecimal;
/**
*
*
@ -34,7 +36,7 @@ public interface SfcDispatchCommonService {
* @param dispatchNo
* @param dispatchStatus
*/
void updateSfcDispatchStatus(String site, String user, String dispatchNo, String dispatchStatus);
void updateSfcDispatchStatus(String site, String user, String dispatchNo, String dispatchStatus, BigDecimal workHour);
/**
* sfc

@ -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);

@ -6,6 +6,7 @@ import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@ -33,18 +34,18 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
/**
*
*
* @param site
* @param site
* @param dispatchNo
* @param dispatchStatus
* @param modifyUser
* @param modifiedDateTime
* @param workHour
*/
void updateSfcDispatchStatus(@Param("site") String site,
@Param("dispatchNo") String dispatchNo,
@Param("dispatchStatus") String dispatchStatus,
@Param("modifyUser") String modifyUser,
@Param("modifiedDateTime") LocalDateTime modifiedDateTime);
@Param("modifiedDateTime") LocalDateTime modifiedDateTime, @Param("workHour")BigDecimal workHour);
/**
*

@ -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

@ -37,6 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@ -684,9 +685,9 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
@Override
public void updateSfcDispatchStatus(String site, String user, String dispatchNo, String dispatchStatus) {
public void updateSfcDispatchStatus(String site, String user, String dispatchNo, String dispatchStatus, BigDecimal workHour) {
LocalDateTime nowDateTime = LocalDateTime.now();
sfcDispatchMapper.updateSfcDispatchStatus(site, dispatchNo, dispatchStatus, user, nowDateTime);
sfcDispatchMapper.updateSfcDispatchStatus(site, dispatchNo, dispatchStatus, user, nowDateTime,workHour);
}
@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
@ -770,7 +786,7 @@
<update id="updateSfcDispatchStatus" >
UPDATE Z_SFC_DISPATCH SET DISPATCH_STATUS = #{dispatchStatus}, MODIFY_USER = #{modifyUser}, MODIFIED_DATE_TIME = #{modifiedDateTime}
<if test="dispatchStatus== 'COMPLETE'">
, ACTUAL_COMPLETE_DATE = #{modifiedDateTime}
, ACTUAL_COMPLETE_DATE = #{modifiedDateTime} , ACTUAL_PROD_HOURS = #{workHour}
</if>
<if test="dispatchStatus== 'START'">
, ACTUAL_START_DATE = #{modifiedDateTime}

@ -660,7 +660,7 @@
WHERE
(ZG.USER_GROUP_BO IS NULL OR (ZG.USER_GROUP_BO IS NOT NULL AND UGM.USER_OR_GROUP_GBO = #{currentUser}))
AND RIK.SITE = #{site}
AND TASK_CREATE_DATE &lt;= (SELECT TO_DATE(TO_CHAR(SYSDATE,'yyyy-mm-dd') || ' 00:00:00','yyyy-MM-dd hh24:mi-ss') -4/24 FROM DUAL)
AND TASK_CREATE_DATE &lt;= (SELECT TO_DATE(TO_CHAR(SYSDATE+1,'yyyy-mm-dd') || ' 00:00:00','yyyy-MM-dd hh24:mi-ss') -4/24 FROM DUAL)
<if test="taskNo != null and taskNo != ''">
AND RIK.TASK_NO = #{taskNo}
</if>

@ -7,6 +7,15 @@ public class SplitSfcDto extends SplitSfc {
private String routerBo;
private String ncQty;
private String abnormalNo;
private String abnormalMethod;
public String getAbnormalMethod() {
return abnormalMethod;
}
public void setAbnormalMethod(String abnormalMethod) {
this.abnormalMethod = abnormalMethod;
}
public String getAbnormalNo() {
return abnormalNo;

@ -30,9 +30,11 @@ import com.foreverwin.mesnac.meapi.service.*;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.production.mapper.SfcDataAssembleMapper;
import com.foreverwin.mesnac.production.model.LoadInventory;
import com.foreverwin.mesnac.production.model.SfcHoldLog;
import com.foreverwin.mesnac.production.service.LoadInventoryService;
import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.mesnac.production.service.SfcCrossService;
import com.foreverwin.mesnac.production.service.SfcHoldLogService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
@ -88,6 +90,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private SfcDispatchCommonService sfcDispatchCommonService;
@Autowired
private LoadInventoryService loadInventoryService;
@Autowired
private SfcHoldLogService sfcHoldLogService;
@Override
public Map<String, Object> resrceEnter(WorkCenterDto workCenterDto) {
@ -235,7 +239,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
ExceptionUtil.throwException(e);
}
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode());
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode(),null);
});
}
@ -309,9 +313,18 @@ public class PodTemplateServiceImpl implements PodTemplateService {
LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc));
long workHourSeconds = Duration.between(startTime, LocalDateTime.now()).getSeconds();
BigDecimal workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP);
//减去暂停时间
QueryWrapper<SfcHoldLog> queryWrapper=new QueryWrapper<>();
queryWrapper.eq(SfcHoldLog.SFC,sfc);
queryWrapper.eq(SfcHoldLog.STEP_ID,stepId);
List<SfcHoldLog> list = sfcHoldLogService.list(queryWrapper);
if (!list.isEmpty()){
BigDecimal holdTime = list.stream().map(SfcHoldLog::getHoldDuration).reduce(BigDecimal.ZERO, BigDecimal::add);
workHour=workHour.subtract(holdTime);
}
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode());
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode(),workHour);
//报工
//sendErp(sfc, stepId, qty, BigDecimal.ZERO, workHour);
} catch (Exception e) {

@ -162,7 +162,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
splitSfc.setCreatedDateTime(LocalDateTime.now());
save(splitSfc);
Router routerBySfcBo = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfc));
sfcDispatchCommonService.saveSplitSfcDispatch(site, CommonMethods.getUser(), "N", sfcData.getShopOrder(), sfc, operation, sfcDto.getStepId(),newSfc, routerBySfcBo.getHandle());
sfcDispatchCommonService.saveSplitSfcDispatch(site, CommonMethods.getUser(), "N", sfcData.getShopOrder(), sfc, operation, sfcData.getStepId(),newSfc, routerBySfcBo.getHandle());
return splitSfc;
} catch (Exception e) {
ExceptionUtil.throwException(e);
@ -198,6 +198,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo);
String routerBo = splitSfcDto.getRouterBo();
String ncCode = splitSfcDto.getNcCode();
String abnormalMethod = splitSfcDto.getAbnormalMethod();
if (StringUtil.isBlank(ncCode)){
throw new BaseException("异常处置未选择不良代码");
}
@ -225,8 +226,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
SplitSfcResponse splitSfcResponse = splitSfcResponses.iterator().next();
String newSfcRef = splitSfcResponse.getNewSfcRef();
String newSfc = StringUtil.trimHandle(newSfcRef);
if(StringUtil.notBlank(routerBo)){
if(abnormalMethod.equals("F")&&StringUtil.notBlank(routerBo)){
//记录不合格
CreateNCRequest createNCRequest=new CreateNCRequest();
createNCRequest.setQty(splitQty);

@ -28,6 +28,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.ArrayList;
@ -152,7 +153,7 @@ public class WorkShopTransferServiceImpl extends ServiceImpl<WorkShopTransferMap
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, dto.getOperation());
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), dto.getResrce(), sfcBO, dto.getQty());
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.START.getCode());
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.START.getCode(),null);
} catch (Exception e) {
ExceptionUtil.throwException(e);
@ -221,7 +222,7 @@ public class WorkShopTransferServiceImpl extends ServiceImpl<WorkShopTransferMap
//转入完成
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), dto.getResrce(), sfcBO, dto.getQty());
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.COMPLETE.getCode());
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.COMPLETE.getCode(), BigDecimal.ZERO);
} catch (Exception e) {
ExceptionUtil.throwException(e);

@ -378,7 +378,7 @@
WHERE S.HANDLE=#{handle}
</select>
<select id="getAbnormalQty" resultType="com.foreverwin.mesnac.production.dto.SplitSfcDto">
SELECT zab.NC_QTY,zsbd.ROUTER_BO,zab.NC_CODE,zab.ABNORMAL_NO FROM Z_ABNORMAL_BILL zab
SELECT zab.NC_QTY,zsbd.ROUTER_BO,zab.NC_CODE,zab.ABNORMAL_NO,zsbd.ABNORMAL_METHOD FROM Z_ABNORMAL_BILL zab
JOIN Z_ABNORMAL_BILL_DISPOSE zsbd ON zab.HANDLE=ZSBD.ABNORMAL_BILL_BO
WHERE ZAB.SFC=#{sfc} AND zab.ABNORMAL_NO=#{abnormalNo} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='G' AND zab."TYPE"='Z' AND (zsbd.ABNORMAL_METHOD='F' OR zsbd.ABNORMAL_METHOD='C')
</select>

Loading…
Cancel
Save