代码更新
This commit is contained in:
@@ -201,7 +201,7 @@ public class AppRun {
|
||||
int nodeSizeH = 50;
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
|
||||
JSONArray resultJSONArray = attrTab.query("col_num = '" + i + "' and point_type = '9' and layer_num = '1' order by row_num ASC").getResultJSONArray(0);
|
||||
JSONArray resultJSONArray = attrTab.query("col_num = '" + i + "' and point_type = '9' and layer_num = '2' order by row_num ASC").getResultJSONArray(0);
|
||||
|
||||
for (int j = 0; j < resultJSONArray.size(); j++) {
|
||||
JSONObject json = resultJSONArray.getJSONObject(j);
|
||||
@@ -229,7 +229,7 @@ public class AppRun {
|
||||
}
|
||||
save.put("nodes", nodes);
|
||||
save.put("edges", edges);
|
||||
JSONObject jsonObject = stageTab.query("stage_code = 'FS'").uniqueResult(0);
|
||||
JSONObject jsonObject = stageTab.query("stage_code = 'FS_2'").uniqueResult(0);
|
||||
jsonObject.put("stage_data", save);
|
||||
stageTab.update(jsonObject);
|
||||
return "Backend service started successfully";
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
|
||||
package org.nl.wms.basedata.master.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.basedata.master.service.FaultDeviceService;
|
||||
import org.nl.wms.basedata.master.service.dto.CustomerbaseDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2023-04-20
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "设备故处理")
|
||||
@RequestMapping("/api/faultdevice")
|
||||
@Slf4j
|
||||
public class FaultDeviceController {
|
||||
|
||||
private final FaultDeviceService faultDeviceService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询设备故障处理表")
|
||||
@ApiOperation("查询设备故障处理表")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(faultDeviceService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/deviceCharge")
|
||||
@Log("查询说有设备故障")
|
||||
@ApiOperation("查询说有设备故障")
|
||||
public ResponseEntity<Object> queryDeviceAll(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(faultDeviceService.queryDeviceAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增设备故障处理表")
|
||||
@ApiOperation("新增设备故障处理表")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody CustomerbaseDto dto) {
|
||||
faultDeviceService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改设备故障处理表")
|
||||
@ApiOperation("修改设备故障处理表")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
faultDeviceService.update(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除设备故障处理表")
|
||||
@ApiOperation("删除设备故障处理表")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
faultDeviceService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("同步信息")
|
||||
@ApiOperation("同步信息")
|
||||
@PostMapping("/syncInfo")
|
||||
public ResponseEntity<Object> syncInfo() {
|
||||
faultDeviceService.syncInfo();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
|
||||
package org.nl.wms.basedata.master.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.basedata.master.service.dto.CustomerbaseDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author liuxy
|
||||
* @date 2023-04-20
|
||||
**/
|
||||
public interface FaultDeviceService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryDeviceAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<CustomerbaseDto>
|
||||
*/
|
||||
List<CustomerbaseDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param cust_id ID
|
||||
* @return Customerbase
|
||||
*/
|
||||
CustomerbaseDto findById(Long cust_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return Customerbase
|
||||
*/
|
||||
CustomerbaseDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(CustomerbaseDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param whereJson /
|
||||
*/
|
||||
void update(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 同步信息
|
||||
*/
|
||||
void syncInfo();
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
|
||||
package org.nl.wms.basedata.master.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.PageUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.basedata.master.service.FaultDeviceService;
|
||||
import org.nl.wms.basedata.master.service.dto.CustomerbaseDto;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
* @date 2023-04-20
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class FaultDeviceServiceImpl implements FaultDeviceService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String fault_code = MapUtil.getStr(whereJson, "fault_code");
|
||||
String fault_type = MapUtil.getStr(whereJson, "fault_type");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag","1");
|
||||
map.put("fault_code",fault_code);
|
||||
map.put("fault_type",fault_type);
|
||||
|
||||
JSONObject json = WQL.getWO("QMD_BI_FAULT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "update_time DESC");
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryDeviceAll(Map whereJson, Pageable page) {
|
||||
WQLObject faultTab = WQLObject.getWQLObject("EM_BI_FaultDisposeDevice");
|
||||
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String is_fault = MapUtil.getStr(whereJson, "is_fault");
|
||||
String region_code = MapUtil.getStr(whereJson, "region_code");
|
||||
String plant_code = MapUtil.getStr(whereJson, "plant_code");
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(device_code)) {
|
||||
param.put("device_code",device_code);
|
||||
}
|
||||
|
||||
// 调用acs接口获取设备
|
||||
JSONObject result = SpringContextHolder.getBean(WmsToAcsServiceImpl.class).realTimefaultInfo(param);
|
||||
JSONArray data = result.getJSONArray("data");
|
||||
|
||||
// 根据入参处理对应数据
|
||||
ArrayList<Object> objects = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("region_code", region_code);
|
||||
map.put("plant_code", plant_code);
|
||||
map.put("device_code", json.getString("device_code"));
|
||||
|
||||
JSONObject jsonDevice = WQL.getWO("QMD_BI_FAULT").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonDevice)) continue;
|
||||
|
||||
// 获取报警码
|
||||
JSONObject jsonFault = faultTab.query("fault_type = '" + json.getString("fault_type") + "' and fault_code = '" + json.getString("fault_code") + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonFault)) {
|
||||
jsonDevice.put("fault_code", jsonFault.getString("fault_code"));
|
||||
jsonDevice.put("fault_info", jsonFault.getString("fault_info"));
|
||||
jsonDevice.put("fault_type", jsonFault.getString("fault_type"));
|
||||
jsonDevice.put("solve_mode", jsonFault.getString("solve_mode"));
|
||||
}
|
||||
|
||||
// 判断是否异常
|
||||
if (!StrUtil.equals(json.getString("fault_code"),"0")) {
|
||||
jsonDevice.put("is_fault", "1");
|
||||
} else {
|
||||
jsonDevice.put("is_fault", "0");
|
||||
}
|
||||
|
||||
if (StrUtil.equals(is_fault, "1")) {
|
||||
if (!StrUtil.equals(json.getString("fault_code"),"0")) {
|
||||
objects.add(jsonDevice);
|
||||
}
|
||||
} else if (StrUtil.equals(is_fault, "0")) {
|
||||
if (StrUtil.equals(json.getString("fault_code"),"0")) {
|
||||
objects.add(jsonDevice);
|
||||
}
|
||||
} else {
|
||||
objects.add(jsonDevice);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 组织分页查询并返回
|
||||
Map<String, Object> json = PageUtil.toPage(
|
||||
PageUtil.toPage(page.getPageNumber(), page.getPageSize(), objects),
|
||||
objects.size()
|
||||
);
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomerbaseDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
List<CustomerbaseDto> list = arr.toJavaList(CustomerbaseDto.class);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerbaseDto findById(Long cust_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
JSONObject json = wo.query("cust_id =" + cust_id + "").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(json)) return null;
|
||||
final CustomerbaseDto obj = json.toJavaObject(CustomerbaseDto.class);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerbaseDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
JSONObject json = wo.query("cust_code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(json)) return null;
|
||||
final CustomerbaseDto obj = json.toJavaObject(CustomerbaseDto.class);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(CustomerbaseDto dto) {
|
||||
String cust_code = dto.getCust_code();
|
||||
CustomerbaseDto customerbaseDto = this.findByCode(cust_code);
|
||||
if (customerbaseDto != null && customerbaseDto.getIs_delete().equals("0")) {
|
||||
throw new BadRequestException("存在相同的客户编号");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setCust_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(JSONObject whereJson) {
|
||||
WQLObject faultTab = WQLObject.getWQLObject("EM_BI_FaultDisposeDevice");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
whereJson.put("update_id",currentUserId);
|
||||
whereJson.put("update_name",nickName);
|
||||
whereJson.put("update_time",DateUtil.now());
|
||||
faultTab.update(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
for (Long cust_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("cust_id", String.valueOf(cust_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncInfo() {
|
||||
WQLObject faultTab = WQLObject.getWQLObject("EM_BI_FaultDisposeDevice");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
// 调用acs接口获取信息
|
||||
JSONObject json = SpringContextHolder.getBean(WmsToAcsServiceImpl.class).syncfaultInfo();
|
||||
|
||||
JSONArray data = json.getJSONArray("data");
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject jsonDtl = data.getJSONObject(i);
|
||||
|
||||
JSONObject jsonFault = faultTab.query("fault_code = '" + jsonDtl.getString("fault_code") + "' and fault_type = '" + jsonDtl.getString("fault_type") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonFault)) {
|
||||
jsonFault.put("fault_info",jsonDtl.getString("fault_info"));
|
||||
jsonFault.put("create_id",currentUserId);
|
||||
jsonFault.put("create_name",nickName);
|
||||
jsonFault.put("create_time",DateUtil.now());
|
||||
jsonFault.put("update_id",currentUserId);
|
||||
jsonFault.put("update_name",nickName);
|
||||
jsonFault.put("update_time",DateUtil.now());
|
||||
faultTab.update(jsonFault);
|
||||
} else {
|
||||
jsonDtl.put("fault_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonDtl.put("create_id",currentUserId);
|
||||
jsonDtl.put("create_name",nickName);
|
||||
jsonDtl.put("create_time",DateUtil.now());
|
||||
jsonDtl.put("update_id",currentUserId);
|
||||
jsonDtl.put("update_name",nickName);
|
||||
jsonDtl.put("update_time",DateUtil.now());
|
||||
faultTab.insert(jsonDtl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
[交易说明]
|
||||
交易名: 故障分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.fault_code TYPEAS s_string
|
||||
输入.fault_type TYPEAS s_string
|
||||
输入.region_code TYPEAS s_string
|
||||
输入.plant_code TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
EM_BI_FaultDisposeDevice
|
||||
WHERE
|
||||
1 = 1
|
||||
|
||||
OPTION 输入.fault_code <> ""
|
||||
fault_code = 输入.fault_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.fault_type <> ""
|
||||
fault_type = 输入.fault_type
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
EM_BI_MonitorDevice
|
||||
WHERE
|
||||
is_crux = '1'
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.plant_code <> ""
|
||||
plant_code = 输入.plant_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
device_code = 输入.device_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -336,12 +336,23 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
|
||||
/*
|
||||
判断点位是第几层
|
||||
1层:解锁当前点位和2层点位
|
||||
2层:直接解锁当前点位
|
||||
*/
|
||||
if (StrUtil.equals(jsonPoint.getString("layer_num"), "1")) {
|
||||
JSONObject jsonPoint2 = pointTab.query("device_code = '" + jsonPoint.getString("device_code") + "' and layer_num = '2'").uniqueResult(0);
|
||||
jsonPoint2.put("point_status", "1");
|
||||
jsonPoint2.put("lock_type", "1");
|
||||
jsonPoint2.put("vehicle_code", "");
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
jsonPoint.put("point_status", "1");
|
||||
jsonPoint.put("vehicle_code", "");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
|
||||
jsonPoint.put("vehicle_code", "");
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,11 +91,19 @@ public class AcsToWmsController {
|
||||
@Log(value = "仓位初始化", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("仓位初始化")
|
||||
@SaIgnore
|
||||
|
||||
public ResponseEntity<Object> initialize(@RequestBody JSONObject json) {
|
||||
acsToWmsService.initialize(json);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/initPoint")
|
||||
@Log(value = "点位初始化", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("点位初始化")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> initPoint() {
|
||||
acsToWmsService.initPoint();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -125,5 +125,19 @@ public class WmsToAcsController {
|
||||
return new ResponseEntity<>(wmsToAcsService.sendAgvChargeTask(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/syncfaultInfo")
|
||||
@Log(value = "LMS同步ACS报警码信息", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("LMS同步ACS报警码信息")
|
||||
public ResponseEntity<Object> syncfaultInfo() {
|
||||
return new ResponseEntity<>(wmsToAcsService.syncfaultInfo(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/realTimefaultInfo")
|
||||
@Log(value = "LMS查看ACS实时报警信息", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("LMS查看ACS实时报警信息")
|
||||
public ResponseEntity<Object> realTimefaultInfo(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(wmsToAcsService.realTimefaultInfo(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -82,4 +82,9 @@ public interface AcsToWmsService {
|
||||
* 仓位初始化
|
||||
*/
|
||||
void initialize(JSONObject json);
|
||||
|
||||
/**
|
||||
* 点位初始化
|
||||
*/
|
||||
void initPoint();
|
||||
}
|
||||
|
||||
@@ -97,4 +97,17 @@ public interface WmsToAcsService {
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject sendAgvChargeTask(JSONObject jo);
|
||||
|
||||
/**
|
||||
* LMS同步ACS报警码信息
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject syncfaultInfo();
|
||||
|
||||
/**
|
||||
* LMS查看ACS实时报警信息
|
||||
* @param jo /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject realTimefaultInfo(JSONObject jo);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.ext.acs.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -429,13 +430,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
String sale_order_name = sub_jo.getString("sale_order_name");
|
||||
String box_length_1 = sub_jo.getString("box_length");
|
||||
String box_width_1 = sub_jo.getString("box_width");
|
||||
String box_high_1 = sub_jo.getString("box_high");
|
||||
String product_name = sub_jo.getString("product_name");
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("flag", "1");
|
||||
param.put("sale_order_name",sale_order_name);
|
||||
param.put("product_name",product_name);
|
||||
param.put("box_length",box_length_1);
|
||||
param.put("box_width",box_width_1);
|
||||
param.put("box_high",box_high_1);
|
||||
|
||||
//查询是否存在可用的空位
|
||||
String point_code = "";
|
||||
JSONArray joArr = new JSONArray();
|
||||
|
||||
// 查找此订单号所在的所有排
|
||||
JSONArray joRow = WQL.getWO("QST_ACSTOLMSTYPE4").addParam("flag", "1").addParam("sale_order_name", sale_order_name).process().getResultJSONArray(0);
|
||||
// 查找此订单号、物料、木箱长宽高相同的一排
|
||||
JSONArray joRow = WQL.getWO("QST_ACSTOLMSTYPE4").addParamMap(param).process().getResultJSONArray(0);
|
||||
for (int j = 0; j < joRow.size(); j++) {
|
||||
JSONObject json = joRow.getJSONObject(j);
|
||||
String row_num = json.getString("row_num");
|
||||
@@ -461,8 +474,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject point_jo = rowArr.getJSONObject(i);
|
||||
|
||||
JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' order by out_order_seq ASC").getResultJSONArray(0);
|
||||
if (pointArr.size() == 4) {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
if (pointArr.size() == 8) {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
break;
|
||||
}
|
||||
@@ -501,8 +514,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject point_jo = rowArr.getJSONObject(i);
|
||||
|
||||
JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' order by out_order_seq ASC").getResultJSONArray(0);
|
||||
if (pointArr.size() == 4) {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
if (pointArr.size() == 8) {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
break;
|
||||
}
|
||||
@@ -564,6 +577,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
try {
|
||||
if (tryLock) {
|
||||
if (type.equals("1")) {
|
||||
//贴标申请
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("木箱码不能为空!");
|
||||
}
|
||||
@@ -574,7 +588,21 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||
}
|
||||
//贴标申请
|
||||
|
||||
/*
|
||||
* 判断此客户是否是自动贴标
|
||||
*/
|
||||
// 查询客户
|
||||
JSONObject jsonCust = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + sub_jo.getString("customer_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCust)) {
|
||||
throw new BadRequestException("客户不存在请检查!");
|
||||
}
|
||||
|
||||
// 判断是否贴标
|
||||
if (!StrUtil.equals(jsonCust.getString("is_auto_table"), "1")) {
|
||||
return result;
|
||||
}
|
||||
|
||||
String print_type = "1";
|
||||
if (StrUtil.isEmpty(print_type)) {
|
||||
throw new BadRequestException("请指定一台打印机进行打印!");
|
||||
@@ -591,13 +619,35 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
default:
|
||||
throw new BadRequestException("未查询到对应打印机!");
|
||||
}
|
||||
|
||||
// 调用打印机进行打印
|
||||
JSONObject print_info = WQLObject.getWQLObject("pdm_bi_printinfo").query("print_name = '" + print_code + "'").uniqueResult(0);
|
||||
JSONObject print_jo = new JSONObject();
|
||||
print_jo.put("box_no", vehicle_code);
|
||||
print_jo.put("print_type", print_info.getString("print_id"));
|
||||
print_jo.put("box_weight", weight);
|
||||
new PrintServiceImpl().customerPrint2(print_jo);
|
||||
|
||||
// 贴标成功:更新系统参数贴标次数
|
||||
WQLObject paramTab = WQLObject.getWQLObject("sys_param");
|
||||
|
||||
String label_num_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("label_num_up").getValue();
|
||||
String now_num = NumberUtil.sub(label_num_up, "1").toString();
|
||||
|
||||
JSONObject jsonParam = paramTab.query("code = 'label_num_up'").uniqueResult(0);
|
||||
jsonParam.put("value", now_num);
|
||||
paramTab.update(jsonParam);
|
||||
|
||||
// 判断是否到达预警值
|
||||
String label_num_down = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("label_num_down").getValue();
|
||||
|
||||
if (Integer.valueOf(label_num_down) >= Integer.valueOf(now_num)) {
|
||||
result.put("message", "标签纸数量过低,请更换!");
|
||||
}
|
||||
|
||||
} else if (type.equals("2")) {
|
||||
//捆扎申请
|
||||
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("木箱码不能为空!");
|
||||
}
|
||||
@@ -605,7 +655,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||
}
|
||||
//捆扎申请
|
||||
|
||||
// 计算此木箱需要捆扎几次
|
||||
String box_length = sub_jo.getString("box_length");
|
||||
String box_width = sub_jo.getString("box_width");
|
||||
String box_high = sub_jo.getString("box_high");
|
||||
@@ -624,7 +675,40 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
data.put("bundle_times", 2);
|
||||
}
|
||||
|
||||
// 判断是否需要捆扎
|
||||
String is_lash = whereJson.getString("is_lash"); // TODO 此字段未跟acs确认,需要确认
|
||||
|
||||
if (StrUtil.equals(is_lash, "1")) {
|
||||
// 获取系统参数:捆扎米数
|
||||
String lash_num_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("lash_num_up").getValue();
|
||||
Double lash_num_up_double = Double.valueOf(lash_num_up);
|
||||
// 获取系统参数:捆扎一次的米数
|
||||
String lash_num_one = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("lash_num_one").getValue();
|
||||
Double lash_num_one_double = Double.valueOf(lash_num_one);
|
||||
// 捆扎次数
|
||||
Double bundle_times_double = data.getDoubleValue("bundle_times");
|
||||
|
||||
// 当前米数 = 捆扎米数 - (捆扎次数 * 捆扎一次的米数)
|
||||
double now_num = NumberUtil.sub(lash_num_up_double, (Double) NumberUtil.mul(lash_num_one_double, bundle_times_double));
|
||||
|
||||
// 更新捆扎米数
|
||||
WQLObject paramTab = WQLObject.getWQLObject("sys_param");
|
||||
|
||||
JSONObject jsonParam = paramTab.query("code = 'lash_num_up'").uniqueResult(0);
|
||||
jsonParam.put("value", String.valueOf(now_num));
|
||||
paramTab.update(jsonParam);
|
||||
|
||||
// 判断是否达到预警值
|
||||
String lash_num_down = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("lash_num_down").getValue();
|
||||
|
||||
if (Double.parseDouble(lash_num_down) >= now_num) {
|
||||
result.put("message", "捆扎带米数过低,请更换!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
result.put("data", data);
|
||||
|
||||
} else if (type.equals("3")) {
|
||||
//判断AGV是否启用
|
||||
String agv_status = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("agv_status").getValue();
|
||||
@@ -891,4 +975,43 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initPoint() {
|
||||
WQLObject point = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
JSONArray resultJSONArray = point.query("point_type = '9' order by point_code").getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject json = resultJSONArray.getJSONObject(i);
|
||||
json.put("device_code", json.getString("point_code"));
|
||||
json.put("point_code", json.getString("point_code") + "_1");
|
||||
json.put("layer_num", 1);
|
||||
point.update(json);
|
||||
|
||||
JSONObject jsonTwo = new JSONObject();
|
||||
jsonTwo.put("point_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonTwo.put("device_code", json.getString("device_code"));
|
||||
jsonTwo.put("point_code", jsonTwo.getString("device_code") + "_2");
|
||||
jsonTwo.put("point_name", json.getString("point_name"));
|
||||
jsonTwo.put("region_id", json.get("region_id"));
|
||||
jsonTwo.put("region_code", json.getString("region_code"));
|
||||
jsonTwo.put("region_name", json.getString("region_name"));
|
||||
jsonTwo.put("point_type", json.getString("point_type"));
|
||||
jsonTwo.put("point_status", json.getString("point_status"));
|
||||
jsonTwo.put("lock_type", json.getString("lock_type"));
|
||||
jsonTwo.put("row_num", json.get("row_num"));
|
||||
jsonTwo.put("col_num", json.get("col_num"));
|
||||
jsonTwo.put("layer_num", 2);
|
||||
jsonTwo.put("out_order_seq", json.get("out_order_seq"));
|
||||
jsonTwo.put("is_used", "1");
|
||||
jsonTwo.put("is_delete", "0");
|
||||
jsonTwo.put("create_id", 1);
|
||||
jsonTwo.put("create_name", "管理员");
|
||||
jsonTwo.put("create_time", DateUtil.now());
|
||||
point.insert(jsonTwo);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,18 +279,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
result.put("message", "下发成功,但未连接ACS!");
|
||||
result.put("data", new JSONObject());
|
||||
|
||||
/* // 测试数据
|
||||
String car_no = whereJson.getString("car_no");
|
||||
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
if ("2,3".contains(car_no)) {
|
||||
jsonParam.put("avg_system", "2");
|
||||
jsonParam.put("car_no", car_no);
|
||||
} else if ("1".contains(car_no)) {
|
||||
jsonParam.put("avg_system", "1");
|
||||
jsonParam.put("car_no", car_no);
|
||||
}*/
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -304,10 +292,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
if ("2,3".contains(car_no)) {
|
||||
jsonParam.put("avg_system", "2");
|
||||
jsonParam.put("agv_system", "2");
|
||||
jsonParam.put("car_no", car_no);
|
||||
} else if ("1".contains(car_no)) {
|
||||
jsonParam.put("avg_system", "1");
|
||||
jsonParam.put("agv_system", "1");
|
||||
jsonParam.put("car_no", car_no);
|
||||
}
|
||||
|
||||
@@ -332,4 +320,81 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject syncfaultInfo() {
|
||||
JSONObject whereJson = new JSONObject();
|
||||
String api = "api/wms/syncfaultInfo";
|
||||
//判断是否连接ACS系统
|
||||
String isConnect = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_connect_acs").getValue();
|
||||
JSONObject result = new JSONObject();
|
||||
if (StrUtil.equals("0", isConnect)) {
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "下发成功,但未连接ACS!");
|
||||
result.put("data", new JSONArray());
|
||||
return result;
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
|
||||
String url = acsUrl + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(whereJson))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
result.put("status", HttpStatus.BAD_REQUEST);
|
||||
result.put("message", "网络不通,操作失败!");
|
||||
result.put("data", new JSONArray());
|
||||
}
|
||||
//acs抛异常这里
|
||||
if (!StrUtil.equals(result.getString("status"), "200")) {
|
||||
throw new BadRequestException("同步失败:"+result.getString("message"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject realTimefaultInfo(JSONObject whereJson) {
|
||||
String api = "api/wms/realTimefaultInfo";
|
||||
//判断是否连接ACS系统
|
||||
String isConnect = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_connect_acs").getValue();
|
||||
JSONObject result = new JSONObject();
|
||||
if (StrUtil.equals("0", isConnect)) {
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "下发成功,但未连接ACS!");
|
||||
result.put("data", new JSONArray());
|
||||
return result;
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
|
||||
String url = acsUrl + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(whereJson))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
result.put("status", HttpStatus.BAD_REQUEST);
|
||||
result.put("message", "网络不通,操作失败!");
|
||||
result.put("data", new JSONArray());
|
||||
}
|
||||
//acs抛异常这里
|
||||
if (!StrUtil.equals(result.getString("status"), "200")) {
|
||||
throw new BadRequestException("同步失败:"+result.getString("message"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,4 +58,11 @@ public class ProductInstorController {
|
||||
return new ResponseEntity<>(productInstorService.bale(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/abnormalOut")
|
||||
@Log("异常出口点位解锁")
|
||||
@ApiOperation("异常出口点位解锁")
|
||||
public ResponseEntity<Object> abnormalOut(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productInstorService.abnormalOut(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "出库确认")
|
||||
@Api(tags = "生产区发货")
|
||||
@RequestMapping("/api/pda/st")
|
||||
@Slf4j
|
||||
public class ProductionOutController {
|
||||
@@ -31,12 +31,26 @@ public class ProductionOutController {
|
||||
private final ProductionOutService productionOutService;
|
||||
|
||||
@PostMapping("/ivtQuery")
|
||||
@Log("出库初始化查询")
|
||||
@ApiOperation("出库初始化查询")
|
||||
@Log("单据初始化查询")
|
||||
@ApiOperation("单据初始化查询")
|
||||
public ResponseEntity<Object> ivtQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productionOutService.ivtQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/ivtDtlQuery")
|
||||
@Log("查询点位木箱")
|
||||
@ApiOperation("查询点位木箱")
|
||||
public ResponseEntity<Object> ivtDtlQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productionOutService.ivtDtlQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/ivtbBoxDtlQuery")
|
||||
@Log("木箱明细")
|
||||
@ApiOperation("木箱明细")
|
||||
public ResponseEntity<Object> ivtbBoxDtlQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productionOutService.ivtbBoxDtlQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/outConfirm")
|
||||
@Log("出库确认")
|
||||
@ApiOperation("出库确认")
|
||||
|
||||
@@ -23,4 +23,6 @@ public interface ProductInstorService {
|
||||
JSONObject mendCode(JSONObject whereJson);
|
||||
|
||||
JSONObject bale(JSONObject whereJson);
|
||||
|
||||
JSONObject abnormalOut(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
public interface ProductionOutService {
|
||||
|
||||
/**
|
||||
* 出库初始化查询
|
||||
* 单据初始化查询
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
@@ -23,4 +23,18 @@ public interface ProductionOutService {
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject outConfirm(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询点位木箱
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject ivtDtlQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 木箱明细
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject ivtbBoxDtlQuery(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -372,4 +372,45 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
jo.put("message", "捆扎成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject abnormalOut(JSONObject whereJson) {
|
||||
|
||||
String vehicle_code = whereJson.getString("box_no");
|
||||
String device_code = whereJson.getString("point_code");
|
||||
|
||||
if (ObjectUtil.isEmpty(vehicle_code) && ObjectUtil.isEmpty(device_code)) {
|
||||
throw new BadRequestException("载具号或木箱号不能为空!");
|
||||
}
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "9");
|
||||
map.put("box_no",vehicle_code);
|
||||
map.put("point_code",device_code);
|
||||
|
||||
// 查询对应任务
|
||||
JSONObject json = WQL.getWO("PDA_ST_01").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(json)) throw new BadRequestException("木箱不存在或任务不存在!");
|
||||
|
||||
// 下发给acs
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
jsonParam.put("device_code", json.getString("point_code2"));
|
||||
jsonParam.put("vehicle_code", json.getString("vehicle_code"));
|
||||
jsonParam.put("task_code", json.getString("task_code"));
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "解锁成功!");
|
||||
|
||||
WmsToAcsServiceImpl bean = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||
|
||||
try {
|
||||
bean.unLock(jsonParam);
|
||||
} catch (Exception e) {
|
||||
jo.put("message",e.getMessage());
|
||||
}
|
||||
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
package org.nl.wms.pda.st.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -11,11 +9,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pda.st.service.CoolInService;
|
||||
import org.nl.wms.pda.st.service.ProductionOutService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -33,24 +28,16 @@ public class ProductionOutServiceImpl implements ProductionOutService {
|
||||
@Override
|
||||
public JSONObject ivtQuery(JSONObject whereJson) {
|
||||
|
||||
String box_no = whereJson.getString("box_no");
|
||||
String bill_code = whereJson.getString("bill_code");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("box_no", whereJson.getString("box_no"));
|
||||
map.put("point_code", whereJson.getString("point_code"));
|
||||
if (ObjectUtil.isNotEmpty(box_no)) map.put("box_no","%"+box_no+"%");
|
||||
if (ObjectUtil.isNotEmpty(bill_code)) map.put("bill_code","%"+bill_code+"%");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_PRODUVTIONOUT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject jsonObject = resultJSONArray.getJSONObject(i);
|
||||
String isRePrintPackageBoxLabel = jsonObject.getString("isRePrintPackageBoxLabel");
|
||||
String isUnPackBox = jsonObject.getString("isUnPackBox");
|
||||
|
||||
if (StrUtil.equals(isRePrintPackageBoxLabel, "1") || StrUtil.equals(isUnPackBox, "1")) {
|
||||
jsonObject.put("colro_flag", "1");
|
||||
} else {
|
||||
jsonObject.put("colro_flag", "0");
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
@@ -69,17 +56,25 @@ public class ProductionOutServiceImpl implements ProductionOutService {
|
||||
JSONObject jsonPoint = pointTab.query("vehicle_code = '" + box_no + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("请输入正确的木箱");
|
||||
throw new BadRequestException("请输入正确的木箱或查看点位是否存在");
|
||||
}
|
||||
|
||||
/*
|
||||
* 生产区确认
|
||||
* a.解锁出库点位、清除木箱号
|
||||
判断点位是第几层
|
||||
1层:解锁当前点位和2层点位
|
||||
2层:直接解锁当前点位
|
||||
*/
|
||||
if (StrUtil.equals(jsonPoint.getString("layer_num"), "1")) {
|
||||
JSONObject jsonPoint2 = pointTab.query("device_code = '" + jsonPoint.getString("device_code") + "' and layer_num = '2'").uniqueResult(0);
|
||||
jsonPoint2.put("point_status", "1");
|
||||
jsonPoint2.put("lock_type", "1");
|
||||
jsonPoint2.put("vehicle_code", "");
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
jsonPoint.put("point_status", "1");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("vehicle_code", "");
|
||||
jsonPoint.put("vehicle_type", "");
|
||||
jsonPoint.put("vehicle_qty", 0);
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
@@ -87,4 +82,38 @@ public class ProductionOutServiceImpl implements ProductionOutService {
|
||||
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject ivtDtlQuery(JSONObject whereJson) {
|
||||
String box_no = whereJson.getString("box_no");
|
||||
String bill_code = whereJson.getString("bill_code");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("bill_code", bill_code);
|
||||
if (ObjectUtil.isNotEmpty(box_no)) map.put("box_no","%"+box_no+"%");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_PRODUVTIONOUT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject ivtbBoxDtlQuery(JSONObject whereJson) {
|
||||
String box_no = whereJson.getString("box_no");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "3");
|
||||
map.put("box_no", box_no);
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_PRODUVTIONOUT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.box_no TYPEAS s_string
|
||||
|
||||
|
||||
@@ -42,44 +42,155 @@
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
sub.package_box_SN AS package_box_SN,
|
||||
sub.container_name AS container_name,
|
||||
sub.product_name AS product_name,
|
||||
sub.product_description AS product_description,
|
||||
sub.net_weight AS net_weight,
|
||||
(
|
||||
CASE
|
||||
sub.isRePrintPackageBoxLabel
|
||||
WHEN '1' THEN '是'
|
||||
WHEN '0' THEN '否'
|
||||
END
|
||||
) AS change_out,
|
||||
(
|
||||
CASE
|
||||
sub.isUnPackBox
|
||||
WHEN '1' THEN '是'
|
||||
WHEN '0' THEN '否'
|
||||
END
|
||||
) AS change_in,
|
||||
|
||||
sub.isRePrintPackageBoxLabel,
|
||||
sub.isUnPackBox,
|
||||
point.point_code
|
||||
SELECT DISTINCT
|
||||
mst.bill_code,
|
||||
(
|
||||
CASE
|
||||
mst.bill_status
|
||||
WHEN '10' THEN '生成'
|
||||
WHEN '20' THEN '提交'
|
||||
WHEN '30' THEN '分配中'
|
||||
WHEN '40' THEN '分配完'
|
||||
WHEN '50' THEN '确认'
|
||||
WHEN '99' THEN '完成'
|
||||
END
|
||||
) AS bill_status,
|
||||
ROUND(mst.total_qty, 3) AS total_qty,
|
||||
mst.detail_count,
|
||||
mst.cust_code,
|
||||
cust.cust_name,
|
||||
mst.source_id,
|
||||
mst.remark,
|
||||
mst.input_optname,
|
||||
mst.input_time,
|
||||
mst.dis_optname,
|
||||
mst.dis_time,
|
||||
mst.confirm_optname,
|
||||
mst.confirm_time
|
||||
FROM
|
||||
PDM_BI_SubPackageRelation sub
|
||||
LEFT JOIN sch_base_point point ON sub.package_box_SN = point.vehicle_code
|
||||
st_ivt_iostorinv mst
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
box_no,
|
||||
max(iostorinv_id) AS iostorinv_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis
|
||||
WHERE
|
||||
1 = 1
|
||||
group by box_no
|
||||
) dis ON dis.iostorinv_id = mst.iostorinv_id
|
||||
LEFT JOIN sch_base_point point ON point.vehicle_code = dis.box_no
|
||||
LEFT JOIN md_cs_customerbase cust ON cust.cust_code = mst.cust_code
|
||||
WHERE
|
||||
point.point_type = '9'
|
||||
mst.is_delete = '0'
|
||||
AND mst.io_type = '1'
|
||||
AND point.point_type = '9'
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
point.vehicle_code = 输入.box_no
|
||||
point.vehicle_code LIKE 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
point.point_code = 输入.point_code
|
||||
OPTION 输入.bill_code <> ""
|
||||
mst.bill_code LIKE 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
point.vehicle_code AS package_box_sn,
|
||||
point.point_code,
|
||||
point.point_name,
|
||||
ROUND(sub.box_weight,3) AS box_weight,
|
||||
sub.product_name,
|
||||
sub.product_description,
|
||||
sub.sale_order_name
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
box_no,
|
||||
max(iostorinv_id) AS iostorinv_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis
|
||||
WHERE
|
||||
1 = 1
|
||||
group by box_no
|
||||
) dis ON dis.box_no = point.vehicle_code
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
package_box_sn,
|
||||
MAX(box_weight) AS box_weight,
|
||||
MAX(product_name) AS product_name,
|
||||
MAX(product_description) AS product_description,
|
||||
MAX(sale_order_name) AS sale_order_name
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1 = 1
|
||||
group by package_box_sn
|
||||
) sub ON sub.package_box_sn = dis.box_no
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND mst.io_type = '1'
|
||||
AND point.point_type = '9'
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
point.vehicle_code LIKE 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
mst.bill_code = 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
order by point_code
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
package_box_sn,
|
||||
container_name,
|
||||
sap_pcsn,
|
||||
ROUND(net_weight,3) AS net_weight,
|
||||
(
|
||||
CASE
|
||||
status
|
||||
WHEN '0' THEN '生成'
|
||||
WHEN '1' THEN '包装'
|
||||
WHEN '2' THEN '入库'
|
||||
WHEN '3' THEN '出库'
|
||||
END
|
||||
) AS status,
|
||||
sale_order_name,
|
||||
customer_name,
|
||||
customer_description,
|
||||
width,
|
||||
thickness,
|
||||
ROUND(length,3) AS length,
|
||||
width_standard,
|
||||
thickness_request,
|
||||
quality_guaran_period,
|
||||
date_of_production,
|
||||
date_of_fG_inbound
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1 = 1
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
package_box_sn = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
order by package_box_sn,container_name
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -15,6 +15,7 @@
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.box_no TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.stor_id TYPEAS s_string
|
||||
|
||||
|
||||
@@ -206,6 +207,31 @@
|
||||
dis.box_no = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "9"
|
||||
QUERY
|
||||
SELECT
|
||||
task.*
|
||||
FROM
|
||||
sch_base_task task
|
||||
WHERE
|
||||
task.is_delete = '0'
|
||||
AND task.task_status = '07'
|
||||
AND task.task_type = '010503'
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
task.vehicle_code = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
task.point_code2 = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
order by update_time DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
Binary file not shown.
@@ -38,4 +38,8 @@ public class AcsTaskDto {
|
||||
private String oven_time;
|
||||
//密集库明细类型
|
||||
private String dtl_type;
|
||||
//发货区起点高度
|
||||
private String start_height;
|
||||
//发货区终点高度
|
||||
private String next_height;
|
||||
}
|
||||
|
||||
@@ -34,24 +34,43 @@ public class SendOutTask extends AbstractAcsTask {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
String start_high = "0";
|
||||
String next_high = "";
|
||||
|
||||
// 判断此木箱是在2层还是1层
|
||||
JSONObject jsonPoint = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + json.getString("point_code2") + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("终点点位不存在!");
|
||||
|
||||
if (StrUtil.equals(jsonPoint.getString("layer_num"), "2")) {
|
||||
JSONObject jsonSub = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + json.getString("vehicle_code") + "'").uniqueResult(0);
|
||||
next_high = jsonSub.getString("box_high");
|
||||
} else {
|
||||
next_high = "0";
|
||||
}
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.next_device_code(jsonPoint.getString("device_code"))
|
||||
.agv_system_type("1")
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.start_height(start_high)
|
||||
.next_height(next_high)
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
System.out.println(resultList.toString());
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.sale_order_name TYPEAS s_string
|
||||
输入.product_name TYPEAS s_string
|
||||
输入.box_length TYPEAS s_string
|
||||
输入.box_width TYPEAS s_string
|
||||
输入.box_high TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.row_num TYPEAS s_string
|
||||
|
||||
@@ -50,7 +54,26 @@
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = po.vehicle_code
|
||||
WHERE
|
||||
po.point_type = '9'
|
||||
AND sub.sale_order_name = 输入.sale_order_name
|
||||
|
||||
OPTION 输入.sale_order_name <> ""
|
||||
sub.sale_order_name = 输入.sale_order_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.product_name <> ""
|
||||
sub.product_name = 输入.product_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_length <> ""
|
||||
sub.box_length = 输入.box_length
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_width <> ""
|
||||
sub.box_width = 输入.box_width
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_high <> ""
|
||||
sub.box_high = 输入.box_high
|
||||
ENDOPTION
|
||||
|
||||
GROUP BY po.row_num
|
||||
|
||||
@@ -87,7 +110,7 @@
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
ORDER BY po.out_order_seq ASC
|
||||
ORDER BY po.out_order_seq,po.layer_num
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
AND
|
||||
sa2.is_used = '1'
|
||||
AND
|
||||
sa.sect_id = 输入.sect_id
|
||||
sa2.sect_id = 输入.sect_id
|
||||
OPTION 输入.material_code <> ""
|
||||
mb.material_code = 输入.material_code
|
||||
ENDOPTION
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.OutTask;
|
||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
@@ -2574,6 +2575,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
String point_code = whereJson.getString("point_code"); // 终点
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id");
|
||||
boolean checked = whereJson.getBoolean("checked"); // 是否异常出库
|
||||
|
||||
//查询主表信息
|
||||
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
@@ -2608,11 +2610,66 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
}
|
||||
|
||||
if (checked) {
|
||||
// 查询此明细所有的层
|
||||
JSONArray layerArr = WQL.getWO("ST_OUTIVT04")
|
||||
.addParam("flag", "9")
|
||||
.addParam("iostorinv_id", iostorinv_id)
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < layerArr.size(); i++) {
|
||||
JSONObject json = layerArr.getJSONObject(i);
|
||||
|
||||
String layer_num = json.getString("layer_num");
|
||||
|
||||
String out_point = "";
|
||||
|
||||
switch (layer_num) {
|
||||
case "1" :
|
||||
out_point = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_1").getValue();
|
||||
break;
|
||||
case "2" :
|
||||
out_point = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_2").getValue();
|
||||
break;
|
||||
case "3" :
|
||||
out_point = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_3").getValue();
|
||||
break;
|
||||
}
|
||||
|
||||
// 将这一巷道的所有木箱进行移库
|
||||
JSONObject jsonNextPoint = attrTab.query("struct_code = '" + out_point + "'").uniqueResult(0);
|
||||
|
||||
JSONObject map2 = new JSONObject();
|
||||
map2.put("block_num", jsonNextPoint.getString("block_num"));
|
||||
map2.put("row_num", jsonNextPoint.getString("row_num"));
|
||||
map2.put("out_order_seq", jsonNextPoint.getString("out_order_seq"));
|
||||
|
||||
map2.put("flag", "7");
|
||||
JSONArray paramMoveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map2).process().getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(paramMoveArr)) {
|
||||
JSONObject moveParam = new JSONObject();
|
||||
moveParam.put("jsonAllBlockPoint", paramMoveArr);
|
||||
moveParam.put("task_group_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
this.createMove(moveParam);
|
||||
|
||||
new HandMoveStorAcsTask().immediateNotifyAcs(null);
|
||||
|
||||
// 更新任务为下发
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
wo_Task.update(param,"task_group_id = '"+moveParam.getString("task_group_id")+"'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < allRowArr.size(); i++) {
|
||||
// 调用当前排处理方法
|
||||
JSONObject jsonRow = allRowArr.getJSONObject(i);
|
||||
jsonRow.put("iostorinv_id", iostorinv_id);
|
||||
jsonRow.put("point_code", point_code);
|
||||
jsonRow.put("checked", checked);
|
||||
jsonRow.put("iostorinvdtl_id", iostorinvdtl_id);
|
||||
jsonRow.put("point_id", jsonPoint2.getString("point_id"));
|
||||
this.rowDispose(jsonRow);
|
||||
@@ -2625,10 +2682,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
// 仓位表
|
||||
WQLObject attr_tab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
// 点位表
|
||||
WQLObject point_tab = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
String point_code = jsonRow.getString("point_code");
|
||||
String iostorinvdtl_id = jsonRow.getString("iostorinvdtl_id");
|
||||
String point_id = jsonRow.getString("point_id");
|
||||
Boolean checked = jsonRow.getBoolean("checked");
|
||||
|
||||
/*
|
||||
* 查询这一排的要出库的所有分配明细(正序)
|
||||
@@ -2887,6 +2949,29 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
this.createMove(moveParam);
|
||||
}
|
||||
|
||||
// 判断是否是异常出库口
|
||||
if (checked) {
|
||||
JSONObject jsonStartPoint = attr_tab.query("struct_code = '" + jsonObject.getString("struct_code") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonStartPoint)) throw new BadRequestException("起始点位异常!");
|
||||
|
||||
String layer_num = jsonStartPoint.getString("layer_num");
|
||||
|
||||
switch (layer_num) {
|
||||
case "1" :
|
||||
point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_1").getValue();
|
||||
break;
|
||||
case "2" :
|
||||
point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_2").getValue();
|
||||
break;
|
||||
case "3" :
|
||||
point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_3").getValue();
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("起点楼层异常:"+jsonStartPoint.getString("struct_code"));
|
||||
}
|
||||
point_id = point_tab.query("point_code = '"+point_code+"'").uniqueResult(0).getString("point_id");
|
||||
}
|
||||
|
||||
// 创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("task_type", "010503");
|
||||
@@ -3031,6 +3116,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id");
|
||||
String iostorinvdis_id = whereJson.getString("iostorinvdis_id");
|
||||
boolean checked = whereJson.getBoolean("checked"); // 是否异常出库
|
||||
String point_id = "";
|
||||
|
||||
//查询主表信息
|
||||
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
@@ -3043,6 +3130,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (ObjectUtil.isEmpty(jsonPoint2)) {
|
||||
throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!");
|
||||
}
|
||||
point_id = jsonPoint2.getString("point_id");
|
||||
|
||||
// 查询未生成和生成未下发的分配记录
|
||||
JSONArray disArrOne = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
@@ -3291,6 +3379,29 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
this.createMove(moveParam);
|
||||
}
|
||||
|
||||
// 判断是否是异常出库口
|
||||
if (checked) {
|
||||
JSONObject jsonStartPoint = attrTab.query("struct_code = '" + jsonObject.getString("struct_code") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonStartPoint)) throw new BadRequestException("起始点位异常!");
|
||||
|
||||
String layer_num = jsonStartPoint.getString("layer_num");
|
||||
|
||||
switch (layer_num) {
|
||||
case "1" :
|
||||
point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_1").getValue();
|
||||
break;
|
||||
case "2" :
|
||||
point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_2").getValue();
|
||||
break;
|
||||
case "3" :
|
||||
point_code = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("out_point_3").getValue();
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("起点楼层异常:"+jsonStartPoint.getString("struct_code"));
|
||||
}
|
||||
point_id = wo_Point.query("point_code = '"+point_code+"'").uniqueResult(0).getString("point_id");
|
||||
}
|
||||
|
||||
// 创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("task_type", "010503");
|
||||
@@ -3309,7 +3420,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
JSONObject jsonUpdateMap = new JSONObject();
|
||||
jsonUpdateMap.put("work_status", "01");
|
||||
jsonUpdateMap.put("task_id", jsonTask.getLong("task_id"));
|
||||
jsonUpdateMap.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||
jsonUpdateMap.put("point_id", point_id);
|
||||
wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + jsonObject.getString("iostorinvdis_id") + "'");
|
||||
|
||||
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
|
||||
@@ -3323,7 +3434,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
JSONObject jsonObject2 = disArr.getJSONObject(n);
|
||||
jsonObject2.put("work_status", "01");
|
||||
jsonObject2.put("task_id", jsonTask.getLong("task_id"));
|
||||
jsonObject2.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||
jsonObject2.put("point_id", point_id);
|
||||
wo_dis.update(jsonObject2);
|
||||
}
|
||||
|
||||
@@ -3377,7 +3488,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
JSONObject jsonUpdateMap2 = new JSONObject();
|
||||
jsonUpdateMap2.put("work_status", "01");
|
||||
jsonUpdateMap2.put("task_id", jsonTask2.getLong("task_id"));
|
||||
jsonUpdateMap2.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||
jsonUpdateMap2.put("point_id", point_id);
|
||||
wo_dis.update(jsonUpdateMap2, "iostorinvdis_id = '" + jsonNext.getString("iostorinvdis_id") + "'");
|
||||
|
||||
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
|
||||
@@ -3391,7 +3502,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
JSONObject jsonObject3 = disArr2.getJSONObject(m);
|
||||
jsonObject3.put("work_status", "01");
|
||||
jsonObject3.put("task_id", jsonTask2.getLong("task_id"));
|
||||
jsonObject3.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||
jsonObject3.put("point_id", point_id);
|
||||
wo_dis.update(jsonObject3);
|
||||
}
|
||||
|
||||
@@ -3421,6 +3532,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
|
||||
JSONArray jsonAllBlockPoint = whereJson.getJSONArray("jsonAllBlockPoint");
|
||||
String is_move = whereJson.getString("is_move");
|
||||
|
||||
for (int i = 0; i < jsonAllBlockPoint.size(); i++) {
|
||||
JSONObject json = jsonAllBlockPoint.getJSONObject(i);
|
||||
@@ -3429,9 +3541,16 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
JSONObject mapParam = new JSONObject();// 生成移库单传入参数
|
||||
JSONArray table = new JSONArray(); // 明细参数
|
||||
mapParam.put("bill_status", "10");
|
||||
mapParam.put("bill_type", "21");
|
||||
mapParam.put("buss_type", "21");
|
||||
if (ObjectUtil.isNotEmpty(is_move)) {
|
||||
mapParam.put("bill_type", "28");
|
||||
mapParam.put("buss_type", "28");
|
||||
mapParam.put("bill_status", "20");
|
||||
|
||||
} else {
|
||||
mapParam.put("bill_type", "21");
|
||||
mapParam.put("buss_type", "21");
|
||||
mapParam.put("bill_status", "10");
|
||||
}
|
||||
mapParam.put("biz_date", DateUtil.today());
|
||||
mapParam.put("stor_code", "CP01");
|
||||
mapParam.put("stor_id", "1582991156504039424");
|
||||
|
||||
Reference in New Issue
Block a user