库存查询。供应商关联信息同步等问题

master
anthonyywj2 3 years ago
parent 3dc9968aa6
commit ae8ba3dd36

@ -50,9 +50,9 @@ public class InoutUtils {
}
public UdiInfoEntity getUdiInfo(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, String code, UdiDlHttpClient udiDlHttpClient) {
public UdiInfoEntity getUdiInfo(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, WarehouseEntity warehouseEntity, UdiDlHttpClient udiDlHttpClient) {
String prefix;
prefix = FilterUdiUtils.getDiStr(code);
prefix = FilterUdiUtils.getDiStr(warehouseEntity.getCode());
UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(prefix);
if (udiInfoEntity == null) {
List<UdiInfoEntity> froms = udiDlHttpClient.getUdiByDi(prefix);
@ -73,15 +73,19 @@ public class InoutUtils {
}
}
udiInfoEntity.setCode(code);
udiInfoEntity = FilterUdiUtils.transUdi(udiInfoEntity);
udiInfoEntity.setCode(warehouseEntity.getCode());
udiInfoEntity.setBatchNo(warehouseEntity.getBatchNo());
udiInfoEntity.setProduceDate(warehouseEntity.getProduceDate());
udiInfoEntity.setExpireDate(warehouseEntity.getExpireDate());
udiInfoEntity.setSerialNo(warehouseEntity.getSerialNo());
udiInfoEntity.setUdi(warehouseEntity.getNameCode());
return udiInfoEntity;
}
public UdiInfoEntity getUdiInfoByRlId(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, String code) {
public UdiInfoEntity getUdiInfoByRlId(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, WarehouseEntity warehouseEntity) {
String prefix;
prefix = FilterUdiUtils.getDiStr(code);
prefix = FilterUdiUtils.getDiStr(warehouseEntity.getCode());
UdiInfoEntity udiInfoEntity = new UdiInfoEntity();
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(prefix);
@ -91,16 +95,21 @@ public class InoutUtils {
udiRelevanceResponse = udiRelevanceResponses.get(0);
}
if (udiRelevanceResponse == null) {
udiInfoEntity = getUdiInfo(udiInfoService, udiRelevanceService, code, udiDlHttpClient);
udiInfoEntity = getUdiInfo(udiInfoService, udiRelevanceService, warehouseEntity, udiDlHttpClient);
} else {
BeanUtils.copyProperties(udiRelevanceResponse, udiInfoEntity);
udiInfoEntity.setRelId(udiRelevanceResponse.getId() + "");
udiInfoEntity.setCode(code);
udiInfoEntity = FilterUdiUtils.transUdi(udiInfoEntity);
udiInfoEntity.setCode(warehouseEntity.getCode());
// udiInfoEntity = FilterUdiUtils.transUdi(udiInfoEntity);
udiInfoEntity.setNameCode(udiRelevanceResponse.getNameCode());
udiInfoEntity.setCode(warehouseEntity.getCode());
udiInfoEntity.setBatchNo(warehouseEntity.getBatchNo());
udiInfoEntity.setProduceDate(warehouseEntity.getProduceDate());
udiInfoEntity.setExpireDate(warehouseEntity.getExpireDate());
udiInfoEntity.setSerialNo(warehouseEntity.getSerialNo());
udiInfoEntity.setUdi(warehouseEntity.getNameCode());
}
udiInfoEntity.setCode(code);
udiInfoEntity.setCode(warehouseEntity.getCode());
return udiInfoEntity;
@ -114,7 +123,7 @@ public class InoutUtils {
List<UdiInfoEntity> udiInfoEntities = new ArrayList<>();
for (WarehouseEntity warehouseEntity : warehouseEntityList) {
UdiInfoEntity udiInfoEntity = null;
udiInfoEntity = getUdiInfoByRlId(udiInfoService, udiRelevanceService, warehouseEntity.getCode());
udiInfoEntity = getUdiInfoByRlId(udiInfoService, udiRelevanceService, warehouseEntity);
if (udiInfoEntity != null) {
udiInfoEntity.setCount(getActCount(warehouseEntity, udiRelevanceService) * warehouseEntity.getCount());
udiInfoEntity.setRelId(warehouseEntity.getRelId());

@ -48,17 +48,6 @@ public class InvProductServiceImpl implements InvProductService {
@Override
public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) {
// FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
// filterInvProductRequest.setRelIdFk(uuid);
// filterInvProductRequest.setBatchNo(batchNo);
// filterInvProductRequest.setSupId(supId);
// filterInvProductRequest.setInvWarehouseCode(invWarehouseCode);
// filterInvProductRequest.setInvStorageCode(invStorageCode);
// List<InvProductEntity> data = filterInvProduct(filterInvProductRequest);
// if (data != null && data.size() > 0) {
// return data.get(0);
// }
// return null;
if (StrUtil.isEmpty(batchNo)) {
batchNo = "empty";
}

@ -346,8 +346,27 @@ public class DlBasicService {
orderEntity.setErpFk(null);
orderEntity.setOutChangeEnable(false);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
orderService.deleteByOrderId(orderEntity.getId());
mapper.importOrder(orderEntity);
OrderEntity temp = orderService.findById(orderEntity.getId());
if(temp == null){
mapper.importOrder(orderEntity);
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseEntityList())) {
try {
CodesTempDao codeMappert = batchSession.getMapper(CodesTempDao.class);
List<WarehouseEntity> warehouseEntityList = syncDataResponse.getWarehouseEntityList();
for (WarehouseEntity warehouseEntity:warehouseEntityList){
if(warehouseEntity.getOrderId().equals(orderEntity.getId())){
codeMappert.replaceCodesTempSingle(warehouseEntity);
}
}
batchSession.commit();
} catch (Exception e) {
}
}
}
}
batchSession.commit();
} catch (Exception e) {
@ -364,17 +383,7 @@ public class DlBasicService {
// } catch (Exception e) {
// }
// }
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseEntityList())) {
try {
List<WarehouseEntity> warehouseEntityList = syncDataResponse.getWarehouseEntityList();
CodesTempDao mapper = batchSession.getMapper(CodesTempDao.class);
for (WarehouseEntity warehouseEntity : warehouseEntityList) {
mapper.replaceCodesTempSingle(warehouseEntity);
}
batchSession.commit();
} catch (Exception e) {
}
}
batchSession.close();
spGetHttp.postBasicStatus(basicExportStatusEntity.getId());
}

@ -104,6 +104,14 @@ public class UpBasicService {
syncDataResponse.setUdiInfoEntities(udiInfoEntities);
syncDataResponse.setUdiRelevanceEntities(udiRelevanceEntities);
//供应商产品信息关联表
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterCompanyProductRelevanceRequest);
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = companyProductRelevanceService.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest);
syncDataResponse.setCompanyProductRelevanceEntities(companyProductRelevanceEntities);
}
//往来单位字典
@ -157,12 +165,7 @@ public class UpBasicService {
syncDataResponse.setThrOrderEntities(thrOrderEntities);
}
//供应商产品信息关联表
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterCompanyProductRelevanceRequest);
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = companyProductRelevanceService.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest);
syncDataResponse.setCompanyProductRelevanceEntities(companyProductRelevanceEntities);
return syncDataResponse;
}
@ -279,10 +282,6 @@ public class UpBasicService {
List<WarehouseEntity> warehouseEntityList = new ArrayList<>();
if (CollUtil.isNotEmpty(orderEntities)) {
for (OrderEntity orderEntity : orderEntities) {
// List<ErpOrderEntity> orderDetailEntityList = orderDetailService.filterAllByOrderIdFk(orderEntity.getId());
// if (CollUtil.isNotEmpty(orderDetailEntityList)) {
// allOrderDetailEntityList.addAll(orderDetailEntityList);
// }
List<WarehouseEntity> codes = codesService.findByReceiptId(orderEntity.getId());
if (CollUtil.isNotEmpty(codes)) {
warehouseEntityList.addAll(codes);

@ -63,12 +63,12 @@
<insert id="replaceCodesTempSingle" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inout.WarehouseEntity">
replace
INTO io_codes_temp(id,`action`, mainAction, code, corpOrderId, actor, actDate,
insert
ignore
INTO io_codes_temp(`action`, mainAction, code, corpOrderId, actor, actDate,
fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate, serialNo,
`count`, nameCode, supId, invStorageCode, invWarehouseCode, locStorageCode, relId)
values (
#{id},
#{action},
#{mainAction},
#{code},

@ -33,7 +33,7 @@
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo,preCheck,thirdBillNo)
outChangeEnable, originUllageSupNo, preCheck, thirdBillNo)
values (#{id},
#{action},
#{corpOrderId},
@ -52,11 +52,13 @@
#{erpFk},
#{stockCheckFk},
#{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo}
, #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},#{preCheck},#{thirdBillNo})
, #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},
#{preCheck}, #{thirdBillNo})
</insert>
<insert id="importOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.inout.OrderEntity">
replace
insert
ignore
INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, supId,
@ -88,7 +90,9 @@
#{createUser},
#{reviewUser},
#{outChangeEnable},
#{originUllageSupNo},#{preCheck},#{thirdBillNo}
#{originUllageSupNo},
#{preCheck},
#{thirdBillNo}
)
</insert>
@ -237,7 +241,8 @@
and reviewUser =#{reviewUser}
</if>
<if test="unionUser != '' and unionUser!=null">
and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is null) )
and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is
null) )
</if>
<if test="ullageSupNo != '' and ullageSupNo!=null">
and ullageSupNo =#{ullageSupNo}
@ -502,7 +507,8 @@
and receiveStatus = #{receiveStatus}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
and <![CDATA[ DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
and
<![CDATA[ DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="filterActions!=null">
and `action` in
@ -549,8 +555,8 @@
<update id="updateOrderTime">
update io_order
set actDate = #{actDate},
auditTime = #{auditTime},
set actDate = #{actDate},
auditTime = #{auditTime},
updateTime = #{updateTime}
where id in
<foreach collection="orderIds" item="item" index="index" open="(" close=")" separator=",">

Loading…
Cancel
Save