fix:将管制点改为查询点位下拉框

This commit is contained in:
zhouz
2025-06-12 11:19:54 +08:00
parent dbd45a5bf6
commit 917bf37baa
2 changed files with 29 additions and 8 deletions

View File

@@ -2,10 +2,14 @@ package org.nl.b_lms.pda.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.pda.service.VehicleTwoService;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.modules.logging.annotation.Log;
import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +21,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author liuxy
@@ -35,6 +41,8 @@ public class VehicleTwoController {
private IbstIvtPackageinfoivtService bstIvtPackageInfoIvtService;
@Autowired
private IpdmBiSubpackagerelationService subpackagerelationService;
@Autowired
private BstIvtPackageinfoivtMapper bstIvtPackageinfoivtMapper;
@PostMapping("/vehicleIn")
@@ -80,4 +88,20 @@ public class VehicleTwoController {
Map result = subpackagerelationService.toEndSubpackagerelation(whereJson.getString("container_name"));
return new ResponseEntity<>(result, HttpStatus.OK);
}
@PostMapping("/getControlList")
@Log("获取管制下拉框")
@SaIgnore
public ResponseEntity<Object> getControlList(@RequestBody JSONObject whereJson) {
List<BstIvtPackageinfoivt> bstIvtPackageinfoivts = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_status, "4"));
JSONArray jsonArray = bstIvtPackageinfoivts.stream()
.map(item -> {
JSONObject jsonObject = new JSONObject();
jsonObject.put("text", item.getPoint_code());
jsonObject.put("value", item.getPoint_code());
return jsonObject;
})
.collect(Collectors.toCollection(JSONArray::new));
return new ResponseEntity<>(jsonArray, HttpStatus.OK);
}
}

View File

@@ -1028,8 +1028,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
return result;
}
BstIvtPackageinfoivt packageinfoivt = dtoList.get(0);
String pointCode = packageinfoivt.getPoint_code();
if (pointCode.equals("ZXQ_135") || pointCode.equals("ZXQ_136")) {
if (packageinfoivt.getPoint_status().equals("4")) {
throw new BadRequestException("管制点设置子卷状态时需要选择点位");
}
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) {
@@ -1074,7 +1073,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
}
//复称
else if (StringUtils.isNotBlank(whereJson.getString("container_name")) && StringUtils.isNotBlank(whereJson.getString("pointCode"))) {
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("pointCode").equals("1") ? "ZXQ_135" : "ZXQ_136"));
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("point_code")));
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) {
//获取子卷最新信息
jo.put("container_name", whereJson.getString("container_name"));
@@ -1098,13 +1097,11 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
if (StringUtils.isEmpty(pointCode)){
throw new BadRequestException("人工管制点不能为空");
}
HashMap of = MapOf.of("1", "ZXQ_135", "2", "ZXQ_136");
// "ZXQ_135" : "ZXQ_136";
JSONObject task = new JSONObject();
task.put("point_code1", of.get(pointCode));
task.put("point_code1", pointCode);
int count = taskService.count(new QueryWrapper<SchBaseTask>()
.eq("is_delete", "0")
.eq("point_code1", of.get(pointCode))
.eq("point_code1", pointCode)
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
if (count>0){
throw new BadRequestException("当前人工管制点存在任务,稍后操作");
@@ -1112,7 +1109,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("管制品"))){
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
}
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("pointCode").equals("1") ? "ZXQ_135" : "ZXQ_136"));
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("pointCode")));
updateWrapper.set("container_name", null);
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
} else {