add:新增其他球磨参数维护、下发
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
package org.nl.pda.pdm;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class otherQmUtil {
|
||||
/**
|
||||
* 料浆卸料参数字段
|
||||
*/
|
||||
static List<String> rawPulpCodeList = Arrays.asList(
|
||||
"slurry_angle1", "slurry_angle2", "slurry_angle3", "slurry_angle4", "slurry_angle5", "slurry_angle6",
|
||||
"slurry_angle7", "slurry_angle8", "slurry_time1", "slurry_time2", "slurry_time3", "slurry_time4",
|
||||
"slurry_time5", "slurry_time6", "slurry_time7", "slurry_time8"
|
||||
);
|
||||
/**
|
||||
* 酒精卸料参数表
|
||||
*/
|
||||
static List<String> alcoholCodeList = Arrays.asList(
|
||||
"alc_qty1", "alc_qty2", "alc_qty3", "alc_qty4", "alc_qty5", "alc_qty6","alc_qty7","alc_qty8",
|
||||
"alc_alcangle1", "alc_alcangle2", "alc_alcangle3", "alc_alcangle4", "alc_alcangle5", "alc_alcangle6","alc_alcangle7","alc_alcangle8",
|
||||
"alc_angle1", "alc_angle2", "alc_angle3", "alc_angle4", "alc_angle5", "alc_angle6","alc_angle7","alc_angle8",
|
||||
"alc_flattime1", "alc_flattime2", "alc_flattime3", "alc_flattime4", "alc_flattime5", "alc_flattime6","alc_flattime7","alc_flattime8",
|
||||
"alc_time1", "alc_time2", "alc_time3", "alc_time4", "alc_time5", "alc_time6","alc_time7","alc_time8"
|
||||
);
|
||||
/**
|
||||
* 清洗参数表一
|
||||
*/
|
||||
static List<String> cleanseOneCodeList = Arrays.asList(
|
||||
"clean_waterqty1", "clean_waterqty2", "clean_waterqty3", "clean_waterqty4", "clean_waterqty5",
|
||||
"clean_waterangle1", "clean_waterangle2", "clean_waterangle3", "clean_waterangle4", "clean_waterangle5",
|
||||
"clean_angle1", "clean_angle2", "clean_angle3", "clean_angle4", "clean_angle5",
|
||||
"clean_flattime1", "clean_flattime2", "clean_flattime3", "clean_flattime4", "clean_flattime5",
|
||||
"clean_time1", "clean_time2", "clean_time3", "clean_time4", "clean_time5",
|
||||
"clean_resttime1", "clean_resttime2", "clean_resttime3", "clean_resttime4", "clean_resttime5"
|
||||
);
|
||||
/**
|
||||
* 清洗参数表二
|
||||
*/
|
||||
static List<String> cleanseTwoCodeList = Arrays.asList(
|
||||
"extra_qty", "extra_alcangle", "extra_angle", "extra_flattime", "extra_time"
|
||||
);
|
||||
|
||||
static Map<String, List<String>> TYPE_CODE_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
// type -> List 映射表
|
||||
TYPE_CODE_MAP.put("A", rawPulpCodeList);
|
||||
TYPE_CODE_MAP.put("B", alcoholCodeList);
|
||||
TYPE_CODE_MAP.put("C", cleanseOneCodeList);
|
||||
TYPE_CODE_MAP.put("D", cleanseTwoCodeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织下发acs数组
|
||||
* @param typeTable 集合类型 {
|
||||
* A:料浆卸料参数表
|
||||
* B:酒精卸料参数表
|
||||
* C:清洗参数表一
|
||||
* D:清洗参数表二
|
||||
* }
|
||||
* @param json 具体表数据
|
||||
* @param deviceCode 设备编码
|
||||
* @return result
|
||||
*/
|
||||
static public JSONArray otherQm(String typeTable, JSONObject json, String deviceCode) {
|
||||
JSONArray result = new JSONArray();
|
||||
// 根据type拿到对应数组,拿不到返回空
|
||||
List<String> codeList = TYPE_CODE_MAP.get(typeTable);
|
||||
if (codeList == null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
for (String code : codeList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("code", code);
|
||||
item.put("device_code", deviceCode);
|
||||
item.put("value", ObjectUtil.isEmpty(json)
|
||||
? "0"
|
||||
: (ObjectUtil.isEmpty(NumberUtil.round(json.getString(code),1)) ? "0" : NumberUtil.round(json.getString(code),1))
|
||||
);
|
||||
result.add(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.pda.exception.PdaRequestException;
|
||||
import org.nl.pda.pdm.otherQmUtil;
|
||||
import org.nl.pda.pdm.service.PdmWorkTaskService;
|
||||
import org.nl.pda.st.vehicle.service.impl.EmptyVehicleServiceImpl;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
@@ -975,6 +976,9 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
||||
array.add(data2);
|
||||
}
|
||||
|
||||
// 组织其他球磨参数
|
||||
JSONArray otherQMList = otherQM(material_id,device_jo.getString("device_code"));
|
||||
array.addAll(otherQMList);
|
||||
Map<String, Object> result = wmsToAcsService.action(array);
|
||||
String status = MapUtil.getStr(result, "status");
|
||||
if (!StrUtil.equals(status, "200")) {
|
||||
@@ -995,6 +999,42 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
||||
return returnjo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他球磨参数
|
||||
* @param materialId 物料标识
|
||||
* @param deviceCode 设备编码
|
||||
* @return JSONArray
|
||||
*/
|
||||
private JSONArray otherQM(String materialId, String deviceCode) {
|
||||
JSONArray result = new JSONArray();
|
||||
// 浆卸料参数表
|
||||
WQLObject rawPulpWo = WQLObject.getWQLObject("PDM_BI_RawPulpParam");
|
||||
// 酒精卸料参数表
|
||||
WQLObject alcoholWo = WQLObject.getWQLObject("PDM_BI_AlcoholParam");
|
||||
// 清洗参数表一
|
||||
WQLObject cleanseOneWo = WQLObject.getWQLObject("PDM_BI_CleanseParamOne");
|
||||
// 清洗参数表二
|
||||
WQLObject cleanseTwoWo = WQLObject.getWQLObject("PDM_BI_CleanseParamTwo");
|
||||
|
||||
// 查询浆卸料参数
|
||||
JSONObject rawPulpWoJson = rawPulpWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray rawPulpList = otherQmUtil.otherQm("A", rawPulpWoJson, deviceCode);
|
||||
result.addAll(rawPulpList);
|
||||
// 查询酒精卸料参数
|
||||
JSONObject alcoholWoJson = alcoholWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray alcoholList = otherQmUtil.otherQm("B", alcoholWoJson, deviceCode);
|
||||
result.addAll(alcoholList);
|
||||
// 查询清洗参数一
|
||||
JSONObject cleanseOneWoJson = cleanseOneWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray cleanseOneList = otherQmUtil.otherQm("C", cleanseOneWoJson, deviceCode);
|
||||
result.addAll(cleanseOneList);
|
||||
// 查询清洗参数二
|
||||
JSONObject cleanseTwoWoJson = cleanseTwoWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray cleanseTwoList = otherQmUtil.otherQm("D", cleanseTwoWoJson, deviceCode);
|
||||
result.addAll(cleanseTwoList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> moveQMVehicle(Map jsonObject) {
|
||||
if (ObjectUtil.isEmpty(jsonObject)) {
|
||||
|
||||
@@ -74,4 +74,19 @@ public class ProductProcessParamController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getBallMillParam")
|
||||
@Log("获取其他球磨参数")
|
||||
@ApiOperation("获取其他球磨参数")
|
||||
public ResponseEntity<Object> getBallMillParam(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(productProcessParamService.getBallMillParam(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveBallMillParam")
|
||||
@Log("保存其他球磨参数")
|
||||
@ApiOperation("保存其他球磨参数")
|
||||
public ResponseEntity<Object> saveBallMillParam(@RequestBody JSONObject whereJson) {
|
||||
productProcessParamService.saveBallMillParam(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,4 +49,30 @@ public interface ProductProcessParamService {
|
||||
* 删除参数
|
||||
*/
|
||||
void deleteAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 获取其他球磨参数
|
||||
* @param whereJson {
|
||||
* material_id: 物料标识
|
||||
* }
|
||||
* @return JSONObject {
|
||||
* slurryParams: {} --原浆卸料
|
||||
* alcoholParams: {} --酒精卸料
|
||||
* cleanParams: {} --清洗一
|
||||
* extraAlcoholParams: {} --清洗二
|
||||
* }
|
||||
*/
|
||||
JSONObject getBallMillParam(Map whereJson);
|
||||
|
||||
/**
|
||||
* 保存其他球磨参数
|
||||
* @param whereJson {
|
||||
* material_id : 物料标识
|
||||
* slurryParams: {} --原浆卸料
|
||||
* alcoholParams: {} --酒精卸料
|
||||
* cleanParams: {} --清洗
|
||||
* extraAlcoholParams: {} --清洗二
|
||||
* }
|
||||
*/
|
||||
void saveBallMillParam(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ 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 lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
@@ -44,8 +44,8 @@ public class ProductProcessParamServiceImpl implements ProductProcessParamServic
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
//只能查询PG粉
|
||||
String classIds=classstandardService.getAllChildIdStr(MaterOptTypeEnum.PGF.getClass_idStr());
|
||||
String where = "is_delete ='0' and material_type_id in "+ classIds;
|
||||
String classIds = classstandardService.getAllChildIdStr(MaterOptTypeEnum.PGF.getClass_idStr());
|
||||
String where = "is_delete ='0' and material_type_id in " + classIds;
|
||||
if (ObjectUtil.isNotEmpty(search)) {
|
||||
if (search.contains("\\")) search = search.replace("\\", "\\\\\\");
|
||||
where += " AND (material_code like '%" + search + "%' OR material_code like '%" + search + "%' ) ";
|
||||
@@ -223,7 +223,67 @@ public class ProductProcessParamServiceImpl implements ProductProcessParamServic
|
||||
String material_id = (String) whereJson.get("material_id");
|
||||
String workprocedure_code = (String) whereJson.get("workprocedure_code");
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BI_WorkProcedureParaProduct");
|
||||
wo.delete("material_id = '" + material_id + "' and workprocedure_code='"+workprocedure_code+"'");
|
||||
wo.delete("material_id = '" + material_id + "' and workprocedure_code='" + workprocedure_code + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getBallMillParam(Map whereJson) {
|
||||
// 浆卸料参数表
|
||||
WQLObject rawPulpWo = WQLObject.getWQLObject("PDM_BI_RawPulpParam");
|
||||
// 酒精卸料参数表
|
||||
WQLObject alcoholWo = WQLObject.getWQLObject("PDM_BI_AlcoholParam");
|
||||
// 清洗参数表一
|
||||
WQLObject cleanseOneWo = WQLObject.getWQLObject("PDM_BI_CleanseParamOne");
|
||||
// 清洗参数表二
|
||||
WQLObject cleanseOneTwo = WQLObject.getWQLObject("PDM_BI_CleanseParamTwo");
|
||||
String materialId = MapUtil.getStr(whereJson, "material_id");
|
||||
|
||||
JSONObject slurryParams = rawPulpWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONObject alcoholParams = alcoholWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONObject cleanParams = cleanseOneWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONObject extraAlcoholParams = cleanseOneTwo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("slurryParams", slurryParams);
|
||||
result.put("alcoholParams", alcoholParams);
|
||||
result.put("cleanParams", cleanParams);
|
||||
result.put("extraAlcoholParams", extraAlcoholParams);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveBallMillParam(JSONObject whereJson) {
|
||||
// 料浆卸料参数表
|
||||
WQLObject rawPulpWo = WQLObject.getWQLObject("PDM_BI_RawPulpParam");
|
||||
// 酒精卸料参数表
|
||||
WQLObject alcoholWo = WQLObject.getWQLObject("PDM_BI_AlcoholParam");
|
||||
// 清洗参数表一
|
||||
WQLObject cleanseOneWo = WQLObject.getWQLObject("PDM_BI_CleanseParamOne");
|
||||
// 清洗参数表二
|
||||
WQLObject cleanseOneTwo = WQLObject.getWQLObject("PDM_BI_CleanseParamTwo");
|
||||
String materialId = MapUtil.getStr(whereJson, "material_id");
|
||||
|
||||
// 先删除后新增
|
||||
rawPulpWo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject slurryParams = whereJson.getJSONObject("slurryParams");
|
||||
slurryParams.put("material_id", materialId);
|
||||
rawPulpWo.insert(slurryParams);
|
||||
|
||||
alcoholWo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject alcoholParams = whereJson.getJSONObject("alcoholParams");
|
||||
alcoholParams.put("material_id", materialId);
|
||||
alcoholWo.insert(alcoholParams);
|
||||
|
||||
cleanseOneWo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject cleanParams = whereJson.getJSONObject("cleanParams");
|
||||
cleanParams.put("material_id", materialId);
|
||||
cleanseOneWo.insert(cleanParams);
|
||||
|
||||
cleanseOneTwo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject extraAlcoholParams = whereJson.getJSONObject("extraAlcoholParams");
|
||||
extraAlcoholParams.put("material_id", materialId);
|
||||
cleanseOneTwo.insert(extraAlcoholParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -357,7 +357,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
if (row.getString("bill_type").equals("000203")) {
|
||||
//通过入库单对象组织数据
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "2");
|
||||
map.put("flag", "222");
|
||||
map.put("iostorinv_id", row.getString("iostorinv_id"));
|
||||
JSONArray dtl_rows = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParamMap(map).process().getResultJSONArray(0);
|
||||
// 根据物料批次获取到货通知单的采购订单采购组织
|
||||
@@ -2064,7 +2064,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
throw new BadRequestException("物料【"+dtl.getString("material_id")+"】,批次【"+dtl.getString("pcsn")+"】的通知单对应的采购订单库位为空!");
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("找不到物料为【"+dtl.getString("material_id")+"】,批次为【"+dtl.getString("pcsn")+"】的到货通知单对应的采购订单!");
|
||||
// 没有采购订单的设默认值:如软废型材入库:erp提供
|
||||
erp_storage_id = "1002A11000000055U84C";
|
||||
}
|
||||
|
||||
// 出库仓库
|
||||
|
||||
@@ -158,6 +158,48 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "222"
|
||||
QUERY
|
||||
SELECT
|
||||
proc.PK_DEPT,
|
||||
proc.VEND_ID,
|
||||
proc.CEMPLOYEEID,
|
||||
proc.PK_DEPT_V,
|
||||
proc.VBILLCODE,
|
||||
dtl.pcsn,
|
||||
dtl.material_id,
|
||||
proc.PRICE,
|
||||
proc.PRICE_TAX,
|
||||
(case when mst.bill_type not in ('000601','000501','010701') then dtl.real_qty else concat('-',dtl.plan_qty) end) AS real_qty,
|
||||
proc.TAX,
|
||||
proc.PURCHASE_ID_B,
|
||||
proc.PURCHASE_ID,
|
||||
mb.ext_id AS ITEM_ID,
|
||||
proc.CROWNO,
|
||||
proc.QTY,
|
||||
mb.material_name,
|
||||
unit.ext_id AS F_UNIT_ID,
|
||||
unit.ext_id AS M_UNIT_ID,
|
||||
userper.ext_id AS make_ext_id,
|
||||
userper.extuser_id AS create_user_id,
|
||||
mb.measrate AS vchangerate,
|
||||
dict.label,
|
||||
mst.biz_date,
|
||||
mst.input_time
|
||||
FROM
|
||||
st_ivt_iostorinvdtl dtl
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN sys_dict_detail dict ON dict.`value` = mst.bill_type AND dict.name = 'IO_BUSS_TYPE'
|
||||
LEFT JOIN pcs_if_purchaseorderproc proc ON proc.id = dtl.base_billdtl_id
|
||||
LEFT JOIN sys_user userper ON userper.user_id = mst.input_optid
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
||||
LEFT JOIN md_pb_measureunit unit ON mb.base_unit_id = unit.measure_unit_id
|
||||
WHERE
|
||||
dtl.iostorinv_id = 输入.iostorinv_id
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user