b390f8b6 张雷

refactor(module-biz):调整数据库连接和文件路径配置

- 修改 application.yml 中的 active profile 为 prod
- 更新 application-prod.yml 中的数据库连接 URL 和文件路径
- 优化 EquipmentInController 和 EquipmentOutController 中的分页查询逻辑
-调整 EquipmentOut 实体类和 EquipmentOutVO VO 类中的规格型号字段名称
1 个父辈 a2d7cc6f
...@@ -89,19 +89,19 @@ spring: ...@@ -89,19 +89,19 @@ spring:
89 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 89 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
90 datasource: 90 datasource:
91 master: 91 master:
92 url: jdbc:mysql://20.0.99.3:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false 92 url: jdbc:mysql://192.168.20.24:3307/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
93 username: root 93 username: root
94 password: jkauto@123 94 password: jkauto@123
95 driver-class-name: com.mysql.jdbc.Driver 95 driver-class-name: com.mysql.jdbc.Driver
96 # 恩菲数据同步 96 # 恩菲数据同步
97 nf-db: 97 nf-db:
98 url: jdbc:mysql://20.0.99.3:3306/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false 98 url: jdbc:mysql://192.168.20.24:3307/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
99 username: root 99 username: root
100 password: jkauto@123 100 password: jkauto@123
101 driver-class-name: com.mysql.jdbc.Driver 101 driver-class-name: com.mysql.jdbc.Driver
102 # 多数据源配置 102 # 多数据源配置
103 pg-db: 103 pg-db:
104 url: jdbc:postgresql://112.123.135.140:10086/postgres?useUnicode=true&characterEncoding=UTF8 104 url: jdbc:postgresql://192.168.20.25:10086/postgres?useUnicode=true&characterEncoding=UTF8
105 username: postgres 105 username: postgres
106 password: jkauto@123 106 password: jkauto@123
107 driver-class-name: org.postgresql.Driver 107 driver-class-name: org.postgresql.Driver
...@@ -139,11 +139,11 @@ skua: ...@@ -139,11 +139,11 @@ skua:
139 web-url: https://zhsw.mcchb.com/ 139 web-url: https://zhsw.mcchb.com/
140 path: 140 path:
141 #文件上传根目录 设置 141 #文件上传根目录 设置
142 upload: /home/skboot/file 142 upload: /app/file
143 #webapp文件路径 143 #webapp文件路径
144 webapp: /home/skboot/file 144 webapp: /app/file
145 # 断点续传路径 145 # 断点续传路径
146 chunk: /home/skboot/file/files 146 chunk: /app/file/files
147 #创蓝短信秘钥 147 #创蓝短信秘钥
148 sms: 148 sms:
149 #应用地址 149 #应用地址
......
1 spring: 1 spring:
2 profiles: 2 profiles:
3 active: test 3 active: prod
4 # 信息安全 4 # 信息安全
5 security: 5 security:
6 csrf: 6 csrf:
......
...@@ -193,12 +193,9 @@ public class EquipmentInController { ...@@ -193,12 +193,9 @@ public class EquipmentInController {
193 193
194 Page<EquipmentInVO> voPage = new Page<>(pageNo, pageSize); 194 Page<EquipmentInVO> voPage = new Page<>(pageNo, pageSize);
195 Page<EquipmentIn> page = new Page<EquipmentIn>(pageNo, pageSize); 195 Page<EquipmentIn> page = new Page<EquipmentIn>(pageNo, pageSize);
196 List<EquipmentIn> totalList = equipmentInService.list(queryWrapper); 196 IPage<EquipmentIn> pageList = equipmentInService.page(page,queryWrapper);
197 IPage<EquipmentIn> equipmentInIPage = page.setRecords(totalList); 197 voPage.setTotal(pageList.getTotal());
198 List<EquipmentIn> equipmentInList = equipmentInIPage.getRecords(); 198 List<EquipmentInVO> equipmentInVOList = BeanExtUtils.beans2Beans(pageList.getRecords(), EquipmentInVO.class, (targetFieldName, srcFieldVal) -> {
199 equipmentInList.stream().map(data -> "'" + data.getId() + "'").collect(Collectors.joining(","));
200
201 List<EquipmentInVO> equipmentInVOList = BeanExtUtils.beans2Beans(equipmentInList, EquipmentInVO.class, (targetFieldName, srcFieldVal) -> {
202 if ("departIdName".equals(targetFieldName) && srcFieldVal != null) { 199 if ("departIdName".equals(targetFieldName) && srcFieldVal != null) {
203 return sysDepartVal2KeyMap.getOrDefault(srcFieldVal, ""); 200 return sysDepartVal2KeyMap.getOrDefault(srcFieldVal, "");
204 } else if ("sparepartName".equals(targetFieldName)) { 201 } else if ("sparepartName".equals(targetFieldName)) {
...@@ -285,6 +282,7 @@ public class EquipmentInController { ...@@ -285,6 +282,7 @@ public class EquipmentInController {
285 // 入库表主键 282 // 入库表主键
286 String inId = UUID.randomUUID().toString().replaceAll("-", ""); 283 String inId = UUID.randomUUID().toString().replaceAll("-", "");
287 equipmentInDTO.setId(inId); 284 equipmentInDTO.setId(inId);
285 equipmentInDTO.setSpecification(inId);
288 EquipmentIn equipmentIn = BeanExtUtils.bean2Bean(equipmentInDTO, EquipmentIn.class); 286 EquipmentIn equipmentIn = BeanExtUtils.bean2Bean(equipmentInDTO, EquipmentIn.class);
289 equipmentIn.setIsConfirm(1); 287 equipmentIn.setIsConfirm(1);
290 transactionTemplate.execute((transactionStatus -> { 288 transactionTemplate.execute((transactionStatus -> {
......
...@@ -180,9 +180,9 @@ public class EquipmentOutController { ...@@ -180,9 +180,9 @@ public class EquipmentOutController {
180 Map<String, String> departCodeVal2KeyMap = key2ValueService.dictKey2Val("departCode", false); 180 Map<String, String> departCodeVal2KeyMap = key2ValueService.dictKey2Val("departCode", false);
181 Map<String, String> suppliesWarehouseVal2KeyMap = key2ValueService.dictKey2Val("suppliesWarehouse", false); 181 Map<String, String> suppliesWarehouseVal2KeyMap = key2ValueService.dictKey2Val("suppliesWarehouse", false);
182 182
183 Page<EquipmentOutVO> voPage = new Page<>(pageNo, pageSize);
183 Page<EquipmentOut> page = new Page<>(pageNo, pageSize); 184 Page<EquipmentOut> page = new Page<>(pageNo, pageSize);
184 IPage<EquipmentOut> pageList = equipmentOutService.page(page, queryWrapper); 185 IPage<EquipmentOut> pageList = equipmentOutService.page(page, queryWrapper);
185 Page<EquipmentOutVO> voPage = new Page<>(pageNo, pageSize);
186 voPage.setTotal(pageList.getTotal()); 186 voPage.setTotal(pageList.getTotal());
187 List<EquipmentOutVO> equipmentOutVOList = BeanExtUtils.beans2Beans(pageList.getRecords(), EquipmentOutVO.class, (targetFieldName, srcFieldVal) -> { 187 List<EquipmentOutVO> equipmentOutVOList = BeanExtUtils.beans2Beans(pageList.getRecords(), EquipmentOutVO.class, (targetFieldName, srcFieldVal) -> {
188 if ("departIdName".equals(targetFieldName) && srcFieldVal != null) { 188 if ("departIdName".equals(targetFieldName) && srcFieldVal != null) {
...@@ -202,7 +202,7 @@ public class EquipmentOutController { ...@@ -202,7 +202,7 @@ public class EquipmentOutController {
202 stringBuilder.append(",").append(item.getKey()); 202 stringBuilder.append(",").append(item.getKey());
203 } 203 }
204 return stringBuilder.toString().replaceFirst(",", ""); 204 return stringBuilder.toString().replaceFirst(",", "");
205 } else if ("specification".equals(targetFieldName)) { 205 } else if ("specification_dictText".equals(targetFieldName)) {
206 String sql2 = "select es.sparepart_name as sparepartName from equipment_sparepart_supplies as es inner join (select sparepart_id from equipment_out_child where out_id = '" + srcFieldVal + "') as tmp on es.id = tmp.sparepart_id"; 206 String sql2 = "select es.sparepart_name as sparepartName from equipment_sparepart_supplies as es inner join (select sparepart_id from equipment_out_child where out_id = '" + srcFieldVal + "') as tmp on es.id = tmp.sparepart_id";
207 List<Map<String, Object>> sparePartList = iCommonSqlService.queryForList(sql2); 207 List<Map<String, Object>> sparePartList = iCommonSqlService.queryForList(sql2);
208 Map<String, Integer> code2CountMap = new HashMap<>(); 208 Map<String, Integer> code2CountMap = new HashMap<>();
...@@ -260,6 +260,7 @@ public class EquipmentOutController { ...@@ -260,6 +260,7 @@ public class EquipmentOutController {
260 // 出库表主键 260 // 出库表主键
261 String outId = UUID.randomUUID().toString().replaceAll("-", ""); 261 String outId = UUID.randomUUID().toString().replaceAll("-", "");
262 equipmentOutDTO.setId(outId); 262 equipmentOutDTO.setId(outId);
263 equipmentOutDTO.setSpecification(outId);
263 EquipmentOut equipmentOut = BeanExtUtils.bean2Bean(equipmentOutDTO, EquipmentOut.class); 264 EquipmentOut equipmentOut = BeanExtUtils.bean2Bean(equipmentOutDTO, EquipmentOut.class);
264 equipmentOut.setInventoryUpdateTime(new Date()); 265 equipmentOut.setInventoryUpdateTime(new Date());
265 equipmentOutService.save(equipmentOut); 266 equipmentOutService.save(equipmentOut);
......
...@@ -141,7 +141,7 @@ public class EquipmentOut { ...@@ -141,7 +141,7 @@ public class EquipmentOut {
141 private Date inventoryUpdateTime; 141 private Date inventoryUpdateTime;
142 142
143 @ApiModelProperty(value = "规格型号") 143 @ApiModelProperty(value = "规格型号")
144 @BeanAnno(targetFieldName = "specification") 144 @BeanAnno(targetFieldName = "specification_dictText")
145 private String specification; 145 private String specification;
146 146
147 } 147 }
......
...@@ -23,4 +23,6 @@ public class EquipmentOutVO extends EquipmentOut { ...@@ -23,4 +23,6 @@ public class EquipmentOutVO extends EquipmentOut {
23 private String departCode_dictText; 23 private String departCode_dictText;
24 @Excel(name = "出库仓库", width = 15) 24 @Excel(name = "出库仓库", width = 15)
25 private String suppliesWarehouseId_dictText; 25 private String suppliesWarehouseId_dictText;
26
27 private String specification_dictText;
26 } 28 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!