x_z 3 years ago
parent 2b3021f137
commit 4f6c0fe7e5

@ -6,6 +6,7 @@ import com.glxp.udi.admin.annotation.AuthRuleAnnotation;
import com.glxp.udi.admin.common.res.BaseResponse; import com.glxp.udi.admin.common.res.BaseResponse;
import com.glxp.udi.admin.constant.CacheKey; import com.glxp.udi.admin.constant.CacheKey;
import com.glxp.udi.admin.entity.auth.CustomerContactEntity; import com.glxp.udi.admin.entity.auth.CustomerContactEntity;
import com.glxp.udi.admin.entity.auth.CustomerInfoEntity;
import com.glxp.udi.admin.entity.info.CompanyEntity; import com.glxp.udi.admin.entity.info.CompanyEntity;
import com.glxp.udi.admin.entity.info.CompanyUpdateLogEntity; import com.glxp.udi.admin.entity.info.CompanyUpdateLogEntity;
import com.glxp.udi.admin.req.info.CompanyRequest; import com.glxp.udi.admin.req.info.CompanyRequest;
@ -13,6 +14,7 @@ import com.glxp.udi.admin.req.info.FilterCompanyRequest;
import com.glxp.udi.admin.res.PageSimpleResponse; import com.glxp.udi.admin.res.PageSimpleResponse;
import com.glxp.udi.admin.service.auth.AuthAdminService; import com.glxp.udi.admin.service.auth.AuthAdminService;
import com.glxp.udi.admin.service.auth.CustomerContactService; import com.glxp.udi.admin.service.auth.CustomerContactService;
import com.glxp.udi.admin.service.auth.CustomerInfoService;
import com.glxp.udi.admin.service.info.CompanyService; import com.glxp.udi.admin.service.info.CompanyService;
import com.glxp.udi.admin.service.info.CompanyUpdateLogService; import com.glxp.udi.admin.service.info.CompanyUpdateLogService;
import com.glxp.udi.admin.util.RedisUtil; import com.glxp.udi.admin.util.RedisUtil;
@ -52,6 +54,8 @@ public class CompanyController {
private UdiDlHttpClient udiDlHttpClient; private UdiDlHttpClient udiDlHttpClient;
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Resource
private CustomerInfoService customerInfoService;
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@GetMapping("/warehouse/info/company") @GetMapping("/warehouse/info/company")
@ -146,6 +150,15 @@ public class CompanyController {
customerContactEntity.setCustomerId(companyEntity.getCustomerId()); customerContactEntity.setCustomerId(companyEntity.getCustomerId());
customerContactService.updateCustomerContact(customerContactEntity); customerContactService.updateCustomerContact(customerContactEntity);
//同步更新客户表数据
CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(companyEntity.getCustomerId());
customerInfoEntity.setCompanyName(companyEntity.getCompanyName());
customerInfoEntity.setCustomerName(companyEntity.getCompanyName());
customerInfoEntity.setArea(companyEntity.getArea());
customerInfoEntity.setDetailAddr(companyEntity.getDetailAddr());
customerInfoEntity.setCreditNum(companyEntity.getCreditNum());
customerInfoService.updateCustomerInfo(customerInfoEntity);
return ResultVOUtils.success("修改成功"); return ResultVOUtils.success("修改成功");
} }

@ -85,6 +85,7 @@ public class InvProductsController {
for (InvProductEntity invProductEntity : invProductEntities) { for (InvProductEntity invProductEntity : invProductEntities) {
InvProductResponse invProductResponse = new InvProductResponse(); InvProductResponse invProductResponse = new InvProductResponse();
BeanUtil.copyProperties(invProductEntity, invProductResponse); BeanUtil.copyProperties(invProductEntity, invProductResponse);
invProductResponse.setProductionDate(invProductEntity.getProductDate());
invProductResponse.setInvStorageCode(invProductEntity.getLocStorageCode()); invProductResponse.setInvStorageCode(invProductEntity.getLocStorageCode());
invProductResponse.setInvStorageName(invWarehouseService.findNameByCode(invProductEntity.getLocStorageCode())); invProductResponse.setInvStorageName(invWarehouseService.findNameByCode(invProductEntity.getLocStorageCode()));
result.add(invProductResponse); result.add(invProductResponse);
@ -104,14 +105,14 @@ public class InvProductsController {
if (StringUtils.isNotBlank(filterInvProductRequest.getUdiCode())) { if (StringUtils.isNotBlank(filterInvProductRequest.getUdiCode())) {
filterUdiInfoRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvProductRequest.getUdiCode())); filterUdiInfoRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvProductRequest.getUdiCode()));
} }
String customerId = String.valueOf(customerService.getCustomerId());
filterUdiInfoRequest.setCustomerId(customerId);
filterUdiInfoRequest.setCpmctymc(filterInvProductRequest.getProductsName()); filterUdiInfoRequest.setCpmctymc(filterInvProductRequest.getProductsName());
IPage<UdiInfoEntity> page = udiInfoService.filterUdiInfo(filterUdiInfoRequest); IPage<UdiInfoEntity> page = udiInfoService.filterUdiInfo(filterUdiInfoRequest);
List<String> uuids = new ArrayList<>(); if (page.getTotal() > 0) {
for (UdiInfoEntity udiInfoEntity : page.getRecords()) { filterInvProductRequest.setNameCode(page.getRecords().get(0).getNameCode());
uuids.add(udiInfoEntity.getUuid()); filterInvProductRequest.setCustomerId(customerId);
} } else {
filterInvProductRequest.setUuids(uuids);
if (uuids.size() <= 0) {
return ResultVOUtils.success(new PageSimpleResponse<>()); return ResultVOUtils.success(new PageSimpleResponse<>());
} }
} }
@ -126,7 +127,7 @@ public class InvProductsController {
List<InvProductEntity> invProductEntities = page.getRecords(); List<InvProductEntity> invProductEntities = page.getRecords();
List<InvProductResponse> invProductResponses = new ArrayList<>(); List<InvProductResponse> invProductResponses = new ArrayList<>();
for (InvProductEntity invProductEntity : invProductEntities) { for (InvProductEntity invProductEntity : invProductEntities) {
UdiInfoEntity udiInfoEntity = udiInfoService.findByUuid(invProductEntity.getRelIdFk(), invProductEntity.getCustomerId()); UdiInfoEntity udiInfoEntity = udiInfoService.findById(invProductEntity.getRelIdFk());
invProductEntity.setNameCode(udiInfoEntity.getNameCode()); invProductEntity.setNameCode(udiInfoEntity.getNameCode());
invProductEntity.setGgxh(udiInfoEntity.getGgxh()); invProductEntity.setGgxh(udiInfoEntity.getGgxh());

@ -1,6 +1,7 @@
package com.glxp.udi.admin.entity.inout; package com.glxp.udi.admin.entity.inout;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -112,4 +113,10 @@ public class WarehousetempEntity {
*/ */
private String supId; private String supId;
/**
* 使nameCode
*/
@TableField(exist = false)
private String udi;
} }

@ -27,4 +27,9 @@ public class FilterOrderDetailRequest extends ListPageRequest {
private String uuidFk; private String uuidFk;
List<String> orderIds; List<String> orderIds;
/**
* ID
*/
private String relId;
} }

@ -11,6 +11,10 @@ public class InvProductResponse {
private String relIdFk; private String relIdFk;
private String ggxh; private String ggxh;
private String batchNo; private String batchNo;
/**
*
*/
private String productionDate; private String productionDate;
private String expireDate; private String expireDate;
private String ylqxzcrbarmc; private String ylqxzcrbarmc;

@ -60,6 +60,7 @@ public class OrderDetailService {
.eq(StrUtil.isNotBlank(orderDetailRequest.getOrderIdFk()), "orderIdFk", orderDetailRequest.getOrderIdFk()) .eq(StrUtil.isNotBlank(orderDetailRequest.getOrderIdFk()), "orderIdFk", orderDetailRequest.getOrderIdFk())
.eq(null != orderDetailRequest.getCustomerId(), "customerId", orderDetailRequest.getCustomerId()) .eq(null != orderDetailRequest.getCustomerId(), "customerId", orderDetailRequest.getCustomerId())
.eq(StrUtil.isNotBlank(orderDetailRequest.getUuidFk()), "uuidFk", orderDetailRequest.getUuidFk()) .eq(StrUtil.isNotBlank(orderDetailRequest.getUuidFk()), "uuidFk", orderDetailRequest.getUuidFk())
.eq(StrUtil.isNotBlank(orderDetailRequest.getRelId()),"relId", orderDetailRequest.getRelId())
.eq(StrUtil.isNotBlank(orderDetailRequest.getLotno()), "batchNo", orderDetailRequest.getLotno()); .eq(StrUtil.isNotBlank(orderDetailRequest.getLotno()), "batchNo", orderDetailRequest.getLotno());
return wrapper; return wrapper;
} }

@ -2,6 +2,8 @@ package com.glxp.udi.admin.service.inout;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -92,8 +94,8 @@ public class OrderService {
QueryWrapper<OrderEntity> wrapper = new QueryWrapper<>(); QueryWrapper<OrderEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StrUtil.isNotBlank(orderFilterRequest.getId()), "orderId", orderFilterRequest.getId()) wrapper.eq(StrUtil.isNotBlank(orderFilterRequest.getId()), "orderId", orderFilterRequest.getId())
.in(CollUtil.isNotEmpty(orderFilterRequest.getInvCodes()), "locStorageCode", orderFilterRequest.getInvCodes()) .in(CollUtil.isNotEmpty(orderFilterRequest.getInvCodes()), "locStorageCode", orderFilterRequest.getInvCodes())
.le(StrUtil.isNotBlank(orderFilterRequest.getStartTime()), "actDate", orderFilterRequest.getStartTime()) .ge(StrUtil.isNotBlank(orderFilterRequest.getStartTime()), "actDate", StrUtil.isBlank(orderFilterRequest.getStartTime()) ? null : DateUtil.parse(orderFilterRequest.getStartTime()).toString(DatePattern.NORM_DATETIME_PATTERN))
.ge(StrUtil.isNotBlank(orderFilterRequest.getEndTime()), "actDate", orderFilterRequest.getEndTime()) .le(StrUtil.isNotBlank(orderFilterRequest.getEndTime()), "actDate", StrUtil.isBlank(orderFilterRequest.getEndTime()) ? null : DateUtil.parse(orderFilterRequest.getEndTime()).toString(DatePattern.NORM_DATETIME_PATTERN))
.eq(StrUtil.isNotBlank(orderFilterRequest.getIsError()), "status", orderFilterRequest.getStatus()) .eq(StrUtil.isNotBlank(orderFilterRequest.getIsError()), "status", orderFilterRequest.getStatus())
.eq(StrUtil.isNotBlank(orderFilterRequest.getAction()), "action", orderFilterRequest.getAction()) .eq(StrUtil.isNotBlank(orderFilterRequest.getAction()), "action", orderFilterRequest.getAction())
.ne(StrUtil.isBlank(orderFilterRequest.getAction()), "action", "StockCheck") .ne(StrUtil.isBlank(orderFilterRequest.getAction()), "action", "StockCheck")
@ -103,7 +105,8 @@ public class OrderService {
.eq(StrUtil.isNotBlank(orderFilterRequest.getExportStatus()), "exportStatus", orderFilterRequest.getExportStatus()) .eq(StrUtil.isNotBlank(orderFilterRequest.getExportStatus()), "exportStatus", orderFilterRequest.getExportStatus())
.eq(null != orderFilterRequest.getCustomerId(), "customerId", orderFilterRequest.getCustomerId()) .eq(null != orderFilterRequest.getCustomerId(), "customerId", orderFilterRequest.getCustomerId())
.eq(StrUtil.isNotBlank(orderFilterRequest.getCorpOrderId()), "corpOrderId", orderFilterRequest.getCorpOrderId()) .eq(StrUtil.isNotBlank(orderFilterRequest.getCorpOrderId()), "corpOrderId", orderFilterRequest.getCorpOrderId())
.eq(null != orderFilterRequest.getReceiveStatus(), "receiveStatus", orderFilterRequest.getReceiveStatus()); .eq(null != orderFilterRequest.getReceiveStatus(), "receiveStatus", orderFilterRequest.getReceiveStatus())
.ne(null == orderFilterRequest.getReceiveStatus() && ConstantStatus.ORDER_STATUS_SUCCESS.equals(orderFilterRequest.getStatus()), "receiveStatus", ConstantStatus.RECEIVE_UN);
return wrapper; return wrapper;
} }

@ -167,7 +167,7 @@ public class WarehouseService {
//查询单据详情 //查询单据详情
FilterOrderDetailRequest filterOrderDetailRequest = new FilterOrderDetailRequest(); FilterOrderDetailRequest filterOrderDetailRequest = new FilterOrderDetailRequest();
filterOrderDetailRequest.setOrderIdFk(order.getOrderId()); filterOrderDetailRequest.setOrderIdFk(order.getOrderId());
filterOrderDetailRequest.setUuidFk(invProductEntity.getRelIdFk()); filterOrderDetailRequest.setRelId(invProductEntity.getRelIdFk());
filterOrderDetailRequest.setLotno(warehouseMdEntity.getBatchNo()); filterOrderDetailRequest.setLotno(warehouseMdEntity.getBatchNo());
List<OrderDetailEntity> erpOrderEntities = orderDetailService.filterOrderDetails(filterOrderDetailRequest); List<OrderDetailEntity> erpOrderEntities = orderDetailService.filterOrderDetails(filterOrderDetailRequest);
if (CollUtil.isNotEmpty(erpOrderEntities)) { if (CollUtil.isNotEmpty(erpOrderEntities)) {

@ -199,6 +199,7 @@ public class TransInoutService {
List<WarehousetempEntity> warehousetempList = postOrder.getCodes(); List<WarehousetempEntity> warehousetempList = postOrder.getCodes();
if (warehousetempList != null && warehousetempList.size() > 0) { if (warehousetempList != null && warehousetempList.size() > 0) {
WarehousetempEntity warehousetempEntity = warehousetempList.get(0); WarehousetempEntity warehousetempEntity = warehousetempList.get(0);
warehousetempEntity.setNameCode(warehousetempEntity.getUdi()); //拷贝nameCode参数值
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getBillType(), String.valueOf(customerId)); BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getBillType(), String.valueOf(customerId));
String orderId = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); String orderId = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
OrderEntity orderSaveRequest = new OrderEntity(); OrderEntity orderSaveRequest = new OrderEntity();

@ -246,21 +246,21 @@ public class InoutUtils {
} }
List<OrderDetailEntity> erpOrderEntities = new ArrayList<>(); List<OrderDetailEntity> erpOrderEntities = new ArrayList<>();
for (UdiInfoEntity erpDetailCodeEntity : returnOrderDetail) { for (UdiInfoEntity udiInfoEntity : returnOrderDetail) {
OrderDetailEntity orderDetailEntity = new OrderDetailEntity(); OrderDetailEntity orderDetailEntity = new OrderDetailEntity();
orderDetailEntity.setNameCode(erpDetailCodeEntity.getNameCode()); orderDetailEntity.setNameCode(udiInfoEntity.getNameCode());
orderDetailEntity.setPackRatio(erpDetailCodeEntity.getPackRatio()); orderDetailEntity.setPackRatio(udiInfoEntity.getPackRatio());
orderDetailEntity.setProductName(erpDetailCodeEntity.getCpmctymc()); orderDetailEntity.setProductName(udiInfoEntity.getCpmctymc());
orderDetailEntity.setBatchNo(erpDetailCodeEntity.getBatchNo()); orderDetailEntity.setBatchNo(udiInfoEntity.getBatchNo());
orderDetailEntity.setProduceDate(erpDetailCodeEntity.getProduceDate()); orderDetailEntity.setProduceDate(udiInfoEntity.getProduceDate());
orderDetailEntity.setExpireDate(erpDetailCodeEntity.getExpireDate()); orderDetailEntity.setExpireDate(udiInfoEntity.getExpireDate());
orderDetailEntity.setCount(erpDetailCodeEntity.getCount()); orderDetailEntity.setCount(udiInfoEntity.getCount());
orderDetailEntity.setOrderIdFk(warehouseEntityList.get(0).getOrderId()); orderDetailEntity.setOrderIdFk(warehouseEntityList.get(0).getOrderId());
orderDetailEntity.setProductCompany(erpDetailCodeEntity.getYlqxzcrbarmc()); orderDetailEntity.setProductCompany(udiInfoEntity.getYlqxzcrbarmc());
orderDetailEntity.setZczbhhzbapzbh(erpDetailCodeEntity.getZczbhhzbapzbh()); orderDetailEntity.setZczbhhzbapzbh(udiInfoEntity.getZczbhhzbapzbh());
orderDetailEntity.setUuidFk(orderDetailEntity.getUuidFk()); orderDetailEntity.setUuidFk(udiInfoEntity.getUuid());
orderDetailEntity.setRelId(String.valueOf(erpDetailCodeEntity.getId())); orderDetailEntity.setRelId(String.valueOf(udiInfoEntity.getId()));
orderDetailEntity.setGgxh(erpDetailCodeEntity.getGgxh()); orderDetailEntity.setGgxh(udiInfoEntity.getGgxh());
erpOrderEntities.add(orderDetailEntity); erpOrderEntities.add(orderDetailEntity);
} }
if (CollUtil.isNotEmpty(erpOrderEntities)) { if (CollUtil.isNotEmpty(erpOrderEntities)) {

Loading…
Cancel
Save