异常消息发送

master
赵嘉伟 3 years ago
parent fc3e956cae
commit b3027b8b1e

@ -295,8 +295,10 @@ public class AbnormalBillController {
* @return
*/
@GetMapping("/dutyConfirm")
public R dutyConfirm(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose){
abnormalBillService.dutyConfirm(abnormalBill,abnormalBillDispose);
public R dutyConfirm(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose,
@RequestParam List<String> dutyCauseType,
@RequestParam List<String> dutyType){
abnormalBillService.dutyConfirm(abnormalBill,abnormalBillDispose,dutyCauseType,dutyType);
return R.ok();
}

@ -179,6 +179,21 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
*/
private String program;
/**
*
*/
private String causeType;
/**
*
*/
private String dutyDepart;
/**
*
*/
private String dutyType;
/**
*
* @return
@ -191,6 +206,8 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
private String operationDescription;
private String routerDescription;;
public String getAbnormalNo() {
return abnormalNo;
}
@ -494,4 +511,40 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
public void setOperationDescription(String operationDescription) {
this.operationDescription = operationDescription;
}
public String getCauseType() {
return causeType;
}
public void setCauseType(String causeType) {
this.causeType = causeType;
}
@Override
public String getDutyDepart() {
return dutyDepart;
}
@Override
public void setDutyDepart(String dutyDepart) {
this.dutyDepart = dutyDepart;
}
@Override
public String getDutyType() {
return dutyType;
}
@Override
public void setDutyType(String dutyType) {
this.dutyType = dutyType;
}
public String getRouterDescription() {
return routerDescription;
}
public void setRouterDescription(String routerDescription) {
this.routerDescription = routerDescription;
}
}

@ -92,7 +92,9 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*
* @param abnormalBill
*/
void dutyConfirm(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose);
void dutyConfirm(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,
List<String> dutyCauseType,
List<String> dutyType);
/**
*

@ -1,6 +1,8 @@
package com.foreverwin.mesnac.anomaly.service;
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.model.AbnormalCause;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
@ -25,4 +27,6 @@ public interface AbnormalCauseService extends IService<AbnormalCause> {
IPage<AbnormalCause> selectPage(FrontPage<AbnormalCause> frontPage, AbnormalCause abnormalCause);
List<AbnormalCause> selectList(AbnormalCause abnormalCause);
void insertByAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType);
}

@ -1,8 +1,10 @@
package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalDuty;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.AbnormalDuty;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@ -26,4 +28,5 @@ public interface AbnormalDutyService extends IService<AbnormalDuty> {
List<AbnormalDuty> selectList(AbnormalDuty abnormalDuty);
void insertByAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose, List<String> dutyType);
}

@ -14,7 +14,6 @@ import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.foreverwin.mesnac.meapi.service.NwaUserService;
@ -117,10 +116,13 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl<AbnormalBillLogMappe
}
}
//发送用户
String resolveSendUserGroup = abnormalBillDispose.getResolveSendUserGroup();
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site, resolveSendUserGroup);
if(!StringUtil.isBlank(abnormalBill.getReportSendUserGroup())){
nwaUserService.checkUserGroup(site, abnormalBill.getReportSendUserGroup());
}else if(!StringUtil.isBlank(abnormalBillDispose.getDutySendUserGroup())){
nwaUserService.checkUserGroup(site, abnormalBillDispose.getDutySendUserGroup());
}else if(!StringUtil.isBlank(abnormalBillDispose.getResolveSendUserGroup())){
nwaUserService.checkUserGroup(site, abnormalBillDispose.getResolveSendUserGroup());
}
if(abnormalBillLogMapper.selectById(abnormalBillLog.getHandle()) == null){
//根据abnormalNo找到不合格代码组
@ -170,8 +172,6 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl<AbnormalBillLogMappe
}
if(Constants.ABNORMAL_QUALITY.equals(abnormalBill.getType())){
abnormalPlanService.saveAbnormalPlan(abnormalBill,abnormalBillDispose,now);
abnormalBillService.anomalyReport(abnormalBill,abnormalBillDispose,ncGroupAndNcCodes,dutyCauseType,dutyType);

@ -8,6 +8,7 @@ import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillDisposeMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalCauseMapper;
import com.foreverwin.mesnac.anomaly.model.*;
import com.foreverwin.mesnac.anomaly.service.*;
import com.foreverwin.mesnac.common.constant.Constants;
@ -87,6 +88,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private RouterService routerService;
@Autowired
private RouterMapper routerMapper;
@Autowired
private WorkCenterService workCenterService;
@ -135,6 +139,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private DataFieldListMapper dataFieldListMapper;
@Autowired
private AbnormalCauseMapper abnormalCauseMapper;;
@Override
@ -262,8 +269,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalNcCode.setModifiedDateTime(now);
abnormalNcCodes.add(abnormalNcCode);
}
abnormalNcCodeService.saveOrUpdateBatch(abnormalNcCodes);
abnormalNcCodeService.saveOrUpdateBatch(abnormalNcCodes);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
this.saveOrUpdate(abnormalBill);
//发送消息
@ -434,7 +441,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
@Override
public void dutyConfirm(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose) {
public void dutyConfirm(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,
List<String> dutyCauseType,
List<String> dutyType) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
@ -451,7 +460,13 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBillDispose.setDutyDateTime(now);
abnormalBillDispose.setDutyUser(user);
nwaUserService.checkUserGroup(site,abnormalBillDispose.getDutySendUserGroup());
//插入原因分类和责任分类
abnormalCauseService.insertByAbnormalBill(abnormalBill,abnormalBillDispose,dutyCauseType);
abnormalDutyService.insertByAbnormalBill(abnormalBill,abnormalBillDispose,dutyType);
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
this.anomalyCreatedAndSendMessage(abnormalBillMapper.selectById(abnormalBill.getHandle()),abnormalBillDispose);
@ -467,7 +482,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
String local = LocaleContextHolder.getLocale().getLanguage();
abnormalBillDispose.setHandle(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
abnormalBill.setStatus(Constants.SHUT_DOWN);
abnormalBillDispose.setClosedUser(user);
abnormalBillDispose.setClosedDateTime(now);
@ -543,30 +557,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBillDispose.setDutyDateTime(currentTime);
//判断原因分类是否为空,如果不为空把它放进Z_ABNORMAL_CAUSE表里面
ArrayList<AbnormalCause> causeTypes = new ArrayList<>();
if(dutyCauseType != null && dutyCauseType.size() >= 1){
for(String cause:dutyCauseType){
AbnormalCause abnormalCause = new AbnormalCause();
String uuid = UUID.randomUUID().toString();
abnormalCause.setSite(site);
abnormalCause.setAbnormalBillBo(abnormalBill.getHandle());
abnormalCause.setAbnormalBillDisposeBo(abnormalBillDispose.getHandle());
List<AbnormalCause> abnormalCauses = abnormalCauseService.selectList(abnormalCause);
if(abnormalCauses.size() != 0){
QueryWrapper<AbnormalCause> abnormalCauseQueryWrapper = new QueryWrapper<>();
abnormalCauseQueryWrapper.setEntity(abnormalCause);
abnormalCauseService.remove(abnormalCauseQueryWrapper);
}
abnormalCause.setHandle(uuid);
abnormalCause.setAbnormalCauseNo(cause);
abnormalCause.setCreatedDateTime(currentTime);
abnormalCause.setCreatedUser(user);
abnormalCause.setModifiedUser(user);
abnormalCause.setModifiedDateTime(currentTime);
causeTypes.add(abnormalCause);
}
}
//插入原因分类和责任分类
abnormalCauseService.insertByAbnormalBill(abnormalBill,abnormalBillDispose,dutyCauseType);
abnormalDutyService.insertByAbnormalBill(abnormalBill,abnormalBillDispose,dutyType);
//判断工序编号是否传递错误
@ -591,32 +584,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
ArrayList<AbnormalDuty> dutyTypes = new ArrayList<>();
//判断责任分类是否为空,如果不为空把它放进Z_ABNORMAL_DUTY表里面
if(dutyType != null && dutyType.size() >= 1){
for(String duty:dutyType){
AbnormalDuty abnormalDuty = new AbnormalDuty();
String uuid = UUID.randomUUID().toString();
abnormalDuty.setSite(site);
abnormalDuty.setAbnormalBillBo(abnormalBill.getHandle());
abnormalDuty.setAbnormalBillDisposeBo(abnormalBillDispose.getHandle());
List<AbnormalDuty> abnormalDuties = abnormalDutyService.selectList(abnormalDuty);
if(abnormalDuties.size() != 0){
QueryWrapper<AbnormalDuty> abnormalDutyQueryWrapper = new QueryWrapper<>();
abnormalDutyQueryWrapper.setEntity(abnormalDuty);
abnormalDutyService.remove(abnormalDutyQueryWrapper);
}
abnormalDuty.setHandle(uuid);
abnormalDuty.setAbnormalDutyNo(duty);
abnormalDuty.setModifiedUser(user);
abnormalDuty.setModifiedDateTime(currentTime);
abnormalDuty.setCreatedDateTime(currentTime);
abnormalDuty.setCreatedUser(user);
dutyTypes.add(abnormalDuty);
}
}
/**
* SFC sfc
*
@ -679,16 +646,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//判断输入的责任划分用户组是否正确,并返回对应的用户组下的用户
nwaUserService.checkUserGroup(site,abnormalBillDispose.getDutySendUserGroup());
// nwaUserService.checkUserGroup(site,abnormalBillDispose.getDutySendUserGroup());
//插入原因分类和责任分类
if(dutyTypes.size() > 0){
abnormalDutyService.saveOrUpdateBatch(dutyTypes);
}
if(causeTypes.size() > 0){
abnormalCauseService.saveOrUpdateBatch(causeTypes);
}
if(!StringUtil.isBlank(abnormalBill.getFileName())){
//放置图片
this.fileUpload(abnormalBill);
@ -1075,7 +1034,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
messageMap.put("entityLocation",messageContent.getEntityLocation());
messageMap.put("reportFrom",AnomalyConstant.ReportFrom.msg(messageContent.getReportFrom()));
messageMap.put("operation",messageContent.getOperationDescription());
messageMap.put("reportSendUserGroup",messageContent.getReportSendUserGroup());
// messageMap.put("reportSendUserGroup",messageContent.getReportSendUserGroup());
if(StringUtil.isBlank(messageContent.getNcCode()) || "/,".equals(messageContent.getNcCode())){
messageMap.put("ncCode","");
}else{
@ -1096,7 +1055,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
DataField dataField = new DataField();
dataField.setSite(site);
//原因分类
String dutyCauseType = messageContent.getDutyType();
String dutyCauseType = messageContent.getDutyCauseType();
if(!StringUtil.isBlank(dutyCauseType)){
List<String> dutyCauseTypeList = Arrays.asList(dutyCauseType.split(","));
dataField.setDataField("REASON_CATEGORY");
@ -1118,7 +1077,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
messageMap.put("dutyDepart","");
}
//责任分类
String dutyType = messageContent.getDutyDepart();
String dutyType = messageContent.getDutyType();
if(!StringUtil.isBlank(dutyType)){
List<String> dutyTypeList = Arrays.asList(dutyType.split(","));
dataField.setDataField("RESPONSIBILITY_TYPE");
@ -1128,15 +1087,15 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}else{
messageMap.put("dutyType","");
}
List<UsrDto> list = userService.findList(messageContent.getPrincipalUser());
if(list.size() > 0){
messageMap.put("principalUser",list.get(0).getFullName());
}
messageMap.put("principalUser",messageContent.getPrincipalUser());
messageMap.put("dutyCauseDescription",messageContent.getDutyCauseDescription());
}
if(Constants.PROGRAM_CONFIRM.equals(messageContent.getStatus())){
messageMap.put("abnormalMethod",AnomalyConstant.AnomalyMethod.msg(messageContent.getAbnormalMethod()));
messageMap.put("resolveRemark",messageContent.getResolveRemark());
messageMap.put("router",messageContent.getRouterDescription());
messageMap.put("resolveShopOrder",messageContent.getResolveShopOrder());
}
//格式化之后的消息

@ -1,17 +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.AbnormalCause;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalCauseMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.AbnormalCause;
import com.foreverwin.mesnac.anomaly.service.AbnormalCauseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
/**
* <p>
*
@ -42,5 +50,44 @@ public class AbnormalCauseServiceImpl extends ServiceImpl<AbnormalCauseMapper, A
return super.list(queryWrapper);
}
@Override
public void insertByAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
//判断原因分类是否为空,如果不为空把它放进Z_ABNORMAL_CAUSE表里面先删除后保存
ArrayList<AbnormalCause> causeTypes = new ArrayList<>();
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("ABNORMAL_BILL_BO",abnormalBill.getHandle());
hashMap.put("ABNORMAL_BILL_DISPOSE_BO",abnormalBillDispose.getHandle());
abnormalCauseMapper.deleteByMap(hashMap);
if(dutyCauseType != null && dutyCauseType.size() >= 1){
for(String cause:dutyCauseType){
AbnormalCause abnormalCause = new AbnormalCause();
String uuid = UUID.randomUUID().toString();;
abnormalCause.setSite(site);
abnormalCause.setAbnormalBillBo(abnormalBill.getHandle());
abnormalCause.setAbnormalBillDisposeBo(abnormalBillDispose.getHandle());
// List<AbnormalCause> abnormalCauses = abnormalCauseService.selectList(abnormalCause);
// if(abnormalCauses.size() != 0){
// QueryWrapper<AbnormalCause> abnormalCauseQueryWrapper = new QueryWrapper<>();
// abnormalCauseQueryWrapper.setEntity(abnormalCause);
// abnormalCauseService.remove(abnormalCauseQueryWrapper);
// }
abnormalCause.setHandle(uuid);
abnormalCause.setAbnormalCauseNo(cause);
abnormalCause.setCreatedDateTime(now);
abnormalCause.setCreatedUser(user);
abnormalCause.setModifiedUser(user);
abnormalCause.setModifiedDateTime(now);
causeTypes.add(abnormalCause);
}
}
if(causeTypes.size() > 0){
this.saveOrUpdateBatch(causeTypes);
}
}
}

@ -1,17 +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.AbnormalDuty;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalDutyMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.AbnormalDuty;
import com.foreverwin.mesnac.anomaly.service.AbnormalDutyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
/**
* <p>
*
@ -42,7 +50,44 @@ public class AbnormalDutyServiceImpl extends ServiceImpl<AbnormalDutyMapper, Abn
return super.list(queryWrapper);
}
@Override
public void insertByAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose, List<String> dutyType) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
ArrayList<AbnormalDuty> dutyTypes = new ArrayList<>();
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("ABNORMAL_BILL_BO",abnormalBill.getHandle());
hashMap.put("ABNORMAL_BILL_DISPOSE_BO",abnormalBillDispose.getHandle());
abnormalDutyMapper.deleteByMap(hashMap);
//判断责任分类是否为空,如果不为空把它放进Z_ABNORMAL_DUTY表里面
if(dutyType != null && dutyType.size() >= 1){
for(String duty:dutyType){
AbnormalDuty abnormalDuty = new AbnormalDuty();
String uuid = UUID.randomUUID().toString();
abnormalDuty.setSite(site);
abnormalDuty.setAbnormalBillBo(abnormalBill.getHandle());
abnormalDuty.setAbnormalBillDisposeBo(abnormalBillDispose.getHandle());
// List<AbnormalDuty> abnormalDuties = abnormalDutyService.selectList(abnormalDuty);
// if(abnormalDuties.size() != 0){
// QueryWrapper<AbnormalDuty> abnormalDutyQueryWrapper = new QueryWrapper<>();
// abnormalDutyQueryWrapper.setEntity(abnormalDuty);
// abnormalDutyService.remove(abnormalDutyQueryWrapper);
// }
abnormalDuty.setHandle(uuid);
abnormalDuty.setAbnormalDutyNo(duty);
abnormalDuty.setModifiedUser(user);
abnormalDuty.setModifiedDateTime(now);
abnormalDuty.setCreatedDateTime(now);
abnormalDuty.setCreatedUser(user);
dutyTypes.add(abnormalDuty);
}
}
if(dutyTypes.size() > 0){
this.saveOrUpdateBatch(dutyTypes);
}
}
}

@ -74,6 +74,10 @@
<result column="PROGRAM" property="program"/>
<result column="WORK_CENTER_DESCRIPTION" property="workCenterDescription"/>
<result column="SHUT_DOWN" property="shutDown" />
<result column="DUTY_DEPART" property="dutyDepart"/>
<result column="DUTY_TYPE" property="dutyType"/>
<result column="DUTY_CAUSE_TYPE" property="dutyCauseType"/>
<result column="ROUTER_DESCRIPTION" property="routerDescription"/>
</resultMap>
@ -718,12 +722,12 @@
listagg(ZANC.NC_CODE_GROUP || '/'||ZANC.NC_CODE || ',') within GROUP(ORDER BY zab.ABNORMAL_NO) NC_CODE,
ZABD.ROUTER_BO ROUTER_BO,ZAB.OPERATION OPERATION,I.HANDLE ITEM_BO,ZAB.REPORT_SEND_USER_GROUP REPORT_SEND_USER_GROUP,
ZAB.CORRECTION CORRECTION,ZAB.PROGRAM PROGRAM,WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,ZAB.SHUT_DOWN SHUT_DOWN,
RS.DESCRIPTION RESRCE_DESCRIPTION,OT.DESCRIPTION OPERATION_DESCRIPTION
RS.DESCRIPTION RESRCE_DESCRIPTION,OT.DESCRIPTION OPERATION_DESCRIPTION,R.DESCRIPTION ROUTER_DESCRIPTION
FROM Z_ABNORMAL_BILL ZAB
LEFT JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZAB.HANDLE = ZABD.ABNORMAL_BILL_BO
INNER JOIN ITEM I ON I.HANDLE = ZAB.ITEM_BO
LEFT JOIN ITEM I ON I.HANDLE = ZAB.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{locale}
INNER JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZAB.SHOP_ORDER AND SO.SITE = ZAB.SITE
LEFT JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZAB.SHOP_ORDER AND SO.SITE = ZAB.SITE
LEFT JOIN RESRCE RS ON RS.RESRCE = ZAB.RESRCE AND RS.SITE = ZAB.SITE
LEFT JOIN OPERATION O ON O.OPERATION = ZAB.OPERATION AND O.SITE = ZAB.SITE AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON O.HANDLE = OT.OPERATION_BO AND OT.LOCALE = #{locale}
@ -760,7 +764,7 @@
R.ROUTER ,ZABD.RESOLVE_SHOP_ORDER ,ZABD.RESOLVE_REMARK ,ZABD.RESOLVE_SEND_USER_GROUP ,
ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,ZABD.ROUTER_BO,ZAB.OPERATION,I.HANDLE,
ZAB.REPORT_SEND_USER_GROUP,ZAB.CORRECTION,ZAB.PROGRAM,WCT.DESCRIPTION,ZAB.SHUT_DOWN,RS.DESCRIPTION,
OT.DESCRIPTION
OT.DESCRIPTION,R.DESCRIPTION
</select>

@ -27,6 +27,15 @@ public class ActiveMQConfig {
return this.createConnectionFactory(brokerUrl, username, password);
}
@Bean(name = "mesConnectionFactory")
public ActiveMQConnectionFactory mesConnectionFactory(
@Value("${activemq.brokerUrl}") String brokerUrl,
@Value("${activemq.user}") String username,
@Value("${activemq.password}") String password) {
return this.createConnectionFactory(brokerUrl, username, password);
}
private ActiveMQConnectionFactory createConnectionFactory (String brokerUrl, String username, String password) {
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
@ -46,6 +55,14 @@ public class ActiveMQConfig {
return template;
}
@Bean(name = "mesJmsTemplate")
public JmsMessagingTemplate mesJmsTemplate(
@Qualifier("mesConnectionFactory") ActiveMQConnectionFactory connectionFactory) {
JmsMessagingTemplate template = new JmsMessagingTemplate(connectionFactory);
return template;
}
//☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
@Primary
@ -57,4 +74,13 @@ public class ActiveMQConfig {
factory.setConnectionFactory(connectionFactory);
return factory;
}
@Bean(name = "mesFactory")
public JmsListenerContainerFactory mesFactory(
@Qualifier("mesConnectionFactory") ActiveMQConnectionFactory connectionFactory) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory);
return factory;
}
}

@ -218,4 +218,49 @@ public enum AnomalyConstant {
}
}
public enum AnomalyMethod{
AnomalyMethod1("X","线下换料"),
AnomalyMethod2("S","试装"),
AnomalyMethod3("R","让步放心"),
AnomalyMethod4("C","产品报废"),
AnomalyMethod5("P","配作"),
AnomalyMethod6("F","返修");
private String code;
private String msg;
AnomalyMethod(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static String msg(String code) {
AnomalyMethod[] anomalyMethods = values();
for (AnomalyMethod anomalyMethod : anomalyMethods) {
if (anomalyMethod.getCode().equals(code)) {
return anomalyMethod.getMsg();
}
}
return "";
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
}

@ -36,4 +36,5 @@ public interface AnomalyService {
*
*/
List<ScrapDto> getScrapDtoBysfc(String site, String sfc);
}

@ -26,4 +26,6 @@ public interface DataFieldListMapper extends BaseMapper<DataFieldList> {
*/
List<DataField> findDataFieldListById(@Param("dataField") DataField dataField,@Param("locale")String locale);
String findDataFieldListByDataField(@Param("dataField") DataField dataField,@Param("locale")String locale);
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
@ -55,6 +56,10 @@ public class DataField extends Model<DataField> {
@TableField("CATEGORY")
private String category;
//数据字段定义维护中的数据字段
@TableField(exist = false)
private List<String> dataValue;
public String getHandle() {
return handle;
@ -184,7 +189,15 @@ public class DataField extends Model<DataField> {
this.category = category;
}
public static final String HANDLE = "HANDLE";
public List<String> getDataValue() {
return dataValue;
}
public void setDataValue(List<String> dataValue) {
this.dataValue = dataValue;
}
public static final String HANDLE = "HANDLE";
public static final String DATA_TYPE_BO = "DATA_TYPE_BO";

@ -359,6 +359,33 @@
<if test="dataField.dataField != null and dataField.dataField != ''">
AND DF.DATA_FIELD = #{dataField.dataField}
</if>
</if>
</where>
</select>
<select id="findDataFieldListByDataField" resultType="String" >
SELECT
SUBSTR(LISTAGG(DFLT.DATA_TAG || ',') WITHIN GROUP(ORDER BY DF.DATA_FIELD),0,LENGTH(LISTAGG(DFLT.DATA_TAG || ',') WITHIN GROUP(ORDER BY DF.DATA_FIELD))-1)
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>
<if test="dataField.dataValue != null and dataField.dataValue.size > 0">
AND DFL.DATA_VALUE IN
<foreach item="item" index="index" collection="dataField.dataValue" separator="," open="(" close=")">
UPPER(#{item})
</foreach>
</if>
</where>
</select>

Loading…
Cancel
Save