单据同步

master
anthonywj 2 years ago
parent 8dc444be01
commit 9f946d35c6

@ -51,6 +51,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.rmi.server.UID;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -172,8 +173,8 @@ public class ThrProductsAddDiController {
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
} }
String remark=thrProductsAddDiEntity.getRemark(); String remark = thrProductsAddDiEntity.getRemark();
Integer status=thrProductsAddDiEntity.getStatus(); Integer status = thrProductsAddDiEntity.getStatus();
thrProductsAddDiEntity.setAuditTime(new Date()); thrProductsAddDiEntity.setAuditTime(new Date());
thrProductsAddDiEntity.setAuditUser(customerService.getUserId() + ""); thrProductsAddDiEntity.setAuditUser(customerService.getUserId() + "");
@ -206,7 +207,9 @@ public class ThrProductsAddDiController {
//字段更新 //字段更新
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(udiRelIdFk); UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(udiRelIdFk);
//更新产品信息 //更新产品信息
UdiProductEntity udiProductEntity = udiProductService.findByUuid(udiRelevanceEntity.getUuid()); // UdiProductEntity udiProductEntity = udiProductService.findByUuid(udiRelevanceEntity.getUuid());
UdiProductEntity udiProductEntity = new UdiProductEntity();
udiProductEntity.setUuid(udiRelevanceEntity.getUuid());
udiProductEntity.setSptm(thrProductsAddDiResponse.getSptm()); udiProductEntity.setSptm(thrProductsAddDiResponse.getSptm());
udiProductEntity.setYbbm(thrProductsAddDiResponse.getYbbm()); udiProductEntity.setYbbm(thrProductsAddDiResponse.getYbbm());
udiProductEntity.setMeasname(thrProductsAddDiResponse.getMeasname()); udiProductEntity.setMeasname(thrProductsAddDiResponse.getMeasname());
@ -257,7 +260,7 @@ public class ThrProductsAddDiController {
thrProductsAddDiEntity.setRemark(remark); thrProductsAddDiEntity.setRemark(remark);
thrProductsAddDiEntity.setStatus(status); thrProductsAddDiEntity.setStatus(status);
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity); thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);
}else { } else {
thrProductsAddDiEntity.setRemark(remark); thrProductsAddDiEntity.setRemark(remark);
thrProductsAddDiEntity.setStatus(status); thrProductsAddDiEntity.setStatus(status);
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity); thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);

@ -13,7 +13,7 @@ import java.util.List;
/** /**
* <p> * <p>
* *
* </p> * </p>
* *
* @author * @author
@ -47,7 +47,7 @@ public class SupCertSetEntity {
/** /**
* (1:23. * (1:23.
*/ */
@TableField("foreign") @TableField("`foreign`")
private Integer foreign; private Integer foreign;
/** /**

@ -3,10 +3,10 @@ package com.glxp.api.entity.sync;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
public class SyncDataSetEntity { public class SyncDataSetEntity {
private Integer id; private Integer id;
private int typeBus; //业务单据类型 private int typeBus; //业务单据类型
private int typeScan; //扫码单据类型 private int typeScan; //扫码单据类型
@ -15,11 +15,13 @@ public class SyncDataSetEntity {
private int basicCorp; //往来单位字典 private int basicCorp; //往来单位字典
private int basicDept; //部门字典 private int basicDept; //部门字典
private int basicInv; //仓库字典 private int basicInv; //仓库字典
private int basicThirdDept; //第三方那个部门信息
private int basicThirdProducts; //第三方产品信息 private int basicThirdProducts; //第三方产品信息
private int basicThirdCorp; //第三方往来信息 private int basicThirdCorp; //第三方往来信息
private int basicThirdInv; //第三方仓库信息 private int basicThirdInv; //第三方仓库信息
private int basicThirdBusOrder; //第三方业务单据 private int basicThirdBusOrder; //第三方业务单据
private int dbDiProducts; //DI产品信息 private int dbDiProducts; //DI产品信息
private int dbDiCompany; //DI企业信息
private int udiCodeLost; // UDI码补齐 private int udiCodeLost; // UDI码补齐
private int udiCodeRel; //UDI码关联关系 private int udiCodeRel; //UDI码关联关系
@ -63,5 +65,4 @@ public class SyncDataSetEntity {
private int productCert; private int productCert;
} }

@ -16,11 +16,13 @@ public class SyncDataSetResponse {
private int basicCorp; private int basicCorp;
private int basicInv; private int basicInv;
private int basicDept; private int basicDept;
private int basicThirdDept;
private int basicThirdProducts; private int basicThirdProducts;
private int basicThirdCorp; private int basicThirdCorp;
private int basicThirdInv; private int basicThirdInv;
private int basicThirdBusOrder; private int basicThirdBusOrder;
private int dbDiProducts; private int dbDiProducts;
private int dbDiCompany;
private int udiCodeLost; // UDI码补齐 private int udiCodeLost; // UDI码补齐
private int udiCodeRel; //UDI码关联关系 private int udiCodeRel; //UDI码关联关系

@ -211,8 +211,11 @@ public class IoChangeInoutService {
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID); outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
InvWarehouseEntity curInv = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode()); InvWarehouseEntity curInv = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode());
InvWarehouseEntity upInv = invWarehouseService.findByInvSubByCode(curInv.getParentCode()); InvWarehouseEntity upInv = invWarehouseService.findByInvSubByCode(curInv.getParentCode());
outOrder.setFromInvCode(upInv.getCode()); if (upInv != null) {
outOrder.setFromDeptCode(upInv.getParentId()); outOrder.setFromInvCode(upInv.getCode());
outOrder.setFromDeptCode(upInv.getParentId());
}
//原先流程---使用流转单据默认仓库 //原先流程---使用流转单据默认仓库
// outOrder.setFromInvCode(bussinessChangeTypeEntity.getDefaultInvCode()); // outOrder.setFromInvCode(bussinessChangeTypeEntity.getDefaultInvCode());
// outOrder.setFromDeptCode(bussinessChangeTypeEntity.getDefaultDeptCode()); // outOrder.setFromDeptCode(bussinessChangeTypeEntity.getDefaultDeptCode());

@ -83,7 +83,7 @@ public class SpsSyncDownloadService {
log.info("创建单据同步任务"); log.info("创建单据同步任务");
//自动创建要求被下载已完成单据任务. //自动创建要求被下载已完成单据任务.
// 1.判断是否同步任务已存在 // 1.判断是否同步任务已存在
BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 0); BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 1);
if (basicExportStatusEntity1 == null) { if (basicExportStatusEntity1 == null) {
BaseResponse<SpsSyncOrderResponse> baseResponse = findOrder(getRequest(ConstantStatus.SYNC_SCAN_ORDER)); BaseResponse<SpsSyncOrderResponse> baseResponse = findOrder(getRequest(ConstantStatus.SYNC_SCAN_ORDER));
@ -106,7 +106,7 @@ public class SpsSyncDownloadService {
// 创建国家库同步任务 // 创建国家库同步任务
public void syncDiProductsTask() { public void syncDiProductsTask() {
BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData(ConstantStatus.SYNC_DI_PRODUCTS, 0); BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData(ConstantStatus.SYNC_DI_PRODUCTS, 1);
if (basicExportStatusEntity4 == null) { if (basicExportStatusEntity4 == null) {
BaseResponse<SpSyncUdiResponse> baseResponse = syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS)); BaseResponse<SpSyncUdiResponse> baseResponse = syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS));
SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData(); SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData();
@ -688,12 +688,15 @@ public class SpsSyncDownloadService {
BeanUtils.copyProperties(spsSyncDataRequest, productInfoFilterRequest); BeanUtils.copyProperties(spsSyncDataRequest, productInfoFilterRequest);
productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<ProductInfoEntity> productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest); List<ProductInfoEntity> productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest);
spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList);
}
if (syncDataSetEntity.getDbDiCompany() == 2) {
UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest(); UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest();
BeanUtils.copyProperties(spsSyncDataRequest, udiCompanyRequest); BeanUtils.copyProperties(spsSyncDataRequest, udiCompanyRequest);
udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime());
List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest); List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest);
spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities); spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities);
spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList);
} }
return ResultVOUtils.success(spSyncUdiResponse); return ResultVOUtils.success(spSyncUdiResponse);

@ -132,27 +132,6 @@
) )
</if> </if>
</if> </if>
<if test="supInoivceSearch != null and invoiceActions1 == null and invoiceActions1.size() == 0">
<if test="invoiceActions2 != null and invoiceActions2.size() != 0">
and (
`action` in
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and status = 7
)
</if>
</if>
<if test="supInoivceSearch != null and invoiceActions2 == null and invoiceActions2.size() == 0">
<if test="invoiceActions1 != null and invoiceActions2 == null">
AND (`action` in
<foreach collection="invoiceActions1" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and status = 10)
</if>
</if>
</where> </where>
order by createTime desc order by createTime desc
</select> </select>

@ -12,13 +12,17 @@
<insert id="insert" parameterType="com.glxp.api.entity.sync.SyncDataSetEntity"> <insert id="insert" parameterType="com.glxp.api.entity.sync.SyncDataSetEntity">
replace replace
INTO sync_data_set(id, typeBus, typeScan, INTO sync_data_set( id, typeBus, typeScan,
typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp, typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp
basicThirdInv , basicThirdInv
, basicThirdBusOrder, orderScanFinish, dbDiProducts, downstreamEnable, syncTime, , basicThirdBusOrder, orderScanFinish, dbDiProducts, downstreamEnable, syncTime
orderUnReceive, orderUnCheck, busTypes, sysUser, orderSyncTime, orderSyncStart, , syncDownloadTime,
basicSyncStart, entrustAction orderUnReceive, orderUnCheck, busTypes, sysUser, syncIp, orderSyncTime
, unCheckCert, checkedCert, companyCert, manufacturerCert, productCert, basicType, basicDept) , orderSyncStart, basicSyncStart, entrustAction
, unCheckCert, checkedCert, companyCert, manufacturerCert, productCert, basicDept
, systemConfig
, printConfig, scanChangeConfig, supCert, dbDiCompany, busChangeConfig
, udiCodeLost, udiCodeRel)
values (#{id}, values (#{id},
#{typeBus}, #{typeBus},
#{typeScan}, #{typeScan},
@ -34,15 +38,19 @@
#{dbDiProducts}, #{dbDiProducts},
#{downstreamEnable}, #{downstreamEnable},
#{syncTime}, #{syncTime},
#{syncDownloadTime},
#{orderUnReceive}, #{orderUnReceive},
#{orderUnCheck}, #{orderUnCheck},
#{busTypes}, #{busTypes},
#{sysUser}, #{sysUser},
#{syncIp},
#{orderSyncTime}, #{orderSyncTime},
#{orderSyncStart}, #{orderSyncStart},
#{basicSyncStart}, #{basicSyncStart},
#{entrustAction}, #{entrustAction},
#{unCheckCert}, #{unCheckCert},
#{checkedCert}, #{companyCert}, #{manufacturerCert}, #{productCert}, #{basicType}, #{basicDept}) #{checkedCert}, #{companyCert}, #{manufacturerCert}, #{productCert}, #{basicDept},
#{systemConfig}, #{printConfig}, #{scanChangeConfig}, #{supCert}, #{dbDiCompany}, #{busChangeConfig},
#{udiCodeLost}, #{udiCodeRel})
</insert> </insert>
</mapper> </mapper>

@ -1,7 +1,8 @@
# 字段新增 表名字段名字段类型修改方式1新增2修改3删除 # 字段新增 表名字段名字段类型修改方式1新增2修改3删除
CALL Pro_Temp_ColumnWork('sync_data_set', 'udi_code_lost', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'udi_code_rel', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'udiCodeLost', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'udiCodeRel', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'dbDiCompany', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_order', 'fromReceiveBillNo', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_order', 'fromReceiveBillNo', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'fromThrBillNo', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_order', 'fromThrBillNo', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'syncStatus', 'tinyint ', 1); CALL Pro_Temp_ColumnWork('io_order', 'syncStatus', 'tinyint ', 1);

Loading…
Cancel
Save