diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiContrastController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiContrastController.java index 9cace8a5..66cfbb53 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiContrastController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiContrastController.java @@ -13,6 +13,8 @@ import com.glxp.api.admin.entity.thrsys.ThrProductsEntity; import com.glxp.api.admin.httpclient.UdiDlHttpClient; import com.glxp.api.admin.req.basic.CombineRequest; import com.glxp.api.admin.req.basic.RemoveRelRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiRelevanceRequest; import com.glxp.api.admin.req.receipt.ProductInfoFilterRequest; import com.glxp.api.admin.req.thrsys.FilterThrProductsRequest; import com.glxp.api.admin.res.PageSimpleResponse; @@ -117,18 +119,23 @@ public class UdiContrastController { } List udiInfoEntities = udiDlHttpClient.getUdiByUuid(combineRequest.getKeys().get(0)); - udiInfoService.deleteByUuid(udiRelevanceEntity.getUuid()); +// udiInfoService.deleteByUuid(udiRelevanceEntity.getUuid()); for (UdiInfoEntity udiInfoEntity : udiInfoEntities) { udiInfoEntity.setUuid(udiRelevanceEntity.getUuid()); udiInfoEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI); - + UdiInfoUtil.initUdiInfoEntity(udiInfoEntity); + UdiInfoRequest udiInfoReqeust = new UdiInfoRequest(); + BeanUtils.copyProperties(udiInfoEntity, udiInfoReqeust); + udiInfoService.updateUdiInfo(udiInfoReqeust); } - udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities)); -// udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid()); +// udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities)); + udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid()); String time = DateUtil.formatDateTime(new Date()); udiRelevanceEntity.setUpdateTime(time); udiRelevanceEntity.setModifyTime(time); - udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); return ResultVOUtils.success("切换成功!"); } @@ -149,13 +156,14 @@ public class UdiContrastController { udiRelevanceEntity.setPrice(combineRequest.getPrice()); udiRelevanceEntity.setSptm(combineRequest.getSptm()); udiRelevanceEntity.setYbbm(combineRequest.getYbbm()); - UdiRelevanceEntity temp = udiContrastService.findById(udiRelevanceEntity.getId()); if (udiContrastService.isExit(temp.getOriginUuid(), udiRelevanceEntity.getMainId(), combineRequest.getThirdSys())) { return ResultVOUtils.error(500, "已存在相同的对照关系,对照失败!"); } else { try { - udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); } catch (Exception e) { return ResultVOUtils.error(500, "已存在相同的对照关系,对照失败!"); } @@ -185,7 +193,7 @@ public class UdiContrastController { udiRelevanceEntity.setThirdName(""); UdiRelevanceEntity temp = udiContrastService.findById(udiRelevanceEntity.getId()); if (udiContrastService.isExit(temp.getOriginUuid(), null, null)) { - return ResultVOUtils.error(500, "解除绑定失败!"); + return ResultVOUtils.error(500, "解除绑定失败,存在未关联第三方产品信息DI!"); } } else if (removeRelRequest.getThirdSys().equals("thirdId1")) { udiRelevanceEntity.setThirdId1(""); @@ -205,7 +213,11 @@ public class UdiContrastController { combineRequest.setRelId(removeRelRequest.getRelId()); udiRelevanceEntity.setSupName(""); udiRelevanceEntity.setPrice(""); - udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + udiRelevanceEntity.setManufactory(""); + udiRelevanceEntity.setMeasname(""); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); } catch (Exception e) { e.printStackTrace(); return ResultVOUtils.error(500, "解除绑定失败!"); @@ -304,8 +316,8 @@ public class UdiContrastController { udiRelevanceEntity.setUuid(CustomUtil.getUUId()); udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory()); udiRelevanceEntity.setSupName(combineRequest.getSupName()); - udiRelevanceEntity.setPrice(thrProductsEntity.getPrice()); udiRelevanceEntity.setId(gennerOrderUtils.getRelId() + ""); + udiRelevanceEntity.setPrice(thrProductsEntity.getPrice()); udiRelevanceService.insertUdiRelevance(udiRelevanceEntity); UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); BeanUtils.copyProperties(thrProductsEntity, udiInfoEntity); @@ -323,7 +335,9 @@ public class UdiContrastController { udiInfoEntity.setScbssfbhsxrq("是"); udiInfoEntity.setScbssfbhxlh("否"); udiInfoEntity = UdiInfoUtil.initUdiInfoEntity(udiInfoEntity); - udiInfoService.insertUdiInfo(udiInfoEntity); + UdiInfoRequest udiInfoRequest = new UdiInfoRequest(); + BeanUtils.copyProperties(udiInfoEntity, udiInfoRequest); + udiInfoService.insertUdiInfo(udiInfoRequest); } public void updateDi(UdiRelevanceEntity udiRelevanceEntity, String key) { @@ -333,7 +347,9 @@ public class UdiContrastController { String time = DateUtil.getDateTime(); udiRelevanceEntity.setUpdateTime(time); udiRelevanceEntity.setModifyTime(time); - udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); insertUdiInfos(udiInfoEntities); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java index d892f5fb..82b4e379 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java @@ -299,46 +299,51 @@ public class UdiRelevanceController { } //判断父id不为空就吧值给到id里面防止id变成详情id - if(udiRelevanceResponse.getPid()!=null){ + if (udiRelevanceResponse.getPid() != null) { udiRelevanceResponse.setId(udiRelevanceResponse.getPid()); } - UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity(); - BeanUtils.copyProperties(udiRelevanceResponse, udiRelevanceEntity); - udiRelevanceEntity.setId(udiRelevanceResponse.getId() + ""); + //更新关联表相关信息 + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceResponse, udiRelevanceRequest); + udiRelevanceRequest.setId(udiRelevanceResponse.getId() + ""); String time = DateUtil.getDateTime(); - udiRelevanceEntity.setUpdateTime(time); - udiRelevanceEntity.setModifyTime(time); + udiRelevanceRequest.setUpdateTime(time); + udiRelevanceRequest.setModifyTime(time); if (udiRelevanceResponse.getIsUseDy() == 1) { - udiRelevanceEntity.setIsUseDy(true); - } else udiRelevanceEntity.setIsUseDy(false); - udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); - - - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); - udiInfoEntity.setSptm(udiRelevanceResponse.getSptm()); - udiInfoEntity.setYbbm(udiRelevanceResponse.getYbbm()); - udiInfoEntity.setMeasname(udiRelevanceResponse.getMeasname()); - udiInfoEntity.setManufactory(udiRelevanceResponse.getManufactory()); - udiInfoEntity.setCpms(udiRelevanceResponse.getCpms()); - udiInfoEntity.setPrice(udiRelevanceResponse.getPrice()); - udiInfoEntity.setSpmc(udiRelevanceResponse.getSpmc()); - udiInfoEntity.setZxxsbzbhsydysl(udiRelevanceResponse.getZxxsbzbhsydysl()); - udiInfoEntity.setAllowNoBatch(udiRelevanceResponse.isAllowNoBatch()); - udiInfoEntity.setAllowNoExpire(udiRelevanceResponse.isAllowNoExpire()); - udiInfoEntity.setAllowNoProduct(udiRelevanceResponse.isAllowNoProduct()); - udiInfoEntity.setBasicPrductRemak1(udiRelevanceResponse.getBasicPrductRemak1()); - udiInfoEntity.setBasicPrductRemak2(udiRelevanceResponse.getBasicPrductRemak2()); - udiInfoEntity.setBasicPrductRemak3(udiRelevanceResponse.getBasicPrductRemak3()); - udiInfoEntity.setBasicPrductRemak4(udiRelevanceResponse.getBasicPrductRemak4()); - udiInfoEntity.setBasicPrductRemak5(udiRelevanceResponse.getBasicPrductRemak5()); - udiInfoEntity.setBasicPrductRemak6(udiRelevanceResponse.getBasicPrductRemak6()); - udiInfoEntity.setBasicPrductRemak7(udiRelevanceResponse.getBasicPrductRemak7()); - udiInfoEntity.setBasicPrductRemak8(udiRelevanceResponse.getBasicPrductRemak8()); + udiRelevanceRequest.setIsUseDy(true); + } else udiRelevanceRequest.setIsUseDy(false); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); + + + //更新产品信息表相关产品信息 + UdiInfoRequest udiInfoRequest = new UdiInfoRequest(); + udiInfoRequest.setNameCode(udiRelevanceResponse.getNameCode()); + udiInfoRequest.setSptm(udiRelevanceResponse.getSptm()); + udiInfoRequest.setYbbm(udiRelevanceResponse.getYbbm()); + udiInfoRequest.setMeasname(udiRelevanceResponse.getMeasname()); + udiInfoRequest.setManufactory(udiRelevanceResponse.getManufactory()); + udiInfoRequest.setCpms(udiRelevanceResponse.getCpms()); +// udiInfoRequest.setDiType(udiRelevanceResponse.getDiType()); + udiInfoRequest.setPrice(udiRelevanceResponse.getPrice()); + udiInfoRequest.setSpmc(udiRelevanceResponse.getSpmc()); + udiInfoRequest.setAllowNoBatch(udiRelevanceResponse.isAllowNoBatch()); + udiInfoRequest.setAllowNoExpire(udiRelevanceResponse.isAllowNoExpire()); + udiInfoRequest.setAllowNoProduct(udiRelevanceResponse.isAllowNoProduct()); + udiInfoRequest.setZxxsbzbhsydysl(udiRelevanceResponse.getZxxsbzbhsydysl()); + udiInfoRequest.setBasicPrductRemak1(udiRelevanceResponse.getBasicPrductRemak1()); + udiInfoRequest.setBasicPrductRemak2(udiRelevanceResponse.getBasicPrductRemak2()); + udiInfoRequest.setBasicPrductRemak3(udiRelevanceResponse.getBasicPrductRemak3()); + udiInfoRequest.setBasicPrductRemak4(udiRelevanceResponse.getBasicPrductRemak4()); + udiInfoRequest.setBasicPrductRemak5(udiRelevanceResponse.getBasicPrductRemak5()); + udiInfoRequest.setBasicPrductRemak6(udiRelevanceResponse.getBasicPrductRemak6()); + udiInfoRequest.setBasicPrductRemak7(udiRelevanceResponse.getBasicPrductRemak7()); + udiInfoRequest.setBasicPrductRemak8(udiRelevanceResponse.getBasicPrductRemak8()); if (StrUtil.isNotEmpty(udiRelevanceResponse.getOriginUuid())) { - udiInfoEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI); + udiInfoRequest.setProductType(ConstantStatus.PRODUCT_TYPE_UDI); } - udiInfoEntity.setUuid(udiRelevanceResponse.getUuid()); - udiInfoService.updateUdiInfo(udiInfoEntity); + + udiInfoRequest.setUuid(udiRelevanceResponse.getUuid()); + udiInfoService.updateUdiInfo(udiInfoRequest); return ResultVOUtils.success("更新成功"); } @@ -509,10 +514,11 @@ public class UdiRelevanceController { } else { udiRelevanceEntity.setUuid(postSmpUdiInfoRequest.getUuid()); } + String time = DateUtil.getDateTime(); udiRelevanceEntity.setUpdateTime(time); udiRelevanceEntity.setModifyTime(time); - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + UdiInfoRequest udiInfoEntity = new UdiInfoRequest(); udiInfoEntity.setYbbm(postSmpUdiInfoRequest.getYbbm()); udiInfoEntity.setSptm(postSmpUdiInfoRequest.getSptm()); BeanUtils.copyProperties(postSmpUdiInfoRequest, udiInfoEntity); @@ -696,23 +702,25 @@ public class UdiRelevanceController { } BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getMainId(), basicThirdSysEntity.getThirdId()); - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); - BeanUtils.copyProperties(thrProductsEntity, udiInfoEntity); - udiInfoEntity.setNameCode(thrProductsEntity.getCode()); - udiInfoEntity.setCpmctymc(thrProductsEntity.getName()); - udiInfoEntity.setManufactory(thrProductsEntity.getManufactory()); - udiInfoEntity.setYlqxzcrbarmc(thrProductsEntity.getManufactory()); - udiInfoEntity.setGgxh(thrProductsEntity.getSpec()); - udiInfoEntity.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo()); - udiInfoEntity.setUuid(CustomUtil.getUUId()); - udiInfoEntity.setProductType(ConstantStatus.PRODUCT_TYPE_THIRD); - udiInfoEntity.setDiType(1); - udiInfoService.insertUdiInfo(udiInfoEntity); - udiRelevanceEntity.setUuid(udiInfoEntity.getUuid()); + UdiInfoRequest UdiInfoRequest = new UdiInfoRequest(); + BeanUtils.copyProperties(thrProductsEntity, UdiInfoRequest); + UdiInfoRequest.setNameCode(thrProductsEntity.getCode()); + UdiInfoRequest.setCpmctymc(thrProductsEntity.getName()); + UdiInfoRequest.setManufactory(thrProductsEntity.getManufactory()); + UdiInfoRequest.setYlqxzcrbarmc(thrProductsEntity.getManufactory()); + UdiInfoRequest.setGgxh(thrProductsEntity.getSpec()); + UdiInfoRequest.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo()); + UdiInfoRequest.setUuid(CustomUtil.getUUId()); + UdiInfoRequest.setProductType(ConstantStatus.PRODUCT_TYPE_THIRD); + UdiInfoRequest.setDiType(1); + udiInfoService.insertUdiInfo(UdiInfoRequest); + udiRelevanceEntity.setUuid(UdiInfoRequest.getUuid()); String time = DateUtil.getDateTime(); udiRelevanceEntity.setUpdateTime(time); udiRelevanceEntity.setModifyTime(time); - udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); return ResultVOUtils.success("解除绑定成功!"); } @@ -732,7 +740,9 @@ public class UdiRelevanceController { UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity(); udiRelevanceEntity.setId(id); udiRelevanceEntity.setLockStatus(lockUdiRequest.getLockStatus()); - udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); } return ResultVOUtils.success("更新成功!"); } else { diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiInfoDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiInfoDao.java index a8349cbf..d33a2244 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiInfoDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiInfoDao.java @@ -2,6 +2,7 @@ package com.glxp.api.admin.dao.basic; import com.glxp.api.admin.entity.basic.UdiInfoEntity; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -21,11 +22,11 @@ public interface UdiInfoDao { UdiInfoEntity findById(@Param("id") String id); - boolean insertUdiInfo(UdiInfoEntity udiInfoEntity); + boolean insertUdiInfo(UdiInfoRequest udiInfoRequest); boolean insertUdiInfos(@Param("udiInfoEntities") List udiInfoEntities); - boolean updateUdiInfo(UdiInfoEntity udiInfoEntity); + boolean updateUdiInfo(UdiInfoRequest udiInfoEntity); boolean deleteById(@Param("id") String id); @@ -59,5 +60,4 @@ public interface UdiInfoDao { void updateUdiInfoByUuid(UdiInfoEntity udiInfoEntity); - } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiRelevanceDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiRelevanceDao.java index c65ffe06..29f997c9 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiRelevanceDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/UdiRelevanceDao.java @@ -2,6 +2,7 @@ package com.glxp.api.admin.dao.basic; import com.glxp.api.admin.entity.basic.UdiRelevanceEntity; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiRelevanceRequest; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -40,7 +41,7 @@ public interface UdiRelevanceDao { boolean insertUdiRelevanceignore(UdiRelevanceEntity udiRelevanceEntity); - boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity); + boolean updateUdiRelevance(UdiRelevanceRequest udiRelevanceRequest); boolean deleteById(@Param("id") String id); @@ -77,6 +78,7 @@ public interface UdiRelevanceDao { /** * 查找产品UUID + * * @param relId * @return */ diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiRelevanceEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiRelevanceEntity.java index f0a452f5..a2793bbf 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiRelevanceEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiRelevanceEntity.java @@ -35,38 +35,6 @@ public class UdiRelevanceEntity { private String price; private String modifyTime;//修改时间 - private Boolean isCheck; - private boolean allowNoBatch; - private boolean allowNoExpire; - private boolean allowNoProduct; - - //规格型号 - private String ggxh; - - //器械类别 - private String qxlb; - - //产品类别 - private String cplb; - - //分类编码 - private String flbm; - - //医疗器械注册人 - private String ylqxzcrbarmc; - - //注册人英文名称 - private String ylqxzcrbarywmc; - - //统一社会信用号 - private String tyshxydm; - - //注册证/备案号 - private String zczbhhzbapzbh; - - //产品描述 - private String cpms; - private Boolean useMuti; //是否多次使用 private Integer useNum; //最小包装单元可使用次数 @@ -76,4 +44,5 @@ public class UdiRelevanceEntity { return 1; return lockStatus; } + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/basic/UdiInfoRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/basic/UdiInfoRequest.java new file mode 100644 index 00000000..9ccaf27a --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/req/basic/UdiInfoRequest.java @@ -0,0 +1,83 @@ +package com.glxp.api.admin.req.basic; + +import lombok.Data; + +@Data +public class UdiInfoRequest { + private Integer id; + private String nameCode; + private String packRatio; + private String packLevel; + private Integer bhxjsl; + private Integer bhzxxsbzsl; + private Integer zxxsbzbhsydysl; + private String bhxjcpbm; + private String sjcpbm; // + private String bzcj; + private String addType; + private String deviceRecordKey; + private String cpmctymc; + private String cplb; + private String flbm; + private String ggxh; + private String qxlb; + private String tyshxydm; + private String ylqxzcrbarmc; + private String zczbhhzbapzbh; + private String ylqxzcrbarywmc; + private String sydycpbs; + private String uuid; + private Integer versionNumber; + private Integer diType; + private String thirdId; + private String thirdName; + private String ybbm; + private String sptm; + private String manufactory; + private String measname; + private Integer productType; + private String scbssfbhph; + private String scbssfbhxlh; + private String scbssfbhscrq; + private String scbssfbhsxrq; + private String cpms; + private String spmc; + private String originUuid; + + //本地生成信息 + private String batchNo; + private String produceDate; + private String expireDate; + private String serialNo; + private String udi; + private String code; + private Integer count; + private String warehouseCode; + private String udplatCode; + private String relId;//关联ID主键 + private Integer status; + private String supId; + + private Boolean isCheck; + private boolean allowNoBatch; + private boolean allowNoExpire; + private boolean allowNoProduct; + + private String price; + private String cplx; + private String hchzsb; + + //产品代理商 + private String cpdls; + + + private String basicPrductRemak1; + private String basicPrductRemak2; + private String basicPrductRemak3; + private String basicPrductRemak4; + private String basicPrductRemak5; + private String basicPrductRemak6; + private String basicPrductRemak7; + private String basicPrductRemak8; + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/basic/UdiRelevanceRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/basic/UdiRelevanceRequest.java new file mode 100644 index 00000000..6cb85999 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/req/basic/UdiRelevanceRequest.java @@ -0,0 +1,42 @@ +package com.glxp.api.admin.req.basic; + +import lombok.Data; + +@Data +public class UdiRelevanceRequest { + + private String id; + private String thirdId; + private String thirdName; + private String uuid; + private Boolean isUseDy; + private String updateTime; + private String thirdId1; + private String thirdId2; + private String thirdId3; + private String thirdId4; + private String thirdName1; + private String thirdName2; + private String thirdName3; + private String thirdName4; + private String manufactory; + private String measname; + private String ybbm; + private String sptm; + private Boolean isDisable; + private Boolean isLock; + private String mainId; + private String mainName; + private Integer lockStatus; + private String udplatCode; + private Boolean isAdavence; + private String supName; + private String originUuid; + private String price; + private String modifyTime; //修改时间 + + private Boolean useMuti; //是否多次使用 + private Integer useNum; //最小包装单元可使用次数 + + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiContrastService.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiContrastService.java index b37b7e2f..389ab64a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiContrastService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiContrastService.java @@ -10,6 +10,7 @@ import com.glxp.api.admin.entity.thrsys.ThrProductsEntity; import com.glxp.api.admin.httpclient.UdiDlHttpClient; import com.glxp.api.admin.req.basic.CombineRequest; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.req.thrsys.FilterThrProductsRequest; import com.glxp.api.admin.service.thrsys.ThrProductsService; import com.glxp.api.admin.util.CustomUtil; @@ -153,7 +154,7 @@ public class UdiContrastService { udiRelevanceEntity.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceEntity.setPrice(thrProductsEntity.getPrice()); udiRelevanceService.insertUdiRelevance(udiRelevanceEntity); - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + UdiInfoRequest udiInfoEntity = new UdiInfoRequest(); BeanUtils.copyProperties(thrProductsEntity, udiInfoEntity); udiInfoEntity.setNameCode(thrProductsEntity.getCode()); udiInfoEntity.setCpmctymc(thrProductsEntity.getName()); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiInfoService.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiInfoService.java index 93f0a017..6e7d441f 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiInfoService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiInfoService.java @@ -3,6 +3,7 @@ package com.glxp.api.admin.service.basic; import com.glxp.api.admin.entity.basic.UdiInfoEntity; import com.glxp.api.admin.entity.basic.UdiRelevanceEntity; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import org.apache.ibatis.annotations.Param; @@ -25,11 +26,11 @@ public interface UdiInfoService { List findByUuids(String uuid); - boolean insertUdiInfo(UdiInfoEntity udiInfoEntity); + boolean insertUdiInfo(UdiInfoRequest udiInfoRequest); boolean insertUdiInfos(List udiInfoEntities); - boolean updateUdiInfo(UdiInfoEntity udiInfoEntity); + boolean updateUdiInfo(UdiInfoRequest udiInfoRequest); boolean deleteById(String id); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiRelevanceService.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiRelevanceService.java index 5c5d8e9a..3dda300f 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiRelevanceService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/UdiRelevanceService.java @@ -2,6 +2,7 @@ package com.glxp.api.admin.service.basic; import com.glxp.api.admin.entity.basic.UdiRelevanceEntity; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiRelevanceRequest; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import java.util.List; @@ -55,7 +56,7 @@ public interface UdiRelevanceService { boolean insertUdiRelevanceignore(UdiRelevanceEntity udiRelevanceEntity); - boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity); + boolean updateUdiRelevance(UdiRelevanceRequest udiRelevanceRequest); boolean deleteById(String id); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoImportDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoImportDetailServiceImpl.java index a9d7c262..da900daa 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoImportDetailServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoImportDetailServiceImpl.java @@ -7,6 +7,7 @@ import com.glxp.api.admin.dao.thrsys.ThrProductsDao; import com.glxp.api.admin.entity.basic.*; import com.glxp.api.admin.entity.thrsys.ThrProductsEntity; import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.res.basic.UdiRelevanceExportJsonResponse; import com.glxp.api.admin.service.basic.UdiInfoImportDetailService; import com.glxp.api.admin.service.info.CompanyProductRelevanceService; @@ -14,6 +15,7 @@ import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.TransactionIsolationLevel; +import org.springframework.beans.BeanUtils; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -85,8 +87,10 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getUdiInfoEntities())) { List corpList = udiRelevanceExportJsonResponse.getUdiInfoEntities(); UdiInfoDao mapper = batchSession.getMapper(UdiInfoDao.class); - for (UdiInfoEntity basicUnitMaintainEntity : corpList) { - mapper.insertUdiInfo(basicUnitMaintainEntity); + for (UdiInfoEntity udiInfoEntity : corpList) { + UdiInfoRequest udiInfoRequest = new UdiInfoRequest(); + BeanUtils.copyProperties(udiInfoEntity, udiInfoRequest); + mapper.insertUdiInfo(udiInfoRequest); } batchSession.commit(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoServiceImpl.java index ef9c34e0..8c4d5914 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiInfoServiceImpl.java @@ -6,6 +6,7 @@ import com.github.pagehelper.PageHelper; import com.glxp.api.admin.dao.basic.UdiInfoDao; import com.glxp.api.admin.entity.basic.UdiInfoEntity; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import com.glxp.api.admin.service.basic.UdiInfoService; import com.glxp.api.admin.util.FilterUdiUtils; @@ -92,8 +93,8 @@ public class UdiInfoServiceImpl implements UdiInfoService { } @Override - public boolean insertUdiInfo(UdiInfoEntity udiInfoEntity) { - return udiInfoDao.insertUdiInfo(udiInfoEntity); + public boolean insertUdiInfo(UdiInfoRequest udiInfoRequest) { + return udiInfoDao.insertUdiInfo(udiInfoRequest); } @Override @@ -102,7 +103,7 @@ public class UdiInfoServiceImpl implements UdiInfoService { } @Override - public boolean updateUdiInfo(UdiInfoEntity udiInfoEntity) { + public boolean updateUdiInfo(UdiInfoRequest udiInfoEntity) { if (StrUtil.isEmpty(udiInfoEntity.getUuid())) return false; return udiInfoDao.updateUdiInfo(udiInfoEntity); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiRelevanceServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiRelevanceServiceImpl.java index f7b17070..ff7bac91 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiRelevanceServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/UdiRelevanceServiceImpl.java @@ -10,6 +10,7 @@ import com.glxp.api.admin.entity.basic.BasicThirdSysEntity; import com.glxp.api.admin.entity.basic.UdiInfoEntity; import com.glxp.api.admin.entity.basic.UdiRelevanceEntity; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiRelevanceRequest; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import com.glxp.api.admin.service.basic.BasicThirdSysService; import com.glxp.api.admin.service.basic.UdiRelevanceService; @@ -278,30 +279,26 @@ public class UdiRelevanceServiceImpl implements UdiRelevanceService { } @Override - public boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity) { + public boolean updateUdiRelevance(UdiRelevanceRequest udiRelevanceRequest) { BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); String mainSys = basicThirdSysEntity.getThirdId(); if (mainSys.equals("thirdId")) { - udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId()); - udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName()); + udiRelevanceRequest.setMainId(udiRelevanceRequest.getThirdId()); + udiRelevanceRequest.setMainName(udiRelevanceRequest.getThirdName()); } else if (mainSys.equals("thirdId1")) { - udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId1()); - udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName1()); + udiRelevanceRequest.setMainId(udiRelevanceRequest.getThirdId1()); + udiRelevanceRequest.setMainName(udiRelevanceRequest.getThirdName1()); } else if (mainSys.equals("thirdId2")) { - udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId2()); - udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName2()); + udiRelevanceRequest.setMainId(udiRelevanceRequest.getThirdId2()); + udiRelevanceRequest.setMainName(udiRelevanceRequest.getThirdName2()); } else if (mainSys.equals("thirdId3")) { - udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId3()); - udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName3()); + udiRelevanceRequest.setMainId(udiRelevanceRequest.getThirdId3()); + udiRelevanceRequest.setMainName(udiRelevanceRequest.getThirdName3()); } else if (mainSys.equals("thirdId4")) { - udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId4()); - udiRelevanceEntity.setMainName(udiRelevanceEntity.getThirdName4()); + udiRelevanceRequest.setMainId(udiRelevanceRequest.getThirdId4()); + udiRelevanceRequest.setMainName(udiRelevanceRequest.getThirdName4()); } - - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); - BeanUtil.copyProperties(udiRelevanceEntity, udiInfoEntity); - udiInfoDao.updateUdiInfoByUuid(udiInfoEntity); - return udiRelevanceDao.updateUdiRelevance(udiRelevanceEntity); + return udiRelevanceDao.updateUdiRelevance(udiRelevanceRequest); } @Override diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/BasicBackUpdateProductService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/BasicBackUpdateProductService.java index 6b390564..4d1aa7ce 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/BasicBackUpdateProductService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/BasicBackUpdateProductService.java @@ -8,6 +8,7 @@ import com.glxp.api.admin.entity.info.SystemParamConfigEntity; import com.glxp.api.admin.entity.thrsys.ThrProductsEntity; import com.glxp.api.admin.httpclient.ErpBasicClient; import com.glxp.api.admin.req.basic.FilterErpGoodsRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.req.thrsys.FilterThrProductsRequest; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.basic.ErpProductsResponse; @@ -77,17 +78,13 @@ public class BasicBackUpdateProductService { Map erpProductsMap = new HashMap<>(); if (invmandocResponses != null && invmandocResponses.size() > 0) { List inventoryCodes = new ArrayList<>(); -// if (filterErpGoodsRequest.getCode() != null) { -// inventoryCodes.add(filterErpGoodsRequest.getCode()); -// erpProductsMap.put(filterErpGoodsRequest.getCode(), invmandocResponses.get(0)); -// } else { for (ErpProductsResponse invmandocResponse : invmandocResponses) { UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(invmandocResponse.getCode(), thirdSysId); if (udiRelevanceEntity == null) { inventoryCodes.add(invmandocResponse.getCode()); erpProductsMap.put(invmandocResponse.getCode(), invmandocResponse); if (isUpdate.getParamValue().equals("1")) {//不根据库存信息过滤 - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + UdiInfoRequest udiInfoEntity = new UdiInfoRequest(); udiInfoEntity.setNameCode(invmandocResponse.getCode()); udiInfoEntity.setCpmctymc(invmandocResponse.getName()); udiInfoEntity.setGgxh(invmandocResponse.getSpec()); @@ -140,8 +137,8 @@ public class BasicBackUpdateProductService { udiRelevanceEntity1.setThirdName(invmandocResponse.getName()); String time = DateUtil.getDateTime(); udiRelevanceEntity1.setUpdateTime(time); - udiRelevanceEntity.setModifyTime(time); - udiRelevanceEntity1.setId(gennerOrderUtils.getRelId() + ""); + udiRelevanceEntity1.setModifyTime(time); + udiRelevanceEntity.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceService.insertUdiRelevance(udiRelevanceEntity1); } } @@ -151,31 +148,6 @@ public class BasicBackUpdateProductService { //若需要对照库存信息 if (!isUpdate.getParamValue().equals("1")) { -// if (inventoryCodes.size() > 0) { -// ErpOnhandRequest erpOnhandRequest = new ErpOnhandRequest(); -// erpOnhandRequest.setInventoryCodes(inventoryCodes); -// List erpOnHandResponses = new ErpInvClient().getInvPrdoduct(erpOnhandRequest, onHandUrl); -// if (erpOnHandResponses != null) { -// Map> map = erpOnHandResponses.stream().collect(Collectors.groupingBy(ErpInvProductResponse::getCode)); -// for (List onHandResponses : map.values()) { -// if (onHandResponses != null && onHandResponses.size() > 0) { -// ErpInvProductResponse onhandQueryResponse = onHandResponses.get(0); -// if (isUpdate.getParamValue().equals("2")) { -// addRl(onhandQueryResponse, thirdSysId, erpProductsMap); -// } else if (isUpdate.getParamValue().equals("3")) { -// if (onhandQueryResponse.getCount() != null && onhandQueryResponse.getCount() > 0) { -// addRl(onhandQueryResponse, thirdSysId, erpProductsMap); -// } -// } else if (isUpdate.getParamValue().equals("4")) { -// if (onhandQueryResponse.getCount() == null || onhandQueryResponse.getCount() <= 0) { -// addRl(onhandQueryResponse, thirdSysId, erpProductsMap); -// } -// } -// -// } -// } -// } -// } } filterErpGoodsRequest.setPage(filterErpGoodsRequest.getPage() + 1); @@ -214,7 +186,7 @@ public class BasicBackUpdateProductService { if (udiRelevanceEntity == null) { if (isUpdate.getParamValue().equals("1")) { - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + UdiInfoRequest udiInfoEntity = new UdiInfoRequest(); udiInfoEntity.setNameCode(thrProductsEntity.getCode()); udiInfoEntity.setCpmctymc(thrProductsEntity.getName()); udiInfoEntity.setGgxh(thrProductsEntity.getSpec()); @@ -265,7 +237,7 @@ public class BasicBackUpdateProductService { udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId4()); udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName4()); } - + udiRelevanceEntity1.setPrice(thrProductsEntity.getPrice()); udiRelevanceEntity1.setManufactory(thrProductsEntity.getManufactory()); udiRelevanceEntity1.setMeasname(thrProductsEntity.getMeasname()); udiRelevanceEntity1.setThirdId(thrProductsEntity.getCode()); @@ -273,14 +245,13 @@ public class BasicBackUpdateProductService { String time = DateUtil.getDateTime(); udiRelevanceEntity1.setUpdateTime(time); udiRelevanceEntity1.setModifyTime(time); + udiRelevanceEntity1.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1); } } - } } redisUtil.set("load_thrid_basic", "finish", 15 * 60); } - } diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUdiInfoImportService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUdiInfoImportService.java index 9fbf8c82..29e0aef8 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUdiInfoImportService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUdiInfoImportService.java @@ -9,6 +9,8 @@ import com.glxp.api.admin.entity.info.SystemParamConfigEntity; import com.glxp.api.admin.entity.thrsys.ThrProductsEntity; import com.glxp.api.admin.httpclient.UdiDlHttpClient; import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiRelevanceRequest; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import com.glxp.api.admin.service.basic.*; @@ -52,6 +54,7 @@ public class BasicUdiInfoImportService { @Resource GennerOrderUtils gennerOrderUtils; + //导入产品信息文件,生成产品信息,更新或插入对照表 @Async public void importUdiInfo(String genKey) { @@ -62,31 +65,11 @@ public class BasicUdiInfoImportService { filterUdiIpLogRequest.setGenKey(genKey); List udiInfoImportEntities = udiInfoImportService.filterUdiInfoImport(filterUdiIpLogRequest); - if (udiInfoImportEntities != null && udiInfoImportEntities.size() > 0) { + if (udiInfoImportEntities != null) { for (UdiInfoImportDetailEntity udiInfoImportDetailEntity : udiInfoImportEntities) { UdiInfoEntity udiInfoEntity = null; - - //判断更新 - BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); - String mainSys = basicThirdSysEntity.getThirdId(); - String mainId = null; - if (mainSys.equals("thirdId")) { - mainId = udiInfoImportDetailEntity.getThirdId(); - } else if (mainSys.equals("thirdId1")) { - mainId = udiInfoImportDetailEntity.getThirdId1(); - } else if (mainSys.equals("thirdId2")) { - mainId = udiInfoImportDetailEntity.getThirdId2(); - } else if (mainSys.equals("thirdId3")) { - mainId = udiInfoImportDetailEntity.getThirdId3(); - } else if (mainSys.equals("thirdId4")) { - mainId = udiInfoImportDetailEntity.getThirdId4(); - } - //国家库获取取UDI信息 - if (udiInfoImportDetailEntity.getUdiCode() != null - && !udiInfoImportDetailEntity.getUdiCode().trim().isEmpty() - && !udiInfoImportDetailEntity.getUdiCode().equals(mainId) - ) { + if (udiInfoImportDetailEntity.getUdiCode() != null && !udiInfoImportDetailEntity.getUdiCode().trim().isEmpty()) { udiInfoEntity = udiInfoService.findByNameCode(udiInfoImportDetailEntity.getUdiCode()); List froms = null; if (udiInfoEntity == null) { @@ -104,7 +87,21 @@ public class BasicUdiInfoImportService { if (froms != null) udiInfoService.insertUdiInfos(froms); } - + //判断更新 + BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); + String mainSys = basicThirdSysEntity.getThirdId(); + String mainId = null; + if (mainSys.equals("thirdId")) { + mainId = udiInfoImportDetailEntity.getThirdId(); + } else if (mainSys.equals("thirdId1")) { + mainId = udiInfoImportDetailEntity.getThirdId1(); + } else if (mainSys.equals("thirdId2")) { + mainId = udiInfoImportDetailEntity.getThirdId2(); + } else if (mainSys.equals("thirdId3")) { + mainId = udiInfoImportDetailEntity.getThirdId3(); + } else if (mainSys.equals("thirdId4")) { + mainId = udiInfoImportDetailEntity.getThirdId4(); + } UdiRelevanceEntity udiRelevanceEntity = null; if (udiInfoEntity == null) { udiRelevanceEntity = udiRelevanceService.selectUpdateByThirdId(mainId); //更新 @@ -116,11 +113,13 @@ public class BasicUdiInfoImportService { udiInfoEntity.setGgxh(thrProductsEntity.getSpec()); udiInfoEntity.setUuid(CustomUtil.getUUId()); udiInfoEntity.setProductType(ConstantStatus.PRODUCT_TYPE_THIRD); - udiInfoEntity.setDiType(ConstantStatus.DI_TYPE_MAIN); + udiInfoEntity.setDiType(1); udiInfoEntity.setManufactory(thrProductsEntity.getManufactory()); udiInfoEntity.setYlqxzcrbarmc(thrProductsEntity.getManufactory()); udiInfoEntity.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo()); - udiInfoService.insertUdiInfo(udiInfoEntity); + UdiInfoRequest udiInfoRequest=new UdiInfoRequest(); + BeanUtils.copyProperties(udiInfoEntity, udiInfoRequest); + udiInfoService.insertUdiInfo(udiInfoRequest); } else { udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_FAIL); @@ -168,17 +167,12 @@ public class BasicUdiInfoImportService { UdiRelevanceEntity temp = udiRelevanceService.selectUpteaByAll(udiInfoEntity.getUuid(), mainId); if (temp != null) { updateValue(temp, udiInfoImportDetailEntity, udiInfoImportLogEntity, mainId); - udiRelevanceService.updateUdiRelevance(temp); + UdiRelevanceRequest udiRelevanceRequest=new UdiRelevanceRequest(); + BeanUtils.copyProperties(temp,udiRelevanceRequest); + udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); } else { UdiRelevanceEntity mTemp = udiRelevanceService.selectUpdateByThirdId(mainId); - boolean isThird = false; if (mTemp != null) { - UdiInfoEntity udiInfoEntity1 = udiInfoService.findByUuid(mTemp.getUuid()); - if (udiInfoEntity1 != null && udiInfoEntity1.getProductType() != null && udiInfoEntity1.getProductType() == 1) { - isThird = true; - } - } - if (mTemp != null && !isThird) { udiInfoImportDetailEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_FAIL); udiInfoImportDetailEntity.setRemark("产品编码已存在关联不能重复插入!"); udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL); @@ -205,20 +199,19 @@ public class BasicUdiInfoImportService { } } + + //字段更新 udiInfoImportService.updateUdiInfoImport(udiInfoImportDetailEntity); } - udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); - udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity); - } else { - udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL); - udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity); } - + udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); + udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity); } } + public void updateValue(UdiRelevanceEntity udiRelevanceEntity, UdiInfoImportDetailEntity udiInfoImportDetailEntity, UdiInfoImportLogEntity udiInfoImportLogEntity, String mainId) { String time = DateUtil.getDateTime(); diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUpdateProductService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUpdateProductService.java index 1d42be88..495798a0 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUpdateProductService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/BasicUpdateProductService.java @@ -9,6 +9,7 @@ import com.glxp.api.admin.entity.thrsys.ThrProductsEntity; import com.glxp.api.admin.httpclient.ErpInvClient; import com.glxp.api.admin.req.basic.CombineRequest; import com.glxp.api.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.req.inventory.ErpOnhandRequest; import com.glxp.api.admin.req.thrsys.FilterThrInvProductsRequest; import com.glxp.api.admin.req.thrsys.FilterThrProductsRequest; @@ -83,7 +84,7 @@ public class BasicUpdateProductService { ErpOnhandRequest erpOnhandRequest = new ErpOnhandRequest(); erpOnhandRequest.setInventoryCodes(inventoryCodes); erpOnhandRequest.setFilterCount(2); - List erpOnHandResponses =erpInvClient.getInvPrdoduct(erpOnhandRequest, inQuery.getValue()); + List erpOnHandResponses = erpInvClient.getInvPrdoduct(erpOnhandRequest, inQuery.getValue()); if (erpOnHandResponses != null && erpOnHandResponses.size() > 0) { ErpInvProductResponse erpInvProductResponse = erpOnHandResponses.get(0); Map erpProductsMap = new HashMap<>(); @@ -111,7 +112,7 @@ public class BasicUpdateProductService { } } } else { - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + UdiInfoRequest udiInfoEntity = new UdiInfoRequest(); BeanUtils.copyProperties(thrProductsEntity, udiInfoEntity); udiInfoEntity.setNameCode(thrProductsEntity.getCode()); udiInfoEntity.setCpmctymc(thrProductsEntity.getName()); @@ -161,7 +162,7 @@ public class BasicUpdateProductService { public void addRl(ErpInvProductResponse onhandQueryResponse, String thirdSysId, Map erpProductsMap) { - UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + UdiInfoRequest udiInfoEntity = new UdiInfoRequest(); udiInfoEntity.setNameCode(onhandQueryResponse.getCode()); udiInfoEntity.setCpmctymc(onhandQueryResponse.getName()); udiInfoEntity.setGgxh(onhandQueryResponse.getSpec()); diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java index da3e2344..58866ff5 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java @@ -33,6 +33,7 @@ import com.glxp.api.admin.entity.purchase.*; import com.glxp.api.admin.entity.thrsys.*; import com.glxp.api.admin.httpclient.SpGetHttpClient; import com.glxp.api.admin.req.basic.BasicExportStatusRequest; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import com.glxp.api.admin.req.purchase.FilterCertSetsRequest; import com.glxp.api.admin.req.sync.PostDownloadInfo; import com.glxp.api.admin.res.basic.*; @@ -229,7 +230,9 @@ public class DlBasicService { List corpList = syncDataResponse.getUdiInfoEntities(); UdiInfoDao mapper = batchSession.getMapper(UdiInfoDao.class); for (UdiInfoEntity udiInfoEntity : corpList) { - mapper.insertUdiInfo(udiInfoEntity); + UdiInfoRequest udiInfoRequest = new UdiInfoRequest(); + BeanUtils.copyProperties(udiInfoEntity, udiInfoRequest); + mapper.insertUdiInfo(udiInfoRequest); } batchSession.commit(); remark.append("耗材字典:").append(syncDataResponse.getUdiInfoEntities().size()).append("条\n"); diff --git a/api-admin/src/main/java/com/glxp/api/admin/util/UdiInfoUtil.java b/api-admin/src/main/java/com/glxp/api/admin/util/UdiInfoUtil.java index 6b715ec6..80e17fe2 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/util/UdiInfoUtil.java +++ b/api-admin/src/main/java/com/glxp/api/admin/util/UdiInfoUtil.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.glxp.api.admin.constant.ConstantStatus; import com.glxp.api.admin.entity.basic.UdiInfoEntity; +import com.glxp.api.admin.req.basic.UdiInfoRequest; import java.util.List; @@ -42,5 +43,18 @@ public class UdiInfoUtil { return udiInfoEntitys; } + public static UdiInfoRequest initUdiInfoEntity(UdiInfoRequest udiInfoEntity) { + if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhph()) && "否".equals(udiInfoEntity.getScbssfbhph())) { + udiInfoEntity.setAllowNoBatch(true); + } + if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhscrq()) && "否".equals(udiInfoEntity.getScbssfbhscrq())) { + udiInfoEntity.setAllowNoProduct(true); + } + if (StrUtil.isNotEmpty(udiInfoEntity.getScbssfbhsxrq()) && "否".equals(udiInfoEntity.getScbssfbhsxrq())) { + udiInfoEntity.setAllowNoExpire(true); + } + return udiInfoEntity; + } + } diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml index 4a933752..20e23f9b 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml @@ -127,7 +127,7 @@ nameCode = #{nameCode}) limit 1 - + replace INTO basic_products (id, @@ -230,7 +230,7 @@ WHERE uuid = #{uuid} - + UPDATE basic_products packRatio=#{packRatio}, @@ -268,6 +268,7 @@ allowNoBatch=#{allowNoBatch}, allowNoExpire=#{allowNoExpire}, allowNoProduct=#{allowNoProduct}, + spmc=#{spmc}, cpdls=#{cpdls}, basicPrductRemak1=#{basicPrductRemak1}, basicPrductRemak2=#{basicPrductRemak2}, @@ -277,9 +278,8 @@ basicPrductRemak6=#{basicPrductRemak6}, basicPrductRemak7=#{basicPrductRemak7}, basicPrductRemak8=#{basicPrductRemak8}, - - WHERE uuid = #{uuid} + WHERE nameCode = #{nameCode} diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index 2038884b..a9480329 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -653,87 +653,33 @@ UPDATE basic_udirel - - thirdId=#{thirdId}, - - - thirdName=#{thirdName}, - - - uuid=#{uuid}, - - - isUseDy=#{isUseDy}, - - - thirdId1=#{thirdId1}, - - - thirdId2=#{thirdId2}, - - - thirdId3=#{thirdId3}, - - - thirdId4=#{thirdId4}, - - - thirdName1=#{thirdName1}, - - - thirdName2=#{thirdName2}, - - - thirdName3=#{thirdName3}, - - - thirdName4=#{thirdName4}, - - - manufactory=#{manufactory}, - - - measname=#{measname}, - - - ybbm=#{ybbm}, - - - sptm=#{sptm}, - - - updateTime=#{updateTime}, - - - modifyTime=#{modifyTime}, - - - isDisable=#{isDisable}, - - - isLock=#{isLock}, - - - mainId=#{mainId}, - - - lockStatus=#{lockStatus}, - - - mainName=#{mainName}, - - - udplatCode=#{udplatCode}, - - - isAdavence=#{isAdavence}, - - - supName=#{supName}, - - - price=#{price}, - + thirdId=#{thirdId}, + thirdName=#{thirdName}, + uuid=#{uuid}, + isUseDy=#{isUseDy}, + thirdId1=#{thirdId1}, + thirdId2=#{thirdId2}, + thirdId3=#{thirdId3}, + thirdId4=#{thirdId4}, + thirdName1=#{thirdName1}, + thirdName2=#{thirdName2}, + thirdName3=#{thirdName3}, + thirdName4=#{thirdName4}, + manufactory=#{manufactory}, + measname=#{measname}, + ybbm=#{ybbm}, + sptm=#{sptm}, + updateTime=#{updateTime}, + modifyTime=#{modifyTime}, + isDisable=#{isDisable}, + isLock=#{isLock}, + mainId=#{mainId}, + lockStatus=#{lockStatus}, + mainName=#{mainName}, + udplatCode=#{udplatCode}, + isAdavence=#{isAdavence}, + supName=#{supName}, + price=#{price}, useNum=#{useNum}, useMuti=#{useMuti}