add:打印机增加客户标签功能
This commit is contained in:
@@ -5,16 +5,21 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pda.service.PrintTableTwoService;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.pdm_manage.enums.SUBEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.pda.st.service.PrintService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -35,18 +40,42 @@ public class PrintTableTwoServiceImpl implements PrintTableTwoService {
|
||||
*/
|
||||
@Autowired
|
||||
private IPdmBiOrderbominfoService iPdmBiOrderbominfoService;
|
||||
/*
|
||||
* 子卷包装关系
|
||||
*/
|
||||
@Autowired
|
||||
private IpdmBiSubpackagerelationService subpackagerelationService;
|
||||
/*
|
||||
* 订单bom服务
|
||||
*/
|
||||
@Autowired
|
||||
private PrintService printService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject withinTable(JSONObject whereJson) {
|
||||
// 返回参数
|
||||
// 返回参数//{"print_code":"10000007","pcsn":"多少发多少发多少分","type":"1"} type:3客户标
|
||||
JSONObject result = new JSONObject();
|
||||
// 基础校验
|
||||
String pcsn = whereJson.getString("pcsn");
|
||||
String print_code = whereJson.getString("print_code");
|
||||
String type = whereJson.getString("type");
|
||||
if (ObjectUtil.isEmpty(pcsn)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
}
|
||||
|
||||
if (type.equals("3")||print_code.equals("10000009")){
|
||||
//查询子卷包装关系:
|
||||
PdmBiSubpackagerelation containerName = subpackagerelationService.getOne(new QueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq("container_name", pcsn));
|
||||
if (containerName==null){
|
||||
throw new BadRequestException("子卷包装信息不存在");
|
||||
}
|
||||
if (StringUtils.isEmpty(containerName.getPackage_box_sn())){
|
||||
throw new BadRequestException("子卷包装缺少木箱信息");
|
||||
}
|
||||
JSONObject printCus = new JSONObject(MapOf.of("box_no",containerName.getPackage_box_sn(),"print_type",print_code));
|
||||
printService.customerPrint(printCus);//{"box_no":"MX250105000119","print_type":"10000006"}
|
||||
}
|
||||
JSONObject jsonPrint = WQLObject.getWQLObject("pdm_bi_printinfo")
|
||||
.query("print_id = '" + whereJson.getString("print_code") + "' and print_region = '2'")
|
||||
.uniqueResult(0);
|
||||
|
||||
@@ -4,21 +4,30 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
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.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.auto.AutoSendVehicleToDjq;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.auto.Prun;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -36,12 +45,17 @@ import java.util.concurrent.TimeUnit;
|
||||
@Slf4j
|
||||
public class PdmBiSubpackagerelationController {
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
|
||||
|
||||
@Autowired
|
||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||
@Autowired
|
||||
private AutoSendVehicleToDjq autoSendVehicleToDjq;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@@ -179,7 +193,7 @@ public class PdmBiSubpackagerelationController {
|
||||
@PostMapping("/schdule")
|
||||
@Log("定时调度")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> 定时调度(@RequestBody JSONObject whereJson) throws ClassNotFoundException {
|
||||
public ResponseEntity<Object> 定时调度(@RequestBody JSONObject whereJson) {
|
||||
String aClass = whereJson.getString("class");
|
||||
Prun obj = (Prun) SpringContextHolder.getBean(aClass);
|
||||
obj.run();
|
||||
@@ -187,5 +201,23 @@ public class PdmBiSubpackagerelationController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/ycgzd")
|
||||
@Log("异常管制点释放")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> ycgzd(@RequestBody JSONObject param) {
|
||||
String pointCode = param.getString("point_code");
|
||||
if (StringUtils.isEmpty(pointCode)){
|
||||
throw new BadRequestException("人工管制点不能为空");
|
||||
}
|
||||
// "ZXQ_135" : "ZXQ_136";
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("point_code1", pointCode);
|
||||
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -241,18 +241,20 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateEntityList(JSONObject whereJson) {
|
||||
List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
|
||||
List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
|
||||
//子卷信息校验
|
||||
checkEntityList(whereJson, packagerelationList);
|
||||
//均衡获取木箱出库装箱区对接位
|
||||
//= getPointCode(packagerelationList.size());
|
||||
String deviceCode = "ZXQ_1_1";
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("point_code2", deviceCode)
|
||||
.eq("task_type", "010704")
|
||||
.eq("task_type", "010908")
|
||||
.eq("is_delete", "0")
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
if (count>2){
|
||||
int count2 = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq("point_status",PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
.eq("ivt_status",PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
|
||||
if (count+count2>8){
|
||||
throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||
}
|
||||
List<String> workIdList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -31,7 +32,7 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendDjqToGzq {
|
||||
public class AutoSendDjqToGzq extends Prun{
|
||||
|
||||
private final String THIS_CLASS = AutoSendDjqToGzq.class.getName();
|
||||
@Resource
|
||||
@@ -48,6 +49,7 @@ public class AutoSendDjqToGzq {
|
||||
private IschBaseTaskService taskService;
|
||||
|
||||
//待检区->管制区agv自动搬运任务
|
||||
@Autowired
|
||||
public void run() {
|
||||
try {
|
||||
this.sendDjqToGzq();
|
||||
|
||||
@@ -110,7 +110,7 @@ public class AutoSendVehicleToDjq extends Prun{
|
||||
}
|
||||
|
||||
|
||||
private void getPointCode(JSONObject task, String taskType) {
|
||||
public void getPointCode(JSONObject task, String taskType) {
|
||||
List<BstIvtPackageinfoivt> packageList;
|
||||
if (taskType.equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"))) {
|
||||
packageList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
||||
@@ -168,9 +168,8 @@ public class AutoSendVehicleToDjq extends Prun{
|
||||
//如果不同一组,则直接浅库位
|
||||
pointCode2 = shallowIvtList.get(0).getPoint_code();
|
||||
}
|
||||
}
|
||||
//如果只有浅库位有空位,则直接取浅库位的编号为终点
|
||||
else if (ObjectUtils.isNotEmpty(shallowIvtList)) {
|
||||
} else if (ObjectUtils.isNotEmpty(shallowIvtList)) {
|
||||
//如果只有浅库位有空位,则直接取浅库位的编号为终点
|
||||
pointCode2 = shallowIvtList.get(0).getPoint_code();
|
||||
}
|
||||
//如果只有深库位有空位,需要发起浅库位->深库位的移库任务
|
||||
|
||||
Reference in New Issue
Block a user