From 2262b7563b3e680f33459b208a21bea59af354bb Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Tue, 4 Mar 2025 17:36:40 +0800 Subject: [PATCH 01/11] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=9B=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/service/inv/InvCountOrderDetailService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/service/inv/InvCountOrderDetailService.java b/src/main/java/com/glxp/api/service/inv/InvCountOrderDetailService.java index db117991a..cb5df7c5f 100644 --- a/src/main/java/com/glxp/api/service/inv/InvCountOrderDetailService.java +++ b/src/main/java/com/glxp/api/service/inv/InvCountOrderDetailService.java @@ -87,7 +87,12 @@ public class InvCountOrderDetailService extends ServiceImpl Date: Wed, 12 Mar 2025 11:25:18 +0800 Subject: [PATCH 02/11] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E9=AB=98?= =?UTF-8?q?=E4=BD=8D=E6=BC=8F=E6=B4=9E=20=E5=AF=86=E7=A0=81=E4=B8=8D?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/api/controller/auth/SysUserController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index 1ffa4772c..23674781d 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -95,6 +95,7 @@ public class SysUserController extends BaseController { authAdminResponse.setDepts(depts); } authAdminResponse.setRoles(roles); + authAdminResponse.setPassWord(null); return authAdminResponse; }).collect(Collectors.toList()); From 2baf2c4a7667b1a36c86d841413a8997ba666afd Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Wed, 12 Mar 2025 16:11:57 +0800 Subject: [PATCH 03/11] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E9=AB=98?= =?UTF-8?q?=E4=BD=8D=E6=BC=8F=E6=B4=9E=20=E5=AF=86=E7=A0=81=E4=B8=8D?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/api/constant/Constant.java | 3 +++ .../api/controller/auth/LoginController.java | 21 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/glxp/api/constant/Constant.java b/src/main/java/com/glxp/api/constant/Constant.java index 7887d34eb..a55bce90b 100644 --- a/src/main/java/com/glxp/api/constant/Constant.java +++ b/src/main/java/com/glxp/api/constant/Constant.java @@ -334,4 +334,7 @@ public class Constant { public static final Integer SK_PRO_DSB_TYPE = 1;//1:定数包,内部使用 public static final Integer SK_PRO_THR_TYPE = 2;//2:项目、组套外部关联 public static final Integer SK_PRO_SS_TYPE = 3;//3:术式组套 + + //密码错误次数 + public static final String PASSWORD_ERROR_COUNT = "PasswordErrorCount"; } diff --git a/src/main/java/com/glxp/api/controller/auth/LoginController.java b/src/main/java/com/glxp/api/controller/auth/LoginController.java index 0c173906c..3b60d9264 100644 --- a/src/main/java/com/glxp/api/controller/auth/LoginController.java +++ b/src/main/java/com/glxp/api/controller/auth/LoginController.java @@ -62,7 +62,8 @@ public class LoginController extends BaseController { private CompanyService companyService; @Resource private AuthLicenseDao authLicenseDao; - + @Resource + RedisUtil redisUtil; /** * 用户登录 @@ -82,18 +83,26 @@ public class LoginController extends BaseController { throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误"); } - log.info(loginRequest.getPassword()); - log.info(PasswordUtils.authAdminPwd(authAdmin.getPassWord())); + //验证错误了几次 + Integer errorCount = (Integer) redisUtil.get(Constant.PASSWORD_ERROR_COUNT + authAdmin.getId()); + if (errorCount == null ){ + errorCount = 0; + }else { + if (errorCount == 5){ + throw new JsonException(ResultEnum.DATA_NOT, "已连续5次输入错误密码,账号被锁定30分钟!"); + } + } if (PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(PasswordUtils.authAdminPwd(authAdmin.getPassWord())) - || loginRequest.getPassword().equals(authAdmin.getPassWord()) - || (loginRequest.getPassword().equals(PasswordUtils.authAdminPwd(authAdmin.getPassWord()))) + || loginRequest.getPassword().equals(authAdmin.getPassWord()) || (loginRequest.getPassword().equals(PasswordUtils.authAdminPwd(authAdmin.getPassWord()))) ) { - + redisUtil.del(Constant.PASSWORD_ERROR_COUNT+authAdmin.getId()); } else { if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(SecureUtil.sha256(authAdmin.getPassWord()))) { + redisUtil.set(Constant.PASSWORD_ERROR_COUNT+authAdmin.getId(), errorCount + 1,30*60); throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误"); } } + if (authAdmin.getUserFlag() == 0) { throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!"); } From f69668242c8dda4e4dcd29217896294ef88c53e8 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Fri, 14 Mar 2025 09:22:07 +0800 Subject: [PATCH 04/11] =?UTF-8?q?3/14=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=961.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/thrsys/ThrDeptController.java | 6 +++++- src/main/java/com/glxp/api/http/ErpBasicClient.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java index 6ee22923c..c5b862b0b 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java @@ -1,5 +1,6 @@ package com.glxp.api.controller.thrsys; +import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; @@ -146,7 +147,10 @@ public class ThrDeptController { if (StrUtil.isBlank(thirdSysFk)) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); } - return thrDeptService.downloadThirdWarehouse(thirdSysFk); + ThreadUtil.execAsync(() -> { + thrDeptService.downloadThirdWarehouse(thirdSysFk);; + }); + return ResultVOUtils.success("后台已开始下载,请稍后刷新查看!"); } diff --git a/src/main/java/com/glxp/api/http/ErpBasicClient.java b/src/main/java/com/glxp/api/http/ErpBasicClient.java index 4c8dd21e4..736777415 100644 --- a/src/main/java/com/glxp/api/http/ErpBasicClient.java +++ b/src/main/java/com/glxp/api/http/ErpBasicClient.java @@ -131,6 +131,7 @@ public class ErpBasicClient { String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/getWarehouse"; try { String response = httpOkClient.uCloudPost(url, udiwmsWarehouseRequest); + log.error("获取当前部门数据" + response); BaseResponse> listBaseResponse = JSONObject.parseObject(response, new TypeReference>>() { }); @@ -310,6 +311,7 @@ public class ErpBasicClient { String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/basic/getProject"; try { String response = httpOkClient.uCloudPost(url, dlThirdDestinyRequest); + log.error("获取收费项目::::::" + response); BaseResponse> listBaseResponse = JSONObject.parseObject(response, new TypeReference>>() { }); From d2f00aac8185fc87d05dffe0978f2fa4912b821a Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Fri, 14 Mar 2025 09:50:47 +0800 Subject: [PATCH 05/11] =?UTF-8?q?feat:=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/purchase/PurApplyController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java b/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java index aa719956b..2eb4b2f21 100644 --- a/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java +++ b/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java @@ -139,12 +139,12 @@ public class PurApplyController { @PostMapping("/purchase/apply/list") public BaseResponse list(@RequestBody PurApplyRequest purApplyRequest) { - if (purApplyRequest.getStatus() == null) { - purApplyRequest.setStatus(11); //查询未审核和草稿状态 - } + if (purApplyRequest.getIsUser() != null && purApplyRequest.getIsUser()) { AuthAdmin authAdmin = customerService.getUserBean(); purApplyRequest.setCreateUser(authAdmin.getId() + ""); //查询自己 + }else if (purApplyRequest.getStatus() == null) { + purApplyRequest.setStatus(11); //查询未审核和草稿状态 } Boolean sys_approval_flow = "1".equals(systemParamConfigService.selectValueByParamKey("sys_approval_flow")); From f639d3be4549a1175b0c3ec07c902b28c4b768c2 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Fri, 14 Mar 2025 18:18:19 +0800 Subject: [PATCH 06/11] =?UTF-8?q?3/14=20=E4=BC=98=E5=8C=961.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/http/ErpBasicClient.java | 2 - .../thrsys/impl/ThrDeptServiceImpl.java | 95 ++++++++++++++----- 2 files changed, 73 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/glxp/api/http/ErpBasicClient.java b/src/main/java/com/glxp/api/http/ErpBasicClient.java index 736777415..dbb57956e 100644 --- a/src/main/java/com/glxp/api/http/ErpBasicClient.java +++ b/src/main/java/com/glxp/api/http/ErpBasicClient.java @@ -131,11 +131,9 @@ public class ErpBasicClient { String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/getWarehouse"; try { String response = httpOkClient.uCloudPost(url, udiwmsWarehouseRequest); - log.error("获取当前部门数据" + response); BaseResponse> listBaseResponse = JSONObject.parseObject(response, new TypeReference>>() { }); - return listBaseResponse; } catch (Exception e) { log.error("获取第三方系统的仓库货位码异常", e); diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java index 6a0d2d4d3..afa430e61 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java @@ -1,7 +1,11 @@ package com.glxp.api.service.thrsys.impl; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.common.res.BaseResponse; @@ -20,10 +24,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; @Service @Transactional(rollbackFor = Exception.class) @@ -126,7 +130,7 @@ public class ThrDeptServiceImpl extends ServiceImpl i @Override public BaseResponse downloadThirdWarehouse(String thirdSysFk) { int page = 1; - int limit = 100; + int limit = 1000; while (true) { UdiwmsWarehouseRequest udiwmsWarehouseRequest = new UdiwmsWarehouseRequest(); udiwmsWarehouseRequest.setThirdSys(thirdSysFk); @@ -135,42 +139,89 @@ public class ThrDeptServiceImpl extends ServiceImpl i BaseResponse> baseResponse = erpBasicClient.getWarehouse(udiwmsWarehouseRequest); if (baseResponse.getCode() == 20000) { List responseList = baseResponse.getData().getList(); - List list = new ArrayList<>(); - List warehouseList = new ArrayList<>(); - for (UdiwmsWarehouseDetail response : responseList) { - ThrDeptEntity thrDeptEntity = new ThrDeptEntity(); - thrDeptEntity.setPid(0); - thrDeptEntity.setName(response.getName()); - thrDeptEntity.setCode(response.getCode()); + if (CollUtil.isNotEmpty(responseList)) { + AtomicInteger count = new AtomicInteger(); // 计数器 + responseList.forEach(item -> { + ThrDeptEntity thrDeptEntity = new ThrDeptEntity(); + ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); + BeanUtil.copyProperties(item, thrDeptEntity); + BeanUtil.copyProperties(item, thrInvWarehouseEntity); + + thrDeptEntity.setPid(0); + thrDeptEntity.setName(item.getName()); + thrDeptEntity.setCode(item.getCode()); thrDeptEntity.setThirdSysFk(thirdSysFk); thrDeptEntity.setAdvanceType(false); //默认是仓库 thrDeptEntity.setStatus(1);//默认启用 thrDeptEntity.setUpdateTime(new Date()); thrDeptEntity.setId(IdUtil.getSnowflake(6, 1).nextId()); - list.add(thrDeptEntity); - ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); - thrInvWarehouseEntity.setCode(response.getCode()); - thrInvWarehouseEntity.setName(response.getName()); - thrInvWarehouseEntity.setRemark(response.getRemark()); + + thrInvWarehouseEntity.setCode(item.getCode()); + thrInvWarehouseEntity.setName(item.getName()); + thrInvWarehouseEntity.setRemark(item.getRemark()); thrInvWarehouseEntity.setThirdSysFk(thirdSysFk); - thrInvWarehouseEntity.setParentId(response.getCode()); + thrInvWarehouseEntity.setParentId(item.getCode()); thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + ""); thrInvWarehouseEntity.setUpdateTime(new Date()); - warehouseList.add(thrInvWarehouseEntity); - + boolean b = thrDeptDao.exists(new LambdaQueryWrapper().eq(ThrDeptEntity::getCode, thrDeptEntity.getCode())); + if (b) { + thrDeptDao.update(thrDeptEntity, new LambdaUpdateWrapper().eq(ThrDeptEntity::getCode, thrDeptEntity.getCode())); + } else { + thrDeptDao.insert(thrDeptEntity); + } + boolean b1 = thrInvWarehouseDao.exists(new LambdaQueryWrapper().eq(ThrInvWarehouseEntity::getCode, thrInvWarehouseEntity.getCode())); + if (b1) { + thrInvWarehouseDao.update(thrInvWarehouseEntity, new LambdaUpdateWrapper().eq(ThrInvWarehouseEntity::getCode, thrInvWarehouseEntity.getCode())); + } else { + thrInvWarehouseDao.insert(thrInvWarehouseEntity); + } + + }); } - //插入数据 - thrDeptDao.insertThrDeptList(list); - thrInvWarehouseDao.insertThrInvWarehouses(warehouseList); - if (list.size() >= limit) { + if (responseList.size() >= limit) { page++; } else { break; } +// List list = new ArrayList<>(); +// List warehouseList = new ArrayList<>(); +// for (UdiwmsWarehouseDetail response : responseList) { +// ThrDeptEntity thrDeptEntity = new ThrDeptEntity(); +// thrDeptEntity.setPid(0); +// thrDeptEntity.setName(response.getName()); +// thrDeptEntity.setCode(response.getCode()); +// thrDeptEntity.setThirdSysFk(thirdSysFk); +// thrDeptEntity.setAdvanceType(false); //默认是仓库 +// thrDeptEntity.setStatus(1);//默认启用 +// thrDeptEntity.setUpdateTime(new Date()); +// thrDeptEntity.setId(IdUtil.getSnowflake(6, 1).nextId()); +// list.add(thrDeptEntity); +// +// ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); +// thrInvWarehouseEntity.setCode(response.getCode()); +// thrInvWarehouseEntity.setName(response.getName()); +// thrInvWarehouseEntity.setRemark(response.getRemark()); +// thrInvWarehouseEntity.setThirdSysFk(thirdSysFk); +// thrInvWarehouseEntity.setParentId(response.getCode()); +// thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + ""); +// thrInvWarehouseEntity.setUpdateTime(new Date()); +// warehouseList.add(thrInvWarehouseEntity); +// +// +// } +// //插入数据 +// thrDeptDao.insertThrDeptList(list); +// thrInvWarehouseDao.insertThrInvWarehouses(warehouseList); +// if (list.size() >= limit) { +// page++; +// } else { +// break; +// } + } else { - return baseResponse; + return ResultVOUtils.error(500, "下载异常中断"); } } From 091bd6a9292b488d93b74be12802505ed0f0c961 Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Fri, 14 Mar 2025 19:25:13 +0800 Subject: [PATCH 07/11] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/res/purchase/PurContractEntityResponse.java | 6 ++++++ .../resources/mybatis/mapper/purchase/PurContractMapper.xml | 4 +++- src/main/resources/schemas/schema_v2.4.sql | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/res/purchase/PurContractEntityResponse.java b/src/main/java/com/glxp/api/res/purchase/PurContractEntityResponse.java index 5b9619e2a..a8dd401cd 100644 --- a/src/main/java/com/glxp/api/res/purchase/PurContractEntityResponse.java +++ b/src/main/java/com/glxp/api/res/purchase/PurContractEntityResponse.java @@ -41,6 +41,12 @@ public class PurContractEntityResponse implements Serializable { @TableField(value = "fromCorp") private String fromCorp; + /** + * 往来单位/供应商 + */ + private String fromCorpName; + private String invCodeName; + /** * 合同签订日期 */ diff --git a/src/main/resources/mybatis/mapper/purchase/PurContractMapper.xml b/src/main/resources/mybatis/mapper/purchase/PurContractMapper.xml index 789e1fdc7..4e5758226 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurContractMapper.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurContractMapper.xml @@ -94,8 +94,10 @@ pc.id, pc.code, pc.`name`, pc.fromCorp, pc.contractDate, pc.invCode, pc.`type`, pc.payType, pc.startDate, pc.endDate, pc.amount, pc.payAmount, pc.payDate, pc.invoiceDate, pc.planOrderIdFk, pc.orderIdFk, pc.`createUser`, pc.updateUser, pc.createTime, pc.updateTime, pc.remark,pc.approvalFlowId,pc.isGenerateOrder,IFNULL(pc.status,0) as status, - saf.status as flowStatus, saf.nextNodeName as nextNodeName , saf.nextApprovalNodeType as nextApprovalNodeType + saf.status as flowStatus, saf.nextNodeName as nextNodeName , saf.nextApprovalNodeType as nextApprovalNodeType,bc.name as fromCorpName,aw.name AS invCodeName from pur_contract pc + left join basic_corp bc on pc.fromCorp = bc.erpId + left join auth_warehouse aw on pc.invCode = aw.code left join sys_approval_flow saf ON pc.approvalFlowId = saf.id pc.code is not null diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index 69f6d5b85..8ec32530e 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -2583,7 +2583,7 @@ CREATE TABLE IF NOT EXISTS `pur_contract` `invCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '当前仓库', `status` int(0) NULL DEFAULT NULL COMMENT '合同状态', `type` int(0) NULL DEFAULT NULL COMMENT '合同类型', - `payType` int(0) NULL DEFAULT NULL COMMENT '付款方式', + `payType` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '付款方式', `startDate` datetime(0) NULL DEFAULT NULL COMMENT '开始时间', `endDate` datetime(0) NULL DEFAULT NULL COMMENT '截止时间', `amount` decimal(10, 3) NULL DEFAULT NULL COMMENT '合同金额', From 5d4dc61fa76a536e323f0b48483fac30d6844915 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 17 Mar 2025 16:59:39 +0800 Subject: [PATCH 08/11] 3/7 1.0 --- .../com/glxp/api/http/ErpBasicClient.java | 1 - .../basic/impl/BasicDestinyRelService.java | 39 +++++++++++++++++++ .../impl/ThrInvWarehouseServiceImpl.java | 5 ++- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/http/ErpBasicClient.java b/src/main/java/com/glxp/api/http/ErpBasicClient.java index dbb57956e..0594dd692 100644 --- a/src/main/java/com/glxp/api/http/ErpBasicClient.java +++ b/src/main/java/com/glxp/api/http/ErpBasicClient.java @@ -309,7 +309,6 @@ public class ErpBasicClient { String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/basic/getProject"; try { String response = httpOkClient.uCloudPost(url, dlThirdDestinyRequest); - log.error("获取收费项目::::::" + response); BaseResponse> listBaseResponse = JSONObject.parseObject(response, new TypeReference>>() { }); diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicDestinyRelService.java b/src/main/java/com/glxp/api/service/basic/impl/BasicDestinyRelService.java index b02a1b4dc..806a11db5 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicDestinyRelService.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicDestinyRelService.java @@ -118,16 +118,47 @@ public class BasicDestinyRelService extends ServiceImpl> baseResponse = erpBasicClient.getBasicProject(request); +// if (baseResponse.getCode() == 20000) { +// List list = baseResponse.getData().getList(); +// if (CollUtil.isNotEmpty(list)) { +// list.forEach(item -> { +// BasicSkProjectEntity basicSkProjectEntity = new BasicSkProjectEntity(); +// BeanUtil.copyProperties(item, basicSkProjectEntity); +// basicSkProjectEntity.setType(2); +// Boolean b = basicSkProjectMapper.exists(new LambdaQueryWrapper().eq(BasicSkProjectEntity::getCode, basicSkProjectEntity.getCode())); +// if (b) { +// basicSkProjectMapper.update(basicSkProjectEntity, new LambdaUpdateWrapper().eq(BasicSkProjectEntity::getCode, basicSkProjectEntity.getCode())); +// } else { +// basicSkProjectEntity.setId(IdUtil.getSnowflakeNextId()); +// basicSkProjectMapper.insert(basicSkProjectEntity); +// } +// }); +// } +// if (list.size() >= limit && !baseResponse.getData().getTotal().equals(-666)) { +// page++; +// } else { +// break; +// } +// } else { +// return ResultVOUtils.error(500, "下载异常中断"); +// } +// } while (true) { request.setPage(page); BaseResponse> baseResponse = erpBasicClient.getBasicProject(request); + if (baseResponse.getCode() == 20000) { List list = baseResponse.getData().getList(); + if (CollUtil.isNotEmpty(list)) { list.forEach(item -> { BasicSkProjectEntity basicSkProjectEntity = new BasicSkProjectEntity(); BeanUtil.copyProperties(item, basicSkProjectEntity); basicSkProjectEntity.setType(2); + Boolean b = basicSkProjectMapper.exists(new LambdaQueryWrapper().eq(BasicSkProjectEntity::getCode, basicSkProjectEntity.getCode())); if (b) { basicSkProjectMapper.update(basicSkProjectEntity, new LambdaUpdateWrapper().eq(BasicSkProjectEntity::getCode, basicSkProjectEntity.getCode())); @@ -136,7 +167,15 @@ public class BasicDestinyRelService extends ServiceImpl 1000) { + log.error("List size exceeds 1000, stopping the loop." + list.size()); + break; + } } + + // 检查是否继续分页 if (list.size() >= limit && !baseResponse.getData().getTotal().equals(-666)) { page++; } else { diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvWarehouseServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvWarehouseServiceImpl.java index eecde8a5d..4de022dab 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvWarehouseServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvWarehouseServiceImpl.java @@ -164,7 +164,10 @@ public class ThrInvWarehouseServiceImpl extends ServiceImpl 100) { + log.error("downloadThrInv List size exceeds 1000, stopping the loop." + list.size()); + break; + } //请求下一页数据 if (list.size() >= limit) { page++; From 78386ebdfbb7a28d3b0c59741be22f4f4c2c524b Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Wed, 19 Mar 2025 19:28:03 +0800 Subject: [PATCH 09/11] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dev/DeviceInfoController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java b/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java index 7acca60ac..7ba3ad13b 100644 --- a/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java +++ b/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java @@ -137,6 +137,23 @@ public class DeviceInfoController extends BaseController { return ResultVOUtils.success(page); } + /** + * 查看当前用户所在科室设备详情 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/info/detailByUser/one") + public BaseResponse detailByUserOne(@RequestBody DeviceInfoDetailQuery query) { + List list = deviceInfoService.detail(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + /** * 查看当前科室设备详情 * From f9653f920b44b966c4f6625f8f2b523ceca9dfeb Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 20 Mar 2025 10:32:39 +0800 Subject: [PATCH 10/11] 3/7 1.0 --- .../api/service/thrsys/impl/ThrProductsServiceImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index 0a3f2e00e..fd1c913c0 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -273,7 +273,9 @@ public class ThrProductsServiceImpl extends ServiceImpl 500) { + log.error("List size exceeds 1000, stopping the loop." + list.size()); + break; + } //total = -666 表示出错,-555表示数据已经被过滤,可以进行下一页下载 if ((list.size() >= limit && !baseResponse.getData().getTotal().equals(-666)) || IntUtil.value(baseResponse.getData().getTotal()) == -555) { page++; From 497c56ab634a833c8d2f75004351acf0fd0b4f57 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Tue, 25 Mar 2025 18:34:08 +0800 Subject: [PATCH 11/11] =?UTF-8?q?3/25=20=E4=BC=98=E5=8C=961.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index fd1c913c0..bee85f0ab 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -293,7 +293,7 @@ public class ThrProductsServiceImpl extends ServiceImpl 500) { + if (list.size() > 200) { log.error("List size exceeds 1000, stopping the loop." + list.size()); break; }