7月9日,其他异常响应维护,和异常提报、待办事项Bug修改

赵嘉伟 4 years ago
parent 8cf9d7ef86
commit 82f7d0d36c

@ -6,6 +6,8 @@ import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,6 +27,9 @@ public class AbnormalBillController {
@Autowired
private AbnormalBillService abnormalBillService;
@Autowired
private SfcDispatchCommonService sfcDispatchCommonService;
/**
* id
@ -207,8 +212,8 @@ public class AbnormalBillController {
* @return
*/
@GetMapping("/cancelBrowse")
public R cancelBrowse(String handle, String cancelBrowse){
abnormalBillService.cancelBrowse(handle,cancelBrowse);
public R cancelBrowse(String handle, String cancelBrowse,String code){
abnormalBillService.cancelBrowse(handle,cancelBrowse,code);
return R.ok();
}
@ -217,11 +222,24 @@ public class AbnormalBillController {
return R.ok(abnormalBillService.backLog(abnormalBillDto));
}
/**
*
* @param abnormalBill
* @return
*/
@GetMapping("/findAllByAbnormalNo")
public R findAllByAbnormalNo(AbnormalBill abnormalBill){
return R.ok(abnormalBillService.findAllByAbnormalNo(abnormalBill));
}
/**
*
*/
@GetMapping("/findAllByAbnormalNoDevice")
public R findAllByAbnormalNoDevice(AbnormalBill abnormalBill){
return R.ok(abnormalBillService.findAllByAbnormalNoDevice(abnormalBill));
}
/**
*
* @param abnormalBill
@ -268,4 +286,9 @@ public class AbnormalBillController {
abnormalBillService.anomalyShutDown(abnormalBill,abnormalBillDispose);
return R.ok();
}
@GetMapping("/findResrceBySfc")
public R findResrceBySfc(SfcDispatchDto sfcDispatch){
return R.ok(sfcDispatchCommonService.findResrceBySfc(sfcDispatch));
}
}

@ -144,6 +144,16 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
*/
private String router;
/**
*
*/
private String resrceDescription;
/**
*
*/
private String fullName;
public String getAbnormalNo() {
return abnormalNo;
}
@ -360,5 +370,19 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
this.router = router;
}
public String getResrceDescription() {
return resrceDescription;
}
public void setResrceDescription(String resrceDescription) {
this.resrceDescription = resrceDescription;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
}

@ -23,12 +23,24 @@ public class AbnormalBillDto extends AbnormalBill {
/**
*
*/
LocalDateTime startDateTime;
private LocalDateTime startDateTime;
/**
*
*/
LocalDateTime endDateTime;
private LocalDateTime endDateTime;
private String workCenterDescription;
private String resrceDescription;
private String reportUser;
private String abnormalMethod;
private String confirmUser;
private String resolveRemark;
public String getSeq() {
return seq;
@ -61,4 +73,54 @@ public class AbnormalBillDto extends AbnormalBill {
public void setEndDateTime(LocalDateTime endDateTime) {
this.endDateTime = endDateTime;
}
public String getWorkCenterDescription() {
return workCenterDescription;
}
public void setWorkCenterDescription(String workCenterDescription) {
this.workCenterDescription = workCenterDescription;
}
public String getResrceDescription() {
return resrceDescription;
}
public void setResrceDescription(String resrceDescription) {
this.resrceDescription = resrceDescription;
}
public String getAbnormalMethod() {
return abnormalMethod;
}
public void setAbnormalMethod(String abnormalMethod) {
this.abnormalMethod = abnormalMethod;
}
public String getConfirmUser() {
return confirmUser;
}
public void setConfirmUser(String confirmUser) {
this.confirmUser = confirmUser;
}
public String getResolveRemark() {
return resolveRemark;
}
public void setResolveRemark(String resolveRemark) {
this.resolveRemark = resolveRemark;
}
public String getReportUser() {
return reportUser;
}
public void setReportUser(String reportUser) {
this.reportUser = reportUser;
}
}

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.anomaly.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import org.apache.ibatis.annotations.Param;
@ -18,7 +19,15 @@ import org.springframework.stereotype.Repository;
@Repository
public interface AbnormalBillDisposeMapper extends BaseMapper<AbnormalBillDispose> {
/**
*
* @param abnormalBill
* @param language
* @return
*/
AbnormalBillDisposeDto findAllByAbnormalNo(@Param("abnormalBill") AbnormalBill abnormalBill, @Param("language")String language);
}

@ -20,4 +20,12 @@ import java.util.List;
public interface AbnormalBillMapper extends BaseMapper<AbnormalBill> {
List<AbnormalBillDto> backLog(@Param("abnormalBill")AbnormalBillDto abnormalBillDto, @Param("language")String language);
/**
*
* @param abnormalBill
* @param language
* @return
*/
AbnormalBillDto findAllByAbnormalNoDevice(@Param("abnormalBill")AbnormalBill abnormalBill, @Param("language")String language);
}

@ -48,7 +48,7 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*/
void generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType);
void cancelBrowse(String handle,String cancelBrowse);
void cancelBrowse(String handle,String cancelBrowse,String code);
String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose);
@ -68,6 +68,11 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*/
AbnormalBillDisposeDto findAllByAbnormalNo(AbnormalBill abnormalBill);
/**
*
*/
AbnormalBillDto findAllByAbnormalNoDevice(AbnormalBill abnormalBill);
/**
*
* @param abnormalBill

@ -74,9 +74,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private AbnormalBillDisposeMapper abnormalBillDisposeMapper;
@Autowired
private RouterMapper routerMapper;
@Autowired
private ShopOrderMapper shopOrderMapper;
@ -93,6 +90,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
private DataFieldListService dataFieldListService;
@Override
public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
@ -218,6 +216,14 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
dataField.setDataField("RESPONSIBILITY_TYPE");
List<DataField> dutyTypeList = dataFieldListService.findDataFieldListById(dataField);
hashMap.put("dutyType",dutyTypeList);
//当前登录用户的fullName
NwaUser nwaUser = new NwaUser();
nwaUser.setSite(site);
nwaUser.setUserName(CommonMethods.getUser());
List<NwaUser> nwaUsers = nwaUserService.selectList(nwaUser);
if(nwaUsers != null){
hashMap.put("currentUser",nwaUsers.get(0).getFullName());
}
return hashMap;
}
@ -240,10 +246,24 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
@Override
public AbnormalBillDto findAllByAbnormalNoDevice(AbnormalBill abnormalBill) {
String site = CommonMethods.getSite();
String local=LocaleContextHolder.getLocale().getLanguage();
abnormalBill.setSite(site);
if(StringUtil.isEmpty(abnormalBill.getAbnormalNo())){
return null;
}
return abnormalBillMapper.findAllByAbnormalNoDevice(abnormalBill,local);
}
@Override
public void resProcessing(AbnormalBill abnormalBill) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
String user = "";
if(StringUtil.isBlank(abnormalBill.getResponseUser())){
user = CommonMethods.getUser();
}
LocalDateTime now = LocalDateTime.now();
abnormalBill.setSite(site);
abnormalBill.setResponseUser(user);
@ -306,11 +326,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
//判断判责提交是否已经填写
AbnormalBillDispose abnormalBillDispose1 = abnormalBillDisposeMapper.selectById(abnormalBillDispose.getHandle());
if(abnormalBillDispose1 != null){
if(!StringUtil.isBlank(abnormalBillDispose1.getDutyCauseType())){
throw BusinessException.build("该异常单已经判责提交");
}
//AbnormalBillDispose abnormalBillDispose1 = abnormalBillDisposeMapper.selectById(abnormalBillDispose.getHandle());
AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(abnormalBill.getHandle());
if(!"N".equals(abnormalBill1.getStatus()) && !"X".equals(abnormalBill1.getStatus()) ){
throw BusinessException.build("该异常单已经判责提交");
}
abnormalBill.setStatus(Constants.CORRECTION_CONFIRM);
abnormalBillDispose.setDutyDateTime(now);
@ -445,19 +464,20 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(StringUtil.isBlank(abnormalBill.getSfc()) && !"S".equals(abnormalBill.getType())){
throw BusinessException.build("产品条码不能为空");
}
if(StringUtil.isBlank(abnormalBill.getResrce())){
throw BusinessException.build("设备编号不能为空");
}
// if(StringUtil.isBlank(abnormalBill.getResrce())){
// throw BusinessException.build("设备编号不能为空");
// }
if(!StringUtil.isBlank(abnormalBill.getMessageType())){
NcGroup messageType = ncGroupMapper.selectById(HandleEnum.NC_GROUP.getHandle(site, abnormalBill.getMessageType()));
if(messageType == null){
throw BusinessException.build("该消息类型不存在");
}
}
Resrce resrce = resrceMapper.selectById(HandleEnum.RESOURCE.getHandle(site, abnormalBill.getResrce()));
if(resrce == null){
throw BusinessException.build("该设备编号不存在");
}
// Resrce resrce = resrceMapper.selectById(HandleEnum.RESOURCE.getHandle(site, abnormalBill.getResrce()));
// if(resrce == null){
// throw BusinessException.build("该设备编号不存在");
// }
//判断不良品数量和问题数量是否为正整数
try {
if(!StringUtil.isBlank(abnormalBill.getNcQty()) && Integer.parseInt(abnormalBill.getNcQty()) < 0) {
@ -471,7 +491,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
//判断输入的用户组是否正确,并返回对应的用户
nwaUserService.checkUserGroup(abnormalBillDispose.getDutySendUserGroup());
//插入原因分类和责任分类
if(dutyTypes.size() > 0){
abnormalDutyService.saveOrUpdateBatch(dutyTypes);
@ -483,14 +502,16 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
@Override
public void cancelBrowse(String handle, String cancelBrowse) {
public void cancelBrowse(String handle, String cancelBrowse,String code) {
LocalDateTime now = LocalDateTime.now();
AbnormalBill abnormalBill = abnormalBillMapper.selectById(handle);
abnormalBill.setStatus(Constants.CANCEL);
abnormalBill.setCancelReason(cancelBrowse);
if(!StringUtil.isBlank(code)){
abnormalBill.setCancelCode(code);
}
abnormalBill.setCancelUser(CommonMethods.getUser());
abnormalBill.setCancelDateTime(now);
this.saveOrUpdate(abnormalBill);
}
}

@ -32,7 +32,7 @@
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!--异常响应界面检索用-->
<!--质量异常响应界面检索用-->
<resultMap id="AbnormalBillDisposeDto" type="com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto" extends="BaseResultMap">
<result column="ABNORMAL_NO" property="abnormalNo"/>
<result column="STATUS" property="status"/>
@ -61,6 +61,8 @@
<result column="OBJECT_BO" property="objectBo"/>
<result column="PB_PHOTOSHOP" property="pbPhotoShop"/>
<result column="ROUTER" property="router"/>
<result column="RESRCE_DESCRIPTION" property="resrceDescription"/>
<result column="FULL_NAME" property="fullName"/>
</resultMap>
<!-- 通用查询结果列 -->
@ -616,7 +618,7 @@
ZAB."TYPE" "TYPE" ,ZAB.SFC SFC,ZAB.MESSAGE_TYPE MESSAGE_TYPE,ZAB.SHOP_ORDER SHOP_ORDER,
ZAB.WORK_CENTER WORK_CENTER,ZAB.RESRCE RESRCE, WORKORDER.VALUE WORK_ORDER,ITEMNUMBER.VALUE ITEM_NUMBER,
PRODUCTCATEGORY.VALUE PRODUCT_CATEGORY,listagg(NCT2.DESCRIPTION || '/'||NCT.DESCRIPTION || ',') within GROUP(ORDER BY zab.ABNORMAL_NO) NC_CODE , ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.NC_QTY NC_QTY,
ZAB.PB_GRADE PB_GRADE ,ZAB.PB_USER PB_USER ,ZAB.PB_QTY PB_QTY ,ZAB.DISCOVER DISCOVER ,
ZAB.PB_GRADE PB_GRADE ,NWA.FULL_NAME PB_USER ,ZAB.PB_QTY PB_QTY ,ZAB.DISCOVER DISCOVER ,
ZAB.INSPECTOR INSPECTOR ,ZAB.ENTITY_LOCATION ENTITY_LOCATION ,ZAB.REPORT_FROM REPORT_FROM ,ZAB.OBJECT_BO OBJECT_BO ,
ZAB.PB_PHOTOSHOP PB_PHOTOSHOP,ZABD.DUTY_CAUSE_DESCRIPTION DUTY_CAUSE_DESCRIPTION,ZABD.DUTY_CAUSE_TYPE DUTY_CAUSE_TYPE,ZABD.DUTY_DEPART DUTY_DEPART,
ZABD.DUTY_SEND_USER_GROUP DUTY_SEND_USER_GROUP,ZABD.DUTY_TYPE DUTY_TYPE,ZABD.PRINCIPAL_USER PRINCIPAL_USER,ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,
@ -634,6 +636,7 @@
LEFT JOIN CUSTOM_FIELDS "MAP" ON "MAP".HANDLE = SO.HANDLE AND "MAP"."ATTRIBUTE" = 'MAP'
LEFT JOIN Z_ABNORMAL_NC_CODE ZANC ON ZAB.HANDLE = ZANC.ABNORMAL_BILL_BO
LEFT JOIN NC_CODE_T NCT ON ('NCCodeBO:' || ZAB.SITE || ',' || ZANC.NC_CODE) = NCT.NC_CODE_BO AND NCT.LOCALE = #{language}
INNER JOIN Z_NWA_USER NWA ON NWA.USER_NAME = ZAB.PB_USER AND NWA.SITE = ZAB.SITE
LEFT JOIN NC_CODE_T NCT2 ON ('NCCodeBO:' || ZAB.SITE || ',' || ZANC.NC_CODE_GROUP) = NCT2.NC_CODE_BO AND NCT2.LOCALE = #{language}
LEFT JOIN ROUTER R ON SUBSTR(R.HANDLE,1,INSTR(R.HANDLE,',',-1)-1) = SUBSTR(ZABD.ROUTER_BO,1,INSTR(ZABD.ROUTER_BO,',',-1)-1) AND R.CURRENT_REVISION = 'true'
<where>
@ -651,11 +654,14 @@
ZAB."TYPE" ,ZAB.SFC ,ZAB.MESSAGE_TYPE ,ZAB.SHOP_ORDER ,
ZAB.WORK_CENTER ,ZAB.RESRCE , WORKORDER.VALUE ,ITEMNUMBER.VALUE ,
PRODUCTCATEGORY.VALUE, ZAB.PB_DESCRIPTION ,ZAB.NC_QTY ,
ZAB.PB_GRADE ,ZAB.PB_USER ,ZAB.PB_QTY ,ZAB.DISCOVER ,
ZAB.PB_GRADE ,NWA.FULL_NAME ,ZAB.PB_QTY ,ZAB.DISCOVER ,
ZAB.INSPECTOR ,ZAB.ENTITY_LOCATION ,ZAB.REPORT_FROM ,ZAB.OBJECT_BO ,
ZAB.PB_PHOTOSHOP ,ZABD.DUTY_CAUSE_DESCRIPTION ,ZABD.DUTY_CAUSE_TYPE ,ZABD.DUTY_DEPART ,
ZABD.DUTY_SEND_USER_GROUP ,ZABD.DUTY_TYPE ,ZABD.PRINCIPAL_USER ,ZABD.ABNORMAL_METHOD ,
R.ROUTER ,ZABD.RESOLVE_SHOP_ORDER ,ZABD.RESOLVE_REMARK ,ZABD.RESOLVE_SEND_USER ,
ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,ZABD.ROUTER_BO
</select>
</mapper>

@ -46,6 +46,15 @@
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
<result column="START_DATE_TIME" property="startDateTime"/>
<result column="END_DATE_TIME" property="endDateTime"/>
<result column="WORK_CENTER_DESCRIPTION" property="workCenterDescription"/>
<result column="RESRCE_DESCRIPTION" property="resrceDescription"/>
<result column="REPORT_USER" property="reportUser"/>
<result column="RESPONSE_USER" property="responseUser"/>
<result column="RESPONSE_DATE_TIME" property="responseDateTime"/>
<result column="ABNORMAL_METHOD" property="abnormalMethod"/>
<result column="CONFIRM_USER" property="confirmUser"/>
<result column="RESOLVE_REMARK" property="resolveRemark"/>
<result column="CANCEL_UESR" property="cancelUser"/>
</resultMap>
<!-- 通用查询结果列 -->
@ -850,5 +859,30 @@
</select>
<!---->
<select id="findAllByAbnormalNoDevice" resultMap="abnormalBillDto">
SELECT ZAB.ABNORMAL_NO ABNORMAL_NO , ZAB.STATUS STATUS ,ZAB.REPORT_FROM REPORT_FROM ,WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
ZAB.RESRCE RESRCE ,R.DESCRIPTION RESRCE_DESCRIPTION,ZNU.FULL_NAME REPORT_USER,ZAB.MESSAGE_TYPE MESSAGE_TYPE ,
ZAB.NC_CODE NC_CODE ,ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.SHUT_DOWN SHUT_DOWN ,ZAB.RESPONSE_USER RESPONSE_USER,ZAB.RESPONSE_DATE_TIME RESPONSE_DATE_TIME,
ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,ZNU3.FULL_NAME CONFIRM_USER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,ZAB.CANCEL_USER,
ZAB.CANCEL_CODE CANCEL_CODE,ZAB.CANCEL_DATE_TIME CANCEL_DATE_TIME,ZNU4.FULL_NAME CANCEL_USER,ZAB.CANCEL_REASON CANCEL_REASON
FROM
Z_ABNORMAL_BILL ZAB
INNER JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZABD.ABNORMAL_BILL_BO = ZAB.HANDLE
INNER JOIN RESRCE R ON R.RESRCE = ZAB.RESRCE AND R.SITE = ZAB.SITE
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = ('WORKCENTERBO:' || ZAB.SITE || ',' || ZAB.WORK_CENTER) AND WCT.LOCALE =#{language}
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAB.CREATED_USER AND ZNU.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU2 ON ZNU2.USER_NAME = ZAB.RESPONSE_USER AND ZNU2.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU3 ON ZNU3.USER_NAME = ZABD.RESOLVE_USER AND ZNU3.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU4 ON ZNU4.USER_NAME = ZAB.CANCEL_CODE AND ZNU4.SITE = ZAB.SITE
<where>
<if test="abnormalBill != null">
<if test="abnormalBill.site != null and abnormalBill.site != ''">
ZAB.SITE = #{abnormalBill.site}
</if>
<if test="abnormalBill.abnormalNo != null and abnormalBill.abnormalNo != ''">
AND ZAB.ABNORMAL_NO = #{abnormalBill.abnormalNo}
</if>
</if>
</where>
</select>
</mapper>

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.dispatch.mapper;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
@ -37,5 +38,7 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
@Param("dispatchNo") String dispatchNo,
@Param("dispatchStatus") String dispatchStatus,
@Param("modifyUser") String modifyUser,
@Param("modifiedDateTime") LocalDateTime modifiedDateTime);
@Param("modifyDateTime") LocalDateTime modifiedDateTime);
SfcDispatchDto findResrceBySfc(@Param("sfcDispatch")SfcDispatchDto sfcDispatch, @Param("site") String site, @Param("array") String[] array);
}

@ -8,19 +8,20 @@ import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.common.util.ExcelUtils;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.mapper.SfcDispatchMapper;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.mesnac.dispatch.model.UserResource;
import com.foreverwin.mesnac.dispatch.service.CallItemService;
import com.foreverwin.mesnac.dispatch.mapper.SfcDispatchMapper;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.service.SfcDispatchService;
import com.foreverwin.mesnac.dispatch.service.UserResourceService;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import org.apache.commons.fileupload.FileItem;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@ -195,6 +196,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
return this.sfcDispatch(site, user, DispatchStatusEnum.IMPORT.getCode(), message, sfcDispatchList);
}
public String importDispatch(FileItem fileItem, HttpServletRequest httpServletRequest) {
String site = httpServletRequest.getParameter("site");
String user = httpServletRequest.getParameter("user");
@ -411,4 +414,19 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
LocalDateTime nowDateTime = LocalDateTime.now();
sfcDispatchMapper.updateSfcDispatchStatus(site, dispatchNo, dispatchStatus, user, nowDateTime);
}
@Override
public SfcDispatchDto findResrceBySfc(SfcDispatchDto sfcDispatch) {
String site = CommonMethods.getSite();
String[] status = {"START","COMPLETE"};
return sfcDispatchMapper.findResrceBySfc(sfcDispatch,site,status);
}
// @Override
// public SfcDispatchDto findResrceBySfc(SfcDispatch sfcDispatch) {
// String site = CommonMethods.getSite();
// String[] status = {"START","COMPLETE"};
// return sfcDispatchMapper.findResrceBySfc(sfcDispatch,site,status);
// }
}

@ -1073,4 +1073,23 @@
UPDATE Z_SFC_DISPATCH SET DISPATCH_STATUS = #{dispatchStatus}, MODIFY_USER = #{modifyUser}, MODIFIED_DATE_TIME = #{modifiedDateTime}
WHERE SITE = #{site} AND DISPATCH_NO = #{dispatchNo}
</update>
<select id="findResrceBySfc" resultType="com.foreverwin.mesnac.common.dto.SfcDispatchDto">
SELECT RESRCE
FROM Z_SFC_DISPATCH zsd
<where>
SITE = #{site}
<if test="sfcDispatch != null">
<if test="sfcDispatch.sfc != null and sfcDispatch.sfc != ''">
AND SFC = #{sfcDispatch.sfc}
</if>
</if>
<if test="array != null">
AND DISPATCH_STATUS IN
<foreach open="(" item="item" collection="array" separator="," close=")">
UPPER(#{item})
</foreach>
</if>
</where>
</select>
</mapper>

@ -23,6 +23,11 @@ public class ShopOrderDto extends ShopOrder {
*/
private String productCategory;
/**
*
*/
private String workCenter;
public String getWorkOrder() {
return workOrder;
}
@ -46,4 +51,12 @@ public class ShopOrderDto extends ShopOrder {
public void setProductCategory(String productCategory) {
this.productCategory = productCategory;
}
public String getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
}

@ -65,6 +65,7 @@
<result column="WORK_ORDER" property="workOrder" />
<result column="ITEM_NUMBER" property="itemNumber"/>
<result column="PRODUCT_CATEGORY" property="productCategory"/>
<result column="WORK_CENTER" property="workCenter"/>
</resultMap>
<!-- 通用查询结果列 -->
@ -1008,11 +1009,12 @@
<!--根据工单找出工作令号,项目号,产品类别-->
<select id="findByShopOrderBo" resultType="com.foreverwin.mesnac.meapi.dto.ShopOrderDto">
SELECT WO.VALUE WORK_ORDER,ITEM.VALUE ITEM_NUMBER,PC.VALUE PRODUCT_CATEGORY
SELECT WO.VALUE WORK_ORDER,ITEM.VALUE ITEM_NUMBER,PC.VALUE PRODUCT_CATEGORY,WC.WORK_CENTER
FROM SHOP_ORDER SO
LEFT JOIN CUSTOM_FIELDS WO ON WO.HANDLE = SO.HANDLE AND WO."ATTRIBUTE" = 'WORK_ORDER'
LEFT JOIN CUSTOM_FIELDS ITEM ON ITEM.HANDLE = SO.HANDLE AND ITEM."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN CUSTOM_FIELDS PC ON PC.HANDLE = SO.HANDLE AND PC."ATTRIBUTE" = 'PRODUCT_CATEGORY'
LEFT JOIN WORK_CENTER WC ON WC.HANDLE = SO.PLANNED_WORK_CENTER_BO
WHERE SO.HANDLE = #{handle}
</select>
</mapper>

Loading…
Cancel
Save