add:修改软废维护未字典表配置:涉及软废配置表->软费系数;合批球磨时间->合批开单
This commit is contained in:
@@ -50,7 +50,7 @@ public class WasteBallTimeController {
|
||||
@Log("修改合批软废球磨时间")
|
||||
@ApiOperation("修改合批软废球磨时间")
|
||||
//@PreAuthorize("@el.check('wastecchange:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody WastecchangeDto dto) {
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto) {
|
||||
wasteBallTimeService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,11 @@ public class WastecchangeController {
|
||||
@ApiOperation("查询软废碳平衡修正维护")
|
||||
//@PreAuthorize("@el.check('wastecchange:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(wastecchangeService.queryJsonData(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
//@PreAuthorize("@el.check('wastecchange:list')")
|
||||
public ResponseEntity<Object> queryJsonData(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(wastecchangeService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -54,7 +59,7 @@ public class WastecchangeController {
|
||||
@Log("修改软废碳平衡修正维护")
|
||||
@ApiOperation("修改软废碳平衡修正维护")
|
||||
//@PreAuthorize("@el.check('wastecchange:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody WastecchangeDto dto) {
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto) {
|
||||
wastecchangeService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public interface WasteBallTimeService {
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(WastecchangeDto dto);
|
||||
void update(JSONObject dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
||||
@@ -24,31 +24,10 @@ public interface WastecchangeService {
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
@Deprecated
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
Map<String, Object> queryJsonData(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
* @param whereJson 条件参数
|
||||
* @return List<WastecchangeDto>
|
||||
*/
|
||||
List<WastecchangeDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param change_id ID
|
||||
* @return Wastecchange
|
||||
*/
|
||||
WastecchangeDto findById(Long change_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Wastecchange
|
||||
*/
|
||||
WastecchangeDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
@@ -63,7 +42,7 @@ public interface WastecchangeService {
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(WastecchangeDto dto);
|
||||
void update(JSONObject dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.basedata.pdm.service.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
@@ -26,52 +27,54 @@ public class WastecchangeDto implements Serializable {
|
||||
private String tech_type;
|
||||
|
||||
/** CF */
|
||||
private BigDecimal cf_qty;
|
||||
|
||||
/** YZ */
|
||||
private BigDecimal yz_qty;
|
||||
|
||||
/** CX */
|
||||
private BigDecimal cx_qty;
|
||||
|
||||
/** YC */
|
||||
private BigDecimal yc_qty;
|
||||
|
||||
/** JY */
|
||||
private BigDecimal jy_qty;
|
||||
|
||||
/** LT */
|
||||
private BigDecimal lt_qty;
|
||||
|
||||
/** SJ */
|
||||
private BigDecimal sj_qty;
|
||||
|
||||
/** YS */
|
||||
private BigDecimal ys_qty;
|
||||
|
||||
/** DS */
|
||||
private BigDecimal ds_qty;
|
||||
|
||||
/** CQX */
|
||||
private BigDecimal cqx_qty;
|
||||
|
||||
/** XQX */
|
||||
private BigDecimal xqx_qty;
|
||||
|
||||
/** QX */
|
||||
private BigDecimal qx_qty;
|
||||
|
||||
/** JCF */
|
||||
private BigDecimal jcf_qty;
|
||||
|
||||
/** TB */
|
||||
private BigDecimal tb_qty;
|
||||
|
||||
/** YCR */
|
||||
private BigDecimal ycr_qty;
|
||||
|
||||
/** GZ */
|
||||
private BigDecimal gz_qty;
|
||||
// private BigDecimal cf_qty;
|
||||
//
|
||||
// /** YZ */
|
||||
// private BigDecimal yz_qty;
|
||||
//
|
||||
// /** CX */
|
||||
// private BigDecimal cx_qty;
|
||||
//
|
||||
// /** YC */
|
||||
// private BigDecimal yc_qty;
|
||||
//
|
||||
// /** JY */
|
||||
// private BigDecimal jy_qty;
|
||||
//
|
||||
// /** LT */
|
||||
// private BigDecimal lt_qty;
|
||||
//
|
||||
// /** SJ */
|
||||
// private BigDecimal sj_qty;
|
||||
//
|
||||
// /** YS */
|
||||
// private BigDecimal ys_qty;
|
||||
//
|
||||
// /** DS */
|
||||
// private BigDecimal ds_qty;
|
||||
//
|
||||
// /** CQX */
|
||||
// private BigDecimal cqx_qty;
|
||||
//
|
||||
// /** XQX */
|
||||
// private BigDecimal xqx_qty;
|
||||
//
|
||||
// /** QX */
|
||||
// private BigDecimal qx_qty;
|
||||
//
|
||||
// /** JCF */
|
||||
// private BigDecimal jcf_qty;
|
||||
//
|
||||
// /** TB */
|
||||
// private BigDecimal tb_qty;
|
||||
//
|
||||
// /** YCR */
|
||||
// private BigDecimal ycr_qty;
|
||||
//
|
||||
// /** GZ */
|
||||
// private BigDecimal gz_qty;
|
||||
//参数
|
||||
private JSONObject alldata;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
@@ -5,7 +5,6 @@ package org.nl.wms.basedata.pdm.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.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -13,22 +12,26 @@ 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.apache.commons.lang3.StringUtils;
|
||||
import org.nl.modules.system.domain.DictDetail;
|
||||
import org.nl.modules.system.repository.DictDetailRepository;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
import org.nl.wms.basedata.pdm.service.WasteBallTimeService;
|
||||
import org.nl.wms.basedata.pdm.service.WastecchangeService;
|
||||
import org.nl.wms.basedata.pdm.service.dto.WastecchangeDto;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ZZQ
|
||||
@@ -40,6 +43,9 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class WasteBallTimeServiceImpl implements WasteBallTimeService {
|
||||
|
||||
@Autowired
|
||||
private DictDetailRepository dictDetailRepository;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||
@@ -50,6 +56,8 @@ public class WasteBallTimeServiceImpl implements WasteBallTimeService {
|
||||
map.put("material_code", "%" + material_code + "%");
|
||||
}
|
||||
map.put("class_ids", MaterOptTypeEnum.THW.getClass_idStr());
|
||||
List<DictDetail> rfType = dictDetailRepository.findByDictName("MD_MATERIAL_WASTE_TYPE");
|
||||
Map<String, String> typeMap = rfType.stream().collect(HashMap::new, (k, v) -> k.put(v.getValue(), v.getLabel()), HashMap::putAll);
|
||||
|
||||
JSONObject allmaterialIds = WQL.getWO("PDM_WASTEBALLTIME").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mater.material_code");
|
||||
JSONArray array = allmaterialIds.getJSONArray("content");
|
||||
@@ -57,6 +65,14 @@ public class WasteBallTimeServiceImpl implements WasteBallTimeService {
|
||||
if (ObjectUtil.isNotEmpty(array)){
|
||||
for(int i=0;i<array.size();i++){
|
||||
JSONObject jo = array.getJSONObject(i);
|
||||
JSONObject alldata = jo.getJSONObject("alldata");
|
||||
for (String type : typeMap.keySet()) {
|
||||
String qty="99";
|
||||
if (alldata!=null && StringUtils.isNotEmpty(alldata.getString(type))){
|
||||
qty = alldata.getString(type);
|
||||
}
|
||||
jo.put(type,qty);
|
||||
}
|
||||
jo.put("edit","0");
|
||||
array2.add(jo);
|
||||
}
|
||||
@@ -112,13 +128,17 @@ public class WasteBallTimeServiceImpl implements WasteBallTimeService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(WastecchangeDto dto) {
|
||||
WastecchangeDto entity = this.findById(dto.getChange_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_WASTEBALLTIME");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
public void update(JSONObject form) {
|
||||
List<String> rfType = dictDetailRepository.findByDictName("MD_MATERIAL_WASTE_TYPE").stream().map(DictDetail::getValue).collect(Collectors.toList());
|
||||
JSONObject allData = new JSONObject();
|
||||
for (String key : rfType) {
|
||||
allData.put(key,form.get(key));
|
||||
}
|
||||
form.put("create_id",SecurityUtils.getCurrentUserId());
|
||||
form.put("create_name",SecurityUtils.getNickName());
|
||||
form.put("create_time",DateUtil.now());
|
||||
form.put("alldata",allData);
|
||||
WQLObject.getWQLObject("PDM_BI_WasteBallTime").update(form);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -157,36 +177,8 @@ public class WasteBallTimeServiceImpl implements WasteBallTimeService {
|
||||
WQLObject wasTab = WQLObject.getWQLObject("PDM_BI_WasteBallTime");
|
||||
|
||||
// 3.插入软废碳平衡修正表
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
this.update(whereJson);
|
||||
|
||||
// 先删除在插入
|
||||
JSONObject jsonObject = wasTab.query("material_id = '" + whereJson.getString("material_id")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) wasTab.delete("material_id = '"+whereJson.getString("material_id")+"'");
|
||||
|
||||
JSONObject jsonWas = new JSONObject();
|
||||
jsonWas.put("change_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonWas.put("material_id", whereJson.getString("material_id"));
|
||||
jsonWas.put("cf_qty", whereJson.getDoubleValue("cf_qty"));
|
||||
jsonWas.put("yz_qty", whereJson.getDoubleValue("yz_qty"));
|
||||
jsonWas.put("cx_qty", whereJson.getDoubleValue("cx_qty"));
|
||||
jsonWas.put("yc_qty", whereJson.getDoubleValue("yc_qty"));
|
||||
jsonWas.put("jy_qty", whereJson.getDoubleValue("jy_qty"));
|
||||
jsonWas.put("lt_qty", whereJson.getDoubleValue("lt_qty"));
|
||||
jsonWas.put("sj_qty", whereJson.getDoubleValue("sj_qty"));
|
||||
jsonWas.put("ys_qty", whereJson.getDoubleValue("ys_qty"));
|
||||
jsonWas.put("ds_qty", whereJson.getDoubleValue("ds_qty"));
|
||||
jsonWas.put("cqx_qty", whereJson.getDoubleValue("cqx_qty"));
|
||||
jsonWas.put("xqx_qty", whereJson.getDoubleValue("xqx_qty"));
|
||||
jsonWas.put("qx_qty", whereJson.getDoubleValue("qx_qty"));
|
||||
jsonWas.put("jcf_qty", whereJson.getDoubleValue("jcf_qty"));
|
||||
jsonWas.put("tb_qty", whereJson.getDoubleValue("tb_qty"));
|
||||
jsonWas.put("ycr_qty", whereJson.getDoubleValue("ycr_qty"));
|
||||
jsonWas.put("gz_qty", whereJson.getDoubleValue("gz_qty"));
|
||||
jsonWas.put("create_id", currentUserId);
|
||||
jsonWas.put("create_name", nickName);
|
||||
jsonWas.put("create_time", DateUtil.now());
|
||||
wasTab.insert(jsonWas);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,20 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.StringUtil;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.domain.DictDetail;
|
||||
import org.nl.modules.system.repository.DictDetailRepository;
|
||||
import org.nl.modules.system.service.DictDetailService;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
import org.nl.wms.basedata.pdm.service.WastecchangeService;
|
||||
import org.nl.wms.basedata.pdm.service.dto.WastecchangeDto;
|
||||
import org.nl.wql.WQL;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -44,6 +50,9 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class WastecchangeServiceImpl implements WastecchangeService {
|
||||
@Autowired
|
||||
private DictDetailRepository dictDetailRepository;
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
@@ -57,7 +66,6 @@ public class WastecchangeServiceImpl implements WastecchangeService {
|
||||
map.put("material_code", "%" + material_code + "%");
|
||||
}
|
||||
map.put("class_ids", MaterOptTypeEnum.THW.getClass_idStr());
|
||||
|
||||
JSONObject allmaterialIds = WQL.getWO("PDM_WASTECCHANGE").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mater.material_code");
|
||||
JSONArray array = allmaterialIds.getJSONArray("content");
|
||||
JSONArray array2 = new JSONArray();
|
||||
@@ -74,32 +82,44 @@ public class WastecchangeServiceImpl implements WastecchangeService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WastecchangeDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_wastecchange");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(WastecchangeDto.class);
|
||||
return null;
|
||||
public Map<String, Object> queryJsonData(Map whereJson, Pageable page) {
|
||||
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||
String tech_type = MapUtil.getStr(whereJson, "tech_type");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("tech_type", tech_type);
|
||||
if (ObjectUtil.isNotEmpty(material_code)) {
|
||||
map.put("material_code", "%" + material_code + "%");
|
||||
}
|
||||
map.put("class_ids", MaterOptTypeEnum.THW.getClass_idStr());
|
||||
|
||||
JSONObject allmaterialIds = WQL.getWO("PDM_WASTECCHANGE").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mater.material_code");
|
||||
JSONArray array = allmaterialIds.getJSONArray("content");
|
||||
//label:name;value:code
|
||||
List<DictDetail> rfType = dictDetailRepository.findByDictName("MD_MATERIAL_WASTE_TYPE");
|
||||
Map<String, String> typeMap = rfType.stream().collect(HashMap::new, (k, v) -> k.put(v.getValue(), v.getLabel()), HashMap::putAll);
|
||||
JSONArray array2 = new JSONArray();
|
||||
if (ObjectUtil.isNotEmpty(array)){
|
||||
for(int i=0;i<array.size();i++){
|
||||
JSONObject jo = array.getJSONObject(i);
|
||||
JSONObject alldata = jo.getJSONObject("alldata");
|
||||
for (String type : typeMap.keySet()) {
|
||||
String qty="99";
|
||||
if (alldata!=null && StringUtils.isNotEmpty(alldata.getString(type))){
|
||||
qty = alldata.getString(type);
|
||||
}
|
||||
jo.put(type,qty);
|
||||
}
|
||||
jo.put("tech_type",tech_type);
|
||||
jo.put("edit","0");
|
||||
array2.add(jo);
|
||||
}
|
||||
allmaterialIds.put("content",array2);
|
||||
}
|
||||
return allmaterialIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WastecchangeDto findById(Long change_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_wastecchange");
|
||||
JSONObject json = wo.query("change_id = '" + change_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(WastecchangeDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WastecchangeDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_wastecchange");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(WastecchangeDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -120,18 +140,17 @@ public class WastecchangeServiceImpl implements WastecchangeService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(WastecchangeDto dto) {
|
||||
WastecchangeDto entity = this.findById(dto.getChange_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_wastecchange");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
public void update(JSONObject form) {
|
||||
List<String> rfType = dictDetailRepository.findByDictName("MD_MATERIAL_WASTE_TYPE").stream().map(DictDetail::getValue).collect(Collectors.toList());
|
||||
JSONObject allData = new JSONObject();
|
||||
for (String key : rfType) {
|
||||
allData.put(key,form.get(key));
|
||||
}
|
||||
form.put("create_id",SecurityUtils.getCurrentUserId());
|
||||
form.put("create_name",SecurityUtils.getNickName());
|
||||
form.put("create_time",DateUtil.now());
|
||||
form.put("alldata",allData);
|
||||
WQLObject.getWQLObject("pdm_bi_wastecchange").update(form);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,7 +190,7 @@ public class WastecchangeServiceImpl implements WastecchangeService {
|
||||
WQLObject extTab = WQLObject.getWQLObject("MD_ME_ProducMaterialExt");
|
||||
WQLObject wasTab = WQLObject.getWQLObject("PDM_BI_WasteCChange");
|
||||
|
||||
// 1.将16中软废类型 放到一个数组当中
|
||||
// 1.将16中软废类型 放到一个数组当中:list:{name:ZF,value:123}
|
||||
JSONArray rf_arr = this.contentShift(whereJson);
|
||||
// 2.找软废
|
||||
String tech_type = whereJson.getString("tech_type");
|
||||
@@ -227,190 +246,28 @@ public class WastecchangeServiceImpl implements WastecchangeService {
|
||||
extTab.update(jsonExt_rf);
|
||||
}
|
||||
}
|
||||
// 3.插入软废碳平衡修正表
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
// 3.更新软废碳平衡修正表
|
||||
|
||||
// 先删除在插入
|
||||
JSONObject jsonObject = wasTab.query("material_id = '" + whereJson.getString("material_id") + "' and tech_type ='"+whereJson.getString("tech_type")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) wasTab.delete("material_id = '"+whereJson.getString("material_id")+"' and tech_type = '"+whereJson.getString("tech_type")+"'");
|
||||
|
||||
JSONObject jsonWas = new JSONObject();
|
||||
jsonWas.put("change_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonWas.put("material_id", whereJson.getString("material_id"));
|
||||
jsonWas.put("tech_type", whereJson.getString("tech_type"));
|
||||
jsonWas.put("cf_qty", whereJson.getDoubleValue("cf_qty"));
|
||||
jsonWas.put("yz_qty", whereJson.getDoubleValue("yz_qty"));
|
||||
jsonWas.put("cx_qty", whereJson.getDoubleValue("cx_qty"));
|
||||
jsonWas.put("yc_qty", whereJson.getDoubleValue("yc_qty"));
|
||||
jsonWas.put("jy_qty", whereJson.getDoubleValue("jy_qty"));
|
||||
jsonWas.put("lt_qty", whereJson.getDoubleValue("lt_qty"));
|
||||
jsonWas.put("sj_qty", whereJson.getDoubleValue("sj_qty"));
|
||||
jsonWas.put("ys_qty", whereJson.getDoubleValue("ys_qty"));
|
||||
jsonWas.put("ds_qty", whereJson.getDoubleValue("ds_qty"));
|
||||
jsonWas.put("cqx_qty", whereJson.getDoubleValue("cqx_qty"));
|
||||
jsonWas.put("xqx_qty", whereJson.getDoubleValue("xqx_qty"));
|
||||
jsonWas.put("qx_qty", whereJson.getDoubleValue("qx_qty"));
|
||||
jsonWas.put("jcf_qty", whereJson.getDoubleValue("jcf_qty"));
|
||||
jsonWas.put("tb_qty", whereJson.getDoubleValue("tb_qty"));
|
||||
jsonWas.put("ycr_qty", whereJson.getDoubleValue("ycr_qty"));
|
||||
jsonWas.put("gz_qty", whereJson.getDoubleValue("gz_qty"));
|
||||
jsonWas.put("create_id", currentUserId);
|
||||
jsonWas.put("create_name", nickName);
|
||||
jsonWas.put("create_time", DateUtil.now());
|
||||
wasTab.insert(jsonWas);
|
||||
this.update(whereJson);
|
||||
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONArray contentShift(JSONObject json) {
|
||||
JSONArray array = new JSONArray();
|
||||
List<String> rfType = dictDetailRepository.findByDictName("MD_MATERIAL_WASTE_TYPE").stream().map(DictDetail::getValue).collect(Collectors.toList());
|
||||
JSONArray rf_arr = new JSONArray();
|
||||
rfType.forEach(a->{
|
||||
JSONObject json_CF = new JSONObject();
|
||||
json_CF.put("name", a);
|
||||
if (ObjectUtil.isEmpty(json.getString(a))) {
|
||||
json_CF.put("value", "0");
|
||||
} else {
|
||||
json_CF.put("value", json.getString(a));
|
||||
}
|
||||
rf_arr.add(json_CF);
|
||||
});
|
||||
|
||||
JSONObject json_CF = new JSONObject();
|
||||
json_CF.put("name", "CF");
|
||||
if (ObjectUtil.isEmpty(json.getString("cf_qty"))) {
|
||||
json_CF.put("value", "0");
|
||||
} else {
|
||||
json_CF.put("value", json.getString("cf_qty"));
|
||||
}
|
||||
array.add(json_CF);
|
||||
|
||||
JSONObject json_YZ = new JSONObject();
|
||||
json_YZ.put("name", "YZ");
|
||||
if (ObjectUtil.isEmpty(json.getString("yz_qty"))) {
|
||||
json_YZ.put("value", "0");
|
||||
} else {
|
||||
json_YZ.put("value", json.getString("yz_qty"));
|
||||
}
|
||||
array.add(json_YZ);
|
||||
|
||||
JSONObject json_CX = new JSONObject();
|
||||
json_CX.put("name", "CX");
|
||||
if (ObjectUtil.isEmpty(json.getString("cx_qty"))) {
|
||||
json_CX.put("value", "0");
|
||||
} else {
|
||||
json_CX.put("value", json.getString("cx_qty"));
|
||||
}
|
||||
array.add(json_CX);
|
||||
|
||||
JSONObject json_YC = new JSONObject();
|
||||
json_YC.put("name", "YC");
|
||||
if (ObjectUtil.isEmpty(json.getString("yc_qty"))) {
|
||||
json_YC.put("value", "0");
|
||||
} else {
|
||||
json_YC.put("value", json.getString("yc_qty"));
|
||||
}
|
||||
array.add(json_YC);
|
||||
|
||||
JSONObject json_JY = new JSONObject();
|
||||
json_JY.put("name", "JY");
|
||||
if (ObjectUtil.isEmpty(json.getString("jy_qty"))) {
|
||||
json_JY.put("value", "0");
|
||||
} else {
|
||||
json_JY.put("value", json.getString("jy_qty"));
|
||||
}
|
||||
array.add(json_JY);
|
||||
|
||||
JSONObject json_LT = new JSONObject();
|
||||
json_LT.put("name", "LT");
|
||||
if (ObjectUtil.isEmpty(json.getString("lt_qty"))) {
|
||||
json_LT.put("value", "0");
|
||||
} else {
|
||||
json_LT.put("value", json.getString("lt_qty"));
|
||||
}
|
||||
array.add(json_LT);
|
||||
|
||||
JSONObject json_SJ = new JSONObject();
|
||||
json_SJ.put("name", "SJ");
|
||||
if (ObjectUtil.isEmpty(json.getString("sj_qty"))) {
|
||||
json_SJ.put("value", "0");
|
||||
} else {
|
||||
json_SJ.put("value", json.getString("sj_qty"));
|
||||
}
|
||||
array.add(json_SJ);
|
||||
|
||||
JSONObject json_YS = new JSONObject();
|
||||
json_YS.put("name", "YS");
|
||||
if (ObjectUtil.isEmpty(json.getString("ys_qty"))) {
|
||||
json_YS.put("value", "0");
|
||||
} else {
|
||||
json_YS.put("value", json.getString("ys_qty"));
|
||||
}
|
||||
array.add(json_YS);
|
||||
|
||||
JSONObject json_DS = new JSONObject();
|
||||
json_DS.put("name", "DS");
|
||||
if (ObjectUtil.isEmpty(json.getString("ds_qty"))) {
|
||||
json_DS.put("value", "0");
|
||||
} else {
|
||||
json_DS.put("value", json.getString("ds_qty"));
|
||||
}
|
||||
array.add(json_DS);
|
||||
|
||||
JSONObject json_CQX = new JSONObject();
|
||||
json_CQX.put("name", "CQX");
|
||||
if (ObjectUtil.isEmpty(json.getString("cqx_qty"))) {
|
||||
json_CQX.put("value", "0");
|
||||
} else {
|
||||
json_CQX.put("value", json.getString("cqx_qty"));
|
||||
}
|
||||
array.add(json_CQX);
|
||||
|
||||
JSONObject json_XQX = new JSONObject();
|
||||
json_XQX.put("name", "XQX");
|
||||
if (ObjectUtil.isEmpty(json.getString("xqx_qty"))) {
|
||||
json_XQX.put("value", "0");
|
||||
} else {
|
||||
json_XQX.put("value", json.getString("xqx_qty"));
|
||||
}
|
||||
array.add(json_XQX);
|
||||
|
||||
JSONObject json_QX = new JSONObject();
|
||||
json_QX.put("name", "QX");
|
||||
if (ObjectUtil.isEmpty(json.getString("qx_qty"))) {
|
||||
json_QX.put("value", "0");
|
||||
} else {
|
||||
json_QX.put("value", json.getString("qx_qty"));
|
||||
}
|
||||
array.add(json_QX);
|
||||
|
||||
JSONObject json_JCF = new JSONObject();
|
||||
json_JCF.put("name", "JCF");
|
||||
if (ObjectUtil.isEmpty(json.getString("jcf_qty"))) {
|
||||
json_JCF.put("value", "0");
|
||||
} else {
|
||||
json_JCF.put("value", json.getString("jcf_qty"));
|
||||
}
|
||||
array.add(json_JCF);
|
||||
|
||||
JSONObject json_TB = new JSONObject();
|
||||
json_TB.put("name", "TB");
|
||||
if (ObjectUtil.isEmpty(json.getString("tb_qty"))) {
|
||||
json_TB.put("value", "0");
|
||||
} else {
|
||||
json_TB.put("value", json.getString("tb_qty"));
|
||||
}
|
||||
array.add(json_TB);
|
||||
|
||||
JSONObject json_YCR = new JSONObject();
|
||||
json_YCR.put("name", "YCR");
|
||||
if (ObjectUtil.isEmpty(json.getString("ycr_qty"))) {
|
||||
json_YCR.put("value", "0");
|
||||
} else {
|
||||
json_YCR.put("value", json.getString("ycr_qty"));
|
||||
}
|
||||
array.add(json_YCR);
|
||||
|
||||
JSONObject json_GZ = new JSONObject();
|
||||
json_GZ.put("name", "GZ");
|
||||
if (ObjectUtil.isEmpty(json.getString("gz_qty"))) {
|
||||
json_GZ.put("value", "0");
|
||||
} else {
|
||||
json_GZ.put("value", json.getString("gz_qty"));
|
||||
}
|
||||
array.add(json_GZ);
|
||||
|
||||
return array;
|
||||
return rf_arr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,22 +52,7 @@
|
||||
mater.material_name,
|
||||
mater.material_model,
|
||||
chan.change_id,
|
||||
IFNULL(chan.cf_qty,'99') as cf_qty,
|
||||
IFNULL(chan.yz_qty,'99') as yz_qty,
|
||||
IFNULL(chan.cx_qty,'99') as cx_qty,
|
||||
IFNULL(chan.yc_qty,'99') as yc_qty,
|
||||
IFNULL(chan.jy_qty,'99') as jy_qty,
|
||||
IFNULL(chan.lt_qty,'99') as lt_qty,
|
||||
IFNULL(chan.sj_qty,'99') as sj_qty,
|
||||
IFNULL(chan.ys_qty,'99') as ys_qty,
|
||||
IFNULL(chan.ds_qty,'99') as ds_qty,
|
||||
IFNULL(chan.cqx_qty,'99') as cqx_qty,
|
||||
IFNULL(chan.xqx_qty,'99') as xqx_qty,
|
||||
IFNULL(chan.qx_qty,'99') as qx_qty,
|
||||
IFNULL(chan.jcf_qty,'99') as jcf_qty,
|
||||
IFNULL(chan.tb_qty,'99') as tb_qty,
|
||||
IFNULL(chan.ycr_qty,'99') as ycr_qty,
|
||||
IFNULL(chan.gz_qty,'99') as gz_qty,
|
||||
alldata,
|
||||
chan.create_id,
|
||||
chan.create_name,
|
||||
chan.create_time
|
||||
|
||||
@@ -52,22 +52,7 @@
|
||||
mater.material_name,
|
||||
mater.material_model,
|
||||
chan.change_id,
|
||||
chan.cf_qty,
|
||||
chan.yz_qty,
|
||||
chan.cx_qty,
|
||||
chan.yc_qty,
|
||||
chan.jy_qty,
|
||||
chan.lt_qty,
|
||||
chan.sj_qty,
|
||||
chan.ys_qty,
|
||||
chan.ds_qty,
|
||||
chan.cqx_qty,
|
||||
chan.xqx_qty,
|
||||
chan.qx_qty,
|
||||
chan.jcf_qty,
|
||||
chan.tb_qty,
|
||||
chan.ycr_qty,
|
||||
chan.gz_qty,
|
||||
chan.alldata,
|
||||
chan.create_id,
|
||||
chan.create_name,
|
||||
chan.create_time
|
||||
|
||||
Binary file not shown.
@@ -4739,14 +4739,17 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
String[] strs = mater_code.split("-");
|
||||
|
||||
String brf = strs[strs.length-1];
|
||||
|
||||
String now_qty = WasteBallTime.getString( brf.toLowerCase()+"_qty");
|
||||
if (StrUtil.isNotEmpty(now_qty)) {
|
||||
double now = Double.valueOf(now_qty);
|
||||
if(now != 99){
|
||||
doubles.add(Double.valueOf(now_qty));
|
||||
JSONObject alldata = WasteBallTime.getJSONObject("alldata");
|
||||
if (ObjectUtil.isEmpty(alldata)){
|
||||
String now_qty = alldata.getString( brf.toUpperCase(Locale.ROOT));
|
||||
if (StrUtil.isNotEmpty(now_qty)) {
|
||||
double now = Double.valueOf(now_qty);
|
||||
if(now != 99){
|
||||
doubles.add(Double.valueOf(now_qty));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user