Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -317,8 +317,6 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
|
||||
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + raw_jo.getString("mfg_order_name") + "'").uniqueResult(0);
|
||||
|
||||
if (!StrUtil.equals(jsonCool.getString("status"), "04")) throw new BadRequestException("工单不为下卷完成");
|
||||
|
||||
jsonCool.put("status", "09");
|
||||
jsonCool.put("realend_time", DateUtil.now());
|
||||
jsonCool.put("finish_type", "02");
|
||||
|
||||
@@ -74,20 +74,8 @@
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
plan.mfg_order_name,
|
||||
plan.container_name,
|
||||
plan.*,
|
||||
ivt.point_code,
|
||||
plan.split_group,
|
||||
plan.manufacture_sort,
|
||||
plan.manufacture_date,
|
||||
plan.paper_tube_or_FRP,
|
||||
plan.paper_tube_material,
|
||||
plan.paper_tube_description,
|
||||
plan.paper_tube_model,
|
||||
plan.FRP_material,
|
||||
plan.FRP_description,
|
||||
plan.FRP_model,
|
||||
plan.workorder_id,
|
||||
ivt.sort_seq,
|
||||
ivt.product_area,
|
||||
ivt.point_location
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@@ -30,10 +30,17 @@ public class CoolInController {
|
||||
private final CoolInService coolInService;
|
||||
|
||||
@PostMapping("/coolIOQuery")
|
||||
@Log("新增生产设备")
|
||||
@ApiOperation("新增生产设备")
|
||||
@Log("半成品入库初始化查询")
|
||||
@ApiOperation("半成品入库初始化查询")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(coolInService.coolIOQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmInstor")
|
||||
@Log("确认入库")
|
||||
@ApiOperation("确认入库")
|
||||
public ResponseEntity<Object> confirmInstor(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(coolInService.confirmInstor(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
package org.nl.wms.pda.st.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.pda.st.service.CoolInService;
|
||||
import org.nl.wms.pda.st.service.CoolOutService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "半成品出库")
|
||||
@RequestMapping("/api/pda/coolOut")
|
||||
@Slf4j
|
||||
public class CoolOutController {
|
||||
|
||||
private final CoolOutService coolOutService;
|
||||
|
||||
@PostMapping("/coolIOQuery")
|
||||
@Log("半成品出库初始化查询")
|
||||
@ApiOperation("半成品出库初始化查询")
|
||||
public ResponseEntity<Object> coolIOQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(coolOutService.coolIOQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmInstor")
|
||||
@Log("出库确认")
|
||||
@ApiOperation("出库确认")
|
||||
public ResponseEntity<Object> confirmInstor(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(coolOutService.confirmInstor(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -37,4 +37,11 @@ public class ProductInstorController {
|
||||
return new ResponseEntity<>(productInstorService.boxQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("查询子卷包装关系")
|
||||
@ApiOperation("查询子卷包装关系")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productInstorService.confirm(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
package org.nl.wms.pda.st.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.pda.st.service.CoolInService;
|
||||
import org.nl.wms.pda.st.service.ProductionOutService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "出库确认")
|
||||
@RequestMapping("/api/pda/st")
|
||||
@Slf4j
|
||||
public class ProductionOutController {
|
||||
|
||||
private final ProductionOutService productionOutService;
|
||||
|
||||
@PostMapping("/ivtQuery")
|
||||
@Log("出库初始化查询")
|
||||
@ApiOperation("出库初始化查询")
|
||||
public ResponseEntity<Object> ivtQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productionOutService.ivtQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/outConfirm")
|
||||
@Log("出库确认")
|
||||
@ApiOperation("出库确认")
|
||||
public ResponseEntity<Object> outConfirm(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productionOutService.outConfirm(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,22 @@ import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author geng by
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface CoolInService {
|
||||
|
||||
/**
|
||||
*
|
||||
* 半成品入库
|
||||
* @param whereJson /
|
||||
* @return JSONArray /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONArray coolIOQuery(JSONObject whereJson);
|
||||
JSONObject coolIOQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 入库确认
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject confirmInstor(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
package org.nl.wms.pda.st.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface CoolOutService {
|
||||
|
||||
/**
|
||||
* 初始查询
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject coolIOQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 出库确认
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject confirmInstor(JSONObject whereJson);
|
||||
}
|
||||
@@ -17,4 +17,6 @@ public interface ProductInstorService {
|
||||
* @return JSONArray /
|
||||
*/
|
||||
JSONObject boxQuery(JSONObject whereJson);
|
||||
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
package org.nl.wms.pda.st.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface ProductionOutService {
|
||||
|
||||
/**
|
||||
* 出库初始化查询
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject ivtQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 出库确认
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject outConfirm(JSONObject whereJson);
|
||||
}
|
||||
@@ -2,15 +2,25 @@
|
||||
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;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.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.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@@ -19,10 +29,72 @@ import org.springframework.stereotype.Service;
|
||||
@Slf4j
|
||||
public class CoolInServiceImpl implements CoolInService {
|
||||
|
||||
@Override
|
||||
public JSONObject coolIOQuery(JSONObject whereJson) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("container_name", whereJson.getString("container_name"));
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_COOLIN").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray coolIOQuery(JSONObject whereJson) {
|
||||
|
||||
return null;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirmInstor(JSONObject whereJson) {
|
||||
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
String point_code = whereJson.getString("point_code"); // 终点点位
|
||||
String is_bake = whereJson.getString("is_bake"); // 是否烘烤完成
|
||||
|
||||
// 查询终点在冷却区是否存在
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("point_code = '" + point_code + "' and full_point_status = '01' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("此点位不存在或被占用"+point_code);
|
||||
|
||||
/* // 插入冷却区出入库单据
|
||||
JSONObject jsonCool = new JSONObject();
|
||||
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
||||
jsonCool.put("io_type", "0");
|
||||
jsonCool.put("material_id", "");
|
||||
jsonCool.put("pcsn", "");
|
||||
jsonCool.put("bill_status", "50");
|
||||
jsonCool.put("start_point_code", raw_jo.getString("resource_name"));
|
||||
jsonCool.put("end_point_code", point_code);
|
||||
jsonCool.put("create_mode", "03");
|
||||
jsonCool.put("create_id", currentUserId);
|
||||
jsonCool.put("create_name", currentUsername);
|
||||
jsonCool.put("create_time", DateUtil.now());
|
||||
jsonCool.put("update_optid", currentUserId);
|
||||
jsonCool.put("update_optname", currentUsername);
|
||||
jsonCool.put("update_time", DateUtil.now());
|
||||
jsonCool.put("confirm_optid", currentUserId);
|
||||
jsonCool.put("confirm_optname", currentUsername);
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
coolIvtTab.insert(jsonCool);*/
|
||||
|
||||
// 更新冷却区库存
|
||||
jsonCoolIvt.put("full_point_status", "02");
|
||||
if (StrUtil.equals(is_bake, "0")) jsonCoolIvt.put("cool_ivt_status", "01");
|
||||
if (StrUtil.equals(is_bake, "1")) jsonCoolIvt.put("cool_ivt_status", "03");
|
||||
jsonCoolIvt.put("container_name", raw_jo.getString("container_name"));
|
||||
jsonCoolIvt.put("workorder_id", raw_jo.getString("workorder_id"));
|
||||
jsonCoolIvt.put("instorage_time", DateUtil.now());
|
||||
jsonCoolIvt.put("update_optid", currentUserId);
|
||||
jsonCoolIvt.put("create_name", currentUsername);
|
||||
jsonCoolIvt.put("update_time", DateUtil.now());
|
||||
coolIvtTab.update(jsonCoolIvt);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "入库成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
package org.nl.wms.pda.st.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
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.CoolOutService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CoolOutServiceImpl implements CoolOutService {
|
||||
|
||||
@Override
|
||||
public JSONObject coolIOQuery(JSONObject whereJson) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("container_name", whereJson.getString("container_name"));
|
||||
map.put("product_area", whereJson.getString("product_area"));
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_COOLOUT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirmInstor(JSONObject whereJson) {
|
||||
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
String point_code = whereJson.getString("point_code"); // 出库点位
|
||||
|
||||
// 查询终点在冷却区是否存在
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("point_code = '" + point_code + "' and full_point_status = '02' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("此点位不存在或是空位"+point_code);
|
||||
|
||||
// 更新点位状态
|
||||
jsonCoolIvt.put("full_point_status", "01");
|
||||
jsonCoolIvt.put("cool_ivt_status", "01");
|
||||
jsonCoolIvt.put("container_name", "");
|
||||
jsonCoolIvt.put("workorder_id", "");
|
||||
jsonCoolIvt.put("ivt_qty", 0);
|
||||
jsonCoolIvt.put("instorage_time", "");
|
||||
coolIvtTab.update(jsonCoolIvt);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "出库成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,11 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.pda.st.service.CoolInService;
|
||||
import org.nl.wms.pda.st.service.ProductInstorService;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -23,6 +25,7 @@ import java.util.HashMap;
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
private final RawAssistIStorService rawAssistIStorService;
|
||||
|
||||
@Override
|
||||
public JSONObject boxQuery(JSONObject whereJson) {
|
||||
@@ -48,4 +51,35 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
jo.put("message","查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
String box_no = whereJson.getString("box_no");
|
||||
//1-报废入库;2-生产入库;3-退货入库
|
||||
String option = whereJson.getString("option");
|
||||
String material_code = whereJson.getString("material_code");
|
||||
String is_virtual = whereJson.getString("is_virtual");
|
||||
|
||||
JSONArray box_rows = whereJson.getJSONArray("box_rows");
|
||||
|
||||
JSONArray rows = new JSONArray();
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("box_no",box_no);
|
||||
if (option.equals("1")){
|
||||
HashMap<String,String> sub_map = new HashMap<>();
|
||||
sub_map.put("box_type",material_code);
|
||||
//如果是退货入库要更新子卷包装关系的木箱料号
|
||||
WQLObject.getWQLObject("pdm_bi_subpackagerelation").update(sub_map,"package_box_SN = '"+box_no+"'");
|
||||
}
|
||||
|
||||
//如果是入虚拟库直接入库并确认,如果是入成品库则生成入库单,生成一个二楼去一楼的任务
|
||||
JSONObject mst_jo = new JSONObject();
|
||||
mst_jo.put("tableData",box_rows);
|
||||
mst_jo.put("bill_type",box_rows);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data",rows);
|
||||
jo.put("message","查询成功!");
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
|
||||
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;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.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;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ProductionOutServiceImpl implements ProductionOutService {
|
||||
|
||||
@Override
|
||||
public JSONObject ivtQuery(JSONObject whereJson) {
|
||||
/* option
|
||||
* 0-生产区查询
|
||||
* 1-虚拟区查询
|
||||
*/
|
||||
String option = whereJson.getString("option");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
if (StrUtil.equals(option, "0")) map.put("flag", "1");
|
||||
if (StrUtil.equals(option, "1")) map.put("flag", "2");
|
||||
map.put("box_no", whereJson.getString("box_no"));
|
||||
map.put("point_code", whereJson.getString("point_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", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject outConfirm(JSONObject whereJson) {
|
||||
/* option
|
||||
* 0-生产区确认
|
||||
* 1-虚拟区确认
|
||||
*/
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt"); // 仓位库存表
|
||||
WQLObject subTab = WQLObject.getWQLObject("PDM_BI_SubPackageRelation"); // 子卷包装关系表
|
||||
WQLObject ioMstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库单主表
|
||||
WQLObject ioDtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库单明细表
|
||||
WQLObject ioDidsTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); // 出入库单分配表
|
||||
|
||||
String option = whereJson.getString("option");
|
||||
JSONObject box_no = whereJson.getJSONObject("box_no");
|
||||
|
||||
Long deptId = SecurityUtils.getDeptId();
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject jsonSub = subTab.query("package_box_SN = '" + box_no + "'").uniqueResult(0);
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("vehicle_code = '" + box_no + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (StrUtil.equals(option, "0")) {
|
||||
/*
|
||||
* 0 - 生产区确认
|
||||
* a.解锁出库点位、清除木箱号
|
||||
*/
|
||||
jsonPoint.put("point_status", "00");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("vehicle_code", "");
|
||||
jsonPoint.put("vehicle_type", "");
|
||||
jsonPoint.put("vehicle_qty", 0);
|
||||
pointTab.update(jsonPoint);
|
||||
} else {
|
||||
/*
|
||||
* 1 - 虚拟区确认
|
||||
* a.生成出库单主表、明细表、分配表并确认
|
||||
* b.更新库存
|
||||
* c.更新点位
|
||||
*/
|
||||
|
||||
JSONObject jsonIvt = ivtTab.query("pcsn = '" + jsonSub.getString("container_name") + "'").uniqueResult(0);
|
||||
|
||||
// 生成出库单主表
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
jsonMst.put("iostorinv_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMst.put("bill_code", CodeUtil.getNewCode("IO_CODE"));
|
||||
jsonMst.put("io_type", "1");
|
||||
jsonMst.put("buss_type", "");
|
||||
jsonMst.put("bill_type", "");
|
||||
jsonMst.put("biz_date", DateUtil.today());
|
||||
jsonMst.put("detail_count", 1);
|
||||
jsonMst.put("bill_status", "99");
|
||||
jsonMst.put("create_mode", "02");
|
||||
jsonMst.put("input_optid", currentUserId);
|
||||
jsonMst.put("input_optname", nickName);
|
||||
jsonMst.put("input_time", now);
|
||||
jsonMst.put("update_optid", currentUserId);
|
||||
jsonMst.put("update_optname", nickName);
|
||||
jsonMst.put("update_time", now);
|
||||
jsonMst.put("dis_optid", currentUserId);
|
||||
jsonMst.put("dis_optname", nickName);
|
||||
jsonMst.put("dis_time", now);
|
||||
jsonMst.put("confirm_optid", currentUserId);
|
||||
jsonMst.put("confirm_optname", nickName);
|
||||
jsonMst.put("confirm_time", now);
|
||||
jsonMst.put("sysdeptid", deptId);
|
||||
jsonMst.put("syscompanyid", deptId);
|
||||
ioMstTab.insert(jsonMst);
|
||||
|
||||
// 生成出库单明细表
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("iostorinvdtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonDtl.put("iostorinv_id", jsonMst.getString("iostorinv_id"));
|
||||
jsonDtl.put("seq_no", 1);
|
||||
// jsonDtl.put("material_id", "");
|
||||
jsonDtl.put("pcsn", jsonSub.getString("container_name"));
|
||||
jsonDtl.put("box_no", box_no);
|
||||
jsonDtl.put("bill_status", "99");
|
||||
jsonDtl.put("qty_unit_id", 1);
|
||||
jsonDtl.put("qty_unit_name", "KG");
|
||||
jsonDtl.put("plan_qty", jsonIvt.getDoubleValue("ivt_qty"));
|
||||
jsonDtl.put("real_qty", jsonIvt.getDoubleValue("ivt_qty"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
[交易说明]
|
||||
交易名: 半成品入库
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.container_name TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
(
|
||||
CASE
|
||||
der.STATUS
|
||||
WHEN '01' THEN '开始'
|
||||
WHEN '02' THEN '空轴搬出'
|
||||
WHEN '03' THEN '确认下卷'
|
||||
WHEN '04' THEN '下卷完成'
|
||||
WHEN '09' THEN '结束'
|
||||
END
|
||||
) AS status_name,
|
||||
der.mfg_order_name AS mfg_order_name,
|
||||
der.container_name AS container_name,
|
||||
ivt.point_code,
|
||||
der.product_name AS pcsn,
|
||||
der.theory_height AS theory_height,
|
||||
der.realstart_time AS realstart_time,
|
||||
der.realend_time AS realend_time,
|
||||
der.productin_qty AS productin_qty,
|
||||
der.agvno AS agvno,
|
||||
der.product_area AS product_area,
|
||||
der.update_time AS update_time,
|
||||
ivt.point_location,
|
||||
ivt.product_area,
|
||||
der.workorder_id
|
||||
FROM
|
||||
PDM_BI_RawFoilWorkOrder der
|
||||
LEFT JOIN st_ivt_sbpointivt ivt ON ivt.ext_code = der.resource_name
|
||||
WHERE
|
||||
der.is_delete = '0'
|
||||
|
||||
OPTION 输入.container_name <> ""
|
||||
der.container_name = 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -0,0 +1,82 @@
|
||||
[交易说明]
|
||||
交易名: 半成品出库
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.container_name TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
coolIvt.full_point_code AS point_code,
|
||||
coolIvt.container_name AS container_name,
|
||||
der.product_name AS product_name,
|
||||
der.productin_qty AS productin_qty,
|
||||
hotDtl1.confirm_time AS in_time,
|
||||
hotDtl2.confirm_time AS out_time,
|
||||
(
|
||||
CASE
|
||||
coolIvt.cool_ivt_status
|
||||
WHEN '03' THEN '是'
|
||||
ELSE '否'
|
||||
END
|
||||
) AS is_bake
|
||||
FROM
|
||||
ST_IVT_CoolPointIvt coolIvt
|
||||
LEFT JOIN PDM_BI_RawFoilWorkOrder der ON der.container_name = der.container_name
|
||||
LEFT JOIN ST_IVT_HotRegionIOMst hotMst ON hotMst.container_name = coolIvt.container_name
|
||||
LEFT JOIN (
|
||||
SELECT * FROM ST_IVT_HotRegionIODtl WHERE 1=1 ORDER BY confirm_time ASC LIMIT 1
|
||||
) AS hotDtl1 ON hotMst.iostorinv_id = hotDtl1.iostorinv_id
|
||||
LEFT JOIN (
|
||||
SELECT * FROM ST_IVT_HotRegionIODtl WHERE 1=1 ORDER BY confirm_time DESC LIMIT 1
|
||||
) AS hotDtl2 ON hotMst.iostorinv_id = hotDtl1.iostorinv_id
|
||||
WHERE
|
||||
coolIvt.full_point_status = '02'
|
||||
|
||||
OPTION 输入.container_name <> ""
|
||||
coolIvt.container_name = 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.product_area <> ""
|
||||
coolIvt.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -0,0 +1,130 @@
|
||||
[交易说明]
|
||||
交易名: 成品出库
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.box_no TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
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
|
||||
FROM
|
||||
PDM_BI_SubPackageRelation sub
|
||||
LEFT JOIN sch_base_point point ON sub.package_box_SN = point.vehicle_code
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
point.vehicle_code = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
point.point_code = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
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,
|
||||
attr.struct_code AS point_code
|
||||
FROM
|
||||
PDM_BI_SubPackageRelation sub
|
||||
LEFT JOIN ST_IVT_StructIvt ivt ON sub.container_name = ivt.pcsn
|
||||
LEFT JOIN ST_IVT_StructAttr attr ON attr.struct_id = ivt.struct_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
attr.storagevehicle_code = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
attr.struct_code = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -111,4 +111,12 @@ public class PointController {
|
||||
pointService.changeLock(jsonObject);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("仓位同步")
|
||||
@PostMapping("/sync")
|
||||
@ApiOperation("仓位同步")
|
||||
public ResponseEntity<Object> sync() {
|
||||
pointService.sync();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,9 @@ public interface PointService {
|
||||
* @param jsonObject
|
||||
*/
|
||||
void changeLock(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 仓位同步
|
||||
*/
|
||||
void sync();
|
||||
}
|
||||
|
||||
@@ -301,6 +301,51 @@ public class PointServiceImpl implements PointService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void sync() {
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
// 先删除所有点位类型为仓位的点位
|
||||
WQLObject.getWQLObject("sch_base_point").delete(" point_type = '01'");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
JSONArray arrStruct = WQL.getWO("QSCH_BASE_POINT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < arrStruct.size(); i++) {
|
||||
JSONObject json = arrStruct.getJSONObject(i);
|
||||
JSONObject structMap = new JSONObject();
|
||||
structMap.put("point_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
structMap.put("point_code", json.getString("struct_code"));
|
||||
structMap.put("point_name", json.getString("struct_name"));
|
||||
structMap.put("region_id", "");
|
||||
structMap.put("region_code", "");
|
||||
structMap.put("region_name", "");
|
||||
structMap.put("point_type", "01");
|
||||
structMap.put("point_status", "00");
|
||||
structMap.put("lock_type", "1");
|
||||
structMap.put("block_num", json.getIntValue("block_num"));
|
||||
structMap.put("row_num", json.getIntValue("row_num"));
|
||||
structMap.put("col_num", json.getIntValue("col_num"));
|
||||
structMap.put("layer_num", json.getIntValue("layer_num"));
|
||||
structMap.put("source_id", json.getString("struct_id"));
|
||||
structMap.put("create_id", currentUserId);
|
||||
structMap.put("create_name", nickName);
|
||||
structMap.put("create_time", now);
|
||||
structMap.put("update_optid", currentUserId);
|
||||
structMap.put("update_optname", nickName);
|
||||
structMap.put("update_time", now);
|
||||
wo.insert(structMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//根据重量返回最大的 级数
|
||||
public String getLoadSeriesByqty(Double qty) {
|
||||
JSONArray dictArr = WQLObject.getWQLObject("sys_dict_detail").query("dict_id ='108'", "label").getResultJSONArray(0);
|
||||
|
||||
@@ -116,9 +116,12 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2);
|
||||
|
||||
// 更新冷却库存状态
|
||||
// 更新工单状态为完成
|
||||
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
|
||||
jsonRaw.put("status", "09");
|
||||
rawTab.update(jsonRaw);
|
||||
|
||||
// 更新冷却库存状态
|
||||
jsonIvt2.put("full_point_status", "02");
|
||||
jsonIvt2.put("instorage_time", DateUtil.now());
|
||||
jsonIvt2.put("container_name", jsonRaw.getString("container_name"));
|
||||
|
||||
@@ -180,6 +180,17 @@
|
||||
>
|
||||
解锁
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="sync"
|
||||
:loading="sync_flag"
|
||||
>
|
||||
仓位同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -326,7 +337,7 @@
|
||||
|
||||
<script>
|
||||
import crudRegion from '@/views/wms/sch/region'
|
||||
import crudPoint, { changeActive } from '@/views/wms/sch/point'
|
||||
import crudPoint, { changeActive } from '@/views/wms/sch/point/point'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -357,6 +368,7 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
sync_flag: false,
|
||||
syncLoading: false,
|
||||
invtypelist: [],
|
||||
pointStatusList: [],
|
||||
@@ -464,6 +476,15 @@ export default {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
sync() {
|
||||
this.sync_flag = true
|
||||
crudPoint.sync().then(res => {
|
||||
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.sync_flag = false
|
||||
}).cache(() => {
|
||||
this.sync_flag = false
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,4 +68,11 @@ export function changeLock(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock }
|
||||
export function sync() {
|
||||
return request({
|
||||
url: 'api/point/sync',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock, sync }
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTask from '@/views/wms/sch/task'
|
||||
import crudTask from '@/views/wms/sch/task/task'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
|
||||
Reference in New Issue
Block a user