定时任务:报警和审核时定时任务发送邮件
Erp同步原材料入库、原材料出库、原材料退库、成品入库和成品出库完善
仓储部分显示页面完善
master
xs 1 year ago
parent a1ad065e6f
commit 3cadbe66ae

@ -34,4 +34,7 @@ public interface RemoteSysCommonService {
@PostMapping("/wfprocessactivity/processActivityUserInfo") @PostMapping("/wfprocessactivity/processActivityUserInfo")
R<WfProcessActivity> selectProcessActivityUserInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source, Long processActivityId); R<WfProcessActivity> selectProcessActivityUserInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source, Long processActivityId);
@PostMapping("/pointRouter/processActivityEmailNotify")
R<?> processActivityEmailNotify(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
} }

@ -56,6 +56,12 @@ public class SysPointRouter extends BaseEntity {
@Excel(name = "提示信息") @Excel(name = "提示信息")
private String remark; private String remark;
private Long processActivityId;
private String emailFlag;
private String sentEmailFlag;
@Override @Override
public String getRemark() { public String getRemark() {
return remark; return remark;
@ -114,6 +120,30 @@ public class SysPointRouter extends BaseEntity {
return routerFlag; return routerFlag;
} }
public Long getProcessActivityId() {
return processActivityId;
}
public void setProcessActivityId(Long processActivityId) {
this.processActivityId = processActivityId;
}
public String getEmailFlag() {
return emailFlag;
}
public void setEmailFlag(String emailFlag) {
this.emailFlag = emailFlag;
}
public String getSentEmailFlag() {
return sentEmailFlag;
}
public void setSentEmailFlag(String sentEmailFlag) {
this.sentEmailFlag = sentEmailFlag;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -57,6 +57,11 @@ public class RemoteSysCommonFallbackFactory implements FallbackFactory<RemoteSys
return R.fail("获取工单流程步骤用户信息失败:" + throwable.getMessage()); return R.fail("获取工单流程步骤用户信息失败:" + throwable.getMessage());
} }
@Override
public R<?> processActivityEmailNotify(String source) {
return R.fail("发送工单流程节点权限用户邮件失败:" + throwable.getMessage());
}
}; };
} }

@ -38,4 +38,16 @@ public class SystemConstants {
public static final String SYS_ROUTER_DMS_ALARM_URL = "/dms/deviceAlarm/dmsRecordAlarmInfo"; public static final String SYS_ROUTER_DMS_ALARM_URL = "/dms/deviceAlarm/dmsRecordAlarmInfo";
/**
* ID
*/
public static final Long PROCESS_ACTIVITY_ID_QUALITY_CHECK_ABNORMAL = 3012L;//质检异常处理
public static final Long PROCESS_ACTIVITY_ID_PRODUCT_ORDER_OVERTIME = 2021L;//生产工单超时
public static final Long PROCESS_ACTIVITY_ID_PURCHASEORDER_OVERTIME = 2031L;//采购订单交货超时
public static final Long PROCESS_ACTIVITY_ID_SALE_ORDER_OVERTIME = 2041L;//销售订单交货超时
public static final Long PROCESS_ACTIVITY_ID_DEVICE_ALARM = 1071L;//设备报警处理
public static final Long PROCESS_ACTIVITY_ID_STOCK_NOTENOUGH = 5011L;//物料库存告警
} }

@ -9,44 +9,46 @@ public class MailUtils {
public static void main(String[] args) { public static void main(String[] args) {
// 设置发件人、收件人、SMTP服务器等信息 // 设置发件人、收件人、SMTP服务器等信息
String senderEmail = "chencheng01@jsjyep.com"; // String senderEmail = "chencheng01@jsjyep.com";
String receiverEmail = "chencheng01@jsjyep.com"; // String receiverEmail = "chencheng01@jsjyep.com";
String password = "QH6faJaWw5rgvM4u"; // String password = "QH6faJaWw5rgvM4u";
String host = "smtp.exmail.qq.com"; // SMTP服务器地址 // String host = "smtp.exmail.qq.com"; // SMTP服务器地址
int port = 465; // 端口号如果是SSL连接常用465非SSL常用587或25 // int port = 465; // 端口号如果是SSL连接常用465非SSL常用587或25
//
// // 设置邮件服务器的属性
// Properties props = new Properties();
// props.put("mail.smtp.auth", "true");
// props.put("mail.smtp.ssl.enable", "true"); // 启用SSL
// props.put("mail.smtp.ssl.protocols", "TLSv1.2"); // 设置SSL/TLS版本
//
//// props.put("mail.smtp.starttls.enable", "true"); // 如果是SSL连接则不需要这行
// props.put("mail.smtp.host", host);
// props.put("mail.smtp.port", port);
//
// // 创建会话
// Session session = Session.getInstance(props, new Authenticator() {
// protected PasswordAuthentication getPasswordAuthentication() {
// return new PasswordAuthentication(senderEmail, password);
// }
// });
//
// try {
// // 创建邮件消息
// Message message = new MimeMessage(session);
// message.setFrom(new InternetAddress(senderEmail));
// message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(receiverEmail));
// message.setSubject("测试");
// message.setText("测试正文内容");
//
// // 发送邮件
// Transport.send(message);
//// System.out.println("邮件已成功发送!");
// } catch (MessagingException e) {
// e.printStackTrace();
// throw new RuntimeException(e);
// }
// 设置邮件服务器的属性 processSendEmail("ericxinstar@163.com","ddd","ddde");
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.ssl.enable", "true"); // 启用SSL
props.put("mail.smtp.ssl.protocols", "TLSv1.2"); // 设置SSL/TLS版本
// props.put("mail.smtp.starttls.enable", "true"); // 如果是SSL连接则不需要这行
props.put("mail.smtp.host", host);
props.put("mail.smtp.port", port);
// 创建会话
Session session = Session.getInstance(props, new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(senderEmail, password);
}
});
try {
// 创建邮件消息
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmail));
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(receiverEmail));
message.setSubject("测试");
message.setText("测试正文内容");
// 发送邮件
Transport.send(message);
// System.out.println("邮件已成功发送!");
} catch (MessagingException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
} }
/** /**
@ -57,9 +59,9 @@ public class MailUtils {
*/ */
public static void processSendEmail(String receiverEmail, String subject, String text) { public static void processSendEmail(String receiverEmail, String subject, String text) {
// 设置发件人、收件人、SMTP服务器等信息 // 设置发件人、收件人、SMTP服务器等信息
String senderEmail = "chencheng01@jsjyep.com"; String senderEmail = "zhuangbeizhizaozhongxin@jsjyep.com";
// String receiverEmail = "chencheng01@jsjyep.com"; // String receiverEmail = "chencheng01@jsjyep.com";
String password = "QH6faJaWw5rgvM4u"; String password = "Dingxl226129";
String host = "smtp.exmail.qq.com"; // SMTP服务器地址 String host = "smtp.exmail.qq.com"; // SMTP服务器地址
int port = 465; // 端口号如果是SSL连接常用465非SSL常用587或25 int port = 465; // 端口号如果是SSL连接常用465非SSL常用587或25
@ -74,6 +76,12 @@ public class MailUtils {
props.put("mail.smtp.port", port); props.put("mail.smtp.port", port);
// 创建会话 // 创建会话
// Session session = Session.getInstance(props, new Authenticator() {
// protected PasswordAuthentication getPasswordAuthentication() {
// return new PasswordAuthentication(senderEmail, password);
// }
// });
Session session = Session.getInstance(props, new Authenticator() { Session session = Session.getInstance(props, new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() { protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(senderEmail, password); return new PasswordAuthentication(senderEmail, password);
@ -97,4 +105,6 @@ public class MailUtils {
} }
} }
} }

@ -136,19 +136,21 @@ public class DmsRecordAlarmInfoServiceImpl implements IDmsRecordAlarmInfoService
List<SysPointRouter> webRouterList = new ArrayList<>(); List<SysPointRouter> webRouterList = new ArrayList<>();
Gson gson = new Gson(); Gson gson = new Gson();
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
for (DmsRecordAlarmInfo alarmInfo : alarmInfoList) { //trigger写此逻辑
SysPointRouter pointRouter = new SysPointRouter(); // for (DmsRecordAlarmInfo alarmInfo : alarmInfoList) {
pointRouter.setModuleCode(SystemConstants.DMS); // SysPointRouter pointRouter = new SysPointRouter();
pointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM); // pointRouter.setModuleCode(SystemConstants.DMS);
pointRouter.setRouterAddress(SystemConstants.SYS_ROUTER_DMS_ALARM_URL); // pointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM);
map.put("alarmId", alarmInfo.getAlarmId()); // pointRouter.setRouterAddress(SystemConstants.SYS_ROUTER_DMS_ALARM_URL);
String json = gson.toJson(map); // pointRouter.setProcessActivityId(SystemConstants.PROCESS_ACTIVITY_ID_QUALITY_CHECK_ABNORMAL);
pointRouter.setRouterAddressDetail(json); // map.put("alarmId", alarmInfo.getAlarmId());
pointRouter.setRemark(alarmInfo.getAlarmReason()); // String json = gson.toJson(map);
webRouterList.add(pointRouter); // pointRouter.setRouterAddressDetail(json);
} // pointRouter.setRemark(alarmInfo.getAlarmReason());
//WEB通知 // webRouterList.add(pointRouter);
remoteSysCommonService.insertSysPointRouterPort(webRouterList, SecurityConstants.INNER); // }
// //WEB通知
// remoteSysCommonService.insertSysPointRouterPort(webRouterList, SecurityConstants.INNER);
for (DmsRecordAlarmInfo alarmInfo : alarmInfoList) { for (DmsRecordAlarmInfo alarmInfo : alarmInfoList) {
DmsRecordAlarmInfo recordAlarmInfo = new DmsRecordAlarmInfo(); DmsRecordAlarmInfo recordAlarmInfo = new DmsRecordAlarmInfo();
recordAlarmInfo.setAlarmId(alarmInfo.getAlarmId()); recordAlarmInfo.setAlarmId(alarmInfo.getAlarmId());

@ -151,6 +151,8 @@ public class MesPurchaseOrder extends BaseEntity {
*/ */
private String specificationParameter; private String specificationParameter;
private BigDecimal price;
public String getSpecificationParameter() { public String getSpecificationParameter() {
return specificationParameter; return specificationParameter;
} }
@ -367,6 +369,14 @@ public class MesPurchaseOrder extends BaseEntity {
return isFlag; return isFlag;
} }
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -929,7 +929,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject queryJson = new JSONObject(); JSONObject queryJson = new JSONObject();
String formId = "PUR_PurchaseOrder"; String formId = "PUR_PurchaseOrder";
String fieldKeys = "FID,FBillNo,FApproveDate,FDocumentStatus,FPOOrderEntry_FEntryID,FRequireDeptId,FMaterialId,FMaterialId.FNumber,FMaterialId.FName," + String fieldKeys = "FID,FBillNo,FApproveDate,FDocumentStatus,FPOOrderEntry_FEntryID,FRequireDeptId,FMaterialId,FMaterialId.FNumber,FMaterialId.FName," +
"FQty,FDeliveryDate,FCreateDate,FModifyDate,FUnitId,FStockUnitID,FPriceUnitID,FAuxPropId,FAUXPROPID.FF100001,FSrcBillNo,FPurchaseOrgId,FPurchaseDeptId,F_TOND_Base,FSupplierId"; "FQty,FDeliveryDate,FCreateDate,FModifyDate,FUnitId,FStockUnitID,FPriceUnitID,FPrice,FAuxPropId,FAUXPROPID.FF100001,FSrcBillNo,FPurchaseOrgId,FPurchaseDeptId,F_TOND_Base,FSupplierId";
// String filterString = ""; // String filterString = "";
String orderString = ""; String orderString = "";
int topRowCount = 0; int topRowCount = 0;
@ -1006,6 +1006,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
Long stockUnitId = resultObject.getLong("FStockUnitID"); Long stockUnitId = resultObject.getLong("FStockUnitID");
//计价单位 //计价单位
Long priceUnitId = resultObject.getLong("FPriceUnitID"); Long priceUnitId = resultObject.getLong("FPriceUnitID");
//单价
BigDecimal price = resultObject.getBigDecimal("FPrice");
//辅助属性 //辅助属性
Long auxPropId = resultObject.getLong("FAuxPropId"); Long auxPropId = resultObject.getLong("FAuxPropId");
//规格参数 //规格参数
@ -1035,6 +1037,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesPurchaseOrder.setUnitId(unitId); mesPurchaseOrder.setUnitId(unitId);
mesPurchaseOrder.setStockUnitId(stockUnitId); mesPurchaseOrder.setStockUnitId(stockUnitId);
mesPurchaseOrder.setPriceUnitId(priceUnitId); mesPurchaseOrder.setPriceUnitId(priceUnitId);
mesPurchaseOrder.setPrice(price);
mesPurchaseOrder.setAuxPropId(auxPropId); mesPurchaseOrder.setAuxPropId(auxPropId);
mesPurchaseOrder.setSpecificationParameter(FF100001); mesPurchaseOrder.setSpecificationParameter(FF100001);
mesPurchaseOrder.setSrcBillNo(srcBillNo); mesPurchaseOrder.setSrcBillNo(srcBillNo);

@ -7,6 +7,7 @@ import com.hw.ems.api.RemoteEmsService;
import com.hw.jindie.api.RemoteJindieService; import com.hw.jindie.api.RemoteJindieService;
import com.hw.jindie.api.domain.vo.ErpSyncInfoVo; import com.hw.jindie.api.domain.vo.ErpSyncInfoVo;
import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.RemoteMesService;
import com.hw.system.api.RemoteSysCommonService;
import com.hw.wms.api.RemoteWmsService; import com.hw.wms.api.RemoteWmsService;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -33,6 +34,8 @@ public class RyTask
private RemoteWmsService remoteWmsService; private RemoteWmsService remoteWmsService;
@Autowired @Autowired
private RemoteMesService remoteMesService; private RemoteMesService remoteMesService;
@Autowired
private RemoteSysCommonService remoteSysCommonService;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
{ {
@ -127,28 +130,28 @@ public class RyTask
} }
public void syncInventoryInformationToERP(){ public void syncInventoryInformationToERP(){
System.out.println("++定时同步原材料入库信息给ERP++syncInventoryInformationToERP"); System.out.println(new Date()+"++定时同步原材料入库信息给ERP++syncInventoryInformationToERP");
remoteWmsService.synchronizeInventoryInformationToERP(SecurityConstants.INNER); remoteWmsService.synchronizeInventoryInformationToERP(SecurityConstants.INNER);
} }
public void syncRawMaterialDeliveryInformationToERP(){ public void syncRawMaterialDeliveryInformationToERP(){
System.out.println("++定时同步原材料出库信息给ERP++syncRawMaterialDeliveryInformationToERP"); System.out.println(new Date()+"++定时同步原材料出库信息给ERP++syncRawMaterialDeliveryInformationToERP");
remoteWmsService.synchronizeRawMaterialDeliveryInformationToERP(SecurityConstants.INNER); remoteWmsService.synchronizeRawMaterialDeliveryInformationToERP(SecurityConstants.INNER);
} }
public void synchronizeRawReturnInformationToERP(){ public void synchronizeRawReturnInformationToERP(){
System.out.println("++定时同步原材料退库信息给ERP++syncRawMaterialDeliveryInformationToERP"); System.out.println(new Date()+"++定时同步原材料退库信息给ERP++syncRawMaterialDeliveryInformationToERP");
remoteWmsService.synchronizeRawReturnInformationToERP(SecurityConstants.INNER); remoteWmsService.synchronizeRawReturnInformationToERP(SecurityConstants.INNER);
} }
public void synchronizeProductInstockInformationToERP(Integer days){ public void synchronizeProductInstockInformationToERP(Integer days){
System.out.println("++定时同步成品入库信息给ERP++synchronizeProductInstockInformationToERP"); System.out.println(new Date()+"++定时同步成品入库信息给ERP++synchronizeProductInstockInformationToERP");
remoteWmsService.synchronizeProductInstockInformationToERP(days, SecurityConstants.INNER); remoteWmsService.synchronizeProductInstockInformationToERP(days, SecurityConstants.INNER);
} }
public void synchronizeProductOutstockInformationToERP(Integer days){ public void synchronizeProductOutstockInformationToERP(Integer days){
System.out.println("++定时同步成品出库信息给ERP++synchronizeProductOutstockInformationToERP"); System.out.println(new Date()+"++定时同步成品出库信息给ERP++synchronizeProductOutstockInformationToERP");
remoteWmsService.synchronizeProductOutstockInformationToERP(days, SecurityConstants.INNER); remoteWmsService.synchronizeProductOutstockInformationToERP(days, SecurityConstants.INNER);
} }
@ -176,4 +179,12 @@ public class RyTask
public void generateProduceStatisticsDetail(){ public void generateProduceStatisticsDetail(){
remoteMesService.generateProduceStatisticsDetail(SecurityConstants.INNER); remoteMesService.generateProduceStatisticsDetail(SecurityConstants.INNER);
} }
/**
* syspointrouter
*/
public void processActivityEmailNotify(){
remoteSysCommonService.processActivityEmailNotify(SecurityConstants.INNER);
}
} }

@ -239,6 +239,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
routerAddressDetailJson.put("alarmInfoId", alarmInfoId); routerAddressDetailJson.put("alarmInfoId", alarmInfoId);
sysPointRouter.setRouterAddressDetail(routerAddressDetailJson.toString()); sysPointRouter.setRouterAddressDetail(routerAddressDetailJson.toString());
sysPointRouter.setRemark("库存不足报警"); sysPointRouter.setRemark("库存不足报警");
sysPointRouter.setProcessActivityId(SystemConstants.PROCESS_ACTIVITY_ID_STOCK_NOTENOUGH);
sysPointRouter.setCreateBy(nickName); sysPointRouter.setCreateBy(nickName);
sysPointRouter.setCreateTime(currentDate); sysPointRouter.setCreateTime(currentDate);
return sysPointRouter; return sysPointRouter;

@ -673,6 +673,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
sysPointRouter.setModuleCode("MES"); sysPointRouter.setModuleCode("MES");
sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM); sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM);
sysPointRouter.setRouterAddress("/mes/plan/productOrder"); sysPointRouter.setRouterAddress("/mes/plan/productOrder");
sysPointRouter.setProcessActivityId(SystemConstants.PROCESS_ACTIVITY_ID_PRODUCT_ORDER_OVERTIME);
if(productOrderId!=null){ if(productOrderId!=null){
JSONObject routerAddressDetailJson = new JSONObject(); JSONObject routerAddressDetailJson = new JSONObject();
routerAddressDetailJson.put("productOrderId", productOrderId); routerAddressDetailJson.put("productOrderId", productOrderId);

@ -656,6 +656,7 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
sysPointRouter.setModuleCode("MES"); sysPointRouter.setModuleCode("MES");
sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM); sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM);
sysPointRouter.setRouterAddress("/mes/plan/purchaseOrder"); sysPointRouter.setRouterAddress("/mes/plan/purchaseOrder");
sysPointRouter.setProcessActivityId(SystemConstants.PROCESS_ACTIVITY_ID_PURCHASEORDER_OVERTIME);
if(purchaseOrderId!=null){ if(purchaseOrderId!=null){
JSONObject routerAddressDetailJson = new JSONObject(); JSONObject routerAddressDetailJson = new JSONObject();
routerAddressDetailJson.put("purchaseOrderId", purchaseOrderId); routerAddressDetailJson.put("purchaseOrderId", purchaseOrderId);

@ -374,6 +374,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
sysPointRouter.setModuleCode("MES"); sysPointRouter.setModuleCode("MES");
sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM); sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM);
sysPointRouter.setRouterAddress("/mes/plan/saleOrder"); sysPointRouter.setRouterAddress("/mes/plan/saleOrder");
sysPointRouter.setProcessActivityId(SystemConstants.PROCESS_ACTIVITY_ID_SALE_ORDER_OVERTIME);
if (saleOrderId != null) { if (saleOrderId != null) {
JSONObject routerAddressDetailJson = new JSONObject(); JSONObject routerAddressDetailJson = new JSONObject();
routerAddressDetailJson.put("saleOrderId", saleOrderId); routerAddressDetailJson.put("saleOrderId", saleOrderId);

@ -113,4 +113,13 @@ public class SysPointRouterController extends BaseController {
} }
/**
* syspointrouter
*/
@PostMapping(("/processActivityEmailNotify"))
public AjaxResult processActivityEmailNotify() {
return toAjax(sysPointRouterService.processActivityEmailNotify());
}
} }

@ -58,4 +58,14 @@ public interface SysPointRouterMapper
* @return * @return
*/ */
public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds); public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds);
/**
* ,使
*
* @param sysPointRouter
* @return
*/
public List<SysPointRouter> selectEmailNotifySysPointRouterList(SysPointRouter sysPointRouter);
} }

@ -65,4 +65,9 @@ public interface ISysPointRouterService
* @return * @return
*/ */
public int insertSysPointRouterList(List<SysPointRouter> sysPointRouterList); public int insertSysPointRouterList(List<SysPointRouter> sysPointRouterList);
/**
* Email
*/
public int processActivityEmailNotify();
} }

@ -1,9 +1,18 @@
package com.hw.system.common.service.impl; package com.hw.system.common.service.impl;
import java.rmi.ServerException; import java.rmi.ServerException;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.MailUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.system.api.domain.SysUser;
import com.hw.system.common.mapper.WfProcessActivityAuthMapper;
import com.hw.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.system.common.mapper.SysPointRouterMapper; import com.hw.system.common.mapper.SysPointRouterMapper;
@ -22,6 +31,9 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
@Autowired @Autowired
private SysPointRouterMapper sysPointRouterMapper; private SysPointRouterMapper sysPointRouterMapper;
@Autowired
private SysUserMapper sysUserMapper;
/** /**
* *
* *
@ -92,6 +104,7 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
/** /**
* List * List
*
* @param sysPointRouterList * @param sysPointRouterList
* @return * @return
*/ */
@ -104,4 +117,38 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
return 1; return 1;
} }
/**
* Email
*/
@Override
public int processActivityEmailNotify() {
SysPointRouter queryPointRouter = new SysPointRouter();
List<SysPointRouter> sysPointRouterList = sysPointRouterMapper.selectEmailNotifySysPointRouterList(queryPointRouter);
//根据流程节点ID group
Map<Long, List<SysPointRouter>> sysPointRouterMap = sysPointRouterList.stream()
.filter(spo->spo.getProcessActivityId()!=null).collect(Collectors.groupingBy(SysPointRouter::getProcessActivityId));
for (Long processActivityId : sysPointRouterMap.keySet()) {
List<SysPointRouter> sysPointRoutersByActivityList = sysPointRouterMap.get(processActivityId);
List<SysUser> sysUsers = sysUserMapper.selectProcessActivityAuthUserList(processActivityId);
String sendMsg = "";
for (SysPointRouter sysPointRouter : sysPointRoutersByActivityList) {
sendMsg += sysPointRouter.getRemark() + ";";
sysPointRouter.setSentEmailFlag("1");
sysPointRouter.setUpdateTime(new Date());
// sysPointRouter.setUpdateBy(SecurityUtils.getLoginUser().getNickname());
sysPointRouterMapper.updateSysPointRouter(sysPointRouter);
}
for (SysUser sysUser : sysUsers) {
if (StringUtils.isNotEmpty(sysUser.getEmail())) {
MailUtils.processSendEmail(sysUser.getEmail(), "通知", sendMsg);
}
}
}
return 1;
}
} }

@ -129,4 +129,13 @@ public interface SysUserMapper
public List<SysUser> selectnoperList(SysUser user); public List<SysUser> selectnoperList(SysUser user);
/**
* ID
* @param user
* @return
*/
public List<SysUser> selectProcessActivityAuthUserList(Long processActivityId);
} }

@ -235,4 +235,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nickName != null">and u.nick_name like concat('%', #{nickName} ,'%')</if> <if test="nickName != null">and u.nick_name like concat('%', #{nickName} ,'%')</if>
${params.dataScope} ${params.dataScope}
</select> </select>
<select id="selectProcessActivityAuthUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber,
u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u
where u.del_flag = '0' and exists (select 1 from wf_process_activity_auth wpau where wpau.auth_target_id = u.user_id AND wpau.process_activity_id = #{processActivityId})
</select>
</mapper> </mapper>

@ -16,6 +16,9 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="processActivityId" column="process_activity_id"/>
<result property="emailFlag" column="email_flag"/>
<result property="sentEmailFlag" column="sent_email_flag"/>
</resultMap> </resultMap>
<sql id="selectSysPointRouterVo"> <sql id="selectSysPointRouterVo">
@ -29,7 +32,8 @@
create_by, create_by,
create_time, create_time,
update_by, update_by,
update_time update_time,
process_activity_id
from sys_point_router from sys_point_router
</sql> </sql>
@ -68,6 +72,7 @@
<if test="routerAddressDetail != null">router_address_detail,</if> <if test="routerAddressDetail != null">router_address_detail,</if>
<if test="routerFlag != null">router_flag,</if> <if test="routerFlag != null">router_flag,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="processActivityId != null">process_activity_id,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@ -80,6 +85,7 @@
<if test="routerAddressDetail != null">#{routerAddressDetail},</if> <if test="routerAddressDetail != null">#{routerAddressDetail},</if>
<if test="routerFlag != null">#{routerFlag},</if> <if test="routerFlag != null">#{routerFlag},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="processActivityId != null">#{processActivityId},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@ -96,6 +102,8 @@
<if test="routerAddressDetail != null">router_address_detail = #{routerAddressDetail},</if> <if test="routerAddressDetail != null">router_address_detail = #{routerAddressDetail},</if>
<if test="routerFlag != null">router_flag = #{routerFlag},</if> <if test="routerFlag != null">router_flag = #{routerFlag},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="emailFlag != null">email_flag = #{emailFlag},</if>
<if test="sentEmailFlag != null">sent_email_flag = #{sentEmailFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
@ -116,4 +124,16 @@
#{pointRouterId} #{pointRouterId}
</foreach> </foreach>
</delete> </delete>
<select id="selectEmailNotifySysPointRouterList" parameterType="SysPointRouter" resultMap="SysPointRouterResult">
<include refid="selectSysPointRouterVo"/>
<where>
email_flag ='1' and sent_email_flag = '0'
</where>
order by create_time desc
</select>
</mapper> </mapper>

@ -250,7 +250,7 @@ public class WmsApiController extends BaseController {
} }
/** /**
* ERP * ERPrawoutstockdetailERP
* *
* @return * @return
*/ */

@ -125,6 +125,8 @@ public class WmsRawInstock extends BaseEntity
private String materialName; private String materialName;
private String materialSpec;
/** 计量单位编号 */ /** 计量单位编号 */
private String unitCode; private String unitCode;
@ -401,6 +403,14 @@ public class WmsRawInstock extends BaseEntity
this.materialName = materialName; this.materialName = materialName;
} }
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getSrcBillNo() { public String getSrcBillNo() {
return srcBillNo; return srcBillNo;
} }

@ -90,6 +90,10 @@ public class WmsRawOutstockDetail extends BaseEntity {
@Excel(name = "同步ERP状态(0:失败,1成功)") @Excel(name = "同步ERP状态(0:失败,1成功)")
private String erpStatus; private String erpStatus;
/** 同步给ERP的数量 */
@Excel(name = "同步给ERP的数量")
private BigDecimal erpAmount;
/** /**
* *
*/ */
@ -146,6 +150,10 @@ public class WmsRawOutstockDetail extends BaseEntity {
private String materialName; private String materialName;
private String materialSpec;
private String barcodeSpec;
private String applyBy; private String applyBy;
private Date applyDate; private Date applyDate;
@ -162,6 +170,17 @@ public class WmsRawOutstockDetail extends BaseEntity {
/**仓库总库存信息ID*/ /**仓库总库存信息ID*/
private Long stockTotalId; private Long stockTotalId;
private String taskTypeStr;
/** 单价 */
private BigDecimal price;
/** 规格参数 */
private String specificationParameter;
/** 计量单位编号 */
private String unitCode;
public void setRawOutstockDetailId(Long rawOutstockDetailId) { public void setRawOutstockDetailId(Long rawOutstockDetailId) {
this.rawOutstockDetailId = rawOutstockDetailId; this.rawOutstockDetailId = rawOutstockDetailId;
@ -259,6 +278,14 @@ public class WmsRawOutstockDetail extends BaseEntity {
return erpStatus; return erpStatus;
} }
public BigDecimal getErpAmount() {
return erpAmount;
}
public void setErpAmount(BigDecimal erpAmount) {
this.erpAmount = erpAmount;
}
public void setOutstockPerson(String outstockPerson) { public void setOutstockPerson(String outstockPerson) {
this.outstockPerson = outstockPerson; this.outstockPerson = outstockPerson;
} }
@ -339,6 +366,22 @@ public class WmsRawOutstockDetail extends BaseEntity {
this.materialName = materialName; this.materialName = materialName;
} }
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getBarcodeSpec() {
return barcodeSpec;
}
public void setBarcodeSpec(String barcodeSpec) {
this.barcodeSpec = barcodeSpec;
}
public String getApplyBy() { public String getApplyBy() {
return applyBy; return applyBy;
} }
@ -403,6 +446,38 @@ public class WmsRawOutstockDetail extends BaseEntity {
this.stockTotalId = stockTotalId; this.stockTotalId = stockTotalId;
} }
public String getTaskTypeStr() {
return taskTypeStr;
}
public void setTaskTypeStr(String taskTypeStr) {
this.taskTypeStr = taskTypeStr;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getSpecificationParameter() {
return specificationParameter;
}
public void setSpecificationParameter(String specificationParameter) {
this.specificationParameter = specificationParameter;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -105,6 +105,8 @@ public class WmsRawReturnDetail extends BaseEntity
private String materialSpec; private String materialSpec;
private String barcodeSpec;
private String applyBy; private String applyBy;
private String taskType; private String taskType;
@ -321,6 +323,14 @@ public class WmsRawReturnDetail extends BaseEntity
this.materialSpec = materialSpec; this.materialSpec = materialSpec;
} }
public String getBarcodeSpec() {
return barcodeSpec;
}
public void setBarcodeSpec(String barcodeSpec) {
this.barcodeSpec = barcodeSpec;
}
public String getApplyBy() { public String getApplyBy() {
return applyBy; return applyBy;
} }

@ -92,4 +92,12 @@ public interface WmsRawOutstockDetailMapper {
public int selectCountOfWmsRawOutstockDetail(WmsRawOutstockDetail wmsRawOutstockDetail); public int selectCountOfWmsRawOutstockDetail(WmsRawOutstockDetail wmsRawOutstockDetail);
/**
* ERPdetailList
*
* @param wmsRawOutstockDetail
* @return
*/
public List<WmsRawOutstockDetail> selectWmsRawOutstockDetailERPNotSynchronized(WmsRawOutstockDetail wmsRawOutstockDetail);
} }

@ -44,6 +44,9 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
@Autowired @Autowired
private WmsRawOutstockMapper wmsRawOutstockMapper; private WmsRawOutstockMapper wmsRawOutstockMapper;
@Autowired
private WmsRawOutstockDetailMapper wmsRawOutstockDetailMapper;
@Autowired @Autowired
private WmsProductInstockMapper wmsProductInstockMapper; private WmsProductInstockMapper wmsProductInstockMapper;
@ -71,7 +74,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return * @return
*/ */
@Override @Override
// @Transactional @Transactional
public int synchronizeInventoryInformationToERP() { public int synchronizeInventoryInformationToERP() {
WmsRawInstock wmsRawInstock = new WmsRawInstock(); WmsRawInstock wmsRawInstock = new WmsRawInstock();
int result = 0; int result = 0;
@ -105,9 +108,24 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
rawInstock.setUpdateDate(DateUtils.getNowDate()); rawInstock.setUpdateDate(DateUtils.getNowDate());
wmsRawInstockMapper.updateWmsRawInstock(rawInstock); wmsRawInstockMapper.updateWmsRawInstock(rawInstock);
} }
data.put("FDate", DateUtils.getTime());
String fdate = DateUtils.getTime();
if (instock.getApplyDate() != null) {
fdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, instock.getApplyDate());
}
String specificationParameter = instock.getSpecificationParameter();
if(StringUtils.isEmpty(specificationParameter)){
specificationParameter = instock.getMaterialSpec();
}
if(StringUtils.isEmpty(specificationParameter)){
specificationParameter = "无";
}
data.put("FDate", fdate);
data.put("FMaterialId", instock.getMaterialCode()); data.put("FMaterialId", instock.getMaterialCode());
data.put("FAuxPropId", instock.getSpecificationParameter()); data.put("FAuxPropId", specificationParameter);
data.put("FSrcBillNo", instock.getSrcBillNo()); data.put("FSrcBillNo", instock.getSrcBillNo());
data.put("FUnitID", instock.getUnitCode()); data.put("FUnitID", instock.getUnitCode());
data.put("FRealQty", FRealQty); data.put("FRealQty", FRealQty);
@ -115,17 +133,23 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
data.put("FSupplierCode", supplierCode); data.put("FSupplierCode", supplierCode);
data.put("FTondBase", projectNo); data.put("FTondBase", projectNo);
String params = data.toJSONString(); String params = data.toJSONString();
R<AjaxResult> paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER); try {
String paramsResultData = paramsResult.getMsg(); R<AjaxResult> paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER);
JSONObject jsonObject = JSONObject.parseObject(paramsResultData); String paramsResultData = paramsResult.getMsg();
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
if (isSuccess) { Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
result++; if (isSuccess) {
log.info("synchronizeInventoryInformationToERP同步原材料入库成功:" + paramsResult.toString()); result++;
} else { log.info("synchronizeInventoryInformationToERP同步原材料入库成功:" + paramsResult.toString());
log.error("synchronizeInventoryInformationToERP同步原材料入库失败:" + paramsResult.toString()); } else {
throw new ServiceException("同步原材料入库失败" + paramsResult.toString()); log.error("synchronizeInventoryInformationToERP同步原材料入库失败:" + paramsResult.toString());
throw new RuntimeException("同步原材料入库失败" + paramsResult.toString());
}
} catch (Exception e) {
log.error("同步原材料入库失败" + e.getMessage());
throw new RuntimeException("同步原材料入库失败" + e.getMessage());
} }
} }
/** /**
@ -134,21 +158,24 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return * @return
*/ */
@Override @Override
@Transactional
public int synchronizeRawMaterialDeliveryInformationToERP() { public int synchronizeRawMaterialDeliveryInformationToERP() {
int result = 0; int result = 0;
WmsRawOutstock otherRawOutstock = new WmsRawOutstock(); //领料
otherRawOutstock.setTaskTypeStr(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL WmsRawOutstockDetail otherRawOutstockDetail = new WmsRawOutstockDetail();
+ "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER); otherRawOutstockDetail.setTaskTypeStr(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL
List<WmsRawOutstock> otherRawOutstockList = wmsRawOutstockMapper.selectWmsRawOutstockERPNotSynchronized(otherRawOutstock); + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_AUTO_OUTSTOCK + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER);
Map<Long, List<WmsRawOutstock>> otherMaterialIdMap = otherRawOutstockList.stream().collect(Collectors.groupingBy(WmsRawOutstock::getMaterialId)); List<WmsRawOutstockDetail> otherRawOutstockDetailList = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailERPNotSynchronized(otherRawOutstockDetail);
Map<Long, List<WmsRawOutstockDetail>> otherMaterialIdMap = otherRawOutstockDetailList.stream().collect(Collectors.groupingBy(WmsRawOutstockDetail::getMaterialId));
for (Long materialId : otherMaterialIdMap.keySet()) { for (Long materialId : otherMaterialIdMap.keySet()) {
result += syncOutstockInformation(otherMaterialIdMap, materialId, ""); result += syncOutstockInformation(otherMaterialIdMap, materialId, "");
} }
WmsRawOutstock returnRawOutstock = new WmsRawOutstock(); //退货出库
returnRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK); WmsRawOutstockDetail returnRawOutstockDetail = new WmsRawOutstockDetail();
List<WmsRawOutstock> returnOutstockList = wmsRawOutstockMapper.selectWmsRawOutstockERPNotSynchronized(returnRawOutstock); returnRawOutstockDetail.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK);
Map<Long, List<WmsRawOutstock>> returnMaterialIdMap = returnOutstockList.stream().collect(Collectors.groupingBy(WmsRawOutstock::getMaterialId)); List<WmsRawOutstockDetail> returnRawOutstockDetailList = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailERPNotSynchronized(returnRawOutstockDetail);
Map<Long, List<WmsRawOutstockDetail>> returnMaterialIdMap = returnRawOutstockDetailList.stream().collect(Collectors.groupingBy(WmsRawOutstockDetail::getMaterialId));
for (Long materialId : returnMaterialIdMap.keySet()) { for (Long materialId : returnMaterialIdMap.keySet()) {
result += syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK); result += syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK);
} }
@ -162,7 +189,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return * @return
*/ */
@Override @Override
// @Transactional @Transactional
public int synchronizeRawReturnInformationToERP() { public int synchronizeRawReturnInformationToERP() {
WmsRawReturnDetail wmsRawReturnDetail = new WmsRawReturnDetail(); WmsRawReturnDetail wmsRawReturnDetail = new WmsRawReturnDetail();
int result = 0; int result = 0;
@ -191,25 +218,35 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
double FRealQty = wmsRawReturnDetaiList.stream().mapToDouble(item -> item.getReturnAmount().subtract(item.getErpAmount()).doubleValue()).sum(); double FRealQty = wmsRawReturnDetaiList.stream().mapToDouble(item -> item.getReturnAmount().subtract(item.getErpAmount()).doubleValue()).sum();
WmsRawReturnDetail rawReturnDetail = wmsRawReturnDetaiList.get(0); WmsRawReturnDetail rawReturnDetail = wmsRawReturnDetaiList.get(0);
String specificationParameter = StringUtils.isNotEmpty(mesPurchaseOrder.getSpecificationParameter()) ? mesPurchaseOrder.getSpecificationParameter() : rawReturnDetail.getMaterialSpec(); String specificationParameter = StringUtils.isNotEmpty(mesPurchaseOrder.getSpecificationParameter()) ?
if (StringUtils.isNotEmpty(specificationParameter)) { mesPurchaseOrder.getSpecificationParameter() : rawReturnDetail.getMaterialSpec();
if (StringUtils.isEmpty(specificationParameter)) {
specificationParameter = "无";
}
for (WmsRawReturnDetail wmsRawReturnDetail : wmsRawReturnDetaiList) { for (WmsRawReturnDetail wmsRawReturnDetail : wmsRawReturnDetaiList) {
wmsRawReturnDetail.setErpStatus("1");//同步ERP状态(0:失败,1成功) wmsRawReturnDetail.setErpStatus("1");//同步ERP状态(0:失败,1成功)
wmsRawReturnDetail.setErpAmount(wmsRawReturnDetail.getReturnAmount()); wmsRawReturnDetail.setErpAmount(wmsRawReturnDetail.getReturnAmount());
wmsRawReturnDetail.setUpdateDate(DateUtils.getNowDate()); wmsRawReturnDetail.setUpdateDate(DateUtils.getNowDate());
wmsRawReturnDetailMapper.updateWmsRawReturnDetail(wmsRawReturnDetail); wmsRawReturnDetailMapper.updateWmsRawReturnDetail(wmsRawReturnDetail);
} }
data.put("FDate", DateUtils.getTime());
data.put("FMaterialId", rawReturnDetail.getMaterialCode()); String fdate = DateUtils.getTime();
data.put("FAuxPropId", specificationParameter); if (rawReturnDetail.getReturnTime() != null) {
data.put("FSrcBillNo", srcBillNo); fdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, rawReturnDetail.getReturnTime());
data.put("FUnitID", rawReturnDetail.getUnitCode()); }
data.put("FRealQty", FRealQty);
data.put("FStockId", wmsConfig.getfStockId()); data.put("FDate", fdate);
data.put("FSupplierCode", supplierCode); data.put("FMaterialId", rawReturnDetail.getMaterialCode());
data.put("FTondBase", projectNo); data.put("FAuxPropId", specificationParameter);
String params = data.toJSONString(); data.put("FSrcBillNo", srcBillNo);
data.put("FUnitID", rawReturnDetail.getUnitCode());
data.put("FRealQty", FRealQty);
data.put("FStockId", wmsConfig.getfStockId());
data.put("FSupplierCode", supplierCode);
data.put("FTondBase", projectNo);
String params = data.toJSONString();
try {
R<AjaxResult> paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER); R<AjaxResult> paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER);
String paramsResultData = paramsResult.getMsg(); String paramsResultData = paramsResult.getMsg();
JSONObject jsonObject = JSONObject.parseObject(paramsResultData); JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
@ -221,27 +258,31 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
log.error("synchronizeInventoryInformationToERP同步原材料退库失败:" + paramsResult.toString()); log.error("synchronizeInventoryInformationToERP同步原材料退库失败:" + paramsResult.toString());
throw new ServiceException("同步原材料入库失败" + paramsResult.toString()); throw new ServiceException("同步原材料入库失败" + paramsResult.toString());
} }
} catch (Exception e) {
log.error("synchronizeInventoryInformationToERP同步原材料退库失败:" + e.getMessage());
throw new ServiceException("同步原材料入库失败" + e.getMessage());
} }
} }
} }
@Transactional(propagation = Propagation.REQUIRES_NEW) @Transactional(propagation = Propagation.REQUIRES_NEW)
public int syncOutstockInformation(Map<Long, List<WmsRawOutstock>> materialIdMap, Long materialId, String taskType) { public int syncOutstockInformation(Map<Long, List<WmsRawOutstockDetail>> materialIdMap, Long materialId, String taskType) {
int result = 0; int result = 0;
List<WmsRawOutstock> wmsRawOutstockList = materialIdMap.get(materialId); List<WmsRawOutstockDetail> wmsRawOutstockDetailList = materialIdMap.get(materialId);
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
double FRealQty = wmsRawOutstockList.stream().mapToDouble(item -> item.getRealOutstockAmount().subtract(item.getErpAmount()).doubleValue()).sum(); double FRealQty = wmsRawOutstockDetailList.stream().mapToDouble(item -> item.getOutstockAmount().subtract(item.getErpAmount()).doubleValue()).sum();
WmsRawOutstock outstock = wmsRawOutstockList.get(0); WmsRawOutstockDetail outstockDetail = wmsRawOutstockDetailList.get(0);
for (WmsRawOutstock wmsRawOutstock : wmsRawOutstockList) { for (WmsRawOutstockDetail wmsRawOutstockDetail : wmsRawOutstockDetailList) {
if (wmsRawOutstock.getRealOutstockAmount().equals(wmsRawOutstock.getOutstockAmount())) { if (wmsRawOutstockDetail.getPlanAmount().equals(wmsRawOutstockDetail.getOutstockAmount())) {
wmsRawOutstock.setErpStatus("1");//同步ERP状态(0:失败,1成功,2同步中) wmsRawOutstockDetail.setErpStatus("1");//同步ERP状态(0:失败,1成功,2同步中)
} else { } else {
wmsRawOutstock.setErpStatus("2");//同步ERP状态(0:失败,1成功,2同步中) wmsRawOutstockDetail.setErpStatus("2");//同步ERP状态(0:失败,1成功,2同步中)
} }
wmsRawOutstock.setErpAmount(wmsRawOutstock.getRealOutstockAmount()); wmsRawOutstockDetail.setErpAmount(wmsRawOutstockDetail.getOutstockAmount());
wmsRawOutstock.setUpdateDate(DateUtils.getNowDate()); wmsRawOutstockDetail.setUpdateDate(DateUtils.getNowDate());
wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock); wmsRawOutstockDetailMapper.updateWmsRawOutstockDetail(wmsRawOutstockDetail);
} }
if (StringUtils.isNotEmpty(taskType) && taskType.equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK)) { if (StringUtils.isNotEmpty(taskType) && taskType.equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK)) {
@ -251,27 +292,48 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
} }
// model.put("F_TOND_Combo", "一般领料"); //领料类型(必填项) // model.put("F_TOND_Combo", "一般领料"); //领料类型(必填项)
data.put("FDate", DateUtils.getTime()); String fdate = DateUtils.getTime();
data.put("FMaterialId", outstock.getMaterialCode()); if (outstockDetail.getOutstockTime() != null) {
data.put("FAuxPropId", outstock.getSpecificationParameter() == null ? "" : outstock.getSpecificationParameter()); fdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, outstockDetail.getOutstockTime());
data.put("FUnitID", outstock.getUnitCode()); }
String barcodeSpec = outstockDetail.getBarcodeSpec();
String materialSpec = outstockDetail.getMaterialSpec();
if(StringUtils.isEmpty(barcodeSpec)){
if(StringUtils.isNotEmpty(materialSpec)){
barcodeSpec = materialSpec;
}else{
barcodeSpec = "无";
}
}
data.put("FDate", fdate);
data.put("FMaterialId", outstockDetail.getMaterialCode());
data.put("FAuxPropId", barcodeSpec);
data.put("FUnitID", outstockDetail.getUnitCode());
data.put("FQty", FRealQty); data.put("FQty", FRealQty);
data.put("FPrice", outstock.getPrice()); data.put("FPrice", outstockDetail.getPrice());
data.put("FStockId", wmsConfig.getfStockId()); data.put("FStockId", wmsConfig.getfStockId());
String params = data.toJSONString(); String params = data.toJSONString();
R<AjaxResult> paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER); try {
String paramsResultData = paramsResult.getMsg(); R<AjaxResult> paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER);
JSONObject jsonObject = JSONObject.parseObject(paramsResultData); String paramsResultData = paramsResult.getMsg();
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
if (isSuccess) { Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
result++; if (isSuccess) {
log.info("synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult.toString()); result++;
} else { log.info("synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult.toString());
log.error("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString()); } else {
throw new RuntimeException("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString()); log.error("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString());
throw new RuntimeException("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString());
}
return result;
} catch (Exception e) {
log.error("synchronizeRawMaterialDeliveryInformationToERP失败:" + e.getMessage());
throw new RuntimeException("synchronizeRawMaterialDeliveryInformationToERP失败:" + e.getMessage());
} }
return result;
} }
/** /**
@ -311,24 +373,41 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
wmsProductInstockMapper.updateWmsProductInstock(wmsProductInstock); wmsProductInstockMapper.updateWmsProductInstock(wmsProductInstock);
} }
data.put("FDate", DateUtils.getTime()); String fdate = DateUtils.getTime();
if (instock.getApplyDate() != null) {
fdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, instock.getApplyDate());
}
String specificationParameter = StringUtils.isNotEmpty(instock.getSpecificationParameter()) ?
instock.getSpecificationParameter() : instock.getMaterialSpec();
if (StringUtils.isEmpty(specificationParameter)) {
specificationParameter = "无";
}
data.put("FDate", fdate);
data.put("FMaterialId", instock.getMaterialCode()); data.put("FMaterialId", instock.getMaterialCode());
data.put("FAuxPropId", instock.getSpecificationParameter() == null ? "B" : instock.getSpecificationParameter()); data.put("FAuxPropId", specificationParameter);
data.put("FUnitID", instock.getUnitCode()); data.put("FUnitID", instock.getUnitCode());
data.put("FQty", FRealQty); data.put("FQty", FRealQty);
data.put("FPrice", instock.getPrice()); data.put("FPrice", instock.getPrice());
data.put("FStockId", wmsConfig.getfStockId()); data.put("FStockId", wmsConfig.getfStockId());
String params = data.toJSONString(); String params = data.toJSONString();
R<AjaxResult> paramsResult = remoteJindieService.saveOtherInStorage(params, SecurityConstants.INNER); try {
String paramsResultData = paramsResult.getMsg(); R<AjaxResult> paramsResult = remoteJindieService.saveOtherInStorage(params, SecurityConstants.INNER);
JSONObject jsonObject = JSONObject.parseObject(paramsResultData); String paramsResultData = paramsResult.getMsg();
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
if (isSuccess) { Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
result++; if (isSuccess) {
log.info("synchronizeProductInstockInformationToERP成功:" + paramsResult.toString()); result++;
} else { log.info("synchronizeProductInstockInformationToERP成功:" + paramsResult.toString());
log.error("synchronizeProductInstockInformationToERP失败:" + paramsResult.toString()); } else {
throw new RuntimeException("synchronizeProductInstockInformationToERP失败:" + paramsResult.toString()); log.error("synchronizeProductInstockInformationToERP失败:" + paramsResult.toString());
throw new RuntimeException("synchronizeProductInstockInformationToERP失败:" + paramsResult.toString());
}
} catch (Exception e) {
log.error("synchronizeProductInstockInformationToERP失败:" + e.getMessage());
throw new RuntimeException("synchronizeProductInstockInformationToERP失败:" + e.getMessage());
} }
} }
@ -368,26 +447,44 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
wmsProductOutstock.setUpdateDate(DateUtils.getNowDate()); wmsProductOutstock.setUpdateDate(DateUtils.getNowDate());
wmsProductOutstockMapper.updateWmsProductOutstock(wmsProductOutstock); wmsProductOutstockMapper.updateWmsProductOutstock(wmsProductOutstock);
} }
data.put("FDate", DateUtils.getTime());
String fdate = DateUtils.getTime();
if (outstock.getApplyDate() != null) {
fdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, outstock.getApplyDate());
}
String specificationParameter = StringUtils.isNotEmpty(outstock.getSpecificationParameter()) ?
outstock.getSpecificationParameter() : outstock.getMaterialSpec();
if (StringUtils.isEmpty(specificationParameter)) {
specificationParameter = "无";
}
data.put("FDate", fdate);
data.put("FMaterialId", outstock.getMaterialCode()); data.put("FMaterialId", outstock.getMaterialCode());
data.put("FAuxPropId", outstock.getSpecificationParameter() == null ? "无" : outstock.getSpecificationParameter()); data.put("FAuxPropId", specificationParameter);
data.put("FUnitID", outstock.getUnitCode()); data.put("FUnitID", outstock.getUnitCode());
data.put("FQty", FRealQty); data.put("FQty", FRealQty);
data.put("FPrice", outstock.getPrice()); data.put("FPrice", outstock.getPrice());
data.put("FStockId", wmsConfig.getfStockId()); data.put("FStockId", wmsConfig.getfStockId());
data.put("FTONDCombo", "一般领料"); data.put("FTONDCombo", "一般领料");
String params = data.toJSONString(); String params = data.toJSONString();
R<AjaxResult> paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER); try {
String paramsResultData = paramsResult.getMsg(); R<AjaxResult> paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER);
JSONObject jsonObject = JSONObject.parseObject(paramsResultData); String paramsResultData = paramsResult.getMsg();
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
if (isSuccess) { Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
result++; if (isSuccess) {
result++;
log.info("synchronizeProductOutstockInformationToERP成功:" + paramsResult.toString()); log.info("synchronizeProductOutstockInformationToERP成功:" + paramsResult.toString());
} else { } else {
log.error("synchronizeProductOutstockInformationToERP失败:" + paramsResult.toString()); log.error("synchronizeProductOutstockInformationToERP失败:" + paramsResult.toString());
throw new RuntimeException("synchronizeProductOutstockInformationToERP失败:" + paramsResult.toString()); throw new RuntimeException("synchronizeProductOutstockInformationToERP失败:" + paramsResult.toString());
}
} catch (Exception e) {
log.error("synchronizeProductOutstockInformationToERP失败:" + e.getMessage());
throw new RuntimeException("synchronizeProductOutstockInformationToERP失败:" + e.getMessage());
} }
} }

@ -239,11 +239,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wpi.plan_code, wpi.plan_code,
wpi.instock_type, wpi.instock_type,
wpi.product_id, wpi.product_id,
wpi.apply_date,
wpi.instock_amount, wpi.instock_amount,
wpi.execute_status, wpi.execute_status,
wpi.erp_status, wpi.erp_status,
if(wpi.erp_amount is null, 0, wpi.erp_amount) erp_amount, if(wpi.erp_amount is null, 0, wpi.erp_amount) erp_amount,
mbmi.material_code, mbmi.material_code,
mbmi.material_spec,
mbui.unit_code, mbui.unit_code,
mso.price, mso.price,
mso.specification_parameter mso.specification_parameter

@ -322,6 +322,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wpo.erp_status, wpo.erp_status,
if(wpo.erp_amount is null, 0, wpo.erp_amount) erp_amount, if(wpo.erp_amount is null, 0, wpo.erp_amount) erp_amount,
mbmi.material_code, mbmi.material_code,
mbmi.material_spec,
mbui.unit_code, mbui.unit_code,
mso.price, mso.price,
mso.specification_parameter mso.specification_parameter

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialSpec" column="material_spec" />
<result property="unitCode" column="unit_code" /> <result property="unitCode" column="unit_code" />
<result property="warehouseCode" column="warehouse_code" /> <result property="warehouseCode" column="warehouse_code" />
<result property="specificationParameter" column="specification_parameter" /> <result property="specificationParameter" column="specification_parameter" />
@ -214,7 +215,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wri.material_id, wri.material_id,
wri.po_no, wri.po_no,
wri.purchase_order_id, wri.purchase_order_id,
wri.apply_date,
mpo.specification_parameter, mpo.specification_parameter,
mbmi.material_spec,
mpo.src_bill_no, mpo.src_bill_no,
mbmi.material_code, mbmi.material_code,
mbui.unit_code, mbui.unit_code,

@ -33,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="taskType" column="task_type" /> <result property="taskType" column="task_type" />
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialSpec" column="material_spec" />
<result property="barcodeSpec" column="barcode_spec" />
</resultMap> </resultMap>
<sql id="selectWmsRawOutstockDetailVo"> <sql id="selectWmsRawOutstockDetailVo">
@ -130,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="outstockAmount != null">outstock_amount = #{outstockAmount},</if> <if test="outstockAmount != null">outstock_amount = #{outstockAmount},</if>
<if test="executeStatus != null">execute_status = #{executeStatus},</if> <if test="executeStatus != null">execute_status = #{executeStatus},</if>
<if test="erpStatus != null">erp_status = #{erpStatus},</if> <if test="erpStatus != null">erp_status = #{erpStatus},</if>
<if test="erpAmount != null">erp_amount = #{erpAmount},</if>
<if test="outstockPerson != null">outstock_person = #{outstockPerson},</if> <if test="outstockPerson != null">outstock_person = #{outstockPerson},</if>
<if test="outstockTime != null">outstock_time = #{outstockTime},</if> <if test="outstockTime != null">outstock_time = #{outstockTime},</if>
<if test="outstockWay != null">outstock_way = #{outstockWay},</if> <if test="outstockWay != null">outstock_way = #{outstockWay},</if>
@ -208,4 +211,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectWmsRawOutstockDetailERPNotSynchronized" parameterType="WmsRawOutstockDetail" resultMap="WmsRawOutstockDetailResult">
select wrod.raw_outstock_detail_id,
wrod.raw_outstock_id,
wrod.warehouse_id,
wrod.material_barcode,
wrod.material_id,
wrod.outstock_time,
mbmi.material_code,
mbmi.material_spec,
mbbi.barcode_spec,
mbui.unit_code,
wrod.plan_amount,
wrod.outstock_amount,
if(wrod.erp_amount is null, 0, wrod.erp_amount) erp_amount,
wrod.erp_status,
mpo.price,
mpo.specification_parameter
from wms_raw_outstock_detail wrod
left join wms_raw_outstock wro on wrod.raw_outstock_id = wro.raw_outstock_id
left join mes_base_material_info mbmi on mbmi.material_id = wro.material_id
left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id
left join mes_product_plan mpp on mpp.plan_code = wro.plan_code
left join mes_base_barcode_info mbbi on wrod.material_barcode = mbbi.barcode_info
left join mes_purchase_order mpo on mpo.purchase_order_id = mbbi.purchase_order_id
<where>
wrod.outstock_amount > 0
and wrod.plan_amount >= wrod.outstock_amount
and wrod.outstock_amount > if(wrod.erp_amount is null, 0, wrod.erp_amount)
and mbmi.material_classfication = '1'
and mbmi.material_unit_id is not null and mbmi.material_unit_id !=''
and mbbi.purchase_order_id is not null and mbbi.purchase_order_id !=0
<if test="taskTypeStr != null and taskTypeStr != ''"> and wro.task_type in (${taskTypeStr})</if>
<if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if>
</where>
</select>
</mapper> </mapper>

@ -264,7 +264,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select wro.raw_outstock_id, wro.task_code, wro.warehouse_id, wro.location_code, wro.order_id, wro.plan_code, wro.plan_detail_code, wro.station_id,wro.material_batch, select wro.raw_outstock_id, wro.task_code, wro.warehouse_id, wro.location_code, wro.order_id, wro.plan_code, wro.plan_detail_code, wro.station_id,wro.material_batch,
wro.material_id, wro.operation_type, wro.task_type, wro.apply_reason, wro.audit_reason, wro.audit_status, wro.execute_status, wro.apply_by, wro.apply_date, wro.material_id, wro.operation_type, wro.task_type, wro.apply_reason, wro.audit_reason, wro.audit_status, wro.execute_status, wro.apply_by, wro.apply_date,
wro.audit_by, wro.audit_date, wro.update_by, wro.update_date, wro.begin_time, wro.end_time,wro.outstock_amount,wro.real_outstock_amount,wbw.warehouse_name wro.audit_by, wro.audit_date, wro.update_by, wro.update_date, wro.begin_time, wro.end_time,wro.outstock_amount,wro.real_outstock_amount,wbw.warehouse_name
,mbmi.material_code,mbmi.material_name,mbmi.material_spec
from wms_raw_outstock wro left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id from wms_raw_outstock wro left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id
left join mes_base_material_info mbmi on wro.material_id=mbmi.material_id
<where> <where>
<if test="taskCode != null and taskCode != ''"> and wro.task_code like concat('%', #{taskCode}, '%')</if> <if test="taskCode != null and taskCode != ''"> and wro.task_code like concat('%', #{taskCode}, '%')</if>
<if test="warehouseId != null "> and wro.warehouse_id = #{warehouseId}</if> <if test="warehouseId != null "> and wro.warehouse_id = #{warehouseId}</if>
@ -275,6 +277,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="executeStatus != null and executeStatus != ''"> and wro.execute_status = #{executeStatus}</if> <if test="executeStatus != null and executeStatus != ''"> and wro.execute_status = #{executeStatus}</if>
<if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if> <if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if>
<if test="applyBy != null and applyBy != ''"> and wro.apply_by like concat('%', #{applyBy}, '%')</if> <if test="applyBy != null and applyBy != ''"> and wro.apply_by like concat('%', #{applyBy}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
</where> </where>
order by wro.apply_date desc order by wro.apply_date desc
</select> </select>
@ -366,6 +371,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wro.warehouse_id, wro.warehouse_id,
wro.operation_type, wro.operation_type,
wro.material_id, wro.material_id,
wro.apply_date,
mbmi.material_code, mbmi.material_code,
mbui.unit_code, mbui.unit_code,
wro.outstock_amount, wro.outstock_amount,

@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialSpec" column="material_spec" /> <result property="materialSpec" column="material_spec" />
<result property="barcodeSpec" column="barcode_spec" />
<result property="purchaseOrderId" column="purchase_order_id" /> <result property="purchaseOrderId" column="purchase_order_id" />
<result property="unitCode" column="unit_code" /> <result property="unitCode" column="unit_code" />
@ -131,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="returnAmount != null">return_amount = #{returnAmount},</if> <if test="returnAmount != null">return_amount = #{returnAmount},</if>
<if test="executeStatus != null and executeStatus != ''">execute_status = #{executeStatus},</if> <if test="executeStatus != null and executeStatus != ''">execute_status = #{executeStatus},</if>
<if test="erpStatus != null">erp_status = #{erpStatus},</if> <if test="erpStatus != null">erp_status = #{erpStatus},</if>
<if test="erpAmount != null">erp_amount = #{erpAmount},</if>
<if test="returnPerson != null">return_person = #{returnPerson},</if> <if test="returnPerson != null">return_person = #{returnPerson},</if>
<if test="returnTime != null">return_time = #{returnTime},</if> <if test="returnTime != null">return_time = #{returnTime},</if>
<if test="returnWay != null and returnWay != ''">return_way = #{returnWay},</if> <if test="returnWay != null and returnWay != ''">return_way = #{returnWay},</if>
@ -218,11 +220,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsRawReturnDetailERPNotSynchronized" parameterType="WmsRawReturnDetail" resultMap="WmsRawReturnDetailResult"> <select id="selectWmsRawReturnDetailERPNotSynchronized" parameterType="WmsRawReturnDetail" resultMap="WmsRawReturnDetailResult">
select wrrd.raw_return_detail_id, select wrrd.raw_return_detail_id,
wrrd.material_id, wrrd.material_id,
wrrd.return_time,
mbbi.purchase_order_id, mbbi.purchase_order_id,
mbmi.material_spec, mbmi.material_spec,
mbmi.material_code, mbmi.material_code,
mbbi.barcode_spec,
mbui.unit_code, mbui.unit_code,
wrrd.return_amount, wrrd.return_amount,
wrrd.return_time,
if(wrrd.erp_amount is null, 0, wrrd.erp_amount) erp_amount, if(wrrd.erp_amount is null, 0, wrrd.erp_amount) erp_amount,
wrrd.erp_status wrrd.erp_status
from wms_raw_return_detail wrrd from wms_raw_return_detail wrrd

@ -475,7 +475,7 @@ export default {
const poNo = row.poNo; const poNo = row.poNo;
const params = {queryParams: this.queryParams ,t: Date.now()}; const params = {queryParams: this.queryParams ,t: Date.now()};
this.$tab.openPage("订单绑定[" + poNo + "]", '/mes/purchase-order/bind/' + purchaseOrderId +'/'+materialSpec, params); this.$tab.openPage("订单绑定[" + poNo + "]", '/mes/purchase-order/bind/' + purchaseOrderId +'/'+encodeURIComponent(materialSpec), params);
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {

@ -385,7 +385,7 @@ export default {
}, },
handleRouter(row){ handleRouter(row){
let params = {}; let params = {};
if (row.routerAddressDetail != null){ if (row.routerAddressDetail != null && row.routerAddressDetail !==''){
params = JSON.parse(row.routerAddressDetail) params = JSON.parse(row.routerAddressDetail)
} }
this.$tab.openPage(row.moduleCode + this.selectDictLabel(this.dict.type.point_type, row.pointType), this.$tab.openPage(row.moduleCode + this.selectDictLabel(this.dict.type.point_type, row.pointType),

@ -355,30 +355,30 @@
</el-row> </el-row>
<el-row> <!-- <el-row>-->
<el-col :span="12"> <!-- <el-col :span="12">-->
<el-form-item label="混放批次" prop="batchMix"> <!-- <el-form-item label="混放批次" prop="batchMix">-->
<el-radio-group v-model="form.batchMix" :disabled="disableFlag"> <!-- <el-radio-group v-model="form.batchMix" :disabled="disableFlag">-->
<el-radio <!-- <el-radio-->
v-for="dict in dict.type.wms_batch_mix_flag" <!-- v-for="dict in dict.type.wms_batch_mix_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value" <!-- :label="dict.value"-->
>{{dict.label}}</el-radio> <!-- >{{dict.label}}</el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="12"> <!-- <el-col :span="12">-->
<el-form-item label="混放产品" prop="productMix"> <!-- <el-form-item label="混放产品" prop="productMix">-->
<el-radio-group v-model="form.productMix" :disabled="disableFlag"> <!-- <el-radio-group v-model="form.productMix" :disabled="disableFlag">-->
<el-radio <!-- <el-radio-->
v-for="dict in dict.type.wms_product_mix_flag" <!-- v-for="dict in dict.type.wms_product_mix_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value" <!-- :label="dict.value"-->
>{{dict.label}}</el-radio> <!-- >{{dict.label}}</el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
<el-row> <el-row>

@ -111,12 +111,12 @@
</el-table-column> </el-table-column>
<el-table-column label="盘点次数" align="center" prop="inventoryTime" /> <el-table-column label="盘点次数" align="center" prop="inventoryTime" />
<el-table-column label="同步ERP状态" align="center" prop="erpStatus"> <!-- <el-table-column label="同步ERP状态" align="center" prop="erpStatus">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<dict-tag :options="dict.type.wms_erp_status" :value="scope.row.erpStatus"/> <!-- <dict-tag :options="dict.type.wms_erp_status" :value="scope.row.erpStatus"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="同步ERP数量" align="center" prop="erpAmount" /> <!-- <el-table-column label="同步ERP数量" align="center" prop="erpAmount" />-->
<el-table-column label="创建时间" align="center" prop="createDate" /> <el-table-column label="创建时间" align="center" prop="createDate" />
<el-table-column label="最后更新时间" align="center" prop="updateDate" /> <el-table-column label="最后更新时间" align="center" prop="updateDate" />

@ -491,7 +491,7 @@ export default {
this.form = response.data; this.form = response.data;
this.wmsProductOutstockDetailList = response.data.wmsProductOutstockDetailList; this.wmsProductOutstockDetailList = response.data.wmsProductOutstockDetailList;
this.open = true; this.open = true;
this.title = "修改成品出库记录"; this.title = "成品出库记录明细";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */

@ -9,16 +9,16 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="仓库" prop="warehouseId"> <!-- <el-form-item label="仓库" prop="warehouseId">-->
<el-select v-model="queryParams.warehouseId"> <!-- <el-select v-model="queryParams.warehouseId">-->
<el-option <!-- <el-option-->
v-for="item in warehouseOptions" <!-- v-for="item in warehouseOptions"-->
:key="item.warehouseId" <!-- :key="item.warehouseId"-->
:label="item.warehouseName" <!-- :label="item.warehouseName"-->
:value="item.warehouseId" <!-- :value="item.warehouseId"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="计划编号" prop="planCode"> <el-form-item label="计划编号" prop="planCode">
<el-input <el-input
v-model="queryParams.planCode" v-model="queryParams.planCode"
@ -35,6 +35,30 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出库类型" prop="taskType"> <el-form-item label="出库类型" prop="taskType">
<el-select <el-select
v-model="queryParams.taskType" v-model="queryParams.taskType"
@ -101,8 +125,10 @@
<el-table-column label="任务编号" align="center" prop="taskCode" /> <el-table-column label="任务编号" align="center" prop="taskCode" />
<el-table-column label="仓库名称" align="center" prop="warehouseName" /> <el-table-column label="仓库名称" align="center" prop="warehouseName" />
<el-table-column label="计划编号" align="center" prop="planCode" /> <el-table-column label="计划编号" align="center" prop="planCode" />
<el-table-column label="计划明细编号" align="center" prop="planDetailCode" /> <el-table-column label="明细编号" align="center" prop="planDetailCode" />
<el-table-column label="物料批次" align="center" prop="materialBatch" /> <el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="物料规格" align="center" prop="materialSpec" />
<el-table-column label="库位编码" align="center" prop="locationCode" /> <el-table-column label="库位编码" align="center" prop="locationCode" />
<el-table-column label="出库类型" align="center" prop="auditStatus" > <el-table-column label="出库类型" align="center" prop="auditStatus" >
<template slot-scope="scope"> <template slot-scope="scope">

Loading…
Cancel
Save