From d5aab2f18c7ef006a888c805c2855d431be8378d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Sun, 29 Jan 2023 11:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=80=E6=9D=A5=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/thrsys/ThrCorpExportLogController.java | 8 ++++---- .../api/controller/thrsys/ThrCorpsController.java | 11 +++++------ src/main/java/com/glxp/api/dao/thrsys/ThrCorpDao.java | 5 +++-- .../thrsys/ThrUnitMaintainResponse.java} | 4 ++-- .../com/glxp/api/service/thrsys/ThrCorpService.java | 6 ++++-- .../api/service/thrsys/impl/ThrCorpServiceImpl.java | 4 ++-- .../resources/mybatis/mapper/thrsys/ThrCorpDao.xml | 2 +- 7 files changed, 21 insertions(+), 19 deletions(-) rename src/main/java/com/glxp/api/{entity/basic/BasicUnitMaintainEntity.java => res/thrsys/ThrUnitMaintainResponse.java} (92%) diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrCorpExportLogController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrCorpExportLogController.java index 8480c255..9b7ab952 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrCorpExportLogController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrCorpExportLogController.java @@ -186,11 +186,11 @@ public class ThrCorpExportLogController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - ThrSystemDetailEntity basicThirdSysDetailEntity = thrCorpService.selectByKey("corpUrl", unitMaintainFilterRequest.getThirdSys()); - if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null) + ThrSystemDetailEntity thrSystemDetailEntity = thrCorpService.selectByKey("corpUrl", unitMaintainFilterRequest.getThirdSys()); + if (thrSystemDetailEntity == null || thrSystemDetailEntity.getValue() == null) return ResultVOUtils.error(500, "往来单位接口地址未定义"); - if (basicThirdSysDetailEntity.getEnabled()) { - if (basicThirdSysDetailEntity.getFromType() == 0) { + if (thrSystemDetailEntity.getEnabled()) { + if (thrSystemDetailEntity.getFromType() == 0) { BaseResponse> udiDlDeviceResponse = erpBasicClient.getErpCrop(unitMaintainFilterRequest); return udiDlDeviceResponse; diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrCorpsController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrCorpsController.java index 81092fcc..e263cf2d 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrCorpsController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrCorpsController.java @@ -7,8 +7,6 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BasicProcessStatus; import com.glxp.api.constant.Constant; -import com.glxp.api.entity.basic.BasicUnitMaintainEntity; -import com.glxp.api.entity.thrsys.ThrCorpEntity; import com.glxp.api.entity.thrsys.ThrCorpImportLogEntity; import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; import com.glxp.api.http.ErpBasicClient; @@ -18,6 +16,7 @@ import com.glxp.api.req.thrsys.PostThrCorpRequest; import com.glxp.api.req.thrsys.ThrUnitMaintainFilterRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.thrsys.ThrCorpsResponse; +import com.glxp.api.res.thrsys.ThrUnitMaintainResponse; import com.glxp.api.service.thrsys.ThrCorpImportLogService; import com.glxp.api.service.thrsys.ThrCorpService; import com.glxp.api.service.thrsys.ThrCorpsDlService; @@ -193,8 +192,8 @@ public class ThrCorpsController { BaseResponse> udiDlDeviceResponse = erpBasicClient.getErpCrop(thrUnitMaintainFilterRequest); if (udiDlDeviceResponse.getCode() == 20000) { for (ThrCorpsResponse erpUnitsResponse : udiDlDeviceResponse.getData().getList()) { - BasicUnitMaintainEntity basicUnitMaintainEntity = thrCorpService.selectByThirdId(erpUnitsResponse.getId(), thrUnitMaintainFilterRequest.getThirdSys()); - if (basicUnitMaintainEntity != null) { + ThrUnitMaintainResponse thrUnitMaintainResponse = thrCorpService.selectByThirdId(erpUnitsResponse.getId(), thrUnitMaintainFilterRequest.getThirdSys()); + if (thrUnitMaintainResponse != null) { erpUnitsResponse.setChecked(true); } else { erpUnitsResponse.setChecked(false); @@ -215,8 +214,8 @@ public class ThrCorpsController { { ThrCorpsResponse thrCorpEntity = new ThrCorpsResponse(); BeanUtils.copyProperties(item, thrCorpEntity); - BasicUnitMaintainEntity basicUnitMaintainEntity = thrCorpService.selectByThirdId(item.getUnitId(), thrUnitMaintainFilterRequest.getThirdSys()); - if (basicUnitMaintainEntity != null) { + ThrUnitMaintainResponse thrUnitMaintainResponse = thrCorpService.selectByThirdId(item.getUnitId(), thrUnitMaintainFilterRequest.getThirdSys()); + if (thrUnitMaintainResponse != null) { thrCorpEntity.setChecked(true); } else { thrCorpEntity.setChecked(false); diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrCorpDao.java b/src/main/java/com/glxp/api/dao/thrsys/ThrCorpDao.java index b611ec2b..a75bc503 100644 --- a/src/main/java/com/glxp/api/dao/thrsys/ThrCorpDao.java +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrCorpDao.java @@ -1,12 +1,12 @@ package com.glxp.api.dao.thrsys; -import com.glxp.api.entity.basic.BasicUnitMaintainEntity; import com.glxp.api.entity.thrsys.ThrCorpEntity; import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; import com.glxp.api.req.thrsys.FilterThrCorpRequest; import com.glxp.api.req.thrsys.ThrUnitMaintainFilterRequest; import com.glxp.api.res.thrsys.ThrCorpsResponse; +import com.glxp.api.res.thrsys.ThrUnitMaintainResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -31,8 +31,9 @@ public interface ThrCorpDao { void importThrCorp(ThrCorpEntity thrCorpEntity); - BasicUnitMaintainEntity selectByThirdId(ThrUnitMaintainFilterRequest thrUnitMaintainFilterRequest); + ThrUnitMaintainResponse selectByThirdId(ThrUnitMaintainFilterRequest thrUnitMaintainFilterRequest); ThrSystemDetailEntity selectByKey(@Param("key") String key, @Param("thirdSys") String thirdSys); + } diff --git a/src/main/java/com/glxp/api/entity/basic/BasicUnitMaintainEntity.java b/src/main/java/com/glxp/api/res/thrsys/ThrUnitMaintainResponse.java similarity index 92% rename from src/main/java/com/glxp/api/entity/basic/BasicUnitMaintainEntity.java rename to src/main/java/com/glxp/api/res/thrsys/ThrUnitMaintainResponse.java index d4bac6e8..1bb8c0bb 100644 --- a/src/main/java/com/glxp/api/entity/basic/BasicUnitMaintainEntity.java +++ b/src/main/java/com/glxp/api/res/thrsys/ThrUnitMaintainResponse.java @@ -1,4 +1,4 @@ -package com.glxp.api.entity.basic; +package com.glxp.api.res.thrsys; import lombok.Data; @@ -6,7 +6,7 @@ import javax.validation.constraints.NotBlank; import java.util.Date; @Data -public class BasicUnitMaintainEntity { +public class ThrUnitMaintainResponse { private Integer id; private String erpId; diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrCorpService.java b/src/main/java/com/glxp/api/service/thrsys/ThrCorpService.java index 4f82e25e..3e37496e 100644 --- a/src/main/java/com/glxp/api/service/thrsys/ThrCorpService.java +++ b/src/main/java/com/glxp/api/service/thrsys/ThrCorpService.java @@ -1,11 +1,13 @@ package com.glxp.api.service.thrsys; -import com.glxp.api.entity.basic.BasicUnitMaintainEntity; + import com.glxp.api.entity.thrsys.ThrCorpEntity; import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; import com.glxp.api.req.thrsys.FilterThrCorpRequest; +import com.glxp.api.req.thrsys.ThrUnitMaintainFilterRequest; import com.glxp.api.res.thrsys.ThrCorpsResponse; +import com.glxp.api.res.thrsys.ThrUnitMaintainResponse; import java.util.List; @@ -25,7 +27,7 @@ public interface ThrCorpService { boolean deleteAll(); - BasicUnitMaintainEntity selectByThirdId(String thirdId, String thirdSys); + ThrUnitMaintainResponse selectByThirdId(String thirdId, String thirdSys); ThrSystemDetailEntity selectByKey(String key, String thirdSys); diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrCorpServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrCorpServiceImpl.java index c5b842c2..3612a338 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrCorpServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrCorpServiceImpl.java @@ -2,12 +2,12 @@ package com.glxp.api.service.thrsys.impl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.thrsys.ThrCorpDao; -import com.glxp.api.entity.basic.BasicUnitMaintainEntity; import com.glxp.api.entity.thrsys.ThrCorpEntity; import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; import com.glxp.api.req.thrsys.FilterThrCorpRequest; import com.glxp.api.req.thrsys.ThrUnitMaintainFilterRequest; import com.glxp.api.res.thrsys.ThrCorpsResponse; +import com.glxp.api.res.thrsys.ThrUnitMaintainResponse; import com.glxp.api.service.thrsys.ThrCorpService; import org.springframework.stereotype.Service; @@ -64,7 +64,7 @@ public class ThrCorpServiceImpl implements ThrCorpService { return thrCorpDao.deleteAll(); } @Override - public BasicUnitMaintainEntity selectByThirdId(String thirdId, String thirdSys) { + public ThrUnitMaintainResponse selectByThirdId(String thirdId, String thirdSys) { ThrUnitMaintainFilterRequest filterUdiInfoRequest = new ThrUnitMaintainFilterRequest(); diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrCorpDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrCorpDao.xml index 50d422a6..dd2d13c2 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrCorpDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrCorpDao.xml @@ -118,7 +118,7 @@