From 1c6a433763218c83a4f5accf08ba2ac5e1846fe3 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Wed, 28 Dec 2022 22:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=BF=A1=E6=81=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/UdiContrastController.java | 4 +- .../basic/UdiRelevanceController.java | 87 ++++++++++--------- .../admin/req/basic/UdiRelevanceRequest.java | 2 + .../mybatis/mapper/basic/UdiInfoDao.xml | 2 +- 4 files changed, 49 insertions(+), 46 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java index 6807e56..9d6a02e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java @@ -158,7 +158,7 @@ public class UdiContrastController { BeanUtils.copyProperties(udiInfoEntity, udiInfoReqeust); udiInfoService.updateUdiInfo(udiInfoReqeust); } - udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities)); +// udiInfoService.insertUdiInfos(UdiInfoUtil.initUdiInfoEntitys(udiInfoEntities)); udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid()); String time = DateUtil.formatDateTime(new Date()); udiRelevanceEntity.setUpdateTime(time); @@ -222,7 +222,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(""); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java index 8c5c6fa..9372296 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java @@ -284,57 +284,58 @@ 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); - UdiRelevanceRequest udiRelevanceRequest=new UdiRelevanceRequest(); - BeanUtils.copyProperties(udiRelevanceEntity,udiRelevanceRequest); + udiRelevanceRequest.setIsUseDy(true); + } else udiRelevanceRequest.setIsUseDy(false); udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); - if (!customerId.equals("110")) { - if (StrUtil.isNotEmpty(udiRelevanceEntity.getPrice())) { - CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceEntity.getId(), customerId + ""); - companyProductRelevanceEntity.setPrice(new BigDecimal(udiRelevanceEntity.getPrice())); + if (StrUtil.isNotEmpty(udiRelevanceRequest.getPrice())) { + //更新供应商关联表相关信息 + CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceRequest.getId(), customerId + ""); + companyProductRelevanceEntity.setPrice(new BigDecimal(udiRelevanceRequest.getPrice())); companyProductRelevanceService.updateCompanyProductRelevance(companyProductRelevanceEntity); } } - - UdiInfoRequest udiInfoEntity = new UdiInfoRequest(); - udiInfoEntity.setSptm(udiRelevanceResponse.getSptm()); - udiInfoEntity.setYbbm(udiRelevanceResponse.getYbbm()); - udiInfoEntity.setMeasname(udiRelevanceResponse.getMeasname()); - udiInfoEntity.setManufactory(udiRelevanceResponse.getManufactory()); - udiInfoEntity.setCpms(udiRelevanceResponse.getCpms()); -// udiInfoEntity.setDiType(udiRelevanceResponse.getDiType()); - udiInfoEntity.setPrice(udiRelevanceResponse.getPrice()); - udiInfoEntity.setSpmc(udiRelevanceResponse.getSpmc()); - udiInfoEntity.setAllowNoBatch(udiRelevanceResponse.isAllowNoBatch()); - udiInfoEntity.setAllowNoExpire(udiRelevanceResponse.isAllowNoExpire()); - udiInfoEntity.setAllowNoProduct(udiRelevanceResponse.isAllowNoProduct()); - udiInfoEntity.setZxxsbzbhsydysl(udiRelevanceResponse.getZxxsbzbhsydysl()); - 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()); + //更新产品信息表相关产品信息 + 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("更新成功"); } @@ -713,8 +714,8 @@ public class UdiRelevanceController { String time = DateUtil.getDateTime(); udiRelevanceEntity.setUpdateTime(time); udiRelevanceEntity.setModifyTime(time); - UdiRelevanceRequest udiRelevanceRequest=new UdiRelevanceRequest(); - BeanUtils.copyProperties(udiRelevanceEntity,udiRelevanceRequest); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); return ResultVOUtils.success("解除绑定成功!"); } @@ -735,8 +736,8 @@ public class UdiRelevanceController { UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity(); udiRelevanceEntity.setId(id); udiRelevanceEntity.setLockStatus(lockUdiRequest.getLockStatus()); - UdiRelevanceRequest udiRelevanceRequest=new UdiRelevanceRequest(); - BeanUtils.copyProperties(udiRelevanceEntity,udiRelevanceRequest); + UdiRelevanceRequest udiRelevanceRequest = new UdiRelevanceRequest(); + BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceRequest); udiRelevanceService.updateUdiRelevance(udiRelevanceRequest); } return ResultVOUtils.success("更新成功!"); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiRelevanceRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiRelevanceRequest.java index fd0803a..b61e9ba 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiRelevanceRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiRelevanceRequest.java @@ -39,4 +39,6 @@ public class UdiRelevanceRequest { private Integer useNum; //最小包装单元可使用次数 + + } 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 55db533..fb22a30 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml @@ -281,7 +281,7 @@ basicPrductRemak7=#{basicPrductRemak7}, basicPrductRemak8=#{basicPrductRemak8}, - WHERE uuid = #{uuid} + WHERE nameCode = #{nameCode}