1.修改单据相关表单实体类,删除不需要的字段,修改单据详情实体类名称

master
x_z 3 years ago
parent d405de0092
commit c9dde7d795

@ -34,7 +34,7 @@ public class TestController {
private String refreshOrderData() {
try {
//刷新订单详情表的数据
List<ErpOrderEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(new FilterErpOrderRequest());
List<OrderDetailEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(new FilterErpOrderRequest());
/*erpOrderEntities.forEach(orderDetail -> {
String orderId = orderDetail.getOrderIdFk();
if (StrUtil.isNotBlank(orderId)) {

@ -328,18 +328,18 @@ public class OrderController {
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderBean.getOrderId());
//单据详情
List<ErpOrderEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
List<OrderDetailEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
if (CollUtil.isNotEmpty(erpOrderEntities)) {
List<PostUdimsOrderDetailRequest> orderDetails = new ArrayList<>();
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
for (OrderDetailEntity orderDetailEntity : erpOrderEntities) {
PostUdimsOrderDetailRequest orderDetail = new PostUdimsOrderDetailRequest();
orderDetail.setUuidFk(erpOrderEntity.getUuidFk());
orderDetail.setFirstSalesInvNo(erpOrderEntity.getFirstSalesInvNo());
orderDetail.setSecSalesInvNo(erpOrderEntity.getSecSalesInvNo());
orderDetail.setPrice(erpOrderEntity.getPrice());
orderDetail.setInvoiceDate(erpOrderEntity.getInvoiceDate());
orderDetail.setSecSalesListNo(erpOrderEntity.getSecSalesListNo());
orderDetail.setBatchNo(erpOrderEntity.getLotno());
orderDetail.setUuidFk(orderDetailEntity.getUuidFk());
orderDetail.setFirstSalesInvNo(orderDetailEntity.getFirstSalesInvNo());
orderDetail.setSecSalesInvNo(orderDetailEntity.getSecSalesInvNo());
orderDetail.setPrice(orderDetailEntity.getPrice());
orderDetail.setInvoiceDate(orderDetailEntity.getInvoiceDate());
orderDetail.setSecSalesListNo(orderDetailEntity.getSecSalesListNo());
orderDetail.setBatchNo(orderDetailEntity.getBatchNo());
orderDetails.add(orderDetail);
}
orderBean.setOrderDetails(orderDetails);
@ -378,11 +378,11 @@ public class OrderController {
}
filterErpOrderRequest.setPage(1);
filterErpOrderRequest.setLimit(100);
List<ErpOrderEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
List<OrderDetailEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
if (CollUtil.isNotEmpty(erpOrderEntities)) {
erpOrderEntities.forEach(erpOrderEntity -> {
erpOrderEntity.setReCount(erpOrderEntity.getCount());
erpOrderEntity.setBatchNo(erpOrderEntity.getLotno());
erpOrderEntity.setBatchNo(erpOrderEntity.getBatchNo());
});
}
return ResultVOUtils.success(erpOrderEntities);
@ -391,14 +391,14 @@ public class OrderController {
/**
*
*
* @param erpOrderEntity
* @param orderDetailEntity
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/order/detail/update")
public BaseResponse updateStockOrderDetail(ErpOrderEntity erpOrderEntity) {
if (null != erpOrderEntity) {
orderDetailMdService.updateOrderDetail(erpOrderEntity);
public BaseResponse updateStockOrderDetail(OrderDetailEntity orderDetailEntity) {
if (null != orderDetailEntity) {
orderDetailMdService.updateOrderDetail(orderDetailEntity);
}
return ResultVOUtils.success("更新成功");
}
@ -479,10 +479,7 @@ public class OrderController {
//查询条码
List<WarehouseEntity> originCodes = warehouseMdService.findByOrderId(originOrder.getOrderId());
originOrder.setActDate(cn.hutool.core.date.DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
originOrder.setCreateTime(originOrder.getActDate());
originOrder.setFromCorp(addOrderChangeRequest.getFromCorp());
originOrder.setInvWarehouseCode(addOrderChangeRequest.getInvWarehouseCode());
originOrder.setInvStorageCode(addOrderChangeRequest.getLocStorageCode());
originOrder.setFromCorpId(addOrderChangeRequest.getFromCorpId());
originOrder.setCorpOrderId(CustomUtil.getId() + "x");
originOrder.setMainAction(addOrderChangeRequest.getMainAction());
@ -490,7 +487,6 @@ public class OrderController {
originOrder.setExportStatus("0"); //设置导出状态为未导出
originOrder.setReceiveStatus(ConstantStatus.RECEIVE_UN); //设置验收状态为未验收
originOrder.setStatus(ConstantStatus.ORDER_STATUS_WAIT); //单据状态修改为待处理
originOrder.setErpFk(null);//关联业务单据置空
originOrder.setLocStorageCode(addOrderChangeRequest.getLocStorageCode());
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(originOrder.getAction(), addOrderChangeRequest.getCustomerId());
String supplementOrderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
@ -509,7 +505,7 @@ public class OrderController {
code -> {
//复制选中的产品
for (WarehouseEntity product : products) {
if (product.getNameCode().equals(code.getUdi())) {
if (product.getNameCode().equals(code.getNameCode())) {
if ((StrUtil.isNotBlank(product.getBatchNo()) && StrUtil.isNotBlank(code.getBatchNo()) && product.getBatchNo().equals(code.getBatchNo()))
|| (StrUtil.isBlank(product.getBatchNo()) && StrUtil.isBlank(code.getBatchNo()))) {
WarehousetempEntity supplementCode = new WarehousetempEntity();
@ -517,7 +513,6 @@ public class OrderController {
supplementCode.setFromCorpId(originOrder.getFromCorpId());
supplementCode.setFromCorp(originOrder.getFromCorp());
supplementCode.setLocStorageCode(originOrder.getLocStorageCode());
supplementCode.setInvWarehouseCode(originOrder.getInvWarehouseCode());
supplementCode.setOrderId(supplementOrderNo);
//查询补单设置
supplementCode.setAction(originOrder.getAction());

@ -146,7 +146,7 @@ public class UdiTraceController {
orderMdEntities.addAll(set);
if (CollUtil.isNotEmpty(orderMdEntities)) {
//根据时间排序
orderMdEntities = orderMdEntities.stream().sorted(Comparator.comparing(OrderMdEntity::getActDate, Comparator.reverseOrder())).collect(Collectors.toList());
orderMdEntities = orderMdEntities.stream().sorted(Comparator.comparing(OrderMdEntity::getActDate)).collect(Collectors.toList());
}
Page<OrderMdEntity> pageResult = new Page<>(warehouseQueryRequest.getPage(), warehouseQueryRequest.getLimit());

@ -1,90 +0,0 @@
package com.glxp.udi.admin.entity.inout;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ErpOrderEntity {
private String id;
private String companyid;
private String docid;
private String iodtlid;
private String inoutid;
private String goodsunit;
private String goodsid;
private String lotid;
private String goodsname;
private String companyname;
private String lotno; //批次号
private Integer dtlgoodsqty;
private String credate;
private Integer reCount;
private String uuidFk;
private String nameCode;
private String productCompany;
private String coName;
private String produceDate;
private String expireDate;
private String authCode;
private String batchNo;
private String packSpec;
private String packRatio;
private Integer bhzxxsbzsl;
private Integer zxxsbzbhsydysl;
private String isDownload;
private String orderIdFk;
private Integer count;
private String nameCodes;
private String status;
//价格
private BigDecimal price;
//销售发票号(第一票)
private String firstSalesInvNo;
//销售发票号(第二票)
private String secSalesInvNo;
//销售清单号(第二票)
private String secSalesListNo;
//开票日期
private String invoiceDate;
//产品编码
private String relId;
}

@ -10,32 +10,70 @@ public class InvProductDetailEntity {
private String id;
/**
*
*/
private String code;
/**
* ID
*/
private String productIdFk;
/**
* ID
*/
private String orderIdFk;
/**
* ID
*/
private String customerId;
/**
*
*/
private String mainAction;
/**
*
*/
private String action;
/**
*
*/
private Integer count;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
/**
*
*/
private String batchNo;
private String productionDate;
/**
*
*/
private String productDate;
/**
*
*/
private String expireDate;
/**
* ID
*/
private String invProductIdFk;
//仓库码
/**
*
*/
private String locStorageCode;
}

@ -7,42 +7,89 @@ public class InvProductEntity {
private String id;
/**
*
*/
private String productsName;
/**
*
*/
private String nameCode;
/**
* ID
*/
private String relIdFk;
/**
*
*/
private String ggxh;
/**
*
*/
private String batchNo;
private String productionDate;
/**
*
*/
private String productDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String ylqxzcrbarmc;
/**
* /
*/
private String zczbhhzbapzbh;
/**
*
*/
private Integer inCount;
/**
*
*/
private Integer outCount;
/**
*
*/
private Integer reCount;
/**
* ID
*/
private String customerId;
/**
* ID
*/
private String supId;
/**
*
*/
private String unitFk;
private String invWarehouseCode;
//生产厂家
/**
*
*/
private String manufactory;
//仓库码
/**
*
*/
private String locStorageCode;
public Integer getInCount() {

@ -0,0 +1,107 @@
package com.glxp.udi.admin.entity.inout;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class OrderDetailEntity {
private String id;
/**
*
*/
private String batchNo;
/**
*
*/
private String relId;
/**
*
*/
private Integer reCount;
/**
* UUID
*/
private String uuidFk;
/**
*
*/
private String nameCode;
/**
*
*/
private String productCompany;
/**
*
*/
private String productName;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
* /
*/
private String zczbhhzbapzbh;
/**
*
*/
private String ggxh;
/**
*
*/
private String packRatio;
/**
*
*/
private String orderIdFk;
/**
*
*/
private Integer count;
/**
*
*/
private BigDecimal price;
/**
*
*/
private String firstSalesInvNo;
/**
*
*/
private String secSalesInvNo;
/**
*
*/
private String secSalesListNo;
/**
*
*/
private String invoiceDate;
}

@ -34,26 +34,22 @@ public class OrderMdEntity {
private String remark;
/**
*
*/
private String exportStatus;
private String fromType;
private String contrastStatus;
private String erpFk;
/**
*
*/
private String uploadStatus; //上传状态0未上传1已上传
private Long customerId;
private String invStorageCode;
private String invWarehouseCode;
private String locStorageCode;
private String nameCode; //最小销售标识
//复制单号,多个单号之间使用英文逗号,分隔
private String replicateNo;
@ -68,9 +64,6 @@ public class OrderMdEntity {
//单据更新时间
private Date updateTime;
//单据创建时间
private String createTime;
public void setActDate(String actDate) {
if (StrUtil.isNotBlank(actDate)) {
actDate = DateUtil.parse(actDate).toString(DatePattern.NORM_DATETIME_PATTERN);

@ -7,62 +7,111 @@ public class WarehouseEntity {
private String id;
/**
*
*/
private String action;
/**
*
*/
private String mainAction;
/**
*
*/
private String code;
/**
*
*/
private String corpOrderId;
/**
*
*/
private String actor;
/**
*
*/
private String actDate;
/**
* ID
*/
private String fromCorpId;
/**
*
*/
private String fromCorp;
/**
*
*/
private String orderId;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String serialNo;
/**
*
*/
private Integer count;
/**
*
*/
private String packageLevel;
private String warehouseCode;
/**
* ID
*/
private String customerId;
/**
*
*/
private String nameCode;
private String supId;//供应商ID
/**
* ID
*/
private String supId;
/**
*
*/
private String supName;
private String invStorageCode;
private String invWarehouseCode;
/**
* ID
*/
private String relId;
private Integer status;
/**
*
*/
private String locStorageCode;
private String udi;
public String getSupId() {
return supId;
}
public Integer getCount() {
if (count == null) {
return 1;

@ -5,58 +5,106 @@ import lombok.Data;
@Data
public class WarehousetempEntity {
private String id;
/**
*
*/
private String action;
/**
*
*/
private String mainAction;
/**
*
*/
private String code;
/**
*
*/
private String corpOrderId;
/**
*
*/
private String actor;
/**
*
*/
private String actDate;
private Integer wrongCode;
private String upperCorpOrderId;
/**
* ID
*/
private String fromCorpId;
private String id;
/**
*
*/
private String fromCorp;
/**
* ID
*/
private String orderId;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String serialNo;
private String udi;
/**
*
*/
private String nameCode;
/**
*
*/
private Integer count;
private Integer type;
/**
* ID
*/
private Long customerId;
private String invStorageCode;
private String invWarehouseCode;
/**
*
*/
private Integer status;
/**
*
*/
private String locStorageCode;
private String nameCode; //最小销售标识
/**
* ID
*/
private String relId;
private String supId;//供应商ID
/**
* ID
*/
private String supId;
}

@ -2,7 +2,7 @@ package com.glxp.udi.admin.mongo.dao;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ReflectUtil;
import com.glxp.udi.admin.entity.inout.ErpOrderEntity;
import com.glxp.udi.admin.entity.inout.OrderDetailEntity;
import com.glxp.udi.admin.mongo.MongoDBName;
import com.glxp.udi.admin.mongo.dao.base.MongoBaseDao;
import com.glxp.udi.admin.mongo.utils.MongoPageHelper;
@ -20,7 +20,7 @@ import java.util.Arrays;
import java.util.List;
@Component
public class OrderDetailDao implements MongoBaseDao<ErpOrderEntity, FilterErpOrderRequest> {
public class OrderDetailDao implements MongoBaseDao<OrderDetailEntity, FilterErpOrderRequest> {
@Resource
private MongoTemplate mongoTemplate;
@ -29,38 +29,38 @@ public class OrderDetailDao implements MongoBaseDao<ErpOrderEntity, FilterErpOrd
@Override
public PageResult<ErpOrderEntity> pageQuery(Query query, FilterErpOrderRequest filterErpOrderRequest, int page, int size) {
public PageResult<OrderDetailEntity> pageQuery(Query query, FilterErpOrderRequest filterErpOrderRequest, int page, int size) {
if (null == query && null != filterErpOrderRequest) {
query = buildQuery(filterErpOrderRequest);
}
return mongoPageHelper.pageQuery(query, ErpOrderEntity.class, size, page, MongoDBName.NAME_ORDER_DETAIL);
return mongoPageHelper.pageQuery(query, OrderDetailEntity.class, size, page, MongoDBName.NAME_ORDER_DETAIL);
}
@Override
public List<ErpOrderEntity> findList(Query query, FilterErpOrderRequest filterErpOrderRequest) {
public List<OrderDetailEntity> findList(Query query, FilterErpOrderRequest filterErpOrderRequest) {
if (null == query && null != filterErpOrderRequest) {
query = buildQuery(filterErpOrderRequest);
}
return mongoTemplate.find(query, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
return mongoTemplate.find(query, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
}
@Override
public ErpOrderEntity findOne(Query query, FilterErpOrderRequest filterErpOrderRequest) {
public OrderDetailEntity findOne(Query query, FilterErpOrderRequest filterErpOrderRequest) {
if (null == query && null != filterErpOrderRequest) {
query = buildQuery(filterErpOrderRequest);
}
return mongoTemplate.findOne(query, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
return mongoTemplate.findOne(query, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
}
@Override
public void update(Query query, Update update, ErpOrderEntity erpOrderEntity) {
public void update(Query query, Update update, OrderDetailEntity orderDetailEntity) {
if (null == query) {
query = buildQuery(erpOrderEntity);
query = buildQuery(orderDetailEntity);
}
if (null == update) {
update = buildUpdate(erpOrderEntity);
update = buildUpdate(orderDetailEntity);
}
mongoTemplate.updateMulti(query, update, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
mongoTemplate.updateMulti(query, update, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
}
@Override
@ -68,7 +68,7 @@ public class OrderDetailDao implements MongoBaseDao<ErpOrderEntity, FilterErpOrd
if (null == query) {
query = buildQuery(filterErpOrderRequest);
}
mongoTemplate.remove(query, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
mongoTemplate.remove(query, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
}
@Override
@ -76,16 +76,16 @@ public class OrderDetailDao implements MongoBaseDao<ErpOrderEntity, FilterErpOrd
if (null == query) {
query = buildQuery(filterErpOrderRequest);
}
return mongoTemplate.count(query, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
return mongoTemplate.count(query, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
}
@Override
public void insert(ErpOrderEntity erpOrderEntity) {
mongoTemplate.insert(erpOrderEntity, MongoDBName.NAME_ORDER_DETAIL);
public void insert(OrderDetailEntity orderDetailEntity) {
mongoTemplate.insert(orderDetailEntity, MongoDBName.NAME_ORDER_DETAIL);
}
@Override
public void insert(List<ErpOrderEntity> records) {
public void insert(List<OrderDetailEntity> records) {
mongoTemplate.insert(records, MongoDBName.NAME_ORDER_DETAIL);
}
@ -115,14 +115,14 @@ public class OrderDetailDao implements MongoBaseDao<ErpOrderEntity, FilterErpOrd
/**
* mongodb
*
* @param erpOrderEntity
* @param orderDetailEntity
* @return
*/
private Query buildQuery(ErpOrderEntity erpOrderEntity) {
private Query buildQuery(OrderDetailEntity orderDetailEntity) {
Query query = new Query();
Field[] fields = ReflectUtil.getFields(ErpOrderEntity.class);
Field[] fields = ReflectUtil.getFields(OrderDetailEntity.class);
Arrays.stream(fields).forEach(field -> {
Object fieldValue = ReflectUtil.getFieldValue(erpOrderEntity, field);
Object fieldValue = ReflectUtil.getFieldValue(orderDetailEntity, field);
if (ObjectUtil.isNotEmpty(fieldValue)) {
if ("orderId".equals(field.getName())) {
query.addCriteria(Criteria.where("orderIdFk").is(fieldValue));
@ -137,14 +137,14 @@ public class OrderDetailDao implements MongoBaseDao<ErpOrderEntity, FilterErpOrd
/**
*
*
* @param erpOrderEntity
* @param orderDetailEntity
* @return
*/
private Update buildUpdate(ErpOrderEntity erpOrderEntity) {
private Update buildUpdate(OrderDetailEntity orderDetailEntity) {
Update update = new Update();
Field[] fields = ReflectUtil.getFields(ErpOrderEntity.class);
Field[] fields = ReflectUtil.getFields(OrderDetailEntity.class);
Arrays.stream(fields).forEach(field -> {
Object fieldValue = ReflectUtil.getFieldValue(erpOrderEntity, field);
Object fieldValue = ReflectUtil.getFieldValue(orderDetailEntity, field);
if (ObjectUtil.isNotEmpty(fieldValue)) {
if (!"orderId".equals(field.getName()) && !"orderIdFk".equals(field.getName())) {
update.set(field.getName(), fieldValue);

@ -161,8 +161,8 @@ public class InvProductMdService {
if (invProductEntity.getBatchNo() != null) {
update.set("batchNo", invProductEntity.getBatchNo());
}
if (invProductEntity.getProductionDate() != null) {
update.set("productionDate", invProductEntity.getProductionDate());
if (invProductEntity.getProductDate() != null) {
update.set("productionDate", invProductEntity.getProductDate());
}
if (invProductEntity.getExpireDate() != null) {
update.set("expireDate", invProductEntity.getExpireDate());

@ -1,7 +1,7 @@
package com.glxp.udi.admin.mongo.service;
import cn.hutool.core.util.StrUtil;
import com.glxp.udi.admin.entity.inout.ErpOrderEntity;
import com.glxp.udi.admin.entity.inout.OrderDetailEntity;
import com.glxp.udi.admin.mongo.MongoDBName;
import com.glxp.udi.admin.req.inout.DeleteRequest;
import com.glxp.udi.admin.req.inout.FilterErpOrderRequest;
@ -22,7 +22,7 @@ public class OrderDetailMdService {
@Resource
private MongoTemplate mongoTemplate;
public List<ErpOrderEntity> filterOrderDetails(FilterErpOrderRequest filterErpOrderRequest) {
public List<OrderDetailEntity> filterOrderDetails(FilterErpOrderRequest filterErpOrderRequest) {
Query query = new Query();
if (filterErpOrderRequest.getOrderId() != null && !filterErpOrderRequest.getOrderId().isEmpty()) {
query.addCriteria(Criteria.where("orderIdFk").is(filterErpOrderRequest.getOrderId()));
@ -39,12 +39,12 @@ public class OrderDetailMdService {
if (StrUtil.isNotBlank(filterErpOrderRequest.getLotno())) {
query.addCriteria(Criteria.where("lotno").is(filterErpOrderRequest.getLotno()));
}
return mongoTemplate.find(query, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
return mongoTemplate.find(query, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
}
public void insertOrderDetail(List<ErpOrderEntity> erpOrderEntities) {
public void insertOrderDetail(List<OrderDetailEntity> erpOrderEntities) {
if (erpOrderEntities != null) {
Collection<ErpOrderEntity> warehouseEntityCollection = new ArrayList<>();
Collection<OrderDetailEntity> warehouseEntityCollection = new ArrayList<>();
warehouseEntityCollection.addAll(erpOrderEntities);
mongoTemplate.insert(warehouseEntityCollection, MongoDBName.NAME_ORDER_DETAIL);
}
@ -58,28 +58,28 @@ public class OrderDetailMdService {
if (deleteRequest.getOrderId() != null) {
query.addCriteria(Criteria.where("orderIdFk").is(deleteRequest.getOrderId()));
}
mongoTemplate.remove(query, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
mongoTemplate.remove(query, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
}
public void updateOrderDetail(ErpOrderEntity erpOrderEntity) {
public void updateOrderDetail(OrderDetailEntity orderDetailEntity) {
Query query = new Query();
query.addCriteria(new Criteria().and("_id").is(erpOrderEntity.getId()));
query.addCriteria(new Criteria().and("_id").is(orderDetailEntity.getId()));
Update update = new Update();
if (erpOrderEntity.getCount() != null) {
update.set("count", erpOrderEntity.getCount());
if (orderDetailEntity.getCount() != null) {
update.set("count", orderDetailEntity.getCount());
}
if (erpOrderEntity.getReCount() != null) {
update.set("reCount", erpOrderEntity.getReCount());
if (orderDetailEntity.getReCount() != null) {
update.set("reCount", orderDetailEntity.getReCount());
}
//更新发票号等字段
update.set("firstSalesInvNo", erpOrderEntity.getFirstSalesInvNo());
update.set("secSalesInvNo", erpOrderEntity.getSecSalesInvNo());
update.set("secSalesListNo", erpOrderEntity.getSecSalesListNo());
update.set("invoiceDate", erpOrderEntity.getInvoiceDate());
if (null != erpOrderEntity.getPrice()) {
update.set("price", erpOrderEntity.getPrice());
update.set("firstSalesInvNo", orderDetailEntity.getFirstSalesInvNo());
update.set("secSalesInvNo", orderDetailEntity.getSecSalesInvNo());
update.set("secSalesListNo", orderDetailEntity.getSecSalesListNo());
update.set("invoiceDate", orderDetailEntity.getInvoiceDate());
if (null != orderDetailEntity.getPrice()) {
update.set("price", orderDetailEntity.getPrice());
}
mongoTemplate.updateMulti(query, update, MongoDBName.NAME_ORDER_DETAIL);

@ -307,13 +307,13 @@ public class OrderMdService {
FilterErpOrderRequest detailRequest = new FilterErpOrderRequest();
detailRequest.setOrderId(orderId);
List<ErpOrderEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(detailRequest);
List<OrderDetailEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(detailRequest);
CustomerInfoEntity customerInfoEntity = customerInfoDao.selectById(orderMdEntity.getCustomerId());
String customerId = String.valueOf(customerInfoEntity.getCustomerId());
erpOrderEntities.forEach(erpOrderEntity -> {
//查询产品批次
StockOrderPrintEntity printEntity = new StockOrderPrintEntity();
printEntity.setBatchNo(erpOrderEntity.getLotno()); //批次号
printEntity.setBatchNo(erpOrderEntity.getBatchNo()); //批次号
printEntity.setProductId(erpOrderEntity.getNameCode()); //产品ID
printEntity.setCorpId(customerId); //本企业ID
printEntity.setCorpName(orderMdEntity.getFromCorp()); //往来单位名称
@ -323,12 +323,12 @@ public class OrderMdService {
printEntity.setPrice(erpOrderEntity.getPrice());//金额
printEntity.setBillNo(orderMdEntity.getOrderId()); //单号
printEntity.setBilldate(orderMdEntity.getActDate()); //单据日期
printEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode()); //注册/备案证号
printEntity.setSpec(erpOrderEntity.getPackSpec()); //规格型号
printEntity.setZczbhhzbapzbh(erpOrderEntity.getZczbhhzbapzbh()); //注册/备案证号
printEntity.setSpec(erpOrderEntity.getGgxh()); //规格型号
printEntity.setTitle(customerInfoEntity.getCompanyName()); //企业名称,单据抬头
//查询仓库名称
FilterInvProductRequest invProductRequest = new FilterInvProductRequest();
invProductRequest.setBatchNo(erpOrderEntity.getLotno());
invProductRequest.setBatchNo(erpOrderEntity.getBatchNo());
invProductRequest.setRelIdFk(erpOrderEntity.getUuidFk());
invProductRequest.setCustomerId(customerId);
invProductRequest.setInvCodes(Arrays.asList(orderMdEntity.getLocStorageCode()));
@ -337,7 +337,7 @@ public class OrderMdService {
UdiInfoEntity udiInfoEntity = udiInfoDao.findByUuid(erpOrderEntity.getUuidFk(), String.valueOf(orderMdEntity.getCustomerId()));
printEntity.setManufactory(udiInfoEntity.getManufactory()); //生产厂家
printEntity.setLocInv(invWarehouseDao.getNameByCode(orderMdEntity.getLocStorageCode()));
printEntity.setProductName(erpOrderEntity.getCoName()); //产品名称
printEntity.setProductName(erpOrderEntity.getProductName()); //产品名称
printEntity.setProductDate(erpOrderEntity.getProduceDate()); //生产日期
printEntity.setExpireDate(erpOrderEntity.getExpireDate()); //失效日期
list.add(printEntity);
@ -554,7 +554,7 @@ public class OrderMdService {
//删除码详情
mongoTemplate.remove(queryOrder, WarehouseEntity.class, MongoDBName.NAME_CODE);
//删除单据详情
mongoTemplate.remove(queryInvDetail, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
mongoTemplate.remove(queryInvDetail, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
//删除单据
mongoTemplate.remove(queryOrder, OrderMdEntity.class, MongoDBName.NAME_ORDER);
} catch (Exception e) {
@ -568,7 +568,7 @@ public class OrderMdService {
mongoTemplate.remove(queryOrder, OrderMdEntity.class, MongoDBName.NAME_ORDER);
//删除单据详情
Query queryOrderDetail = Query.query(Criteria.where("orderIdFk").is(id));
mongoTemplate.remove(queryOrderDetail, ErpOrderEntity.class, MongoDBName.NAME_ORDER_DETAIL);
mongoTemplate.remove(queryOrderDetail, OrderDetailEntity.class, MongoDBName.NAME_ORDER_DETAIL);
//删除临时码表
mongoTemplate.remove(queryOrder, WarehouseEntity.class, MongoDBName.NAME_CODE_TEMP);
} catch (Exception e) {

@ -211,17 +211,17 @@ public class WarehouseMdService {
filterErpOrderRequest.setOrderIdFk(order.getOrderId());
filterErpOrderRequest.setUuidFk(invProductEntity.getRelIdFk());
filterErpOrderRequest.setLotno(warehouseEntity.getBatchNo());
List<ErpOrderEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
List<OrderDetailEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
if (CollUtil.isNotEmpty(erpOrderEntities)) {
ErpOrderEntity erpOrderEntity = erpOrderEntities.get(0);
if (erpOrderEntity.getCount() > 1) {
erpOrderEntity.setCount(erpOrderEntity.getCount() - 1);
OrderDetailEntity orderDetailEntity = erpOrderEntities.get(0);
if (orderDetailEntity.getCount() > 1) {
orderDetailEntity.setCount(orderDetailEntity.getCount() - 1);
//更新单据详情
orderDetailMdService.updateOrderDetail(erpOrderEntity);
orderDetailMdService.updateOrderDetail(orderDetailEntity);
} else {
//删除扫码单据详情
DeleteRequest deleteRequest = new DeleteRequest();
deleteRequest.setId(erpOrderEntity.getId());
deleteRequest.setId(orderDetailEntity.getId());
orderDetailMdService.deleteOrderDetail(deleteRequest);
}
}

@ -57,40 +57,40 @@ public class InvProductsTrService {
if (orderEntity.getStatus().equals(ConstantStatus.ORDER_STATUS_SUCCESS)) {
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderId);
List<ErpOrderEntity> erpOrderEntities = myErpOrderService.filterOrderDetails(filterErpOrderRequest);
List<OrderDetailEntity> erpOrderEntities = myErpOrderService.filterOrderDetails(filterErpOrderRequest);
if (erpOrderEntities != null && erpOrderEntities.size() > 0) {
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
String nameCode = erpOrderEntity.getNameCode();
for (OrderDetailEntity orderDetailEntity : erpOrderEntities) {
String nameCode = orderDetailEntity.getNameCode();
UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(nameCode, customerId);
InvProductEntity invProductEntity = invProductService.selectByUuid(udiInfoEntity.getUuid(), erpOrderEntity.getLotno(), orderEntity.getCustomerId() + "", orderEntity.getLocStorageCode());
InvProductEntity invProductEntity = invProductService.selectByUuid(udiInfoEntity.getUuid(), orderDetailEntity.getBatchNo(), orderEntity.getCustomerId() + "", orderEntity.getLocStorageCode());
if (invProductEntity == null) {
invProductEntity = new InvProductEntity();
invProductEntity.setRelIdFk(String.valueOf(udiInfoEntity.getId()));
invProductEntity.setBatchNo(erpOrderEntity.getLotno());
invProductEntity.setBatchNo(orderDetailEntity.getBatchNo());
invProductEntity.setCustomerId(orderEntity.getCustomerId() + "");
invProductEntity.setExpireDate(erpOrderEntity.getExpireDate());
invProductEntity.setProductionDate(erpOrderEntity.getProduceDate());
invProductEntity.setGgxh(erpOrderEntity.getPackSpec());
invProductEntity.setNameCode(erpOrderEntity.getNameCode());
invProductEntity.setProductsName(erpOrderEntity.getCoName());
invProductEntity.setYlqxzcrbarmc(erpOrderEntity.getProductCompany());
invProductEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode());
invProductEntity.setExpireDate(orderDetailEntity.getExpireDate());
invProductEntity.setProductDate(orderDetailEntity.getProduceDate());
invProductEntity.setGgxh(orderDetailEntity.getGgxh());
invProductEntity.setNameCode(orderDetailEntity.getNameCode());
invProductEntity.setProductsName(orderDetailEntity.getProductName());
invProductEntity.setYlqxzcrbarmc(orderDetailEntity.getProductCompany());
invProductEntity.setZczbhhzbapzbh(orderDetailEntity.getZczbhhzbapzbh());
invProductEntity.setLocStorageCode(orderEntity.getLocStorageCode());
invProductEntity.setManufactory(udiInfoEntity.getManufactory());
if (orderEntity.getMainAction().equals(TypeConstant.TYPE_OUT)) {
invProductEntity.setOutCount(erpOrderEntity.getCount());
invProductEntity.setOutCount(orderDetailEntity.getCount());
invProductEntity.setInCount(0);
} else if (orderEntity.getMainAction().equals(TypeConstant.TYPE_PUT)) {
invProductEntity.setInCount(erpOrderEntity.getCount());
invProductEntity.setInCount(orderDetailEntity.getCount());
invProductEntity.setOutCount(0);
}
invProductService.insertInvProduct(invProductEntity);
invProductEntity = invProductService.selectByUuid(invProductEntity.getRelIdFk(), invProductEntity.getBatchNo(), orderEntity.getCustomerId() + "", orderEntity.getLocStorageCode());
} else {
if (orderEntity.getMainAction().equals(TypeConstant.TYPE_OUT)) {
invProductEntity.setOutCount(invProductEntity.getOutCount() + erpOrderEntity.getCount());
invProductEntity.setOutCount(invProductEntity.getOutCount() + orderDetailEntity.getCount());
} else if (orderEntity.getMainAction().equals(TypeConstant.TYPE_PUT)) {
invProductEntity.setInCount(invProductEntity.getInCount() + erpOrderEntity.getCount());
invProductEntity.setInCount(invProductEntity.getInCount() + orderDetailEntity.getCount());
}
invProductService.updateInvProduct(invProductEntity);
}
@ -105,8 +105,8 @@ public class InvProductsTrService {
List<WarehouseEntity> warehouseEntities = codesService.filterWarehouse(warehouseQueryRequest);
if (CollUtil.isNotEmpty(warehouseEntities)) {
for (WarehouseEntity warehouseEntity : warehouseEntities) {
UdiInfoEntity tempUdi = udiInfoService.findByNameCode(warehouseEntity.getUdi(), customerId);
if (tempUdi.getUuid().equals(erpOrderEntity.getUuidFk())) {
UdiInfoEntity tempUdi = udiInfoService.findByNameCode(warehouseEntity.getNameCode(), customerId);
if (tempUdi.getUuid().equals(orderDetailEntity.getUuidFk())) {
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
invProductDetailEntity.setProductIdFk(invProductEntity.getRelIdFk() + "");
invProductDetailEntity.setInvProductIdFk(String.valueOf(invProductEntity.getId()));
@ -117,7 +117,7 @@ public class InvProductsTrService {
invProductDetailEntity.setAction(warehouseEntity.getAction());
invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo());
invProductDetailEntity.setMainAction(warehouseEntity.getMainAction());
invProductDetailEntity.setProductionDate(warehouseEntity.getProduceDate());
invProductDetailEntity.setProductDate(warehouseEntity.getProduceDate());
invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate());
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailEntity.setCustomerId(orderEntity.getCustomerId() + "");

@ -11,7 +11,7 @@ import com.glxp.udi.admin.constant.SystemParamConstant;
import com.glxp.udi.admin.dao.info.ScheduledDao;
import com.glxp.udi.admin.entity.info.PlatformEntity;
import com.glxp.udi.admin.entity.info.ScheduledEntity;
import com.glxp.udi.admin.entity.inout.ErpOrderEntity;
import com.glxp.udi.admin.entity.inout.OrderDetailEntity;
import com.glxp.udi.admin.entity.inout.OrderMdEntity;
import com.glxp.udi.admin.entity.inout.UnitMaintainEntity;
import com.glxp.udi.admin.entity.inout.WarehouseEntity;
@ -116,18 +116,18 @@ public class SubmitOrderToSpmsTask implements SchedulingConfigurer {
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderBean.getOrderId());
//单据详情
List<ErpOrderEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
List<OrderDetailEntity> erpOrderEntities = orderDetailMdService.filterOrderDetails(filterErpOrderRequest);
if (CollUtil.isNotEmpty(erpOrderEntities)) {
List<PostUdimsOrderDetailRequest> orderDetails = new ArrayList<>();
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
for (OrderDetailEntity orderDetailEntity : erpOrderEntities) {
PostUdimsOrderDetailRequest orderDetail = new PostUdimsOrderDetailRequest();
orderDetail.setUuidFk(erpOrderEntity.getUuidFk());
orderDetail.setFirstSalesInvNo(erpOrderEntity.getFirstSalesInvNo());
orderDetail.setSecSalesInvNo(erpOrderEntity.getSecSalesInvNo());
orderDetail.setPrice(erpOrderEntity.getPrice());
orderDetail.setInvoiceDate(erpOrderEntity.getInvoiceDate());
orderDetail.setSecSalesListNo(erpOrderEntity.getSecSalesListNo());
orderDetail.setBatchNo(erpOrderEntity.getLotno());
orderDetail.setUuidFk(orderDetailEntity.getUuidFk());
orderDetail.setFirstSalesInvNo(orderDetailEntity.getFirstSalesInvNo());
orderDetail.setSecSalesInvNo(orderDetailEntity.getSecSalesInvNo());
orderDetail.setPrice(orderDetailEntity.getPrice());
orderDetail.setInvoiceDate(orderDetailEntity.getInvoiceDate());
orderDetail.setSecSalesListNo(orderDetailEntity.getSecSalesListNo());
orderDetail.setBatchNo(orderDetailEntity.getBatchNo());
orderDetails.add(orderDetail);
}
orderBean.setOrderDetails(orderDetails);

@ -146,7 +146,7 @@ public class TransInoutService {
}
//产品是否可以使用单元入库
UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(warehousetemp.getUdi(), String.valueOf(warehousetemp.getCustomerId()));
UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(warehousetemp.getNameCode(), String.valueOf(warehousetemp.getCustomerId()));
if (null != udiInfoEntity) {
if (udiInfoEntity.getIsUseDy() == 0 && udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY) {
tempEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL);
@ -217,9 +217,6 @@ public class TransInoutService {
orderSaveRequest.setExportStatus("未上传");
orderSaveRequest.setUploadStatus("0"); //上传状态,未上传
orderSaveRequest.setLocStorageCode(warehousetempEntity.getLocStorageCode());
orderSaveRequest.setInvStorageCode(warehousetempEntity.getInvStorageCode());
orderSaveRequest.setInvWarehouseCode(warehousetempEntity.getInvWarehouseCode());
orderSaveRequest.setNameCode(warehousetempEntity.getNameCode());
//查询此类型单据是否需要校验
boolean secCheckEnable = bussinessTypeService.getSecCheckEnable(orderSaveRequest.getAction(), orderSaveRequest.getCustomerId());
if (secCheckEnable) {

@ -5,7 +5,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.glxp.udi.admin.constant.Constant;
import com.glxp.udi.admin.constant.TypeConstant;
import com.glxp.udi.admin.entity.info.SetupEntity;
import com.glxp.udi.admin.entity.inout.ErpOrderEntity;
import com.glxp.udi.admin.entity.inout.OrderDetailEntity;
import com.glxp.udi.admin.entity.inout.UdiInfoEntity;
import com.glxp.udi.admin.entity.inout.WarehouseEntity;
import com.glxp.udi.admin.entity.inout.WarehousetempEntity;
@ -235,23 +235,23 @@ public class InoutUtils {
returnOrderDetail.add(entry.getValue());
}
List<ErpOrderEntity> erpOrderEntities = new ArrayList<>();
List<OrderDetailEntity> erpOrderEntities = new ArrayList<>();
for (UdiInfoEntity erpDetailCodeEntity : returnOrderDetail) {
ErpOrderEntity erpOrderEntity = new ErpOrderEntity();
erpOrderEntity.setNameCode(erpDetailCodeEntity.getNameCode());
erpOrderEntity.setPackRatio(erpDetailCodeEntity.getPackRatio());
erpOrderEntity.setCoName(erpDetailCodeEntity.getCpmctymc());
erpOrderEntity.setLotno(erpDetailCodeEntity.getBatchNo());
erpOrderEntity.setProduceDate(erpDetailCodeEntity.getProduceDate());
erpOrderEntity.setExpireDate(erpDetailCodeEntity.getExpireDate());
erpOrderEntity.setCount(erpDetailCodeEntity.getCount());
erpOrderEntity.setOrderIdFk(warehouseEntityList.get(0).getOrderId());
erpOrderEntity.setProductCompany(erpDetailCodeEntity.getYlqxzcrbarmc());
erpOrderEntity.setAuthCode(erpDetailCodeEntity.getZczbhhzbapzbh());
erpOrderEntity.setUuidFk(erpOrderEntity.getUuidFk());
erpOrderEntity.setRelId(String.valueOf(erpDetailCodeEntity.getId()));
erpOrderEntity.setPackSpec(erpDetailCodeEntity.getGgxh());
erpOrderEntities.add(erpOrderEntity);
OrderDetailEntity orderDetailEntity = new OrderDetailEntity();
orderDetailEntity.setNameCode(erpDetailCodeEntity.getNameCode());
orderDetailEntity.setPackRatio(erpDetailCodeEntity.getPackRatio());
orderDetailEntity.setProductName(erpDetailCodeEntity.getCpmctymc());
orderDetailEntity.setBatchNo(erpDetailCodeEntity.getBatchNo());
orderDetailEntity.setProduceDate(erpDetailCodeEntity.getProduceDate());
orderDetailEntity.setExpireDate(erpDetailCodeEntity.getExpireDate());
orderDetailEntity.setCount(erpDetailCodeEntity.getCount());
orderDetailEntity.setOrderIdFk(warehouseEntityList.get(0).getOrderId());
orderDetailEntity.setProductCompany(erpDetailCodeEntity.getYlqxzcrbarmc());
orderDetailEntity.setZczbhhzbapzbh(erpDetailCodeEntity.getZczbhhzbapzbh());
orderDetailEntity.setUuidFk(orderDetailEntity.getUuidFk());
orderDetailEntity.setRelId(String.valueOf(erpDetailCodeEntity.getId()));
orderDetailEntity.setGgxh(erpDetailCodeEntity.getGgxh());
erpOrderEntities.add(orderDetailEntity);
}
if (!erpOrderEntities.isEmpty()) {
orderDetailMdService.insertOrderDetail(erpOrderEntities);

Loading…
Cancel
Save