其他异常提交

赵嘉伟 4 years ago
parent 817f186c59
commit 2cc1023904

@ -4,9 +4,13 @@ package com.foreverwin.mesnac.anomaly.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.helper.NextNumberHelper;
import com.foreverwin.mesnac.meapi.controller.DataFieldListController;
import com.foreverwin.mesnac.meapi.controller.NcCodeController;
import com.foreverwin.mesnac.meapi.controller.WorkCenterController;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.foreverwin.mesnac.meapi.model.NcCode;
import com.foreverwin.mesnac.meapi.model.WorkCenter;
import com.foreverwin.mesnac.meapi.service.NcCodeService;
@ -29,16 +33,22 @@ import java.util.List;
public class AbnormalBillController {
@Autowired
public AbnormalBillService abnormalBillService;
private AbnormalBillService abnormalBillService;
@Autowired
public NcCodeService ncCodeService;
private NcCodeService ncCodeService;
@Autowired
public WorkCenterController workCenterController;
private WorkCenterController workCenterController;
@Autowired
public NextNumberHelper nextNumberHelper;
private NextNumberHelper nextNumberHelper;
@Autowired
private NcCodeController ncCodeController;
@Autowired
private DataFieldListController dataFieldListController;
/**
* id
@ -162,13 +172,32 @@ public class AbnormalBillController {
@GetMapping("/init")
public R init(String messageType){
HashMap<String, Object> hashMap = new HashMap<>();
//消息类型
List<NcCode> ncByNG = ncCodeService.findNcByNG(messageType);
String site = CommonMethods.getSite();
hashMap.put("ncByNG",ncByNG);
//工作中心
WorkCenter workCenter = new WorkCenter();
workCenter.setWcCategory("LEVEL4");
R workCenterList = workCenterController.getWorkCenterList(workCenter);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("ncByNG",ncByNG);
hashMap.put("workCenter",workCenterList);
//原因分类
NcCode ncCode = new NcCode();
ncCode.setSite(site);
ncCode.setNcCategory("REPAIR");
R causeType = ncCodeController.getNcCodeList(ncCode);
hashMap.put("causeType",causeType);
//责任部门
DataField dataField = new DataField();
dataField.setSite(site);
dataField.setDataField("RESPONSIBILITY_DEPARTMENT");
R dutyDepart = dataFieldListController.findDataFieldListById(dataField);
hashMap.put("dutyDepart",dutyDepart);
//责任分类
dataField.setDataField("RESPONSIBILITY_TYPE");
R dutyType = dataFieldListController.findDataFieldListById(dataField);
hashMap.put("dutyType",dutyType);
return R.ok(hashMap);
}
@ -182,4 +211,20 @@ public class AbnormalBillController {
List<String> nextNumber = nextNumberHelper.getNextNumber(site, numberType, 1, null);
return R.ok(nextNumber.get(0));
}
/**
*
* @param abnormalBill
* @return
*/
@GetMapping("/anomalyReportOther")
public R anomalyReportOther(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose){
return R.ok(abnormalBillService.anomalyReportOther(abnormalBill, abnormalBillDispose));
}
@GetMapping("/cancelBrowse")
public R cancelBrowse(String handle, String cancelBrowse){
abnormalBillService.cancelBrowse(handle,cancelBrowse);
return R.ok();
}
}

@ -1,16 +1,14 @@
package com.foreverwin.mesnac.anomaly.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillDisposeService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillDisposeService;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import java.util.List;
/**
@ -72,6 +70,7 @@ public class AbnormalBillDisposeController {
.or().like(AbnormalBillDispose::getAbnormalBillBo, frontPage.getGlobalQuery())
.or().like(AbnormalBillDispose::getDutyUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillDispose::getDutyDepart, frontPage.getGlobalQuery())
.or().like(AbnormalBillDispose::getDutyType, frontPage.getGlobalQuery())
.or().like(AbnormalBillDispose::getPrincipalUser, frontPage.getGlobalQuery())
.or().like(AbnormalBillDispose::getDutyCauseDescription, frontPage.getGlobalQuery())
.or().like(AbnormalBillDispose::getDutyCauseType, frontPage.getGlobalQuery())

@ -200,7 +200,6 @@ public class AbnormalBill extends Model<AbnormalBill> {
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
public String getHandle() {
return handle;
}
@ -481,7 +480,7 @@ public class AbnormalBill extends Model<AbnormalBill> {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";

@ -1,6 +1,8 @@
package com.foreverwin.mesnac.anomaly.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
@ -25,7 +27,7 @@ public class AbnormalBillDispose extends Model<AbnormalBillDispose> {
/**
*
*/
@TableField("HANDLE")
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
@ -52,6 +54,11 @@ public class AbnormalBillDispose extends Model<AbnormalBillDispose> {
*/
@TableField("DUTY_DEPART")
private String dutyDepart;
/**
*
*/
@TableField("DUTY_TYPE")
private String dutyType;
/**
*
*/
@ -197,6 +204,14 @@ public class AbnormalBillDispose extends Model<AbnormalBillDispose> {
this.dutyDepart = dutyDepart;
}
public String getDutyType() {
return dutyType;
}
public void setDutyType(String dutyType) {
this.dutyType = dutyType;
}
public String getPrincipalUser() {
return principalUser;
}
@ -361,6 +376,8 @@ public static final String DUTY_DATE_TIME = "DUTY_DATE_TIME";
public static final String DUTY_DEPART = "DUTY_DEPART";
public static final String DUTY_TYPE = "DUTY_TYPE";
public static final String PRINCIPAL_USER = "PRINCIPAL_USER";
public static final String DUTY_CAUSE_DESCRIPTION = "DUTY_CAUSE_DESCRIPTION";
@ -414,6 +431,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
", dutyUser = " + dutyUser +
", dutyDateTime = " + dutyDateTime +
", dutyDepart = " + dutyDepart +
", dutyType = " + dutyType +
", principalUser = " + principalUser +
", dutyCauseDescription = " + dutyCauseDescription +
", dutyCauseType = " + dutyCauseType +

@ -3,6 +3,7 @@ package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@ -25,4 +26,15 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill);
List<AbnormalBill> selectList(AbnormalBill abnormalBill);
String anomalyReportOther(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose);
/**
*
* @param abnormalBill
* @param abnormalBillDispose
*/
void generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose);
void cancelBrowse(String handle,String cancelBrowse);
}

@ -1,16 +1,25 @@
package com.foreverwin.mesnac.anomaly.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillDisposeMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillDisposeService;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
@ -28,6 +37,15 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private AbnormalBillMapper abnormalBillMapper;
@Autowired
private NextNumberHelper nextNumberHelper;
@Autowired
private AbnormalBillDisposeMapper abnormalBillDisposeMapper;
@Autowired
private AbnormalBillDisposeService abnormalBillDisposeService;
@Override
public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
@ -42,5 +60,71 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
return super.list(queryWrapper);
}
@Override
public String anomalyReportOther(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose) {
this.generateAbnormalBill(abnormalBill,abnormalBillDispose);
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
return abnormalBill.getAbnormalNo();
}
@Override
public void generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose) {
if(StringUtil.isBlank(abnormalBill.getAbnormalNo())){
String abnormalNo = null;
//生成异常单号
if("Q".equals(abnormalBill.getType())){//其他异常
abnormalNo = nextNumberHelper.getNextNumber(abnormalBill.getSite(), "ABNORMAL_OTHER", 1, null).get(0);
}else if("Z".equals(abnormalBill.getType())){//质量异常
abnormalNo = nextNumberHelper.getNextNumber(abnormalBill.getSite(), "ABNORMAL_QUALITY", 1, null).get(0);
}else if("S".equals(abnormalBill.getType())){//设备异常
abnormalNo = nextNumberHelper.getNextNumber(abnormalBill.getSite(), "ABNORMAL_DEVICE", 1, null).get(0);
}
abnormalBill.setAbnormalNo(abnormalNo);
}
abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(abnormalBill.getSite(),abnormalBill.getAbnormalNo()));
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(abnormalBill.getSite(),abnormalBill.getAbnormalNo()));
LocalDateTime currentTime = LocalDateTime.now();
String user = CommonMethods.getUser();
//设置责任划分填报人和填报时间
abnormalBillDispose.setDutyUser(user);
abnormalBillDispose.setDutyDateTime(currentTime);
//设置创建时间和更新时间
if(abnormalBillMapper.selectById(abnormalBill.getHandle()) == null){
abnormalBill.setCreatedDataTime(currentTime);
abnormalBill.setCreatedUser(user);
abnormalBillDispose.setCreatedDataTime(currentTime);
abnormalBillDispose.setCreatedUser(user);
}
abnormalBill.setModifiedDateTime(currentTime);
abnormalBill.setModifiedUser(user);
abnormalBillDispose.setModifiedDateTime(currentTime);
abnormalBillDispose.setModifiedUser(user);
//判断SFC和设备编号是否为空
if(StringUtil.isBlank(abnormalBill.getSfc())){
throw BusinessException.build("产品条码不能为空");
}
if(StringUtil.isBlank(abnormalBill.getResrce())){
throw BusinessException.build("设备编号不能为空");
}
}
@Override
public void cancelBrowse(String handle, String cancelBrowse) {
LocalDateTime now = LocalDateTime.now();
AbnormalBill abnormalBill = abnormalBillMapper.selectById(handle);
abnormalBill.setStatus("Q");
abnormalBill.setCancelReason(cancelBrowse);
abnormalBill.setCancelUser(CommonMethods.getUser());
abnormalBill.setCancelDateTime(now);
}
}

@ -10,6 +10,7 @@
<result column="DUTY_USER" property="dutyUser" />
<result column="DUTY_DATE_TIME" property="dutyDateTime" />
<result column="DUTY_DEPART" property="dutyDepart" />
<result column="DUTY_TYPE" property="dutyType" />
<result column="PRINCIPAL_USER" property="principalUser" />
<result column="DUTY_CAUSE_DESCRIPTION" property="dutyCauseDescription" />
<result column="DUTY_CAUSE_TYPE" property="dutyCauseType" />
@ -33,7 +34,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, ABNORMAL_BILL_BO, DUTY_USER, DUTY_DATE_TIME, DUTY_DEPART, PRINCIPAL_USER, DUTY_CAUSE_DESCRIPTION, DUTY_CAUSE_TYPE, DUTY_SEND_USER_GROUP, RESOLVE_USER, RESOLVE_DATE_TIME, ABNORMAL_METHOD, ROUTER_BO, RESOLVE_SHOP_ORDER, RESOLVE_REMARK, RESOLVE_SEND_USER, CLOSED_USER, CLOSED_DATE_TIME, ABNORMAL_REASON, BEFORE_MEASURE, CREATED_USER, CREATED_DATA_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
HANDLE, SITE, ABNORMAL_BILL_BO, DUTY_USER, DUTY_DATE_TIME, DUTY_DEPART, DUTY_TYPE, PRINCIPAL_USER, DUTY_CAUSE_DESCRIPTION, DUTY_CAUSE_TYPE, DUTY_SEND_USER_GROUP, RESOLVE_USER, RESOLVE_DATE_TIME, ABNORMAL_METHOD, ROUTER_BO, RESOLVE_SHOP_ORDER, RESOLVE_REMARK, RESOLVE_SEND_USER, CLOSED_USER, CLOSED_DATE_TIME, ABNORMAL_REASON, BEFORE_MEASURE, CREATED_USER, CREATED_DATA_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -64,6 +65,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -99,6 +101,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -142,6 +145,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -185,6 +189,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -228,6 +233,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -271,6 +277,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -314,6 +321,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -353,6 +361,7 @@
<if test="dutyUser!=null">DUTY_USER,</if>
<if test="dutyDateTime!=null">DUTY_DATE_TIME,</if>
<if test="dutyDepart!=null">DUTY_DEPART,</if>
<if test="dutyType!=null">DUTY_TYPE,</if>
<if test="principalUser!=null">PRINCIPAL_USER,</if>
<if test="dutyCauseDescription!=null">DUTY_CAUSE_DESCRIPTION,</if>
<if test="dutyCauseType!=null">DUTY_CAUSE_TYPE,</if>
@ -380,6 +389,7 @@
<if test="dutyUser!=null">#{dutyUser},</if>
<if test="dutyDateTime!=null">#{dutyDateTime},</if>
<if test="dutyDepart!=null">#{dutyDepart},</if>
<if test="dutyType!=null">#{dutyType},</if>
<if test="principalUser!=null">#{principalUser},</if>
<if test="dutyCauseDescription!=null">#{dutyCauseDescription},</if>
<if test="dutyCauseType!=null">#{dutyCauseType},</if>
@ -414,6 +424,7 @@
#{dutyUser},
#{dutyDateTime},
#{dutyDepart},
#{dutyType},
#{principalUser},
#{dutyCauseDescription},
#{dutyCauseType},
@ -449,6 +460,7 @@
<if test="et.dutyUser!=null">DUTY_USER=#{et.dutyUser},</if>
<if test="et.dutyDateTime!=null">DUTY_DATE_TIME=#{et.dutyDateTime},</if>
<if test="et.dutyDepart!=null">DUTY_DEPART=#{et.dutyDepart},</if>
<if test="et.dutyType!=null">DUTY_TYPE=#{et.dutyType},</if>
<if test="et.principalUser!=null">PRINCIPAL_USER=#{et.principalUser},</if>
<if test="et.dutyCauseDescription!=null">DUTY_CAUSE_DESCRIPTION=#{et.dutyCauseDescription},</if>
<if test="et.dutyCauseType!=null">DUTY_CAUSE_TYPE=#{et.dutyCauseType},</if>
@ -478,6 +490,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>
@ -535,6 +548,7 @@
<if test="ew.entity.dutyUser!=null"> AND DUTY_USER=#{ew.entity.dutyUser}</if>
<if test="ew.entity.dutyDateTime!=null"> AND DUTY_DATE_TIME=#{ew.entity.dutyDateTime}</if>
<if test="ew.entity.dutyDepart!=null"> AND DUTY_DEPART=#{ew.entity.dutyDepart}</if>
<if test="ew.entity.dutyType!=null"> AND DUTY_TYPE=#{ew.entity.dutyType}</if>
<if test="ew.entity.principalUser!=null"> AND PRINCIPAL_USER=#{ew.entity.principalUser}</if>
<if test="ew.entity.dutyCauseDescription!=null"> AND DUTY_CAUSE_DESCRIPTION=#{ew.entity.dutyCauseDescription}</if>
<if test="ew.entity.dutyCauseType!=null"> AND DUTY_CAUSE_TYPE=#{ew.entity.dutyCauseType}</if>

@ -89,8 +89,13 @@ public enum HandleEnum {
PROD_READY_TASK_DETAIL("ProdReadyTaskDetailBO", "ProdReadyTaskDetailBO:{0},{1}"),
/**设备检验任务的检验项**/
RESOURCE_INSPECT_TASK_PARAM("ResourceInspectTaskParamBo","ResourceInspectTaskParamBo:{0},{1}");
RESOURCE_INSPECT_TASK_PARAM("ResourceInspectTaskParamBo","ResourceInspectTaskParamBo:{0},{1}"),
/**异常单**/
Z_ABNORMAL_BILL("AbnormalBillBo","AbnormalBillBo:{0},{1}"),
/**异常单详细表**/
Z_ABNORMAL_BILL_DISPOSE("AbnormalBillDisposeBo","AbnormalBillDisposeBo:{0},{1}");
private String prefix;

@ -1,16 +1,14 @@
package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.foreverwin.mesnac.meapi.service.DataFieldService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.DataFieldService;
import com.foreverwin.mesnac.meapi.model.DataField;
import java.util.List;
/**
@ -128,4 +126,6 @@ public class DataFieldController {
public R removeByIds(List<String> ids){
return R.ok(dataFieldService.removeByIds(ids));
}
}

@ -1,16 +1,15 @@
package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import com.foreverwin.mesnac.meapi.service.DataFieldListService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.DataFieldListService;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import java.util.List;
/**
@ -120,4 +119,13 @@ public class DataFieldListController {
public R removeByIds(List<String> ids){
return R.ok(dataFieldListService.removeByIds(ids));
}
/**
* handle
* @return
*/
@GetMapping("findDataFieldListById")
public R findDataFieldListById(DataField dataField){
return R.ok(dataFieldListService.findDataFieldListById(dataField));
}
}

@ -73,4 +73,22 @@ public class ShopOrderController {
public R findByIdAndPlannedItemBo(String handle,String plannedItemBo){
return R.ok(shopOrderService.findByIdAndPlannedItemBo(handle,plannedItemBo));
}
}
/**
*
*/
@GetMapping("/findByShopOrderBo")
public R findByShopOrderBo(String handle){
return R.ok(shopOrderService.findByShopOrderBo(handle));
}
}

@ -0,0 +1,49 @@
package com.foreverwin.mesnac.meapi.dto;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-06-30
*/
public class ShopOrderDto extends ShopOrder {
/**
*
*/
private String workOrder;
/**
*
*/
private String itemNumber;
/**
*
*/
private String productCategory;
public String getWorkOrder() {
return workOrder;
}
public void setWorkOrder(String workOrder) {
this.workOrder = workOrder;
}
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getProductCategory() {
return productCategory;
}
public void setProductCategory(String productCategory) {
this.productCategory = productCategory;
}
}

@ -1,9 +1,13 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -15,4 +19,6 @@ import org.springframework.stereotype.Repository;
@Repository
public interface DataFieldListMapper extends BaseMapper<DataFieldList> {
List<DataField> findDataFieldListById(@Param("dataField") DataField dataField,@Param("locale")String locale);
}

@ -2,8 +2,11 @@ package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -15,4 +18,5 @@ import org.springframework.stereotype.Repository;
@Repository
public interface DataFieldMapper extends BaseMapper<DataField> {
}

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.dto.ShopOrderDto;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@ -19,4 +20,6 @@ public interface ShopOrderMapper extends BaseMapper<ShopOrder> {
ShopOrder findByIdAndPlannedItemBo(@Param("handle")String handle,
@Param("plannedItemBo")String plannedItemBo,
@Param("status501")String status501);
ShopOrderDto findByShopOrderBo(@Param("handle")String handle);
}

@ -1,13 +1,11 @@
package com.foreverwin.mesnac.meapi.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
/**
* <p>
@ -42,6 +40,8 @@ public class DataFieldList extends Model<DataFieldList> {
private LocalDateTime createdDateTime;
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
@TableField(exist = false)
private String description;
public String getHandle() {
@ -116,7 +116,15 @@ public class DataFieldList extends Model<DataFieldList> {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public static final String HANDLE = "HANDLE";
public static final String SEQUENCE = "SEQUENCE";
@ -134,6 +142,8 @@ public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String DESCRIPTION = "DESCRIPTION";
@Override
protected Serializable pkVal() {

@ -1,8 +1,9 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@ -25,4 +26,6 @@ public interface DataFieldListService extends IService<DataFieldList> {
IPage<DataFieldList> selectPage(FrontPage<DataFieldList> frontPage, DataFieldList dataFieldList);
List<DataFieldList> selectList(DataFieldList dataFieldList);
List<DataField> findDataFieldListById(DataField dataField);
}

@ -25,4 +25,6 @@ public interface DataFieldService extends IService<DataField> {
IPage<DataField> selectPage(FrontPage<DataField> frontPage, DataField dataField);
List<DataField> selectList(DataField dataField);
}

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.dto.ShopOrderDto;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.foreverwin.modular.core.util.FrontPage;
@ -27,4 +28,8 @@ public interface ShopOrderService extends IService<ShopOrder> {
List<ShopOrder> selectList(ShopOrder shopOrder);
ShopOrder findByIdAndPlannedItemBo(String handle,String plannedItemBo);
ShopOrderDto findByShopOrderBo(String handle);
}

@ -1,14 +1,16 @@
package com.foreverwin.mesnac.meapi.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.meapi.mapper.DataFieldListMapper;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import com.foreverwin.mesnac.meapi.service.DataFieldListService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@ -42,5 +44,9 @@ public class DataFieldListServiceImpl extends ServiceImpl<DataFieldListMapper, D
return super.list(queryWrapper);
}
@Override
public List<DataField> findDataFieldListById(DataField dataField) {
String locale = LocaleContextHolder.getLocale().getLanguage();
return dataFieldListMapper.findDataFieldListById(dataField,locale);
}
}

@ -43,4 +43,6 @@ public class DataFieldServiceImpl extends ServiceImpl<DataFieldMapper, DataField
}
}

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.meapi.service.impl;
import com.foreverwin.mesnac.meapi.dto.ShopOrderDto;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -51,5 +52,10 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
return shopOrderMapper.findByIdAndPlannedItemBo(handle,plannedItemBo,status501);
}
@Override
public ShopOrderDto findByShopOrderBo(String handle) {
return shopOrderMapper.findByShopOrderBo(handle);
}
}

@ -13,6 +13,7 @@
<result column="ERP_CODE_GROUP" property="erpCodeGroup" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="DESCRIPTION" property="description"/>
</resultMap>
<!-- 通用查询结果列 -->
@ -342,5 +343,23 @@
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="findDataFieldListById" resultMap="BaseResultMap">
SELECT DFL.DATA_VALUE DATA_VALUE,DFLT.DATA_TAG DESCRIPTION
FROM DATA_FIELD DF
INNER JOIN DATA_FIELD_LIST DFL ON DF.HANDLE = DFL.DATA_FIELD_BO
LEFT JOIN DATA_FIELD_LIST_T DFLT ON DFL.HANDLE = DFLT.DATA_FIELD_LIST_BO AND DFLT.LOCALE = #{locale}
<where>
<if test="dataField != null">
<if test="dataField.handle != null and dataField.handle != ''">
DF.HANDLE = #{dataField.handle}
</if>
<if test="dataField.site != null and dataField.site != ''">
AND DF.SITE = #{dataField.site}
</if>
<if test="dataField.dataField != null and dataField.dataField != ''">
AND DF.DATA_FIELD = #{dataField.dataField}
</if>
</if>
</where>
</select>
</mapper>

@ -272,6 +272,7 @@
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.DataField">
INSERT INTO DATA_FIELD
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -18,7 +18,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, CHANGE_STAMP, SITE, NC_CODE, STATUS_BO, CREATED_DATE_TIME, MODIFIED_DATE_TIME, NC_CATEGORY, DPMO_CATEGORY_BO
HANDLE, CHANGE_STAMP, SITE, NC_CODE, STATUS_BO, CREATED_DATE_TIME, MODIFIED_DATE_TIME, NC_CATEGORY, DPMO_CATEGORY_BO,DESCRIPTION
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -83,7 +83,9 @@
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM NC_CODE
SELECT nc.NC_CODE,nct.DESCRIPTION
FROM NC_CODE nc
LEFT JOIN NC_CODE_T nct ON nc.HANDLE = nct.NC_CODE_BO AND nct.LOCALE='zh'
<where>
<if test="ew!=null">
<if test="ew.entity!=null">

@ -61,6 +61,12 @@
<result column="TOLERANCE_DEFINED_IN" property="toleranceDefinedIn" />
</resultMap>
<resultMap id="shopOrderDto" type="com.foreverwin.mesnac.meapi.dto.ShopOrderDto" extends="BaseResultMap">
<result column="WORK_ORDER" property="workOrder" />
<result column="ITEM_NUMBER" property="itemNumber"/>
<result column="PRODUCT_CATEGORY" property="productCategory"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, CHANGE_STAMP, SITE, SHOP_ORDER, STATUS_BO, PRIORITY, PLANNED_WORK_CENTER_BO, PLANNED_ITEM_BO, PLANNED_BOM_BO, PLANNED_ROUTER_BO, ITEM_BO, BOM_BO, ROUTER_BO, QTY_TO_BUILD, QTY_ORDERED, QTY_RELEASED, RELEASED_DATE, PLANNED_START_DATE, PLANNED_COMP_DATE, SCHEDULED_START_DATE, SCHEDULED_COMP_DATE, ACTUAL_START_DATE, ACTUAL_COMP_DATE, QTY_DONE, QTY_SCRAPPED, CREATED_DATE_TIME, MODIFIED_DATE_TIME, CUSTOMER, CUSTOMER_ORDER, RMA_SFC_DATA_TYPE_BO, RMA_SHOP_ORDER_DATA_TYPE_BO, ORIGINAL_STATUS_BO, TRANSFER_SITE, TRANSFER_TYPE, LCC_BO, SHOP_ORDER_TYPE_BO, HOLD_ID, END_UNIT_NUMBER, REQ_SERIAL_CHANGE, COLLECT_PARENT_SERIAL, BATCH_NUMBER, ERP_ORDER, ERP_PRODUCTION_VERSION, ERP_UNIT_OF_MEASURE, PARTITION_DATE, INSPECTION_LOT, INSPECTION_GROUP_SIZE, ERP_PUTAWAY_STORLOC, WAREHOUSE_NUMBER, UNDERDELIVERY_TOLERANCE, OVERDELIVERY_TOLERANCE, UNLIMITED_OVERDELIVERY, MINIMUM_DELIVERY_QTY, MAXIMUM_DELIVERY_QTY, TOLERANCE_DEFINED_IN
@ -999,4 +1005,14 @@
</if>
</where>
</select>
<!--根据工单找出工作令号,项目号,产品类别-->
<select id="findByShopOrderBo" resultType="com.foreverwin.mesnac.meapi.dto.ShopOrderDto">
SELECT WO.VALUE WORK_ORDER,ITEM.VALUE ITEM_NUMBER,PC.VALUE PRODUCT_CATEGORY
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'
WHERE SO.HANDLE = #{handle}
</select>
</mapper>

Loading…
Cancel
Save