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:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://20.0.99.3:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
url: jdbc:mysql://192.168.20.24:3307/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username: root
password: jkauto@123
driver-class-name: com.mysql.jdbc.Driver
# 恩菲数据同步
nf-db:
url: jdbc:mysql://20.0.99.3:3306/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
url: jdbc:mysql://192.168.20.24:3307/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username: root
password: jkauto@123
driver-class-name: com.mysql.jdbc.Driver
# 多数据源配置
pg-db:
url: jdbc:postgresql://112.123.135.140:10086/postgres?useUnicode=true&characterEncoding=UTF8
url: jdbc:postgresql://192.168.20.25:10086/postgres?useUnicode=true&characterEncoding=UTF8
username: postgres
password: jkauto@123
driver-class-name: org.postgresql.Driver
......@@ -139,11 +139,11 @@ skua:
web-url: https://zhsw.mcchb.com/
path:
#文件上传根目录 设置
upload: /home/skboot/file
upload: /app/file
#webapp文件路径
webapp: /home/skboot/file
webapp: /app/file
# 断点续传路径
chunk: /home/skboot/file/files
chunk: /app/file/files
#创蓝短信秘钥
sms:
#应用地址
......
spring:
profiles:
active: test
active: prod
# 信息安全
security:
csrf:
......
......@@ -193,12 +193,9 @@ public class EquipmentInController {
Page<EquipmentInVO> voPage = new Page<>(pageNo, pageSize);
Page<EquipmentIn> page = new Page<EquipmentIn>(pageNo, pageSize);
List<EquipmentIn> totalList = equipmentInService.list(queryWrapper);
IPage<EquipmentIn> equipmentInIPage = page.setRecords(totalList);
List<EquipmentIn> equipmentInList = equipmentInIPage.getRecords();
equipmentInList.stream().map(data -> "'" + data.getId() + "'").collect(Collectors.joining(","));
List<EquipmentInVO> equipmentInVOList = BeanExtUtils.beans2Beans(equipmentInList, EquipmentInVO.class, (targetFieldName, srcFieldVal) -> {
IPage<EquipmentIn> pageList = equipmentInService.page(page,queryWrapper);
voPage.setTotal(pageList.getTotal());
List<EquipmentInVO> equipmentInVOList = BeanExtUtils.beans2Beans(pageList.getRecords(), EquipmentInVO.class, (targetFieldName, srcFieldVal) -> {
if ("departIdName".equals(targetFieldName) && srcFieldVal != null) {
return sysDepartVal2KeyMap.getOrDefault(srcFieldVal, "");
} else if ("sparepartName".equals(targetFieldName)) {
......@@ -285,6 +282,7 @@ public class EquipmentInController {
// 入库表主键
String inId = UUID.randomUUID().toString().replaceAll("-", "");
equipmentInDTO.setId(inId);
equipmentInDTO.setSpecification(inId);
EquipmentIn equipmentIn = BeanExtUtils.bean2Bean(equipmentInDTO, EquipmentIn.class);
equipmentIn.setIsConfirm(1);
transactionTemplate.execute((transactionStatus -> {
......
......@@ -180,9 +180,9 @@ public class EquipmentOutController {
Map<String, String> departCodeVal2KeyMap = key2ValueService.dictKey2Val("departCode", false);
Map<String, String> suppliesWarehouseVal2KeyMap = key2ValueService.dictKey2Val("suppliesWarehouse", false);
Page<EquipmentOutVO> voPage = new Page<>(pageNo, pageSize);
Page<EquipmentOut> page = new Page<>(pageNo, pageSize);
IPage<EquipmentOut> pageList = equipmentOutService.page(page, queryWrapper);
Page<EquipmentOutVO> voPage = new Page<>(pageNo, pageSize);
voPage.setTotal(pageList.getTotal());
List<EquipmentOutVO> equipmentOutVOList = BeanExtUtils.beans2Beans(pageList.getRecords(), EquipmentOutVO.class, (targetFieldName, srcFieldVal) -> {
if ("departIdName".equals(targetFieldName) && srcFieldVal != null) {
......@@ -202,7 +202,7 @@ public class EquipmentOutController {
stringBuilder.append(",").append(item.getKey());
}
return stringBuilder.toString().replaceFirst(",", "");
} else if ("specification".equals(targetFieldName)) {
} else if ("specification_dictText".equals(targetFieldName)) {
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";
List<Map<String, Object>> sparePartList = iCommonSqlService.queryForList(sql2);
Map<String, Integer> code2CountMap = new HashMap<>();
......@@ -260,6 +260,7 @@ public class EquipmentOutController {
// 出库表主键
String outId = UUID.randomUUID().toString().replaceAll("-", "");
equipmentOutDTO.setId(outId);
equipmentOutDTO.setSpecification(outId);
EquipmentOut equipmentOut = BeanExtUtils.bean2Bean(equipmentOutDTO, EquipmentOut.class);
equipmentOut.setInventoryUpdateTime(new Date());
equipmentOutService.save(equipmentOut);
......
......@@ -141,7 +141,7 @@ public class EquipmentOut {
private Date inventoryUpdateTime;
@ApiModelProperty(value = "规格型号")
@BeanAnno(targetFieldName = "specification")
@BeanAnno(targetFieldName = "specification_dictText")
private String specification;
}
......
......@@ -23,4 +23,6 @@ public class EquipmentOutVO extends EquipmentOut {
private String departCode_dictText;
@Excel(name = "出库仓库", width = 15)
private String suppliesWarehouseId_dictText;
private String specification_dictText;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!