add:增加分切看板接口;增加日志条件;增加子卷称重记录
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
package org.nl.b_lms.bst.ivt.cutpointivt.controller;
|
package org.nl.b_lms.bst.ivt.cutpointivt.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
|
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
@@ -29,14 +33,12 @@ public class BstIvtCutpointivtController {
|
|||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询分切区缓存点位库存")
|
@Log("查询分切区缓存点位库存")
|
||||||
//@SaCheckPermission("@el.check('bstIvtCutpointivt:list')")
|
|
||||||
public ResponseEntity<Object> query(BstIvtCutpointivtQuery whereJson, PageQuery page){
|
public ResponseEntity<Object> query(BstIvtCutpointivtQuery whereJson, PageQuery page){
|
||||||
return new ResponseEntity<>(TableDataInfo.build(bstIvtCutpointivtService.queryAll(whereJson,page)),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(bstIvtCutpointivtService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("新增分切区缓存点位库存")
|
@Log("新增分切区缓存点位库存")
|
||||||
//@SaCheckPermission("@el.check('bstIvtCutpointivt:add')")
|
|
||||||
public ResponseEntity
|
public ResponseEntity
|
||||||
<Object> create(@Validated @RequestBody BstIvtCutpointivt entity){
|
<Object> create(@Validated @RequestBody BstIvtCutpointivt entity){
|
||||||
bstIvtCutpointivtService.create(entity);
|
bstIvtCutpointivtService.create(entity);
|
||||||
@@ -45,17 +47,33 @@ public class BstIvtCutpointivtController {
|
|||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@Log("修改分切区缓存点位库存")
|
@Log("修改分切区缓存点位库存")
|
||||||
//@SaCheckPermission("@el.check('bstIvtCutpointivt:edit')")
|
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody BstIvtCutpointivt entity){
|
public ResponseEntity<Object> update(@Validated @RequestBody BstIvtCutpointivt entity){
|
||||||
bstIvtCutpointivtService.update(entity);
|
bstIvtCutpointivtService.update(entity);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log("删除分切区缓存点位库存")
|
@Log("删除分切区缓存点位库存")
|
||||||
//@SaCheckPermission("@el.check('bstIvtCutpointivt:del')")
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
bstIvtCutpointivtService.deleteAll(ids);
|
bstIvtCutpointivtService.deleteAll(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//区域看板
|
||||||
|
@GetMapping("/cutBoard")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> cutBoard(@RequestParam Map whereJson){
|
||||||
|
JSONObject param = new JSONObject(whereJson);
|
||||||
|
String 车间 = param.getString("product_area");
|
||||||
|
String 暂存架区域 = param.getString("point_type");
|
||||||
|
QueryWrapper<BstIvtCutpointivt> queryWrapper = new QueryWrapper<BstIvtCutpointivt>()
|
||||||
|
.orderByAsc("point_code").select("update_time","point_code","qzz_no1","qzz_no2","product_area","point_status","point_type");
|
||||||
|
if (StringUtils.isNotEmpty(车间)){
|
||||||
|
queryWrapper.eq("product_area", 车间);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(暂存架区域)){
|
||||||
|
queryWrapper.eq("point_type", 暂存架区域);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(bstIvtCutpointivtService.list(queryWrapper),HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.b_lms.pda.service.VehicleTwoService;
|
import org.nl.b_lms.pda.service.VehicleTwoService;
|
||||||
|
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinbound;
|
||||||
|
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.service.impl.PdmProductSpecServiceImpl;
|
||||||
import org.nl.b_lms.sch.point.dao.SchBasePoint;
|
import org.nl.b_lms.sch.point.dao.SchBasePoint;
|
||||||
import org.nl.b_lms.sch.point.service.IschBasePointService;
|
import org.nl.b_lms.sch.point.service.IschBasePointService;
|
||||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||||
@@ -18,8 +21,12 @@ import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
|||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBoxManageService;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBoxManageService;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InVehicleManageService;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InVehicleManageService;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.system.service.param.dao.Param;
|
||||||
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
import org.nl.wms.basedata.st.service.StructattrService;
|
import org.nl.wms.basedata.st.service.StructattrService;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
@@ -29,7 +36,9 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -70,6 +79,8 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private InBussManageService inBussManageService;
|
private InBussManageService inBussManageService;
|
||||||
|
@Autowired
|
||||||
|
private IPdmBiContainerinboundService iPdmBiContainerinboundService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -191,6 +202,19 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ArrayList<String> msg = new ArrayList<>();
|
||||||
|
// msg.add("称重562不匹配564");
|
||||||
|
msg.add("手动至异常口");
|
||||||
|
System.out.println(msg.toString());
|
||||||
|
System.out.println(JSONObject.toJSONString(msg));
|
||||||
|
String a = JSONObject.toJSONString(msg);
|
||||||
|
List<String> list = JSONObject.parseObject(a, List.class);
|
||||||
|
Optional<String> 称重 = list.stream().filter(m -> m.contains("称重")).findAny();
|
||||||
|
if (称重.isPresent()){
|
||||||
|
System.out.println(称重.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject reback(JSONObject whereJson) {
|
public JSONObject reback(JSONObject whereJson) {
|
||||||
@@ -209,6 +233,18 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
if (!CollectionUtils.isEmpty(list)){
|
if (!CollectionUtils.isEmpty(list)){
|
||||||
throw new BadRequestException("稍后再试,异常口存在正在执行的任务"+ list.stream().map(SchBaseTask::getTask_id).collect(Collectors.joining(",")));
|
throw new BadRequestException("稍后再试,异常口存在正在执行的任务"+ list.stream().map(SchBaseTask::getTask_id).collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
|
Param forceWeight = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("force_weight");
|
||||||
|
if (forceWeight!=null && "1".equals(forceWeight.getValue())){
|
||||||
|
PdmBiContainerinbound one = iPdmBiContainerinboundService.getOne(new QueryWrapper<PdmBiContainerinbound>()
|
||||||
|
.eq("box", whereJson.getString("box_no")));
|
||||||
|
if (one!=null && !StringUtils.isEmpty(one.getRemark())){
|
||||||
|
List<String> remark = JSONObject.parseObject(one.getRemark(), List.class);
|
||||||
|
Optional<String> 称重 = remark.stream().filter(m -> m.contains("称重")).findAny();
|
||||||
|
if (称重.isPresent()){
|
||||||
|
throw new BadRequestException("开启称重强制校验"+称重.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (bill_type.equals("1")) {
|
if (bill_type.equals("1")) {
|
||||||
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("返检入库"));
|
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("返检入库"));
|
||||||
@@ -225,12 +261,15 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
throw new BadRequestException("未查询到子卷包装信息!");
|
throw new BadRequestException("未查询到子卷包装信息!");
|
||||||
}
|
}
|
||||||
String material_barcode = "";
|
String material_barcode = "";
|
||||||
|
List<String> subs = new ArrayList<>();
|
||||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||||
JSONObject resultObj = resultJSONArray.getJSONObject(i);
|
JSONObject resultObj = resultJSONArray.getJSONObject(i);
|
||||||
|
String containerName = resultObj.getString("container_name");
|
||||||
|
subs.add(containerName);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
material_barcode = resultObj.getString("container_name");
|
material_barcode = containerName;
|
||||||
} else {
|
} else {
|
||||||
material_barcode += "," + resultObj.getString("container_name");
|
material_barcode += "," + containerName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
whereJson.put("material_barcode", material_barcode);
|
whereJson.put("material_barcode", material_barcode);
|
||||||
@@ -286,6 +325,7 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
extTab.update(jsonExt);
|
extTab.update(jsonExt);
|
||||||
|
|
||||||
inBussManageService.inTask(whereJson);
|
inBussManageService.inTask(whereJson);
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.RK_YC,null,Boolean.TRUE,null,subs);
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("message", "入库成功!");
|
result.put("message", "入库成功!");
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.b_lms.pdm.productSpec.dao.PdmProductSpec;
|
import org.nl.b_lms.pdm.productSpec.dao.PdmProductSpec;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.dto.PdmProductSpecDto;
|
||||||
import org.nl.b_lms.pdm.productSpec.service.IpdmProductSpecService;
|
import org.nl.b_lms.pdm.productSpec.service.IpdmProductSpecService;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||||
@@ -16,6 +17,8 @@ import org.nl.b_lms.sch.tasks.first_floor_area.auto.Prun;
|
|||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
|
import org.nl.common.utils.CopyUtil;
|
||||||
import org.nl.common.utils.RedissonUtils;
|
import org.nl.common.utils.RedissonUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
@@ -52,10 +55,14 @@ public class PdmProductSpecController {
|
|||||||
|
|
||||||
@GetMapping("/subSpec/{code}")
|
@GetMapping("/subSpec/{code}")
|
||||||
public ResponseEntity<Object> subSpec(@PathVariable String code) {
|
public ResponseEntity<Object> subSpec(@PathVariable String code) {
|
||||||
List result = new ArrayList<>();
|
List<PdmProductSpecDto> result = new ArrayList<>();
|
||||||
if (!StringUtils.isEmpty(code)){
|
if (!StringUtils.isEmpty(code)){
|
||||||
result = ipdmProductSpecService.list(new QueryWrapper<PdmProductSpec>()
|
List<PdmProductSpec> list = ipdmProductSpecService.list(new QueryWrapper<PdmProductSpec>()
|
||||||
.eq("container_name", code).orderByAsc("id"));
|
.eq("container_name", code).orderByAsc("id"));
|
||||||
|
result = CopyUtil.copyList(list, PdmProductSpecDto.class);
|
||||||
|
result.forEach(a->{
|
||||||
|
a.setUrl(SpecEnum.conversUrl(a.getSpec()));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.nl.b_lms.pdm.productSpec.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子卷生产步序表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PdmProductSpecDto{
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String container_name;
|
||||||
|
private Integer spec;
|
||||||
|
private String url;
|
||||||
|
private String param;
|
||||||
|
private Boolean result;
|
||||||
|
private String msg;
|
||||||
|
private Date create_time;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.impl.StIvtIostorinvOutServiceImpl;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.impl.StIvtIostorinvOutServiceImpl;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl.LashManageServiceImpl;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl.LashManageServiceImpl;
|
||||||
@@ -30,6 +31,7 @@ import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
|
|||||||
* Created by Lxy on 2021/12/22.
|
* Created by Lxy on 2021/12/22.
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class TwoOutTask extends AbstractAcsTask {
|
public class TwoOutTask extends AbstractAcsTask {
|
||||||
private final String THIS_CLASS = TwoOutTask.class.getName();
|
private final String THIS_CLASS = TwoOutTask.class.getName();
|
||||||
|
|
||||||
@@ -74,6 +76,7 @@ public class TwoOutTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
// 判断长度
|
// 判断长度
|
||||||
if (likeArr.size() >= 2) {
|
if (likeArr.size() >= 2) {
|
||||||
|
log.warn("twoOutTasklikeArr>2");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,11 +119,6 @@ public class TwoOutTask extends AbstractAcsTask {
|
|||||||
.remark(json.getString("remark"))
|
.remark(json.getString("remark"))
|
||||||
.build();
|
.build();
|
||||||
resultList.add(dto);
|
resultList.add(dto);
|
||||||
|
|
||||||
// 更新任务为下发
|
|
||||||
JSONObject paramMap = new JSONObject();
|
|
||||||
paramMap.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
|
||||||
wo_Task.update(paramMap, "task_id ='" + json.getString("task_id") + "'");
|
|
||||||
}
|
}
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import lombok.Getter;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum SpecEnum {
|
public enum SpecEnum {
|
||||||
|
|
||||||
FQ(1, "分切",""),
|
FQ_WG(1, "分切称重",""),
|
||||||
XX(2, "子卷下线",""),
|
XX(2, "子卷下线",""),
|
||||||
ZJ(3, "质检",""),
|
ZJ(3, "质检",""),
|
||||||
BZ(4, "包装",""),
|
BZ(4, "包装",""),
|
||||||
@@ -22,9 +22,21 @@ public enum SpecEnum {
|
|||||||
TYCK(8, "退异常口",""),
|
TYCK(8, "退异常口",""),
|
||||||
YX_MES(9, "验箱","CamstarApi/BoxDataCollectionSubmit2"),
|
YX_MES(9, "验箱","CamstarApi/BoxDataCollectionSubmit2"),
|
||||||
RK(10, "入库",""),
|
RK(10, "入库",""),
|
||||||
|
RK_YC(11, "异常口入库",""),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
private final String url;
|
private final String url;
|
||||||
|
public static String conversUrl(Integer value){
|
||||||
|
if (value != null){
|
||||||
|
for (SpecEnum specEnum : SpecEnum.values()) {
|
||||||
|
if (specEnum.getValue().equals(value)){
|
||||||
|
return specEnum.getUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.alibaba.druid.util.JdbcUtils;
|
|||||||
import com.mysql.cj.jdbc.ConnectionImpl;
|
import com.mysql.cj.jdbc.ConnectionImpl;
|
||||||
import com.mysql.cj.jdbc.result.ResultSetImpl;
|
import com.mysql.cj.jdbc.result.ResultSetImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -30,6 +31,8 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
private static final Pattern GENERIC_HOST_PTRN = Pattern.compile("(?<scheme>[\\w\\+:%]+)\\s*" // scheme: required; alphanumeric, plus, colon or percent
|
private static final Pattern GENERIC_HOST_PTRN = Pattern.compile("(?<scheme>[\\w\\+:%]+)\\s*" // scheme: required; alphanumeric, plus, colon or percent
|
||||||
+ "(?://(?<host>[^:/?#]*)).*");
|
+ "(?://(?<host>[^:/?#]*)).*");
|
||||||
|
|
||||||
|
public static volatile List<String> Table_Range = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int preparedStatement_executeUpdate(FilterChain chain, PreparedStatementProxy statement) throws SQLException {
|
public int preparedStatement_executeUpdate(FilterChain chain, PreparedStatementProxy statement) throws SQLException {
|
||||||
|
|
||||||
@@ -52,26 +55,22 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
if (matcher.matches()){
|
if (matcher.matches()){
|
||||||
database = matcher.group("host");
|
database = matcher.group("host");
|
||||||
}
|
}
|
||||||
}catch (Exception ex){
|
|
||||||
}
|
|
||||||
int size = statement.getParametersSize();
|
int size = statement.getParametersSize();
|
||||||
String executeSql = sql;
|
String executeSql = sql;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
try {
|
|
||||||
count = statement.getUpdateCount();
|
count = statement.getUpdateCount();
|
||||||
} catch (Exception ex) {
|
if (count>=0){
|
||||||
}
|
|
||||||
if (count > 0) {
|
|
||||||
if (size > 0) {
|
|
||||||
Collection<JdbcParameter> values = statement.getParameters().values();
|
Collection<JdbcParameter> values = statement.getParameters().values();
|
||||||
List<Object> params = new ArrayList<>();
|
List<Object> params = new ArrayList<>();
|
||||||
for (JdbcParameter value : values) {
|
for (JdbcParameter value : values) {
|
||||||
params.add(value.getValue());
|
params.add(value.getValue());
|
||||||
}
|
}
|
||||||
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
||||||
}
|
|
||||||
log.info("[----SQL----][update][执行结果:{}][数据库:{}][ SQL: {} ]",count,database, executeSql);
|
log.info("[----SQL----][update][执行结果:{}][数据库:{}][ SQL: {} ]",count,database, executeSql);
|
||||||
}
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
log.warn("[-SQL解析异常-][{}]", ex.getMessage());
|
||||||
|
}
|
||||||
super.statementExecuteAfter(statement, sql, result);
|
super.statementExecuteAfter(statement, sql, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,21 +79,21 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
ResultSetProxy rs = super.statement_getResultSet(chain, statement);
|
ResultSetProxy rs = super.statement_getResultSet(chain, statement);
|
||||||
String executeSql = statement.getLastExecuteSql();
|
String executeSql = statement.getLastExecuteSql();
|
||||||
String database="";
|
String database="";
|
||||||
|
int result = 0;
|
||||||
try {
|
try {
|
||||||
|
String finalExecuteSql = executeSql;
|
||||||
|
boolean present = Table_Range.stream().filter(a -> finalExecuteSql.contains(a)).findAny().isPresent();
|
||||||
|
if (CollectionUtils.isEmpty(Table_Range) || present){
|
||||||
ConnectionImpl connection = (ConnectionImpl)statement.getConnection();
|
ConnectionImpl connection = (ConnectionImpl)statement.getConnection();
|
||||||
String url = connection.getURL();
|
String url = connection.getURL();
|
||||||
Matcher matcher = GENERIC_HOST_PTRN.matcher(url);
|
Matcher matcher = GENERIC_HOST_PTRN.matcher(url);
|
||||||
if (matcher.matches()){
|
if (matcher.matches()){
|
||||||
database = matcher.group("host");
|
database = matcher.group("host");
|
||||||
}
|
}
|
||||||
}catch (Exception ex){
|
|
||||||
}
|
|
||||||
int result = 0;
|
|
||||||
if (rs != null) {
|
if (rs != null) {
|
||||||
ResultSetImpl rss = rs.getResultSetRaw().unwrap(ResultSetImpl.class);
|
ResultSetImpl rss = rs.getResultSetRaw().unwrap(ResultSetImpl.class);
|
||||||
result = rss.getRows().size();
|
result = rss.getRows().size();
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
int size = statement.getParametersSize();
|
int size = statement.getParametersSize();
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
Collection<JdbcParameter> values = statement.getParameters().values();
|
Collection<JdbcParameter> values = statement.getParameters().values();
|
||||||
@@ -104,10 +103,11 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
}
|
}
|
||||||
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
||||||
}
|
}
|
||||||
|
log.info("[----SQL----][select][执行结果:{}][数据库:{}][ SQL: {} ]", result,database, executeSql);
|
||||||
|
}
|
||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
log.warn("[-SQL解析异常-][{}]", ex.getMessage());
|
log.warn("[-SQL解析异常-][{}]", ex.getMessage());
|
||||||
}
|
}
|
||||||
log.info("[----SQL----][select][执行结果:{}][数据库:{}][ SQL: {} ]", result,database, executeSql);
|
|
||||||
return rs;
|
return rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,19 @@ package org.nl.system.controller.generator;
|
|||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import org.nl.config.DruidFilter;
|
||||||
import org.nl.system.service.generator.ICodeGenConfigService;
|
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||||
import org.nl.system.service.generator.dao.CodeGenConfig;
|
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 代码生成配置表 前端控制器
|
* 代码生成配置表 前端控制器
|
||||||
@@ -40,5 +44,15 @@ public class CodeGenConfigController {
|
|||||||
public ResponseEntity<Object> update(@Validated @RequestBody CodeGenConfig genConfig){
|
public ResponseEntity<Object> update(@Validated @RequestBody CodeGenConfig genConfig){
|
||||||
return new ResponseEntity<>(genConfigService.update(genConfig.getTable_name(), genConfig),HttpStatus.OK);
|
return new ResponseEntity<>(genConfigService.update(genConfig.getTable_name(), genConfig),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/changeRange")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> changeRange(@RequestBody Map param){
|
||||||
|
if (!CollectionUtils.isEmpty(param)){
|
||||||
|
DruidFilter.Table_Range = (List<String>) param.get("tables");
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2088,7 +2088,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
} else {
|
} else {
|
||||||
iPdmBiContainerinboundService
|
iPdmBiContainerinboundService
|
||||||
.update(new UpdateWrapper<PdmBiContainerinbound>()
|
.update(new UpdateWrapper<PdmBiContainerinbound>()
|
||||||
.set("remark",errorMsg.toString())
|
.set("remark",JSONObject.toJSONString(errorMsg))
|
||||||
.eq("box",box_no));
|
.eq("box",box_no));
|
||||||
//更新子卷入库备注信息
|
//更新子卷入库备注信息
|
||||||
JSONObject jsonTaskParam = new JSONObject();
|
JSONObject jsonTaskParam = new JSONObject();
|
||||||
@@ -2525,6 +2525,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
updateWrapper.set(PdmBiSlittingproductionplan::getWeight, NumberUtil.round(weight, 2).toString())
|
updateWrapper.set(PdmBiSlittingproductionplan::getWeight, NumberUtil.round(weight, 2).toString())
|
||||||
.eq(PdmBiSlittingproductionplan::getContainer_name, subVolume);
|
.eq(PdmBiSlittingproductionplan::getContainer_name, subVolume);
|
||||||
boolean update = slittingproductionplanService.update(updateWrapper);
|
boolean update = slittingproductionplanService.update(updateWrapper);
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.FQ_WG,param,Boolean.TRUE,null,subVolume);
|
||||||
if (update) {
|
if (update) {
|
||||||
res.put("code", cn.hutool.http.HttpStatus.HTTP_OK);
|
res.put("code", cn.hutool.http.HttpStatus.HTTP_OK);
|
||||||
res.put("message", "更新成功!");
|
res.put("message", "更新成功!");
|
||||||
|
|||||||
@@ -1055,7 +1055,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
|
|
||||||
String RTYPE = result.getString("RTYPE");
|
String RTYPE = result.getString("RTYPE");
|
||||||
if ("E".equals(RTYPE)) {
|
if ("E".equals(RTYPE)) {
|
||||||
PdmProductSpecServiceImpl.doRecord(SpecEnum.YX_MES,param,Boolean.FALSE,result.getString("RTMSG"),containerName);
|
|
||||||
throw new BadRequestException("MES提示错误:" +result.getString("RTMSG"));
|
throw new BadRequestException("MES提示错误:" +result.getString("RTMSG"));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
</appender>
|
</appender>
|
||||||
<appender name="asyncLuceneAppender" class="org.nl.config.lucene.AsyncLuceneAppender">
|
<appender name="asyncLuceneAppender" class="org.nl.config.lucene.AsyncLuceneAppender">
|
||||||
<appender-ref ref="luceneAppender" />
|
<appender-ref ref="luceneAppender" />
|
||||||
<queueSize>3000</queueSize>
|
<queueSize>512</queueSize>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!--开发环境:打印控制台-->
|
<!--开发环境:打印控制台-->
|
||||||
@@ -134,6 +134,7 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="asyncFileAppender"/>
|
<appender-ref ref="asyncFileAppender"/>
|
||||||
<appender-ref ref="asyncLuceneAppender"/>
|
<appender-ref ref="asyncLuceneAppender"/>
|
||||||
|
<appender-ref ref="CONSOLE"/>
|
||||||
</root>
|
</root>
|
||||||
<logger name="jdbc" level="ERROR" additivity="true">
|
<logger name="jdbc" level="ERROR" additivity="true">
|
||||||
<appender-ref ref="asyncFileAppender"/>
|
<appender-ref ref="asyncFileAppender"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user