长泰区厂家

dev
anthonywj 1 year ago
parent b95691bf8b
commit cf77eeb91c

@ -3,6 +3,7 @@ package com.glxp.mipsdl.client.ctqyy;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
@ -23,6 +24,7 @@ import com.glxp.mipsdl.dao.basic.BasicProductsDao;
import com.glxp.mipsdl.dao.basic.BasicUdirelDao;
import com.glxp.mipsdl.dao.inout.*;
import com.glxp.mipsdl.dao.thrsys.ThrInvWarehouseDao;
import com.glxp.mipsdl.dao.thrsys.ThrProductsDao;
import com.glxp.mipsdl.dao.thrsys.ThrSystemBusApiDao;
import com.glxp.mipsdl.entity.auth.AuthUserEntity;
import com.glxp.mipsdl.entity.auth.AuthWarehouseEntity;
@ -38,6 +40,7 @@ import com.glxp.mipsdl.entity.ctqyy.ThrHslbEntity;
import com.glxp.mipsdl.entity.inout.*;
import com.glxp.mipsdl.entity.thrsys.ThrCorpEntity;
import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity;
import com.glxp.mipsdl.entity.thrsys.ThrProductsEntity;
import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity;
import com.glxp.mipsdl.http.HttpClient;
import com.glxp.mipsdl.req.base.*;
@ -347,6 +350,7 @@ public class CtqyyClient extends CommonHttpClient {
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}
}
@ -725,7 +729,7 @@ public class CtqyyClient extends CommonHttpClient {
.isNull(StrUtil.isEmpty(detailBizEntity.getBatchNo()), "batchNo").last("LIMIT 1"));
if (orderDetailCodeEntity != null && IntUtil.value(orderDetailCodeEntity.getReCount()) > 0) {
detailBizEntity.setCount(orderDetailCodeEntity.getReCount());
UdiwmsOrderDetailRequest item = submitOrderUtil.buildProductInfo(detailBizEntity);
UdiwmsOrderDetailRequest item = buildProductInfo(detailBizEntity);
if (item != null) {
//封装条码信息
submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item);
@ -736,6 +740,46 @@ public class CtqyyClient extends CommonHttpClient {
}
@Resource
private ThrProductsDao thrProductsDao;
public UdiwmsOrderDetailRequest buildProductInfo(IoOrderDetailBizEntity detailBizEntity) {
//查询产品信息
BasicUdirelEntity basicUdirel = basicUdirelDao.selectById(detailBizEntity.getBindRlFk());
BasicProductsEntity basicProducts = basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().eq(BasicProductsEntity::getUuid, basicUdirel.getUuid()).last("limit 1"));
UdiwmsOrderDetailRequest item = new UdiwmsOrderDetailRequest();
BeanUtil.copyProperties(detailBizEntity, item);
item.setProductDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getProductDate()) ? null : "20" + detailBizEntity.getProductDate()));
item.setExpireDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getExpireDate()) ? null : "20" + detailBizEntity.getExpireDate()));
String thirdProductId = (String) ReflectUtil.getFieldValue(basicUdirel, thirdSysConfig.getThirdId());
item.setProductId(thirdProductId); //产品ID
//查询第三方产品名称
ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new LambdaQueryWrapper<ThrProductsEntity>()
.eq(ThrProductsEntity::getCode, thirdProductId).last("limit 1"));
if (thrProductsEntity == null) {
log.error("第三方产品编码未关联");
return null;
}
item.setProductName(thrProductsEntity.getName()); //产品名称
item.setBindRlFk(detailBizEntity.getBindRlFk());
item.setStandard(detailBizEntity.getSpec()); //规格型号
item.setBillNo(detailBizEntity.getOrderIdFk()); //单据号
item.setRegisterNo(detailBizEntity.getCertCode()); //注册/备案证号
item.setManufactory(basicProducts.getManufactory()); //生产厂家
item.setMeasname(basicProducts.getMeasname()); //计量单位
item.setAllowNoBatch(IntUtil.value(basicProducts.getAllowNoBatch())); //是否允许无批次号
// item.setManufactoryCode(thrProductsEntity.getManufactoryCode());
item.setSupCode(thrProductsEntity.getSupCode());
item.setCplb(thrProductsEntity.getFlbm());
item.setHslb(thrProductsEntity.getCplb());
item.setCount(detailBizEntity.getCount());
return item;
}
/**
*
*

Loading…
Cancel
Save