修改
This commit is contained in:
@@ -35,6 +35,7 @@ public class CasingController {
|
||||
@Log("套轴确认")
|
||||
@ApiOperation("套轴确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(casingService.confirm(whereJson), HttpStatus.OK);
|
||||
casingService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public class EmptyTubeController {
|
||||
@Log("入库确认")
|
||||
@ApiOperation("入库确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(emptyTubeService.confirm(whereJson), HttpStatus.OK);
|
||||
emptyTubeService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.mps.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public interface CasingService {
|
||||
@@ -9,13 +10,13 @@ public interface CasingService {
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryMaterialInfo(JSONObject whereJson);
|
||||
JSONArray queryMaterialInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 套轴确认
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
void confirm(JSONObject whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.mps.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public interface EmptyTubeService {
|
||||
@@ -9,13 +10,13 @@ public interface EmptyTubeService {
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryMaterialInfo(JSONObject whereJson);
|
||||
JSONArray queryMaterialInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 入库确认
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
void confirm(JSONObject whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,32 +1,71 @@
|
||||
package org.nl.wms.pda.mps.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.pda.mps.service.BakingService;
|
||||
import org.nl.wms.pda.mps.service.CasingService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.jar.JarEntry;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CasingServiceImpl implements CasingService {
|
||||
|
||||
private final LmsToMesService lmsToMesService;
|
||||
|
||||
@Override
|
||||
public JSONObject queryMaterialInfo(JSONObject whereJson) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code", "1");
|
||||
result.put("desc", "查询成功");
|
||||
return result;
|
||||
public JSONArray queryMaterialInfo(JSONObject whereJson) {
|
||||
String product_area = whereJson.getString("product_area");
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("flag", "2");
|
||||
if (StrUtil.isNotEmpty(product_area)) {
|
||||
map.put("product_area", product_area);
|
||||
}
|
||||
JSONArray rows = WQL.getWO("PDA_02").addParamMap(map).process().getResultJSONArray(0);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code", "1");
|
||||
result.put("desc", "查询成功");
|
||||
return result;
|
||||
public void confirm(JSONObject whereJson) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String qzzno = whereJson.getString("qzzno");
|
||||
if (StrUtil.isEmpty(qzzno)){
|
||||
throw new BadRequestException("气涨轴编码不能为空!");
|
||||
}
|
||||
JSONArray rows = whereJson.getJSONArray("cut_rows");
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
String workorder_id = row.getString("workorder_id");
|
||||
//修改分切计划的是否套轴、气涨轴编码
|
||||
HashMap map = new HashMap();
|
||||
map.put("is_child_tz_ok","1");
|
||||
map.put("qzzno",qzzno);
|
||||
map.put("update_optid",currentUserId);
|
||||
map.put("update_optname",nickName);
|
||||
map.put("update_time",now);
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map,"workorder_id = '"+workorder_id+"'");
|
||||
|
||||
//调用MES接口,通知MES已经套轴完成
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("ContainerName",row.getString("container_name"));
|
||||
jo.put("isAirSwellAssComplete",1);
|
||||
lmsToMesService.airSwellWithPaperTubeAssComplete(jo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,23 @@
|
||||
package org.nl.wms.pda.mps.service.impl;
|
||||
|
||||
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.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.pda.mps.service.BakingService;
|
||||
import org.nl.wms.pda.mps.service.EmptyTubeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.jar.JarEntry;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -14,19 +25,56 @@ public class EmptyTubeServiceImpl implements EmptyTubeService {
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject queryMaterialInfo(JSONObject whereJson) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code", "1");
|
||||
result.put("desc", "查询成功");
|
||||
return result;
|
||||
public JSONArray queryMaterialInfo(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
String material_code = whereJson.getString("material_code");
|
||||
String product_area = whereJson.getString("product_area");
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("flag", "1");
|
||||
if (StrUtil.isNotEmpty(point_code)) {
|
||||
map.put("point_code", point_code);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(material_code)) {
|
||||
map.put("material_code", material_code);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(product_area)) {
|
||||
map.put("product_area", product_area);
|
||||
}
|
||||
JSONArray rows = WQL.getWO("PDA_02").addParamMap(map).process().getResultJSONArray(0);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code", "1");
|
||||
result.put("desc", "查询成功");
|
||||
return result;
|
||||
public void confirm(JSONObject whereJson) {
|
||||
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
double add_qty = whereJson.getDoubleValue("qty");
|
||||
if (add_qty == 0) {
|
||||
throw new BadRequestException("输入的数量必须大于0!");
|
||||
}
|
||||
String material_code = whereJson.getString("material_code");
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("必须选择一条点位记录!");
|
||||
}
|
||||
//如果添加,物料必须相同
|
||||
if (StrUtil.isNotEmpty(raw_jo.getString("material_code")) && !raw_jo.getString("material_code").equals(material_code)) {
|
||||
throw new BadRequestException("选择的物料必须相同!");
|
||||
}
|
||||
|
||||
//判断库存数量是否大于最大数量
|
||||
String num = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MAX_TUBE_NUM").getValue();
|
||||
int max_num = Integer.parseInt(num);
|
||||
if (add_qty + raw_jo.getIntValue("qty") > max_num) {
|
||||
throw new BadRequestException("当前货位已超过库存最大数量!");
|
||||
}
|
||||
|
||||
//修改空纸管库区库存
|
||||
JSONObject mater = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '"+material_code+"'").uniqueResult(0);
|
||||
raw_jo.put("material_code",material_code);
|
||||
raw_jo.put("material_name",mater.getString("material_name"));
|
||||
raw_jo.put("qty",add_qty + raw_jo.getIntValue("qty"));
|
||||
WQLObject.getWQLObject("ST_IVT_EmptyTubeIvt").update(raw_jo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
[交易说明]
|
||||
交易名: 手持接口
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.material_code TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
point_code,
|
||||
material_code,
|
||||
material_name,
|
||||
qty
|
||||
FROM
|
||||
st_ivt_emptytubeivt ivt
|
||||
WHERE
|
||||
is_used = '1'
|
||||
OPTION 输入.point_code <> ""
|
||||
ivt.point_code = 输入.point_code
|
||||
ENDOPTION
|
||||
OPTION 输入.material_code <> ""
|
||||
ivt.material_code = 输入.material_code
|
||||
ENDOPTION
|
||||
OPTION 输入.product_area <> ""
|
||||
ivt.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
ORDER BY
|
||||
material_code,qty
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
plan.mfg_order_name,
|
||||
plan.container_name,
|
||||
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
|
||||
FROM
|
||||
PDM_BI_SlittingProductionPlan plan
|
||||
LEFT JOIN st_ivt_cutpointivt ivt ON ivt.ext_code = plan.resource_name
|
||||
WHERE
|
||||
plan.STATUS < 2
|
||||
AND
|
||||
is_child_tz_ok = 0
|
||||
OPTION 输入.product_area <> ""
|
||||
ivt.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
Reference in New Issue
Block a user