fix 修改
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package org.nl.system.controller.kanban;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apiguardian.api.API;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.system.service.kanban.KanbanService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/kanban")
|
||||
@RequiredArgsConstructor
|
||||
@SaIgnore
|
||||
public class KanbanController {
|
||||
@Autowired
|
||||
KanbanService kanbanService;
|
||||
|
||||
@PostMapping("/wwdkdate")
|
||||
@Log("看板")
|
||||
public ResponseEntity<Object> wwdkdate(){
|
||||
return new ResponseEntity<>(kanbanService.wwdkdate(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ public class SysLogController {
|
||||
@Autowired
|
||||
private ISysLogService logService;
|
||||
@GetMapping
|
||||
|
||||
public ResponseEntity<Object> query(@RequestParam Map criteria, PageQuery pageable){
|
||||
criteria.put("log_type","INFO");
|
||||
return new ResponseEntity<>(TableDataInfo.build(logService.queryAll(criteria,pageable)), HttpStatus.OK);
|
||||
|
||||
@@ -186,6 +186,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
sysDictMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Dict> queryAll() {
|
||||
return sysDictMapper.selectList(new QueryWrapper<Dict>()
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.nl.system.service.kanban;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public interface KanbanService {
|
||||
ConcurrentHashMap<String,Object> wwdkdate();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.nl.system.service.kanban.dao;
|
||||
|
||||
public class Bzsituation {
|
||||
public String bz_situation;
|
||||
public String bz_proportion;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.system.service.kanban.dao;
|
||||
|
||||
public class Dddatebase {
|
||||
public String customer;
|
||||
public String production_materials;
|
||||
public String large_model;
|
||||
public String small_model;
|
||||
public String batch_number;
|
||||
public String weight;
|
||||
//(1未开始 2进行中 3已完成)
|
||||
public String dd_status;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.nl.system.service.kanban.dao;
|
||||
|
||||
public class Drbzsituation {
|
||||
public String plan_weight;
|
||||
public String finish_weight;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.nl.system.service.kanban.dao;
|
||||
|
||||
public class Fhsituation {
|
||||
public String enter_proportion;
|
||||
public String out_proportion;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.nl.system.service.kanban.dao;
|
||||
|
||||
public class Todaycpsituation {
|
||||
public String customer;
|
||||
public String plan_weight;
|
||||
public String finish_weight;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.nl.system.service.kanban.dao;
|
||||
|
||||
public class Ypbzsituation {
|
||||
public String customer;
|
||||
public String batch;
|
||||
public String dd_status;
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package org.nl.system.service.kanban.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.system.service.kanban.KanbanService;
|
||||
import org.nl.system.service.kanban.dao.*;
|
||||
import org.nl.system.service.kanban.mapper.KanbanMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class KanbanServiceImpl implements KanbanService {
|
||||
@Autowired
|
||||
KanbanMapper kanbanMapper;
|
||||
@Override
|
||||
public ConcurrentHashMap<String, Object> wwdkdate() {
|
||||
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||
ConcurrentHashMap<String, Object> map = new ConcurrentHashMap<>();
|
||||
|
||||
// 订单数据
|
||||
CompletableFuture<List<Dddatebase>> listWwdkdateFuture = CompletableFuture.supplyAsync(
|
||||
() -> kanbanMapper.getDddatebaseList(), pool);
|
||||
listWwdkdateFuture.thenAccept(result -> {
|
||||
map.put("dddatebase", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("获取订单数据失败: {}", e.getMessage(), e);
|
||||
map.put("dddatebase", Collections.emptyList()); // 返回空列表而不是 null
|
||||
return null;
|
||||
});
|
||||
|
||||
// // 成品包装发货情况
|
||||
// CompletableFuture<Fhsituation> fhsituationFuture = CompletableFuture.supplyAsync(
|
||||
// () -> kanbanMapper.getFhsituation(), pool);
|
||||
// fhsituationFuture.thenAccept(result -> {
|
||||
// map.put("fhsituation", result);
|
||||
// }).exceptionally((e) -> {
|
||||
// log.error("成品包装发货情况获取失败: {}", e.getMessage(), e);
|
||||
// map.put("fhsituation", null);
|
||||
// return null;
|
||||
// });
|
||||
|
||||
// 包装发货情况
|
||||
CompletableFuture<List<Bzsituation>> listBzsituationFuture = CompletableFuture.supplyAsync(
|
||||
() -> kanbanMapper.getBzsituationList(), pool);
|
||||
listBzsituationFuture.thenAccept(result -> {
|
||||
map.put("bzsituation", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("包装发货情况获取失败: {}", e.getMessage(), e);
|
||||
map.put("bzsituation", Collections.emptyList()); // 返回空列表而不是 null
|
||||
return null;
|
||||
});
|
||||
|
||||
// (样品)包装发货进度
|
||||
CompletableFuture<List<Ypbzsituation>> listYpbzsituationFuture = CompletableFuture.supplyAsync(
|
||||
() -> kanbanMapper.getYpbzsituationList(), pool);
|
||||
listYpbzsituationFuture.thenAccept(result -> {
|
||||
map.put("ypsituation", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("(样品)包装发货进度获取失败: {}", e.getMessage(), e);
|
||||
map.put("ypsituation", Collections.emptyList()); // 返回空列表而不是 null
|
||||
return null;
|
||||
});
|
||||
|
||||
// 当日包装完成情况
|
||||
// CompletableFuture<Drbzsituation> drbzsituationFuture = CompletableFuture.supplyAsync(
|
||||
// () -> kanbanMapper.getDrbzsituation(), pool);
|
||||
// drbzsituationFuture.thenAccept(result -> {
|
||||
// map.put("drbzsituation", result);
|
||||
// }).exceptionally((e) -> {
|
||||
// log.error("当日包装完成情况获取失败: {}", e.getMessage(), e);
|
||||
// map.put("drbzsituation", null);
|
||||
// return null;
|
||||
// });
|
||||
//成品包装情况
|
||||
CompletableFuture<List<Todaycpsituation>> listTodaycpsituationFuture = CompletableFuture.supplyAsync(
|
||||
() -> kanbanMapper.getTodaycpsituation(), pool);
|
||||
listTodaycpsituationFuture.thenAccept(result -> {
|
||||
map.put("todaycpsituation", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("成品包装情况进度获取失败: {}", e.getMessage(), e);
|
||||
map.put("todaycpsituation", Collections.emptyList()); // 返回空列表而不是 null
|
||||
return null;
|
||||
});
|
||||
// 等待所有任务完成
|
||||
CompletableFuture<Void> allQuery = CompletableFuture.allOf(
|
||||
listWwdkdateFuture,
|
||||
listBzsituationFuture,
|
||||
listYpbzsituationFuture,
|
||||
listTodaycpsituationFuture
|
||||
);
|
||||
|
||||
// 阻塞,直到所有任务完成
|
||||
allQuery.join(); // 等待所有异步任务完成
|
||||
|
||||
// 检查异步任务是否有异常
|
||||
if (listWwdkdateFuture.isCompletedExceptionally() || listTodaycpsituationFuture.isCompletedExceptionally()||
|
||||
listBzsituationFuture.isCompletedExceptionally() || listYpbzsituationFuture.isCompletedExceptionally()
|
||||
) {
|
||||
log.error("部分任务执行失败");
|
||||
// 可以在这里抛出异常或者返回一个失败的响应
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.system.service.kanban.mapper;
|
||||
|
||||
import org.nl.system.service.kanban.dao.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface KanbanMapper {
|
||||
List<Dddatebase> getDddatebaseList();
|
||||
Fhsituation getFhsituation();
|
||||
List<Bzsituation> getBzsituationList();
|
||||
List<Ypbzsituation> getYpbzsituationList();
|
||||
List<Todaycpsituation > getTodaycpsituation();
|
||||
Drbzsituation getDrbzsituation();
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.system.service.kanban.mapper.KanbanMapper">
|
||||
<select id="getDddatebaseList" resultType="org.nl.system.service.kanban.dao.Dddatebase">
|
||||
SELECT *
|
||||
FROM `md_base_material`
|
||||
</select>
|
||||
<select id="getFhsituation" resultType="org.nl.system.service.kanban.dao.Fhsituation">
|
||||
SELECT FORMAT(
|
||||
IF
|
||||
(SUM(weight) != 0, SUM(inventory_qty) / SUM(weight), 0),
|
||||
2
|
||||
) AS enter_proportion,
|
||||
FORMAT(
|
||||
IF
|
||||
(SUM(weight) != 0,1- SUM(inventory_qty) / SUM(weight), 1),
|
||||
2
|
||||
) AS out_proportion
|
||||
FROM `md_base_material`
|
||||
</select>
|
||||
<select id="getBzsituationList" resultType="org.nl.system.service.kanban.dao.Bzsituation">
|
||||
SELECT
|
||||
dd_status AS bz_situation,
|
||||
FORMAT(SUM(weight) / (SELECT SUM(weight) FROM md_base_material), 2) AS bz_proportion
|
||||
FROM
|
||||
md_base_material
|
||||
GROUP BY
|
||||
dd_status;
|
||||
</select>
|
||||
<select id="getYpbzsituationList" resultType="org.nl.system.service.kanban.dao.Ypbzsituation">
|
||||
SELECT *
|
||||
FROM `yp_material`
|
||||
</select>
|
||||
<select id="getDrbzsituation" resultType="org.nl.system.service.kanban.dao.Drbzsituation">
|
||||
SELECT
|
||||
SUM(weight) AS finish_weight,
|
||||
(SELECT SUM(weight) FROM md_base_material) AS plan_weight
|
||||
FROM `md_base_material`
|
||||
WHERE dd_status = '已完成';
|
||||
</select>
|
||||
<select id="getTodaycpsituation" resultType="org.nl.system.service.kanban.dao.Todaycpsituation">
|
||||
SELECT
|
||||
customer,
|
||||
SUM(weight) AS plan_weight,
|
||||
SUM(product_qty) AS finish_weight
|
||||
FROM
|
||||
md_base_material
|
||||
GROUP BY
|
||||
customer;
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -132,5 +132,7 @@ public class MdBaseMaterial {
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private String update_time;
|
||||
//订单状态
|
||||
private String dd_status;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,4 +26,5 @@ public class MdBaseMaterialDto {
|
||||
private String carton_qty;
|
||||
private String sum_qty;
|
||||
private String shdnumber;
|
||||
private String dd_status;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.nl.system.service.material.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("yp_material")
|
||||
public class YpMaterial {
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
@TableId(type = IdType.NONE)
|
||||
private String material_id;
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
private String customer;
|
||||
/**
|
||||
* 实发批次
|
||||
*/
|
||||
private String batch;
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
private String dd_status;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.nl.system.service.material.dto.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.system.service.material.dto.YpMaterial;
|
||||
|
||||
public interface YpMaterialMapper extends BaseMapper<YpMaterial> {
|
||||
void clearMaterialData();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.system.service.material.dto.mapper.YpMaterialMapper">
|
||||
<!-- 清除所有数据 -->
|
||||
<delete id="clearMaterialData">
|
||||
DELETE FROM yp_material
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -23,7 +23,9 @@ import org.nl.config.language.LangProcess;
|
||||
import org.nl.system.service.material.MdBaseMaterialService;
|
||||
import org.nl.system.service.material.dto.MdBaseMaterial;
|
||||
import org.nl.system.service.material.dto.MdBaseMaterialDto;
|
||||
import org.nl.system.service.material.dto.YpMaterial;
|
||||
import org.nl.system.service.material.dto.mapper.MdBaseMaterialMapper;
|
||||
import org.nl.system.service.material.dto.mapper.YpMaterialMapper;
|
||||
import org.nl.system.service.tickets.dto.TicketsDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -45,6 +47,8 @@ import java.util.regex.Pattern;
|
||||
public class MdBaseMaterialServiceImpl extends ServiceImpl<MdBaseMaterialMapper, MdBaseMaterial> implements MdBaseMaterialService {
|
||||
@Autowired
|
||||
private MdBaseMaterialMapper mdBaseMaterialMapper;
|
||||
@Autowired
|
||||
private YpMaterialMapper ypMaterialMapper;
|
||||
|
||||
@Override
|
||||
public IPage<MdBaseMaterial> queryAll(Map whereJson, PageQuery page) {
|
||||
@@ -128,150 +132,202 @@ public class MdBaseMaterialServiceImpl extends ServiceImpl<MdBaseMaterialMapper,
|
||||
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
|
||||
// 从第二行开始获取数据 excelReader.read的结果是一个2纬的list,外层是行,内层是行对应的所有列
|
||||
List<List<Object>> read = excelReader.read(1, excelReader.getRowCount());
|
||||
|
||||
// 循环获取的数据
|
||||
for (int i = 0; i < read.size(); i++) {
|
||||
List list = read.get(i);
|
||||
JSONObject param = new JSONObject();
|
||||
String customer = list.get(1).toString();
|
||||
String production_materials = null;
|
||||
String actual_batch = null;
|
||||
String inventory_qty = null;
|
||||
String large_model = null;
|
||||
String small_model = null;
|
||||
String product_qty = null;
|
||||
String batch_number = null;
|
||||
String weight = null;
|
||||
String remark = null;
|
||||
String material_code = null;
|
||||
String material_number = null;
|
||||
if (StrUtil.isBlank(customer)) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
production_materials = list.get(2).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行实发型号为空");
|
||||
}
|
||||
try {
|
||||
actual_batch = list.get(3).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行实发批次为空");
|
||||
}
|
||||
try {
|
||||
inventory_qty = list.get(4).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行库存数量为空");
|
||||
}
|
||||
try {
|
||||
product_qty = list.get(5).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行当天生产为空");
|
||||
}
|
||||
try {
|
||||
large_model = list.get(9).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行大型号为空");
|
||||
}
|
||||
try {
|
||||
small_model = list.get(10).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行小型号为空");
|
||||
}
|
||||
try {
|
||||
batch_number = list.get(11).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行标签批次号为空");
|
||||
}
|
||||
try {
|
||||
weight = list.get(12).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行重量/KG为空");
|
||||
}
|
||||
try {
|
||||
remark = list.get(14).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行备注为空");
|
||||
}
|
||||
String bottle_number = null;
|
||||
String carton_number = null;
|
||||
try {
|
||||
material_code = list.get(15).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行物料编码为空");
|
||||
}
|
||||
try {
|
||||
material_number = list.get(16).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行物料名称为空");
|
||||
}
|
||||
String model = null;
|
||||
String batch = null;
|
||||
String shdnumber= null;
|
||||
String sum_qty= null;
|
||||
String carton_qty= null;
|
||||
try {
|
||||
shdnumber = list.get(17).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行送货单单号为空");
|
||||
}
|
||||
try {
|
||||
bottle_number = list.get(18).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行瓶盖号为空");
|
||||
}
|
||||
try {
|
||||
carton_number = list.get(19).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行纸箱号为空");
|
||||
}
|
||||
try {
|
||||
carton_qty = list.get(21).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行总罐数为空");
|
||||
}
|
||||
try {
|
||||
sum_qty = list.get(20).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行箱内罐数为空");
|
||||
}
|
||||
try {
|
||||
model = list.get(22).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行型号为空");
|
||||
}
|
||||
try {
|
||||
batch = list.get(23).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行批号为空");
|
||||
}
|
||||
MdBaseMaterial mdBaseMaterial = new MdBaseMaterial();
|
||||
//
|
||||
List list1 = read.get(1);
|
||||
if(list1.size()>23) {
|
||||
// 循环获取的数据
|
||||
for (int i = 0; i < read.size(); i++) {
|
||||
List list = read.get(i);
|
||||
JSONObject param = new JSONObject();
|
||||
String customer = list.get(1).toString();
|
||||
String production_materials = null;
|
||||
String actual_batch = null;
|
||||
String inventory_qty = null;
|
||||
String large_model = null;
|
||||
String small_model = null;
|
||||
String product_qty = null;
|
||||
String batch_number = null;
|
||||
String weight = null;
|
||||
String remark = null;
|
||||
String material_code = null;
|
||||
String material_number = null;
|
||||
if (StrUtil.isBlank(customer)) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
production_materials = list.get(2).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行实发型号为空");
|
||||
}
|
||||
try {
|
||||
actual_batch = list.get(3).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行实发批次为空");
|
||||
}
|
||||
try {
|
||||
inventory_qty = list.get(4).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行库存数量为空");
|
||||
}
|
||||
try {
|
||||
product_qty = list.get(5).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行当天生产为空");
|
||||
}
|
||||
try {
|
||||
large_model = list.get(9).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行大型号为空");
|
||||
}
|
||||
try {
|
||||
small_model = list.get(10).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行小型号为空");
|
||||
}
|
||||
try {
|
||||
batch_number = list.get(11).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行标签批次号为空");
|
||||
}
|
||||
try {
|
||||
weight = list.get(12).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行重量/KG为空");
|
||||
}
|
||||
try {
|
||||
remark = list.get(14).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行备注为空");
|
||||
}
|
||||
String bottle_number = null;
|
||||
String carton_number = null;
|
||||
try {
|
||||
material_code = list.get(15).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行物料编码为空");
|
||||
}
|
||||
try {
|
||||
material_number = list.get(16).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行物料名称为空");
|
||||
}
|
||||
String model = null;
|
||||
String batch = null;
|
||||
String shdnumber = null;
|
||||
String sum_qty = null;
|
||||
String carton_qty = null;
|
||||
String dd_status = null;
|
||||
try {
|
||||
shdnumber = list.get(17).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行送货单单号为空");
|
||||
}
|
||||
try {
|
||||
bottle_number = list.get(18).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行瓶盖号为空");
|
||||
}
|
||||
try {
|
||||
carton_number = list.get(19).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行纸箱号为空");
|
||||
}
|
||||
try {
|
||||
carton_qty = list.get(21).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行总罐数为空");
|
||||
}
|
||||
try {
|
||||
sum_qty = list.get(20).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行箱内罐数为空");
|
||||
}
|
||||
try {
|
||||
model = list.get(22).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行型号为空");
|
||||
}
|
||||
try {
|
||||
batch = list.get(23).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行批号为空");
|
||||
}
|
||||
try {
|
||||
dd_status = list.get(25).toString();
|
||||
if(dd_status==""||dd_status.equals("1")){
|
||||
dd_status="未开始";}
|
||||
else if(dd_status.equals("2")){
|
||||
dd_status="进行中";
|
||||
}else{
|
||||
dd_status="已完成";
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行订单状态为空");
|
||||
}
|
||||
MdBaseMaterial mdBaseMaterial = new MdBaseMaterial();
|
||||
// mdBaseMaterial=mdBaseMaterialMapper.isbatch(batch_number,actual_batch);
|
||||
// if(mdBaseMaterial!=null){
|
||||
// continue;
|
||||
// }
|
||||
param.put("material_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("customer", customer);
|
||||
param.put("production_materials", production_materials);
|
||||
param.put("actual_batch", actual_batch);
|
||||
param.put("inventory_qty", inventory_qty);
|
||||
param.put("product_qty", product_qty);
|
||||
param.put("large_model", large_model);
|
||||
param.put("small_model", small_model);
|
||||
param.put("batch_number", batch_number);
|
||||
param.put("weight", weight);
|
||||
param.put("remark", remark);
|
||||
param.put("shdnumber", shdnumber);
|
||||
param.put("bottle_number", bottle_number);
|
||||
param.put("carton_number", carton_number);
|
||||
param.put("carton_qty", carton_qty);
|
||||
param.put("sum_qty", sum_qty);
|
||||
param.put("model", model);
|
||||
param.put("batch", batch);
|
||||
param.put("material_code", material_code);
|
||||
param.put("material_number", material_number);
|
||||
MdBaseMaterial entity = ConvertUtil.convert(param, MdBaseMaterial.class);
|
||||
mdBaseMaterialMapper.insert(entity);
|
||||
param.put("material_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("customer", customer);
|
||||
param.put("production_materials", production_materials);
|
||||
param.put("actual_batch", actual_batch);
|
||||
param.put("inventory_qty", inventory_qty);
|
||||
param.put("product_qty", product_qty);
|
||||
param.put("large_model", large_model);
|
||||
param.put("small_model", small_model);
|
||||
param.put("batch_number", batch_number);
|
||||
param.put("weight", weight);
|
||||
param.put("remark", remark);
|
||||
param.put("shdnumber", shdnumber);
|
||||
param.put("bottle_number", bottle_number);
|
||||
param.put("carton_number", carton_number);
|
||||
param.put("carton_qty", carton_qty);
|
||||
param.put("sum_qty", sum_qty);
|
||||
param.put("model", model);
|
||||
param.put("batch", batch);
|
||||
param.put("material_code", material_code);
|
||||
param.put("material_number", material_number);
|
||||
param.put("dd_status",dd_status);
|
||||
MdBaseMaterial entity = ConvertUtil.convert(param, MdBaseMaterial.class);
|
||||
mdBaseMaterialMapper.insert(entity);
|
||||
}
|
||||
}else{
|
||||
ypMaterialMapper.clearMaterialData();
|
||||
for (int i = 0; i < read.size(); i++) {
|
||||
List list = read.get(i);
|
||||
JSONObject param = new JSONObject();
|
||||
String customer = list.get(1).toString();
|
||||
if(list.get(0)==""){
|
||||
break;
|
||||
}
|
||||
String batch=null;
|
||||
String dd_status=null;
|
||||
try {
|
||||
batch = list.get(3).toString();
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行实发批次为空");
|
||||
}
|
||||
try {
|
||||
dd_status = list.get(19).toString();
|
||||
if(dd_status==""||dd_status.equals("1")){
|
||||
dd_status="未开始";}
|
||||
else if(dd_status.equals("2")){
|
||||
dd_status="进行中";
|
||||
}else{
|
||||
dd_status="已完成";
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
throw new BadRequestException("当前客户" + list.get(1).toString() + "所在行订单状态为空");
|
||||
}
|
||||
param.put("material_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("customer", customer);
|
||||
param.put("batch", batch);
|
||||
param.put("dd_status", dd_status);
|
||||
YpMaterial entity = ConvertUtil.convert(param, YpMaterial.class);
|
||||
ypMaterialMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,96 +1,119 @@
|
||||
server:
|
||||
port: 8011
|
||||
# 项目配置
|
||||
nl:
|
||||
config:
|
||||
mysql:
|
||||
ip: 127.0.0.1
|
||||
port: 3306
|
||||
username: root
|
||||
password: 12356
|
||||
database: nl-platform
|
||||
redis:
|
||||
ip: 127.0.0.1
|
||||
port: 6379
|
||||
password: null
|
||||
database: 1
|
||||
oracle:
|
||||
ip: 172.27.37.66
|
||||
port: 1521
|
||||
scheme: RTMES
|
||||
username: LMSTELCOM
|
||||
password: LMSTELCOM_6463
|
||||
sqlserver:
|
||||
ip: 10.93.41.2
|
||||
port: WINCC
|
||||
username: sa
|
||||
password: 123
|
||||
database: 马钢_RH
|
||||
# 配置数据源
|
||||
port: 8010
|
||||
#配置数据源
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
messages:
|
||||
basename: language/login/login,language/error/error,language/buss/buss,language/task/task,language/monitor/one_device/one_device,language/monitor/two_device/two_device,language/monitor/universal/universal
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: mysql
|
||||
datasource:
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:${nl.config.mysql.ip}}:${DB_PORT:${nl.config.mysql.port}}/${DB_NAME:${nl.config.mysql.database}}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:${nl.config.mysql.username}}
|
||||
password: ${DB_PWD:${nl.config.mysql.password}}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
oracle:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@${nl.config.oracle.ip}:${nl.config.oracle.port}:${nl.config.oracle.scheme}
|
||||
username: ${DB_USER:${nl.config.oracle.username}}
|
||||
password: ${DB_PWD:${nl.config.oracle.password}}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
sqlserver:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://${nl.config.sqlserver.ip}\${nl.config.sqlserver.port};DatabaseName=${nl.config.sqlserver.database}
|
||||
username: ${DB_USER:${nl.config.sqlserver.username}}
|
||||
password: ${DB_PWD:${nl.config.sqlserver.password}}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3307}/${DB_NAME:wxdk_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 15
|
||||
# 最大连接数
|
||||
max-active: 30
|
||||
# 超时时间(以秒数为单位)
|
||||
remove-abandoned-timeout: 180
|
||||
# 获取连接超时时间
|
||||
max-wait: 3000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: true
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: true
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,默认db/migration
|
||||
locations: classpath:db/migration
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
redis:
|
||||
# 数据库索引
|
||||
host: ${REDIS_HOST:${nl.config.redis.ip}}
|
||||
port: ${REDIS_PORT:${nl.config.redis.port}}
|
||||
password: ${REDIS_PWD:${nl.config.redis.password}}
|
||||
redisson:
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
database: 3
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
jetcache:
|
||||
statIntervalMinutes: 15
|
||||
areaInCacheName: false
|
||||
local:
|
||||
default:
|
||||
type: linkedhashmap
|
||||
keyConvertor: fastjson
|
||||
remote:
|
||||
default:
|
||||
type: redis
|
||||
keyConvertor: fastjson2
|
||||
broadcastChannel: projectA
|
||||
valueEncoder: java
|
||||
valueDecoder: java
|
||||
poolConfig:
|
||||
minIdle: 5
|
||||
maxIdle: 20
|
||||
maxTotal: 50
|
||||
host: ${nl.config.redis.ip}
|
||||
port: ${nl.config.redis.port}
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:2}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
jpa:
|
||||
show-sql: true
|
||||
rabbitmq:
|
||||
host: 192.168.101.1 # 主机名
|
||||
port: 5672 # 端口
|
||||
virtual-host: / # 虚拟主机
|
||||
username: itcast # 用户名
|
||||
password: 123321 # 密码
|
||||
# password: ${REDIS_PWD:}
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
cache-enable: true
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
# 验证码
|
||||
login-code:
|
||||
# 验证码类型配置 查看 LoginProperties 类
|
||||
code-type: arithmetic
|
||||
# 登录图形验证码有效时间/分钟
|
||||
expiration: 2
|
||||
# 验证码高度
|
||||
width: 111
|
||||
# 验证码宽度
|
||||
heigth: 36
|
||||
# 内容长度
|
||||
length: 2
|
||||
# 字体名称,为空则使用默认字体
|
||||
font-name:
|
||||
# 字体大小
|
||||
font-size: 25
|
||||
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
enabled: true
|
||||
|
||||
# IP 本地解析
|
||||
ip:
|
||||
local-parsing: true
|
||||
@@ -111,8 +134,11 @@ file:
|
||||
avatarMaxSize: 5
|
||||
logging:
|
||||
file:
|
||||
path: C:\log\wms
|
||||
path: D:\acs_logs # /Users/onepiece/myFile/acs_logs
|
||||
config: classpath:logback-spring.xml
|
||||
lucene:
|
||||
index:
|
||||
path: /lucene
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
@@ -149,26 +175,25 @@ sa-token:
|
||||
# ---- 除了以上配置项,你还需要为 Sa-Token 配置http请求处理器(文档有步骤说明)
|
||||
is-read-cookie: true
|
||||
is-print: false
|
||||
# 未登录 StpUtil.getTokenSession() 设置值,获取值 @SaIgnore 得忽略接口
|
||||
# 未登录 StpUtil.getTokenSession() 设置值,获取值 @SaIgnore 得忽略接口
|
||||
token-session-check-login: false
|
||||
alone-redis:
|
||||
# Redis数据库索引(默认为0)
|
||||
database: ${nl.config.redis.database}
|
||||
database: 2
|
||||
# Redis服务器地址
|
||||
host: ${nl.config.redis.ip}
|
||||
host: 127.0.0.1
|
||||
# Redis服务器连接端口
|
||||
port: ${nl.config.redis.port}
|
||||
port: 6379
|
||||
# Redis服务器连接密码(默认为空)
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
comPort:
|
||||
need: true
|
||||
cname: COM5
|
||||
newBaudRate: 9600
|
||||
newDataBits: 8
|
||||
newStopBits: 1
|
||||
newParity: 0
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lucene\index
|
||||
#comPort:
|
||||
# need: true
|
||||
# cname: COM5
|
||||
# newBaudRate: 9600
|
||||
# newDataBits: 8
|
||||
# newStopBits: 1
|
||||
# newParity: 0
|
||||
agvToAcs:
|
||||
addr: http://localhost
|
||||
|
||||
@@ -1,50 +1,92 @@
|
||||
server:
|
||||
port: 8010
|
||||
port: 8011
|
||||
#配置数据源
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
messages:
|
||||
basename: language/login/login,language/error/error,language/buss/buss,language/task/task,language/monitor/one_device/one_device,language/monitor/two_device/two_device,language/monitor/universal/universal
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: mysql
|
||||
datasource:
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:10.93.41.198}:${DB_PORT:3306}/${DB_NAME:lz_lms_two}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:rtmg_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:12356}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
oracle:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@172.27.37.66:1521:RTMES
|
||||
username: ${DB_USER:LMSTELCOM}
|
||||
password: ${DB_PWD:LMSTELCOM_6463}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
sqlserver:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://10.93.41.2\WINCC;DatabaseName=马钢_RH
|
||||
username: ${DB_USER:sa}
|
||||
password: ${DB_PWD:123}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.2.100}:${DB_PORT:3306}/${DB_NAME:wxdk_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 15
|
||||
# 最大连接数
|
||||
max-active: 30
|
||||
# 超时时间(以秒数为单位)
|
||||
remove-abandoned-timeout: 180
|
||||
# 获取连接超时时间
|
||||
max-wait: 3000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: true
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: true
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,默认db/migration
|
||||
locations: classpath:db/migration
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:2}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
redisson:
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
database: 15
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
jpa:
|
||||
show-sql: true
|
||||
rabbitmq:
|
||||
host: 192.168.101.1 # 主机名
|
||||
port: 5672 # 端口
|
||||
virtual-host: / # 虚拟主机
|
||||
username: itcast # 用户名
|
||||
password: 123321 # 密码
|
||||
# password: ${REDIS_PWD:}
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
@@ -63,36 +105,19 @@ login:
|
||||
heigth: 36
|
||||
# 内容长度
|
||||
length: 2
|
||||
# 字体名称,为空则使用默认字体,如遇到线上乱码,设置其他字体即可
|
||||
# 字体名称,为空则使用默认字体
|
||||
font-name:
|
||||
# 字体大小
|
||||
font-size: 25
|
||||
|
||||
#jwt
|
||||
jwt:
|
||||
header: Authorization
|
||||
# 令牌前缀
|
||||
token-start-with: Bearer
|
||||
# 必须使用最少88位的Base64对该令牌进行编码
|
||||
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
|
||||
# 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
||||
token-validity-in-seconds: 7200000
|
||||
# 在线用户key
|
||||
online-key: online-token-
|
||||
# 验证码
|
||||
code-key: code-key-
|
||||
# token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
||||
detect: 1800000
|
||||
# 续期时间范围,默认 1小时,这里单位毫秒
|
||||
renew: 3600000
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
enabled: true
|
||||
|
||||
# IP 本地解析
|
||||
ip:
|
||||
local-parsing: true
|
||||
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
enabled: false
|
||||
# 文件存储路径
|
||||
file:
|
||||
mac:
|
||||
@@ -109,8 +134,11 @@ file:
|
||||
avatarMaxSize: 5
|
||||
logging:
|
||||
file:
|
||||
path: /app/jar/logs
|
||||
path: D:\acs_logs # /Users/onepiece/myFile/acs_logs
|
||||
config: classpath:logback-spring.xml
|
||||
lucene:
|
||||
index:
|
||||
path: /lucene
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
@@ -151,7 +179,7 @@ sa-token:
|
||||
token-session-check-login: false
|
||||
alone-redis:
|
||||
# Redis数据库索引(默认为0)
|
||||
database: 9
|
||||
database: 2
|
||||
# Redis服务器地址
|
||||
host: 127.0.0.1
|
||||
# Redis服务器连接端口
|
||||
@@ -160,6 +188,12 @@ sa-token:
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lucene\index
|
||||
#comPort:
|
||||
# need: true
|
||||
# cname: COM6
|
||||
# newBaudRate: 9600
|
||||
# newDataBits: 8
|
||||
# newStopBits: 1
|
||||
# newParity: 0
|
||||
agvToAcs:
|
||||
addr: http://localhost
|
||||
|
||||
@@ -2,63 +2,49 @@ server:
|
||||
tomcat:
|
||||
relaxed-query-chars: [ '|','{','}','[',']' ] #字符问题:https://blog.csdn.net/CanYue_Yi/article/details/109182577
|
||||
relaxed-path-chars: [ '|','{','}','[',']' ] #字符问题: https://blog.csdn.net/weixin_41996632/article/details/90715118
|
||||
|
||||
spring:
|
||||
messages:
|
||||
basename: language/login/login,language/error/error,language/buss/buss,language/task/task
|
||||
datasource:
|
||||
druid:
|
||||
initial-size: 5 #初始化时建立物理连接的个数
|
||||
min-idle: 15 #最小连接池数量
|
||||
maxActive: 30 #最大连接池数量
|
||||
maxWait: 3000 #获取连接时最大等待时间,单位毫秒
|
||||
#申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
|
||||
test-while-idle: true
|
||||
time-between-eviction-runs-millis: 300000 #既作为检测的间隔时间又作为test-while-idle执行的依据
|
||||
min-evictable-idle-time-millis: 900000 #销毁线程时检测当前连接的最后活动时间和当前时间差大于该值时,关闭当前连接
|
||||
#用来检测连接是否有效的sql
|
||||
#mysql中为 select 'x'
|
||||
#oracle中为 select 1 from dual
|
||||
validation-query: SELECT 'x'
|
||||
test-on-borrow: true #申请连接时会执行validationQuery检测连接是否有效,开启会降低性能,默认为true
|
||||
test-on-return: false #归还连接时会执行validationQuery检测连接是否有效,开启会降低性能,默认为true
|
||||
exception-sorter: true #当数据库抛出不可恢复的异常时,抛弃该连接
|
||||
pool-prepared-statements: true #是否缓存preparedStatement,mysql5.5+建议开启
|
||||
max-pool-prepared-statement-per-connection-size: 20 #当值大于20时poolPreparedStatements会自动修改为true
|
||||
#通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
use-global-data-source-stat: true #合并多个DruidDataSource的监控数据
|
||||
#filters通过别名的方式配置扩展插件,常用的插件有:
|
||||
#监控统计用的filter:stat 日志用的filter:log4j 防御sql注入的filter:wall
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
#设置访问druid监控页面的拦截路径及账号和密码,默认没有
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
login-username: admin
|
||||
login-password: admin
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
# active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
redis:
|
||||
repositories:
|
||||
enabled: false
|
||||
redis:
|
||||
#数据库索引
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
#连接超时时间
|
||||
timeout: 5000
|
||||
redisson:
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
database: 1
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
|
||||
#配置 Jpa
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: none
|
||||
open-in-view: true
|
||||
properties:
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
enable_lazy_load_no_trans: true
|
||||
dynamic:
|
||||
tp:
|
||||
enabled: true # 是否启用 dynamictp,默认true
|
||||
enabled: false # 是否启用 dynamictp,默认true
|
||||
enabledBanner: false # 是否启用 控制台banner,默认true
|
||||
enabledCollect: true # 是否开启监控指标采集,默认true
|
||||
collectorTypes: logging,test_collect # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
|
||||
@@ -66,8 +52,8 @@ spring:
|
||||
monitorInterval: 8
|
||||
tomcatTp: # tomcat webserver 线程池配置
|
||||
threadPoolAliasName: tomcat 线程池 # 线程池别名,可选
|
||||
corePoolSize: 100
|
||||
maximumPoolSize: 200
|
||||
corePoolSize: 10
|
||||
maximumPoolSize: 50
|
||||
keepAliveTime: 60
|
||||
runTimeout: 10000
|
||||
queueTimeout: 100
|
||||
@@ -106,12 +92,14 @@ task:
|
||||
# 队列容量
|
||||
queue-capacity: 50
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
cache-enable: true
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
#七牛云
|
||||
qiniu:
|
||||
# 文件大小 /M
|
||||
max-size: 15
|
||||
|
||||
#邮箱验证码有效时间/秒
|
||||
code:
|
||||
expiration: 300
|
||||
|
||||
#密码加密传输,前端公钥加密,后端私钥解密
|
||||
rsa:
|
||||
@@ -137,9 +125,6 @@ security:
|
||||
- /**/*.html
|
||||
- /**/*.css
|
||||
- /**/*.js
|
||||
- /favicon.ico
|
||||
- /*/api-docs
|
||||
- /*/api-docs/**
|
||||
# druid 监控配置
|
||||
- /druid/**
|
||||
# actuator 监控配置
|
||||
@@ -149,45 +134,17 @@ security:
|
||||
- /api/localStorage/pictures
|
||||
# 参数
|
||||
- /api/param/getValueByCode
|
||||
# mybatis-plus配置
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: false
|
||||
call-setters-on-nulls: true
|
||||
jdbc-type-for-null: null
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mapper-locations:
|
||||
- classpath:/org/nl/**/mapper/**/*.xml
|
||||
- classpath:org.nl.**.mapper/*.xml
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: INPUT
|
||||
banner: false
|
||||
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lucene\index
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: random-128
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix:
|
||||
cookie:
|
||||
# 配置 Cookie 作用域:根据二级域名实现sso登入如lms.sso.com;acs.sso.com
|
||||
domain:
|
||||
is-read-cookie: false
|
||||
is-print: false
|
||||
|
||||
agvToAcs:
|
||||
addr: 127.0.0.1
|
||||
path: C:\acs\lucene\index
|
||||
|
||||
Reference in New Issue
Block a user