Leon 4 years ago
commit 166655bd78

@ -7,7 +7,6 @@ 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.anomaly.service.FileUploadedService;
import com.foreverwin.mesnac.anomaly.service.ProductionScrap;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.meapi.service.NcCodeService;
@ -39,8 +38,7 @@ public class AbnormalBillController {
@Autowired
private FileUploadedService fileUploadedService;
@Autowired
private ProductionScrap productionScrap;
@Autowired
private NcCodeService ncCodeService;
@ -342,16 +340,6 @@ public class AbnormalBillController {
return R.ok(abnormalBillService.anomalyReveseRepair(abnormalBill,abnormalBillDispose));
}
/**
*
* @param site
* @param sfc
* @return
*/
@GetMapping("/getScrapDtoBysfc")
public R getScrapDtoBysfc(String site,String sfc){
return R.ok(productionScrap.getScrapDtoBysfc(site,sfc));
}
@GetMapping("/findNcCodeDescriptionByNcCode")

@ -1,130 +0,0 @@
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.AbnormalMessage;
import com.foreverwin.mesnac.anomaly.service.AbnormalMessageService;
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 java.util.List;
/**
*
* @author
* @since 2021-07-22
*/
@RestController
@RequestMapping("/Z-ABNORMAL-MESSAGE")
public class AbnormalMessageController {
@Autowired
public AbnormalMessageService abnormalMessageService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getAbnormalMessageById(@PathVariable String id) {
return R.ok( abnormalMessageService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getAbnormalMessageList(AbnormalMessage abnormalMessage){
List<AbnormalMessage> result;
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
result = abnormalMessageService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<AbnormalMessage> frontPage, AbnormalMessage abnormalMessage){
IPage result;
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(AbnormalMessage::getHandle, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getSite, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getAbnormalBillBo, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getType, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getMessageType, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getSendUserGroup, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getSendUser, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getContent, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getUpUserGroup, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getUpUser, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getUpMessageType, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getAbnormalNode, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getStatus, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getCreatedUser, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getModifiedUser, frontPage.getGlobalQuery())
);
}
result = abnormalMessageService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param abnormalMessage
* @return null
*/
@PostMapping
public R save(@RequestBody AbnormalMessage abnormalMessage) {
return R.ok(abnormalMessageService.save(abnormalMessage));
}
/**
*
* @param abnormalMessage
* @return null
*/
@PutMapping
public R updateById(@RequestBody AbnormalMessage abnormalMessage) {
return R.ok(abnormalMessageService.updateById(abnormalMessage));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(abnormalMessageService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(abnormalMessageService.removeByIds(ids));
}
}

@ -2,8 +2,8 @@ package com.foreverwin.mesnac.anomaly.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.dto.ScrapDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.common.dto.ScrapDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -34,5 +34,5 @@ public interface AbnormalBillMapper extends BaseMapper<AbnormalBill> {
Integer findAbnormalMethodBySFC(@Param("site")String site,@Param("sfc")String sfc);
List<ScrapDto> findScrapDtoBySfc(@Param("site")String site,@Param("sfc")String sfc);
List<ScrapDto> findScrapDtoBySfc(@Param("site")String site, @Param("sfc")String sfc);
}

@ -1,18 +0,0 @@
package com.foreverwin.mesnac.anomaly.mapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author
* @since 2021-07-22
*/
@Repository
public interface AbnormalMessageMapper extends BaseMapper<AbnormalMessage> {
}

@ -1,28 +0,0 @@
package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-07-22
*/
public interface AbnormalMessageService extends IService<AbnormalMessage> {
/**
*
* @param frontPage
* @return
*/
IPage<AbnormalMessage> selectPage(FrontPage<AbnormalMessage> frontPage, AbnormalMessage abnormalMessage);
List<AbnormalMessage> selectList(AbnormalMessage abnormalMessage);
}

@ -1,24 +1,10 @@
package com.foreverwin.mesnac.anomaly.service;
import com.foreverwin.mesnac.anomaly.dto.ScrapDto;
import java.util.List;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-07-28
*/
public interface ProductionScrap {
/**
*
* @param sfc
* @return
*/
boolean jgProductionIsScrap(String site,String sfc);
/**
*
*/
List<ScrapDto> getScrapDtoBysfc(String site,String sfc);
}

@ -8,20 +8,24 @@ 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.AbnormalMessageMapper;
import com.foreverwin.mesnac.anomaly.model.*;
import com.foreverwin.mesnac.anomaly.service.*;
import com.foreverwin.mesnac.anomaly.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.dto.ScrapDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.common.mapper.MessageMapper;
import com.foreverwin.mesnac.common.model.Message;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.ShopOrderDto;
import com.foreverwin.mesnac.meapi.mapper.*;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.mesnac.production.mapper.SfcScrapMapper;
import com.foreverwin.mesnac.quality.service.SelfReportService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.exception.BusinessException;
@ -127,14 +131,17 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
private ActiveMQUtil activeMQUtil;
@Autowired
private AbnormalMessageMapper abnormalMessageMapper;
private MessageMapper messageMapper;
@Autowired
private AbnormalMessageService abnormalMessageService;
private MessageService messageService;
@Autowired
private SelfReportService selfReportService;
@Autowired
private SfcScrapMapper sfcScrapMapper;
@Override
public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
@ -290,7 +297,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
nwaUser.setSite(site);
nwaUser.setUserName(CommonMethods.getUser());
List<NwaUser> nwaUsers = nwaUserService.selectList(nwaUser);
if(nwaUsers != null){
if(nwaUsers != null && nwaUsers.size() > 0){
hashMap.put("currentUser",nwaUsers.get(0).getFullName());
}
//初始化异常单号
@ -823,14 +830,14 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
String user = CommonMethods.getUser();
String locale = LocaleContextHolder.getLocale().getLanguage();
LocalDateTime now = LocalDateTime.now();
AbnormalMessage abnormalMessage = new AbnormalMessage();
Message abnormalMessage = new Message();
//发送消息的主键
String handle = UUID.randomUUID().toString();
abnormalMessage.setHandle(handle);
//站点
abnormalMessage.setSite(site);
//异常单
abnormalMessage.setAbnormalBillBo(abnormalBill.getHandle());
abnormalMessage.setObjectBo(abnormalBill.getHandle());
//异常类型
abnormalMessage.setType(abnormalBill.getType());
//根据异常的类型找到消息的类型
@ -849,45 +856,45 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
switch (abnormalBill.getStatus()){
case Constants.NEW://新建
abnormalMessage.setSendUserGroup(abnormalBill.getReportSendUserGroup());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_REPORT);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_REPORT);
break;
case Constants.RESPONSE://响应中,设置响应超时的用户的发送的用户组为提报时要升级的用户组
QueryWrapper<AbnormalMessage> wrapper = new QueryWrapper<>();
AbnormalMessage abnormalMessage1 = new AbnormalMessage();
QueryWrapper<Message> wrapper = new QueryWrapper<>();
Message abnormalMessage1 = new Message();
abnormalMessage1.setSite(site);
abnormalMessage1.setAbnormalBillBo(abnormalBill.getHandle());
abnormalMessage1.setAbnormalNode(Constants.ABNORMAL_MESSAGE_REPORT);
abnormalMessage1.setObjectBo(abnormalBill.getHandle());
abnormalMessage1.setNode(Constants.ABNORMAL_MESSAGE_REPORT);
wrapper.setEntity(abnormalMessage1);
AbnormalMessage _abnormalMessage = abnormalMessageMapper.selectOne(wrapper);
Message _abnormalMessage = messageMapper.selectOne(wrapper);
abnormalMessage.setUpUserGroup(_abnormalMessage.getUpUserGroup());
abnormalMessage.setUpMessageType(_abnormalMessage.getUpMessageType());
abnormalMessage.setGrade(_abnormalMessage.getGrade());
abnormalMessage.setUpDateTime(_abnormalMessage.getUpDateTime());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_RESPONSE);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_RESPONSE);
break;
case Constants.CORRECTION_CONFIRM://纠纷确认
abnormalMessage.setSendUserGroup(abnormalBillDispose.getDutySendUserGroup());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM);
break;
case Constants.PROGRAM_CONFIRM://方案确认
abnormalMessage.setSendUser(abnormalBillDispose.getResolveSendUser());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM);
break;
case Constants.CANCEL://取消
abnormalMessage.setSendUserGroup(abnormalBill.getCancelSendUserGroup());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_CANCEL);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_CANCEL);
//异常取消的时候要关闭当前异常单下所有的异常信息
UpdateWrapper<AbnormalMessage> messageTypeUpdateWrapper = new UpdateWrapper<>();
UpdateWrapper<Message> messageTypeUpdateWrapper = new UpdateWrapper<>();
// messageTypeUpdateWrapper.eq("SITE",site);
// messageTypeUpdateWrapper.eq("ABNORMAL_BILL_BO",abnormalMessage.getAbnormalBillBo());
AbnormalMessage abnormalMessage2 = new AbnormalMessage();
Message abnormalMessage2 = new Message();
// abnormalMessage2.setAbnormalBillBo(abnormalMessage.getAbnormalBillBo());
abnormalMessage2.setStatus("Y");
messageTypeUpdateWrapper.eq("STATUS","N");
messageTypeUpdateWrapper.eq("ABNORMAL_BILL_BO",abnormalMessage.getAbnormalBillBo());
abnormalMessageService.update(abnormalMessage2,messageTypeUpdateWrapper);
messageTypeUpdateWrapper.eq("OBJECT_BO",abnormalMessage.getObjectBo());
messageService.update(abnormalMessage2,messageTypeUpdateWrapper);
break;
case Constants.SHUT_DOWN:
break;
@ -911,7 +918,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
assert customFieldByGroup != null;
if(!StringUtil.isBlank(customFieldByGroup.getMessageNoticeLevel())){
abnormalMessage.setGrade(Integer.parseInt(customFieldByGroup.getMessageNoticeLevel()));
abnormalMessage.setGrade(Double.parseDouble(customFieldByGroup.getMessageNoticeLevel()));
}
//得到升级的消息类型
abnormalMessage.setUpMessageType(abnormalMessage.getMessageType());
@ -925,8 +932,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//设置状态新建是Y响应为N纠防确认是N方案确认是Y
if(Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getAbnormalNode()) ||
Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM.equals(abnormalMessage.getAbnormalNode())){
if(Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode()) ||
Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM.equals(abnormalMessage.getNode())){
abnormalMessage.setStatus("N");
}else{
abnormalMessage.setStatus("Y");
@ -940,10 +947,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//判断,如果是方案确认,则发送用户,否则,除了节点是响应之外,则发送用户组
if(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM.equals(abnormalMessage.getAbnormalNode())){
if(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM.equals(abnormalMessage.getNode())){
String sendUsers = abnormalMessage.getSendUser().replace(',', '|');
activeMQUtil.wechatSendMessage(sendUsers,abnormalMessage.getContent());
}else if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getAbnormalNode())){
}else if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode())){
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site,abnormalMessage.getSendUserGroup());
StringBuilder sendUsers = new StringBuilder();
for (int i = 0; i < nwaUsers.size(); i++) {
@ -955,7 +962,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent());
}
abnormalMessageService.saveOrUpdate(abnormalMessage);
messageService.saveOrUpdate(abnormalMessage);
return true;
}
@ -1011,4 +1018,29 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Override
public boolean jgProductionIsScrap(String site,String sfc) {
//查询该sfc在质量异常异常方案是否是报废,如果是则大于1
Integer num = abnormalBillMapper.findAbnormalMethodBySFC(site, sfc);
return num <= 0;
}
@Override
public List<ScrapDto> getScrapDtoBysfc(String site, String sfc) {
//判断该产品条码是否已经报废
if(sfcScrapMapper.selectById(HandleEnum.SFC_SCRAP.getHandle(site,sfc)) != null){
throw new BaseException("该产品条码已经报废");
}
if(this.jgProductionIsScrap(site,sfc)){
throw new BaseException("该产品条码的异常方案不是报废");
}
return abnormalBillMapper.findScrapDtoBySfc(site, sfc);
}
}

@ -1,46 +0,0 @@
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.AbnormalMessage;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalMessageMapper;
import com.foreverwin.mesnac.anomaly.service.AbnormalMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-07-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class AbnormalMessageServiceImpl extends ServiceImpl<AbnormalMessageMapper, AbnormalMessage> implements AbnormalMessageService {
@Autowired
private AbnormalMessageMapper abnormalMessageMapper;
@Override
public IPage<AbnormalMessage> selectPage(FrontPage<AbnormalMessage> frontPage, AbnormalMessage abnormalMessage) {
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<AbnormalMessage> selectList(AbnormalMessage abnormalMessage) {
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
return super.list(queryWrapper);
}
}

@ -2,13 +2,13 @@ package com.foreverwin.mesnac.anomaly.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalMessageMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.anomaly.service.AbnormalMessageService;
import com.foreverwin.mesnac.anomaly.service.AnomalyJobService;
import com.foreverwin.mesnac.anomaly.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.mapper.MessageMapper;
import com.foreverwin.mesnac.common.model.Message;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper;
import com.foreverwin.mesnac.meapi.model.NwaUser;
@ -32,10 +32,10 @@ import java.util.UUID;
public class AnomalyJobServiceImpl implements AnomalyJobService {
@Autowired
private AbnormalMessageService abnormalMessageService;
private MessageService messageService;
@Autowired
private AbnormalMessageMapper abnormalMessageMapper;
private MessageMapper messageMapper;
@Autowired
private AbnormalBillMapper abnormalBillMapper;
@ -58,19 +58,19 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
LocalDateTime now = LocalDateTime.now();
String user = CommonMethods.getUser();
//找到状态为N并且升级时间大于当前时间
QueryWrapper<AbnormalMessage> abnormalMessageQueryWrapper = new QueryWrapper<>();
QueryWrapper<Message> abnormalMessageQueryWrapper = new QueryWrapper<>();
abnormalMessageQueryWrapper.eq("STATUS","N");
abnormalMessageQueryWrapper.lt("UP_DATE_TIME",now);
List<AbnormalMessage> abnormalMessages = abnormalMessageMapper.selectList(abnormalMessageQueryWrapper);
for(AbnormalMessage _abnormalMessage : abnormalMessages){
List<Message> abnormalMessages = messageMapper.selectList(abnormalMessageQueryWrapper);
for(Message _abnormalMessage : abnormalMessages){
String uuid = UUID.randomUUID().toString();
AbnormalMessage abnormalMessage = new AbnormalMessage();
Message abnormalMessage = new Message();
//设置abnormalMessage的handle
abnormalMessage.setHandle(uuid);
//设置abnormalMessage的site
abnormalMessage.setSite(site);
//设置abnormalMessage的异常单Bo
abnormalMessage.setAbnormalBillBo(_abnormalMessage.getAbnormalBillBo());
abnormalMessage.setObjectBo(_abnormalMessage.getObjectBo());
//设置abnormalMessage的type
abnormalMessage.setType(_abnormalMessage.getType());
//设置abnormalMessage的message_type
@ -89,7 +89,7 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
abnormalMessage.setUpUser(null);
}
AbnormalBill abnormalBill = abnormalBillMapper.selectById(abnormalMessage.getAbnormalBillBo());
AbnormalBill abnormalBill = abnormalBillMapper.selectById(abnormalMessage.getObjectBo());
String message = abnormalBillService.formatMessage(abnormalBill,abnormalMessage.getMessageType(),site);
@ -101,7 +101,7 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
abnormalMessage.setGrade(_abnormalMessage.getGrade() + 1);
abnormalMessage.setResponseDateTime(now);
abnormalMessage.setAbnormalNode(_abnormalMessage.getAbnormalNode());
abnormalMessage.setNode(_abnormalMessage.getNode());
abnormalMessage.setStatus("Y");
_abnormalMessage.setStatus("Y");
@ -128,8 +128,8 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
}
activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent());
// }
abnormalMessageService.saveOrUpdate(abnormalMessage);
abnormalMessageService.saveOrUpdate(_abnormalMessage);
messageService.saveOrUpdate(abnormalMessage);
messageService.saveOrUpdate(_abnormalMessage);
}
}
}

@ -1,16 +1,9 @@
package com.foreverwin.mesnac.anomaly.service.impl;
import com.foreverwin.mesnac.anomaly.dto.ScrapDto;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.anomaly.service.ProductionScrap;
import com.foreverwin.modular.core.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @Description TODO
* @Author zhaojiawei
@ -20,24 +13,4 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class)
public class ProductionScrapImpl implements ProductionScrap {
@Autowired
private AbnormalBillService abnormalBillService;
@Autowired
private AbnormalBillMapper abnormalBillMapper;
@Override
public boolean jgProductionIsScrap(String site,String sfc) {
//查询该sfc在质量异常异常方案是否是报废,如果是则大于1
Integer num = abnormalBillMapper.findAbnormalMethodBySFC(site, sfc);
return num <= 0;
}
@Override
public List<ScrapDto> getScrapDtoBysfc(String site,String sfc) {
if(this.jgProductionIsScrap(site,sfc)){
throw new BaseException("该产品条码的异常方案不是报废");
}
return abnormalBillMapper.findScrapDtoBySfc(site, sfc);
}
}

@ -641,7 +641,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 Z_NWA_USER NWA ON NWA.USER_NAME = ZAB.PB_USER AND NWA.SITE = ZAB.SITE
LEFT JOIN NC_GROUP NG ON NG.NC_GROUP = ZANC.NC_CODE_GROUP AND NG.SITE = ZAB.SITE
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>

@ -58,7 +58,7 @@
<result column="REPORT_SEND_USER_GROUP" property="reportSendUserGroup"/>
</resultMap>
<resultMap id="scrapDto" type="com.foreverwin.mesnac.anomaly.dto.ScrapDto" >
<resultMap id="scrapDto" type="com.foreverwin.mesnac.common.dto.ScrapDto" >
<result column="SFC" property="sfc"/>
<result column="STATUS" property="status"/>
<result column="OPERATION" property="operation"/>

@ -153,4 +153,13 @@ public interface Constants {
String ABNORMAL_MESSAGE_CORRECTION_CONFIRM = "CORRECTION_CONFIRM";//纠防确认
String ABNORMAL_MESSAGE_CANCEL = "CANCEL";//取消
/**
*
*/
// 原材料标签
String PRINT_TYPE_INV = "INV";
// 在制品标签
String PRINT_TYPE_SFC = "SFC";
}

@ -0,0 +1,132 @@
package com.foreverwin.mesnac.common.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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.model.Message;
import java.util.List;
/**
*
* @author zjw
* @since 2021-08-02
*/
@RestController
@RequestMapping("/Z-MESSAGE")
public class MessageController {
@Autowired
public MessageService messageService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getMessageById(@PathVariable String id) {
return R.ok( messageService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getMessageList(Message message){
List<Message> result;
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
result = messageService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<Message> frontPage, Message message){
IPage result;
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(Message::getHandle, frontPage.getGlobalQuery())
.or().like(Message::getSite, frontPage.getGlobalQuery())
.or().like(Message::getObjectBo, frontPage.getGlobalQuery())
.or().like(Message::getType, frontPage.getGlobalQuery())
.or().like(Message::getMessageType, frontPage.getGlobalQuery())
.or().like(Message::getSendUserGroup, frontPage.getGlobalQuery())
.or().like(Message::getSendUser, frontPage.getGlobalQuery())
.or().like(Message::getContent, frontPage.getGlobalQuery())
.or().like(Message::getUpUserGroup, frontPage.getGlobalQuery())
.or().like(Message::getUpUser, frontPage.getGlobalQuery())
.or().like(Message::getUpMessageType, frontPage.getGlobalQuery())
.or().like(Message::getNode, frontPage.getGlobalQuery())
.or().like(Message::getStatus, frontPage.getGlobalQuery())
.or().like(Message::getCreatedUser, frontPage.getGlobalQuery())
.or().like(Message::getModifiedUser, frontPage.getGlobalQuery())
);
}
result = messageService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param message
* @return null
*/
@PostMapping
public R save(@RequestBody Message message) {
return R.ok(messageService.save(message));
}
/**
*
* @param message
* @return null
*/
@PutMapping
public R updateById(@RequestBody Message message) {
return R.ok(messageService.updateById(message));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(messageService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(messageService.removeByIds(ids));
}
}

@ -15,6 +15,8 @@ public class LabelPrintDto implements Serializable {
private String printer;
//打印模板名称
private String printTemplate;
//原材料标签参数
//物料编码
private String item;
//物料描述
@ -24,6 +26,7 @@ public class LabelPrintDto implements Serializable {
//批次号
private String batch;
//在制品标签参数
//工作指令
private String workOrder;
//图纸版本号

@ -1,4 +1,4 @@
package com.foreverwin.mesnac.anomaly.dto;
package com.foreverwin.mesnac.common.dto;
/**
* @Description TODO
@ -6,7 +6,6 @@ package com.foreverwin.mesnac.anomaly.dto;
* @Since 2021-07-28
*/
public class ScrapDto {
private String sfc;
private String status;

@ -136,7 +136,11 @@ public enum HandleEnum {
/**用户**/
USR("UserBO","UserBO:{0},{1}"),
TOOL("ToolBO","ToolBO:{0},{1}");
TOOL("ToolBO","ToolBO:{0},{1}"),
USER_RESOURCE("UserResourceBo","UserResourceBo:{0},{1},{2}"),
SFC_SCRAP("SfcScrapBo","SfcScrapBo:{0},{1}");
private String prefix;
private String pattern;

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.common.mapper;
import com.foreverwin.mesnac.common.model.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author zjw
* @since 2021-08-02
*/
@Repository
public interface MessageMapper extends BaseMapper<Message> {
}

@ -1,4 +1,4 @@
package com.foreverwin.mesnac.anomaly.model;
package com.foreverwin.mesnac.common.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
@ -14,13 +14,13 @@ import java.time.LocalDateTime;
*
* </p>
*
* @author
* @since 2021-07-22
* @author zjw
* @since 2021-08-02
*/
@TableName("Z_ABNORMAL_MESSAGE")
@TableName("Z_MESSAGE")
public class AbnormalMessage extends Model<AbnormalMessage> {
public class Message extends Model<Message> {
private static final long serialVersionUID = 1L;
@ -37,8 +37,8 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
/**
*
*/
@TableField("ABNORMAL_BILL_BO")
private String abnormalBillBo;
@TableField("OBJECT_BO")
private String objectBo;
/**
*
*/
@ -88,7 +88,7 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
*
*/
@TableField("GRADE")
private Integer grade;
private Double grade;
/**
*
*/
@ -97,8 +97,8 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
/**
*
*/
@TableField("ABNORMAL_NODE")
private String abnormalNode;
@TableField("NODE")
private String node;
/**
*
*/
@ -142,12 +142,12 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
this.site = site;
}
public String getAbnormalBillBo() {
return abnormalBillBo;
public String getObjectBo() {
return objectBo;
}
public void setAbnormalBillBo(String abnormalBillBo) {
this.abnormalBillBo = abnormalBillBo;
public void setObjectBo(String objectBo) {
this.objectBo = objectBo;
}
public String getType() {
@ -222,11 +222,11 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
this.upDateTime = upDateTime;
}
public Integer getGrade() {
public Double getGrade() {
return grade;
}
public void setGrade(Integer grade) {
public void setGrade(Double grade) {
this.grade = grade;
}
@ -238,12 +238,12 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
this.responseDateTime = responseDateTime;
}
public String getAbnormalNode() {
return abnormalNode;
public String getNode() {
return node;
}
public void setAbnormalNode(String abnormalNode) {
this.abnormalNode = abnormalNode;
public void setNode(String node) {
this.node = node;
}
public String getStatus() {
@ -290,7 +290,7 @@ public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String ABNORMAL_BILL_BO = "ABNORMAL_BILL_BO";
public static final String OBJECT_BO = "OBJECT_BO";
public static final String TYPE = "TYPE";
@ -314,7 +314,7 @@ public static final String GRADE = "GRADE";
public static final String RESPONSE_DATE_TIME = "RESPONSE_DATE_TIME";
public static final String ABNORMAL_NODE = "ABNORMAL_NODE";
public static final String NODE = "NODE";
public static final String STATUS = "STATUS";
@ -334,10 +334,10 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
public String toString() {
return "AbnormalMessage{" +
return "Message{" +
"handle = " + handle +
", site = " + site +
", abnormalBillBo = " + abnormalBillBo +
", objectBo = " + objectBo +
", type = " + type +
", messageType = " + messageType +
", sendUserGroup = " + sendUserGroup +
@ -349,7 +349,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
", upDateTime = " + upDateTime +
", grade = " + grade +
", responseDateTime = " + responseDateTime +
", abnormalNode = " + abnormalNode +
", node = " + node +
", status = " + status +
", createdUser = " + createdUser +
", createdDateTime = " + createdDateTime +

@ -1,5 +1,9 @@
package com.foreverwin.mesnac.common.service;
import com.foreverwin.mesnac.common.dto.ScrapDto;
import java.util.List;
/**
* @Description TODO
* @Author zhaojiawei
@ -20,4 +24,16 @@ public interface AnomalyService {
void createAnomalyTask(String category, String resource, String shopOrder,
String sfc, String ncCodes,String position,String ncQty,
String ncDescription,String userGroup);
/**
*
* @param sfc
* @return
*/
boolean jgProductionIsScrap(String site,String sfc);
/**
*
*/
List<ScrapDto> getScrapDtoBysfc(String site, String sfc);
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.Message;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zjw
* @since 2021-08-02
*/
public interface MessageService extends IService<Message> {
/**
*
* @param frontPage
* @return
*/
IPage<Message> selectPage(FrontPage<Message> frontPage, Message message);
List<Message> selectList(Message message);
}

@ -0,0 +1,46 @@
package com.foreverwin.mesnac.common.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.common.model.Message;
import com.foreverwin.mesnac.common.mapper.MessageMapper;
import com.foreverwin.mesnac.common.service.MessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zjw
* @since 2021-08-02
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements MessageService {
@Autowired
private MessageMapper messageMapper;
@Override
public IPage<Message> selectPage(FrontPage<Message> frontPage, Message message) {
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<Message> selectList(Message message) {
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
return super.list(queryWrapper);
}
}

@ -6,11 +6,14 @@ import cn.hutool.json.JSONString;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.dto.LabelPrintDto;
import com.foreverwin.mesnac.common.model.PrintLog;
import com.foreverwin.mesnac.common.mapper.PrintLogMapper;
import com.foreverwin.mesnac.common.service.PrintLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
@ -39,6 +42,9 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
@Autowired
private PrintLogMapper printLogMapper;
@Autowired
private PrintLogService printLogService;
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void savePrintLog(String site, String user, PrintLog printLog) {
@ -54,10 +60,6 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
@Override
public void labelPrint(String site, String user, List<PrintLog> printList) {
if (printList == null || printList.size() <= 0) {
return;
}
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
for (PrintLog printLog : printList) {
LabelPrintDto labelPrintDto = new LabelPrintDto();
@ -67,7 +69,32 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
labelPrintDto.setItemDescription(printLog.getItemDescription());
labelPrintDtoList.add(labelPrintDto);
}
String post = HttpUtil.post(printServer, JSON.toJSONString(labelPrintDtoList), 30000);
/**
* {"msg":"打印成功","code":0}
* {"msg":"打印失败","code":500}
* -printNameisPrint
*/
JSONObject jsonObject = JSONObject.parseObject(post);
String code = jsonObject.getString("code");
if (code == null){
}
List<PrintLog> printLogList = new ArrayList<>();
if (post.indexOf("500") != -1){
throw BusinessException.build("打印失败!");
}
for (PrintLog printLog : printList) {
PrintLog printLogOne = new PrintLog();
printLogOne.setHandle(printLog.getHandle());
printLogOne.setIsPrint("true");
// 更新日志
if (printLog.getCategory().equals(Constants.PRINT_TYPE_INV)){
printLogOne.setPrintName(printLog.getPrintName());
}
printLogList.add(printLogOne);
}
printLogService.updateBatchById(printLogList);
HttpUtil.post(printServer, JSON.toJSONString(labelPrintDtoList), 30000);
}
}

@ -1,4 +1,4 @@
package com.foreverwin.mesnac.anomaly.util;
package com.foreverwin.mesnac.common.util;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.json.JSONObject;

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.anomaly.mapper.AbnormalMessageMapper">
<mapper namespace="com.foreverwin.mesnac.common.mapper.MessageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.anomaly.model.AbnormalMessage">
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.Message">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="ABNORMAL_BILL_BO" property="abnormalBillBo" />
<result column="OBJECT_BO" property="objectBo" />
<result column="TYPE" property="type" />
<result column="MESSAGE_TYPE" property="messageType" />
<result column="SEND_USER_GROUP" property="sendUserGroup" />
@ -18,7 +18,7 @@
<result column="UP_DATE_TIME" property="upDateTime" />
<result column="GRADE" property="grade" />
<result column="RESPONSE_DATE_TIME" property="responseDateTime" />
<result column="ABNORMAL_NODE" property="abnormalNode" />
<result column="NODE" property="node" />
<result column="STATUS" property="status" />
<result column="CREATED_USER" property="createdUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
@ -28,17 +28,17 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, ABNORMAL_BILL_BO, TYPE, MESSAGE_TYPE, SEND_USER_GROUP, SEND_USER, CONTENT, UP_USER_GROUP, UP_USER, UP_MESSAGE_TYPE, UP_DATE_TIME, GRADE, RESPONSE_DATE_TIME, ABNORMAL_NODE, STATUS, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
HANDLE, SITE, OBJECT_BO, TYPE, MESSAGE_TYPE, SEND_USER_GROUP, SEND_USER, CONTENT, UP_USER_GROUP, UP_USER, UP_MESSAGE_TYPE, UP_DATE_TIME, GRADE, RESPONSE_DATE_TIME, NODE, STATUS, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_MESSAGE WHERE HANDLE=#{handle}
SELECT <include refid="Base_Column_List"></include> FROM Z_MESSAGE WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_ABNORMAL_MESSAGE
FROM Z_MESSAGE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
@ -52,19 +52,19 @@
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_ABNORMAL_MESSAGE WHERE HANDLE IN (
FROM Z_MESSAGE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_MESSAGE
SELECT <include refid="Base_Column_List"></include> FROM Z_MESSAGE
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -76,7 +76,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -86,7 +86,7 @@
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_ABNORMAL_MESSAGE
SELECT COUNT(1) FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -94,7 +94,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -106,7 +106,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -124,7 +124,7 @@
</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 Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -132,7 +132,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -144,7 +144,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -162,7 +162,7 @@
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -170,7 +170,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -182,7 +182,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -200,7 +200,7 @@
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -208,7 +208,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -220,7 +220,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -238,7 +238,7 @@
</select>
<select id="selectPage" 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 Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -246,7 +246,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -258,7 +258,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -276,7 +276,7 @@
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -284,7 +284,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -296,7 +296,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -313,12 +313,12 @@
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.anomaly.model.AbnormalMessage">
INSERT INTO Z_ABNORMAL_MESSAGE
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.Message">
INSERT INTO Z_MESSAGE
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="abnormalBillBo!=null">ABNORMAL_BILL_BO,</if>
<if test="objectBo!=null">OBJECT_BO,</if>
<if test="type!=null">TYPE,</if>
<if test="messageType!=null">MESSAGE_TYPE,</if>
<if test="sendUserGroup!=null">SEND_USER_GROUP,</if>
@ -330,7 +330,7 @@
<if test="upDateTime!=null">UP_DATE_TIME,</if>
<if test="grade!=null">GRADE,</if>
<if test="responseDateTime!=null">RESPONSE_DATE_TIME,</if>
<if test="abnormalNode!=null">ABNORMAL_NODE,</if>
<if test="node!=null">NODE,</if>
<if test="status!=null">STATUS,</if>
<if test="createdUser!=null">CREATED_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
@ -340,7 +340,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="abnormalBillBo!=null">#{abnormalBillBo},</if>
<if test="objectBo!=null">#{objectBo},</if>
<if test="type!=null">#{type},</if>
<if test="messageType!=null">#{messageType},</if>
<if test="sendUserGroup!=null">#{sendUserGroup},</if>
@ -352,7 +352,7 @@
<if test="upDateTime!=null">#{upDateTime},</if>
<if test="grade!=null">#{grade},</if>
<if test="responseDateTime!=null">#{responseDateTime},</if>
<if test="abnormalNode!=null">#{abnormalNode},</if>
<if test="node!=null">#{node},</if>
<if test="status!=null">#{status},</if>
<if test="createdUser!=null">#{createdUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
@ -361,15 +361,15 @@
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.anomaly.model.AbnormalMessage">
INSERT INTO Z_ABNORMAL_MESSAGE
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.Message">
INSERT INTO Z_MESSAGE
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{abnormalBillBo},
#{objectBo},
#{type},
#{messageType},
#{sendUserGroup},
@ -381,7 +381,7 @@
#{upDateTime},
#{grade},
#{responseDateTime},
#{abnormalNode},
#{node},
#{status},
#{createdUser},
#{createdDateTime},
@ -392,9 +392,9 @@
<update id="updateById">
UPDATE Z_ABNORMAL_MESSAGE <trim prefix="SET" suffixOverrides=",">
UPDATE Z_MESSAGE <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.messageType!=null">MESSAGE_TYPE=#{et.messageType},</if>
<if test="et.sendUserGroup!=null">SEND_USER_GROUP=#{et.sendUserGroup},</if>
@ -406,7 +406,7 @@
<if test="et.upDateTime!=null">UP_DATE_TIME=#{et.upDateTime},</if>
<if test="et.grade!=null">GRADE=#{et.grade},</if>
<if test="et.responseDateTime!=null">RESPONSE_DATE_TIME=#{et.responseDateTime},</if>
<if test="et.abnormalNode!=null">ABNORMAL_NODE=#{et.abnormalNode},</if>
<if test="et.node!=null">NODE=#{et.node},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
@ -417,9 +417,9 @@
<update id="updateAllColumnById">
UPDATE Z_ABNORMAL_MESSAGE <trim prefix="SET" suffixOverrides=",">
UPDATE Z_MESSAGE <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
ABNORMAL_BILL_BO=#{et.abnormalBillBo},
OBJECT_BO=#{et.objectBo},
TYPE=#{et.type},
MESSAGE_TYPE=#{et.messageType},
SEND_USER_GROUP=#{et.sendUserGroup},
@ -431,7 +431,7 @@
UP_DATE_TIME=#{et.upDateTime},
GRADE=#{et.grade},
RESPONSE_DATE_TIME=#{et.responseDateTime},
ABNORMAL_NODE=#{et.abnormalNode},
NODE=#{et.node},
STATUS=#{et.status},
CREATED_USER=#{et.createdUser},
CREATED_DATE_TIME=#{et.createdDateTime},
@ -442,9 +442,9 @@
<update id="update">
UPDATE Z_ABNORMAL_MESSAGE <trim prefix="SET" suffixOverrides=",">
UPDATE Z_MESSAGE <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.messageType!=null">MESSAGE_TYPE=#{et.messageType},</if>
<if test="et.sendUserGroup!=null">SEND_USER_GROUP=#{et.sendUserGroup},</if>
@ -456,7 +456,7 @@
<if test="et.upDateTime!=null">UP_DATE_TIME=#{et.upDateTime},</if>
<if test="et.grade!=null">GRADE=#{et.grade},</if>
<if test="et.responseDateTime!=null">RESPONSE_DATE_TIME=#{et.responseDateTime},</if>
<if test="et.abnormalNode!=null">ABNORMAL_NODE=#{et.abnormalNode},</if>
<if test="et.node!=null">NODE=#{et.node},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
@ -468,7 +468,7 @@
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -480,7 +480,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -498,11 +498,11 @@
</update>
<delete id="deleteById">
DELETE FROM Z_ABNORMAL_MESSAGE WHERE HANDLE=#{handle}
DELETE FROM Z_MESSAGE WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_ABNORMAL_MESSAGE
DELETE FROM Z_MESSAGE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
@ -515,7 +515,7 @@
</delete>
<delete id="delete">
DELETE FROM Z_ABNORMAL_MESSAGE
DELETE FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -523,7 +523,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -535,7 +535,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -553,7 +553,7 @@
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_ABNORMAL_MESSAGE WHERE HANDLE IN (
DELETE FROM Z_MESSAGE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>

@ -67,5 +67,9 @@
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>meapi</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>dispatch</artifactId>
</dependency>
</dependencies>
</project>

@ -30,6 +30,8 @@ public class HandlerFactory {
//return new MessageTypeHandler();
case "tool" :
return new ToolHandler();
case "userResource" :
return new UserResourceHandler();
}
return null;

@ -0,0 +1,163 @@
package com.foreverwin.mesnac.dataimport.handler;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dataimport.handler.base.BaseHandler;
import com.foreverwin.mesnac.dataimport.reader.FileReader;
import com.foreverwin.mesnac.dataimport.reader.FileReaderBuilder;
import com.foreverwin.mesnac.dataimport.reader.RowVisitor;
import com.foreverwin.mesnac.dataimport.service.MasterObjectDefine;
import com.foreverwin.mesnac.dispatch.mapper.UserResourceMapper;
import com.foreverwin.mesnac.dispatch.model.UserResource;
import com.foreverwin.mesnac.dispatch.service.UserResourceService;
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
import com.foreverwin.mesnac.meapi.mapper.ResrceMapper;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.I18nUtil;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.Map;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-07-29
*/
public class UserResourceHandler extends BaseHandler {
@Autowired
private ResrceMapper resrceMapper;
@Autowired
private UserResourceService userResourceService;
@Autowired
private NwaUserMapper nwaUserMapper;
@Autowired
private UserResourceMapper userResourceMapper;
@Override
public String importFile(String site, InputStream inputStream, String fileType, String mode) throws Exception {
int row = 0;
StringBuffer buffer = new StringBuffer();
Integer[] failedNumber = new Integer[]{0};
try {
FileReader fileReader = new FileReaderBuilder().build(fileType);
RowVisitor<JSONObject> visitor = getRowVisitor(site, mode, buffer, failedNumber);
row = fileReader.visitor(visitor).read(inputStream, getHeaders());
} catch (Exception e) {
buffer.append(e.getMessage() + "\n");
}
if (buffer.length() > 0) {
buffer.insert(0, I18nUtil.getI18nText("MaterData.import.Summary", new Object[]{row + failedNumber[0], row, failedNumber[0]}) + "\n");
throw BusinessException.build(buffer.toString());
}
buffer.insert(0, I18nUtil.getI18nText("MaterData.import.Summary", new Object[]{row + failedNumber[0], row, failedNumber[0]}) + "\n");
return buffer.toString();
}
@Override
public Map<String, String> getHeaders() {
return MasterObjectDefine.getHeadsMapping("USER_RESOURCE");
}
public RowVisitor<JSONObject> getRowVisitor(String site, String mode, StringBuffer buffer, Integer[] failedNumber) {
return new RowVisitor<JSONObject>() {
@Override
public int visit(long index, JSONObject jsonObject) {
LocalDateTime now = LocalDateTime.now();
String user = CommonMethods.getUser();
String resrce = StringUtil.toString(jsonObject.getString("resrce"));
// String resrceDescription = StringUtil.toString(jsonObject.getString("resrceDescription"));
String userId = StringUtil.toString(jsonObject.getString("userId"));
String userDescription = StringUtil.toString(jsonObject.getString("userDescription"));
String temporaryUser = StringUtil.toString(jsonObject.getString("temporaryUser"));
String status = StringUtil.toString(jsonObject.getString("status"));
UserResource userResource = new UserResource();
userResource.setHandle(HandleEnum.USER_RESOURCE.getHandle(site, resrce, userId));
userResource.setSite(site);
userResource.setResourceBo(HandleEnum.RESOURCE.getHandle(site,resrce));
userResource.setResrce(resrce);
// userResource.setResrceDescription(resrceDescription);
userResource.setUserId(userId);
userResource.setUserDescription(userDescription);
if("Y".equals(temporaryUser)){
userResource.setTemporaryUser("true");
}else {
userResource.setTemporaryUser("false");
}
if("N".equals(status)){
userResource.setStatus("false");
}else {
userResource.setStatus("true");
}
//判断是否是更新还是插入,如果是更新,则没有创建时间和人员
UserResource result = userResourceMapper.selectById(userResource.getHandle());
if(result == null){
userResource.setCreatedUser(user);
userResource.setCreatedDateTime(now);
}
userResource.setModifiedUser(user);
userResource.setModifiedDateTime(now);
try {
//如果资源为空或者员工编号为空,则直接跳过
if (StringUtil.notEmpty(resrce) && StringUtil.notEmpty(userId)) {
//站点
jsonObject.put("site", site);
//不管用户选啥模式,都是更新和插入
this.updateAndInsert(userResource,index);
userResourceService.saveOrUpdate(userResource);
}
return 1;
} catch (Exception e) {
throw BusinessException.build(e.getMessage());
}
}
@Override
public String[] getHeader() {
return null;
}
boolean updateAndInsert(UserResource userResource,Long index){
//判断资源是否存在
Resrce resrce = resrceMapper.selectById(userResource.getResourceBo());
if(resrce == null){
throw BusinessException.build("第"+index+"行的资源不存在");
}
//设置资源描述
userResource.setResrceDescription(resrce.getDescription());
//设置员工描述
NwaUser nwaUser = nwaUserMapper.selectById(HandleEnum.USER.getHandle(userResource.getSite(), userResource.getUserId()));
if(nwaUser != null){
userResource.setUserDescription(nwaUser.getFullName());
}else if("true".equals(userResource.getTemporaryUser())){
//不做任何操作
}else{
throw BusinessException.build("第"+index+"行的用户不存在,必须为临时员工");
}
return true;
}
};
}
}

@ -176,6 +176,15 @@ public class MasterObjectDefine {
cvsHeadsMapping.put("remark","备注");
break;
case "USER_RESOURCE":
cvsHeadsMapping.put("resrce","资源编码");
cvsHeadsMapping.put("resrceDescription","资源描述");
cvsHeadsMapping.put("userId","员工编号");
cvsHeadsMapping.put("userDescription","员工姓名");
cvsHeadsMapping.put("temporaryUser","是否临时员工");
cvsHeadsMapping.put("status","是否有效");
break;
default:
break;
}

@ -7,6 +7,7 @@ import com.foreverwin.mesnac.dispatch.model.UserResource;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.HashMap;
import java.util.List;
/**
@ -32,7 +33,7 @@ public interface UserResourceService extends IService<UserResource> {
List<UserResource> findEnableList(String site, String resource, String user);
List<UserResourceDto> findAll(UserResourceDto userResourceDto);
HashMap<String,Object> findAll(UserResourceDto userResourceDto);
void saveAll(List<UserResourceDto> userResourceDtoList,String resource,String user);

@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
@ -69,11 +70,18 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
}
@Override
public List<UserResourceDto> findAll(UserResourceDto userResourceDto) {
public HashMap<String,Object> findAll(UserResourceDto userResourceDto) {
String site = CommonMethods.getSite();
String resource = userResourceDto.getResrce();
String userId = userResourceDto.getUserId();
return userResourceMapper.findAll(site, resource, userId);
HashMap<String, Object> hashMap = new HashMap<>();;
List<NwaUser> nwaUserList = nwaUserService.selectList(null);
List<UserResourceDto> userResourceList = userResourceMapper.findAll(site, resource, userId);
hashMap.put("users",nwaUserList);
hashMap.put("userResources",userResourceList);
return hashMap;
}
@Override
@ -99,7 +107,8 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
userByUserName == null){
throw BusinessException.build("第"+(i+1)+"行的用户不存在,必须为临时用户");
}else if(userByUserName != null){
userByUserName.setFullName(userResource.getUserDescription());
//userByUserName.setFullName(userResource.getUserDescription());
userResource.setUserDescription(userByUserName.getFullName());
nwaUserService.saveOrUpdate(userByUserName);
}
userResource.setStatus(userResourceDto.getStatus());
@ -117,6 +126,6 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
if(userResourceList.size() > 0){
this.saveOrUpdateBatch(userResourceList);
}
}
}

@ -0,0 +1,153 @@
package com.foreverwin.mesnac.production.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.production.model.SfcScrap;
import com.foreverwin.mesnac.production.service.SfcScrapService;
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 java.util.HashMap;
import java.util.List;
/**
*
* @author zjw
* @since 2021-07-30
*/
@RestController
@RequestMapping("/Z-SFC-SCRAP")
public class SfcScrapController {
@Autowired
public SfcScrapService sfcScrapService;
@Autowired
private AnomalyService anomalyService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getSfcScrapById(@PathVariable String id) {
return R.ok( sfcScrapService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getSfcScrapList(SfcScrap sfcScrap){
List<SfcScrap> result;
QueryWrapper<SfcScrap> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcScrap);
result = sfcScrapService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<SfcScrap> frontPage, SfcScrap sfcScrap){
IPage result;
QueryWrapper<SfcScrap> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcScrap);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(SfcScrap::getHandle, frontPage.getGlobalQuery())
.or().like(SfcScrap::getSite, frontPage.getGlobalQuery())
.or().like(SfcScrap::getSfc, frontPage.getGlobalQuery())
.or().like(SfcScrap::getOperation, frontPage.getGlobalQuery())
.or().like(SfcScrap::getStepId, frontPage.getGlobalQuery())
.or().like(SfcScrap::getType, frontPage.getGlobalQuery())
.or().like(SfcScrap::getReason, frontPage.getGlobalQuery())
.or().like(SfcScrap::getCreatedUser, frontPage.getGlobalQuery())
.or().like(SfcScrap::getModifiedUser, frontPage.getGlobalQuery())
);
}
result = sfcScrapService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param sfcScrap
* @return null
*/
@PostMapping
public R save(@RequestBody SfcScrap sfcScrap) {
return R.ok(sfcScrapService.save(sfcScrap));
}
/**
*
* @param sfcScrap
* @return null
*/
@PutMapping
public R updateById(@RequestBody SfcScrap sfcScrap) {
return R.ok(sfcScrapService.updateById(sfcScrap));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(sfcScrapService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(sfcScrapService.removeByIds(ids));
}
/**
*
* @param site
* @param sfc
* @return
*/
@GetMapping("/getScrapDtoBysfc")
public R getScrapDtoBysfc(String site,String sfc){
return R.ok(anomalyService.getScrapDtoBysfc(site,sfc));
}
/**
*
* @param sfcScrap
* @return
*/
@PostMapping("/scrap")
public R scrap(@RequestBody HashMap<String,Object> param){
return R.ok(sfcScrapService.scrap(param));
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.production.mapper;
import com.foreverwin.mesnac.production.model.SfcScrap;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author zjw
* @since 2021-07-30
*/
@Repository
public interface SfcScrapMapper extends BaseMapper<SfcScrap> {
}

@ -0,0 +1,232 @@
package com.foreverwin.mesnac.production.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;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author zjw
* @since 2021-07-30
*/
@TableName("Z_SFC_SCRAP")
public class SfcScrap extends Model<SfcScrap> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
*
*/
@TableField("STEP_ID")
private String stepId;
/**
*
*/
@TableField("QTY")
private Double qty;
/**
*
*/
@TableField("TYPE")
private String type;
/**
*
*/
@TableField("REASON")
private String reason;
/**
*
*/
@TableField("CREATED_USER")
private String createdUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFIED_USER")
private String modifiedUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public Double getQty() {
return qty;
}
public void setQty(Double qty) {
this.qty = qty;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getCreatedUser() {
return createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifiedUser() {
return modifiedUser;
}
public void setModifiedUser(String modifiedUser) {
this.modifiedUser = modifiedUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String SFC = "SFC";
public static final String OPERATION = "OPERATION";
public static final String STEP_ID = "STEP_ID";
public static final String QTY = "QTY";
public static final String TYPE = "TYPE";
public static final String REASON = "REASON";
public static final String CREATED_USER = "CREATED_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFIED_USER = "MODIFIED_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "SfcScrap{" +
"handle = " + handle +
", site = " + site +
", sfc = " + sfc +
", operation = " + operation +
", stepId = " + stepId +
", qty = " + qty +
", type = " + type +
", reason = " + reason +
", createdUser = " + createdUser +
", createdDateTime = " + createdDateTime +
", modifiedUser = " + modifiedUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -4,6 +4,7 @@ import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import java.math.BigDecimal;
import java.util.Map;
public interface PodTemplateService {
@ -17,6 +18,8 @@ public interface PodTemplateService {
void sfcComplete(Map<String, Object> map);
void sendErp(String sfc, String stepId, BigDecimal qty, BigDecimal scrapQty);
SfcDto getInfoBySfc(Sfc sfc);
}

@ -0,0 +1,32 @@
package com.foreverwin.mesnac.production.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.production.model.SfcScrap;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.HashMap;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zjw
* @since 2021-07-30
*/
public interface SfcScrapService extends IService<SfcScrap> {
/**
*
* @param frontPage
* @return
*/
IPage<SfcScrap> selectPage(FrontPage<SfcScrap> frontPage, SfcScrap sfcScrap);
List<SfcScrap> selectList(SfcScrap sfcScrap);
List<SfcScrap> scrap(HashMap<String,Object> param) ;
}

@ -303,7 +303,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
inspectionTaskService.createTask(paramMap);
}
//报工
sendErp(sfc, stepId, qty);
sendErp(sfc, stepId, qty,BigDecimal.ZERO);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
@ -399,8 +399,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
assemblyServiceInterface.assembleByComponents(assembleComponentsRequest);
}
void sendErp(String sfc, String stepId, BigDecimal qty) {
@Override
public void sendErp(String sfc, String stepId, BigDecimal qty ,BigDecimal scrapQty) {
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(CommonMethods.getSite(),sfc));
String shopOrderBo = sfcServiceById.getShopOrderBo();
String shopOrder = StringUtil.trimHandle(shopOrderBo);
@ -416,7 +416,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//良品数量
struIn.setLmnga(qty);
//报废数量
struIn.setXmnga(BigDecimal.ZERO);
struIn.setXmnga(scrapQty);
//机器工时
struIn.setIsm01(BigDecimal.ZERO);
//人工工时

@ -0,0 +1,148 @@
package com.foreverwin.mesnac.production.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.SfcMapper;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.production.mapper.SfcScrapMapper;
import com.foreverwin.mesnac.production.model.SfcScrap;
import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.mesnac.production.service.SfcScrapService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.sap.me.production.ScrapDeleteServiceInterface;
import com.sap.me.production.ScrapSfcRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zjw
* @since 2021-07-30
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SfcScrapServiceImpl extends ServiceImpl<SfcScrapMapper, SfcScrap> implements SfcScrapService {
@Autowired
private SfcScrapMapper sfcScrapMapper;
@Autowired
private SfcMapper sfcMapper;
@Autowired
private PodTemplateService podTemplateService;
@Override
public IPage<SfcScrap> selectPage(FrontPage<SfcScrap> frontPage, SfcScrap sfcScrap) {
QueryWrapper<SfcScrap> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcScrap);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<SfcScrap> selectList(SfcScrap sfcScrap) {
QueryWrapper<SfcScrap> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcScrap);
return super.list(queryWrapper);
}
@Override
public List<SfcScrap> scrap(HashMap<String,Object> param) {
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
String reason = (String)param.get("reason");
String site = (String)param.get("site");
//类型
List<String> _type = (List<String>)param.get("type");
StringBuilder type = new StringBuilder();
for (int i = 0; i < _type.size(); i++) {
if(i == _type.size() - 1){
type.append(_type.get(i));
}else{
type.append(_type.get(i)).append(",");
}
}
String str = JSONUtil.toJsonStr(param.get("sfcScrap"));
List<SfcScrap> _sfcScrapList = JSONArray.parseArray(str, SfcScrap.class);
List<SfcScrap> sfcScrapsList = new ArrayList<>();
ScrapDeleteServiceInterface scrapDeleteServiceInterface = null;
//mes的公共接口
try{
scrapDeleteServiceInterface = MEServices.create("com.sap.me.production", "ScrapDeleteService", CommonMethods.getSite());
}catch (Exception e){
throw new BaseException("调用mes公共接口失败"+e.getMessage());
}
for (SfcScrap sfcScraps :
_sfcScrapList) {
SfcScrap sfcScrap = new SfcScrap();
sfcScrap.setHandle(HandleEnum.SFC_SCRAP.getHandle(site,sfcScraps.getSfc()));
sfcScrap.setSite(site);
sfcScrap.setSfc(sfcScraps.getSfc());
//设置数量用,并判断该sfc是否有效
Sfc sfc = sfcMapper.selectById(HandleEnum.SFC.getHandle(site,sfcScrap.getSfc()));
if(sfc == null){
throw new BaseException("该sfc不存在不能报废");
}
if(!StringUtil.isBlank(sfcScraps.getOperation())){
String[] split = sfcScraps.getOperation().split("/");
sfcScrap.setOperation(split[0]);
sfcScrap.setStepId(split[1]);
}
sfcScrap.setType(type.toString());
sfcScrap.setReason(reason);
sfcScrap.setQty(sfc.getQty());
sfcScrap.setCreatedUser(user);
sfcScrap.setCreatedDateTime(now);
sfcScrap.setModifiedUser(user);
sfcScrap.setModifiedDateTime(now);
//向生产派工那边发送数据
// podTemplateService.sendErp(sfcScrap.getSfc(),sfcScrap.getStepId(),BigDecimal.valueOf(0L),BigDecimal.valueOf(sfcScrap.getQty()));
try{
//调用mes公共接口报废
ScrapSfcRequest scrapSfcRequest = new ScrapSfcRequest();
scrapSfcRequest.setSfcRef(sfc.getHandle());
scrapSfcRequest.setQuantity(BigDecimal.valueOf(sfcScrap.getQty()));
scrapDeleteServiceInterface.scrapSfc(scrapSfcRequest);
}catch (Exception e){
throw new BaseException("调用mes公共接口失败"+e.getMessage());
}
sfcScrapsList.add(sfcScrap);
}
//保存
this.saveBatch(sfcScrapsList);
return sfcScrapsList;
}
}

@ -0,0 +1,434 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.production.mapper.SfcScrapMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.SfcScrap">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="SFC" property="sfc" />
<result column="OPERATION" property="operation" />
<result column="STEP_ID" property="stepId" />
<result column="QTY" property="qty" />
<result column="TYPE" property="type" />
<result column="REASON" property="reason" />
<result column="CREATED_USER" property="createdUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFIED_USER" property="modifiedUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, SFC, OPERATION, STEP_ID, QTY, TYPE, REASON, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_SCRAP WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_SCRAP
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_SCRAP WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_SCRAP
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_SFC_SCRAP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</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 Z_SFC_SCRAP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_SCRAP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_SCRAP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" 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 Z_SFC_SCRAP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_SCRAP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.production.model.SfcScrap">
INSERT INTO Z_SFC_SCRAP
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="sfc!=null">SFC,</if>
<if test="operation!=null">OPERATION,</if>
<if test="stepId!=null">STEP_ID,</if>
<if test="qty!=null">QTY,</if>
<if test="type!=null">TYPE,</if>
<if test="reason!=null">REASON,</if>
<if test="createdUser!=null">CREATED_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifiedUser!=null">MODIFIED_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="operation!=null">#{operation},</if>
<if test="stepId!=null">#{stepId},</if>
<if test="qty!=null">#{qty},</if>
<if test="type!=null">#{type},</if>
<if test="reason!=null">#{reason},</if>
<if test="createdUser!=null">#{createdUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifiedUser!=null">#{modifiedUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.SfcScrap">
INSERT INTO Z_SFC_SCRAP
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{sfc},
#{operation},
#{stepId},
#{qty},
#{type},
#{reason},
#{createdUser},
#{createdDateTime},
#{modifiedUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_SFC_SCRAP <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.reason!=null">REASON=#{et.reason},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_SFC_SCRAP <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
SFC=#{et.sfc},
OPERATION=#{et.operation},
STEP_ID=#{et.stepId},
QTY=#{et.qty},
TYPE=#{et.type},
REASON=#{et.reason},
CREATED_USER=#{et.createdUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFIED_USER=#{et.modifiedUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_SFC_SCRAP <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.reason!=null">REASON=#{et.reason},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_SFC_SCRAP WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_SFC_SCRAP
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_SFC_SCRAP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_SFC_SCRAP WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>
Loading…
Cancel
Save