add:新增预排量维护功能 rev:粉料到货需求--加入预排量、待检入库量弹出页面加到货时间、明细加所属组织
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
|
||||
package org.nl.wms.basedata.pdm.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.annotation.Log;
|
||||
import org.nl.wms.basedata.pdm.service.SpendRowQtyService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 预排量维护前端控制器
|
||||
* @author lxy
|
||||
* @date 2023-12-12
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "预排量维护")
|
||||
@RequestMapping("/api/spendRowQty")
|
||||
@Slf4j
|
||||
public class SpendRowQtyController {
|
||||
|
||||
private final SpendRowQtyService spendRowQtyService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询预排量")
|
||||
@ApiOperation("查询预排量")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(spendRowQtyService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增预排量")
|
||||
@ApiOperation("新增预排量")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody JSONObject dto) {
|
||||
spendRowQtyService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改预排量")
|
||||
@ApiOperation("修改预排量")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto) {
|
||||
spendRowQtyService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除预排量")
|
||||
@ApiOperation("删除预排量")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
spendRowQtyService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getMaterialList")
|
||||
@Log("获取指定物料")
|
||||
@ApiOperation("获取指定物料")
|
||||
public ResponseEntity<Object> getMaterialList() {
|
||||
return new ResponseEntity<>(spendRowQtyService.getMaterialList(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getSuppList")
|
||||
@Log("获取供应商")
|
||||
@ApiOperation("获取供应商")
|
||||
public ResponseEntity<Object> getSuppList() {
|
||||
return new ResponseEntity<>(spendRowQtyService.getSuppList(),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
|
||||
package org.nl.wms.basedata.pdm.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 服务接口
|
||||
* @author lxy
|
||||
* @date 2023-12-12
|
||||
*/
|
||||
public interface SpendRowQtyService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param spend_id ID
|
||||
* @return Customerbase
|
||||
*/
|
||||
JSONObject findById(Long spend_id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(JSONObject dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(JSONObject dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取指定物料
|
||||
* @return JSONArray /
|
||||
*/
|
||||
JSONArray getMaterialList();
|
||||
|
||||
/**
|
||||
* 获取供应商
|
||||
* @return JSONArray /
|
||||
*/
|
||||
JSONArray getSuppList();
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
|
||||
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.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.exception.BadRequestException;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.basedata.pdm.service.SpendRowQtyService;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @author lxy
|
||||
* @description 服务实现
|
||||
* @date 2023-12-12
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class SpendRowQtyServiceImpl implements SpendRowQtyService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
|
||||
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||
String supp_code = MapUtil.getStr(whereJson, "supp_code");
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("flag", "1");
|
||||
if (ObjectUtil.isNotEmpty(material_code)) {
|
||||
param.put("material_code","%"+material_code+"%");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(supp_code)) {
|
||||
param.put("supp_code","%"+supp_code+"%");
|
||||
}
|
||||
|
||||
JSONObject jsonObject = WQL.getWO("PDM_SPENDROWQTY").addParamMap(param).pageQuery(WqlUtil.getHttpContext(page), "spend.create_time DESC");
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject findById(Long spend_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_spendrowqty");
|
||||
JSONObject json = wo.query("spend_id =" + spend_id + "").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(json)) return null;
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(JSONObject json) {
|
||||
WQLObject spendTab = WQLObject.getWQLObject("pdm_bi_spendrowqty");
|
||||
// 校验此物料供应商是否存在相同的数据、
|
||||
JSONObject jsonObject = spendTab.query("material_id = '" + json.getString("material_id") + "' and supp_id = '" + json.getString("supp_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) {
|
||||
throw new BadRequestException("此物料、供应商的数据已存在!");
|
||||
}
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("spend_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
param.put("material_id", json.getString("material_id"));
|
||||
param.put("supp_id", json.getString("supp_id"));
|
||||
param.put("qty", json.getDoubleValue("qty"));
|
||||
param.put("remark", json.getString("remark"));
|
||||
param.put("create_id", currentUserId);
|
||||
param.put("create_name", nickName);
|
||||
param.put("create_time", now);
|
||||
|
||||
spendTab.insert(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(JSONObject json) {
|
||||
WQLObject spendTab = WQLObject.getWQLObject("pdm_bi_spendrowqty");
|
||||
|
||||
JSONObject param = this.findById(json.getLongValue("spend_id"));
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
param.put("material_id", json.getString("material_id"));
|
||||
param.put("supp_id", json.getString("supp_id"));
|
||||
param.put("qty", json.getDoubleValue("qty"));
|
||||
param.put("remark", json.getString("remark"));
|
||||
param.put("update_id", currentUserId);
|
||||
param.put("update_name", nickName);
|
||||
param.put("update_time", now);
|
||||
spendTab.update(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_spendrowqty");
|
||||
for (Long spend_id : ids) {
|
||||
wo.delete("spend_id = '"+spend_id+"'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getMaterialList() {
|
||||
return WQL.getWO("statistical_report_query_01").addParam("flag", "3").process().getResultJSONArray(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getSuppList() {
|
||||
return WQL.getWO("PDM_SPENDROWQTY").addParam("flag", "2").process().getResultJSONArray(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
[交易说明]
|
||||
交易名: 预排量维护分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.material_code TYPEAS s_string
|
||||
输入.supp_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
spend.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
supp.supp_code,
|
||||
supp.supp_name
|
||||
FROM
|
||||
pdm_bi_spendrowqty spend
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = spend.material_id
|
||||
LEFT JOIN md_cs_supplierbase supp ON supp.supp_id = spend.supp_id
|
||||
WHERE
|
||||
1 = 1
|
||||
|
||||
OPTION 输入.material_code <> ""
|
||||
(mater.material_code like 输入.material_code or
|
||||
mater.material_name like 输入.material_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.supp_code <> ""
|
||||
(supp.supp_code like 输入.supp_code or
|
||||
supp.supp_name like 输入.supp_code)
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
md_cs_supplierbase
|
||||
WHERE
|
||||
is_delete = '0'
|
||||
AND is_used = '1'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
Binary file not shown.
@@ -231,22 +231,31 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
rows.add(jo1);
|
||||
JSONObject jo22 = new JSONObject();
|
||||
jo22.put("first", "已开单重量");
|
||||
rows.add(jo22);
|
||||
// rows.add(jo22);
|
||||
JSONObject jo2 = new JSONObject();
|
||||
jo2.put("first", "排产需求量");
|
||||
rows.add(jo2);
|
||||
JSONObject jo3 = new JSONObject();
|
||||
jo3.put("first", "库/需差额量");
|
||||
rows.add(jo3);
|
||||
JSONObject jo4 = new JSONObject();
|
||||
jo4.put("first", "待检入库量");
|
||||
rows.add(jo4);
|
||||
JSONObject jo5 = new JSONObject();
|
||||
jo5.put("first", "覆盖日期");
|
||||
rows.add(jo5);
|
||||
JSONObject jo4 = new JSONObject();
|
||||
jo4.put("first", "待检入库量");
|
||||
rows.add(jo4);
|
||||
JSONObject jo10 = new JSONObject();
|
||||
jo10.put("first", "覆盖日期(含待检)");
|
||||
rows.add(jo10);
|
||||
JSONObject jo11 = new JSONObject();
|
||||
jo11.put("first", "后续需求量");
|
||||
rows.add(jo11);
|
||||
JSONObject jo6 = new JSONObject();
|
||||
jo6.put("first", "合同在途");
|
||||
rows.add(jo6);
|
||||
JSONObject jo12 = new JSONObject();
|
||||
jo12.put("first", "预排量");
|
||||
rows.add(jo12);
|
||||
JSONObject jo7 = new JSONObject();
|
||||
jo7.put("first", "最低储备定额");
|
||||
rows.add(jo7);
|
||||
@@ -288,6 +297,34 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
JSONArray noinJoArray = WQL.getWO("statistical_report_query_01").addParam("flag", "77").process().getResultJSONArray(0);
|
||||
Map<String, List<Object>> noinJoMap = noinJoArray.stream().collect(Collectors.groupingBy(a -> ((JSONObject)a).getString("material_id")));
|
||||
|
||||
// 待检入库量+库存物料数量
|
||||
JSONArray ivtNoinArry = new JSONArray();
|
||||
|
||||
List<JSONObject> collectNoin = noinJoArray.stream()
|
||||
.map(row -> JSON.parseObject(JSON.toJSONString(row)))
|
||||
.map(row -> {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("qty", row.getDoubleValue("noin_qty"));
|
||||
json.put("material_id", row.getString("material_id"));
|
||||
return json;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
ivtNoinArry.addAll(materQryArray);
|
||||
ivtNoinArry.addAll(collectNoin);
|
||||
|
||||
Map<String, List<JSONObject>> noSumMap = ivtNoinArry.stream()
|
||||
.map(row -> JSON.parseObject(JSON.toJSONString(row)))
|
||||
.collect(Collectors.groupingBy(row -> row.getString("material_id")));
|
||||
|
||||
Map<String, Double> ivtNoinMap = noSumMap.entrySet().stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
row -> row.getValue().stream()
|
||||
.map(item -> item.getDoubleValue("qty"))
|
||||
.reduce(Double::sum).orElse(0.00)
|
||||
));
|
||||
|
||||
//查询物料计划日期内的需求量
|
||||
JSONArray DataPlanQtyArray = WQL.getWO("statistical_report_query_01").addParam("flag", "10")
|
||||
.addParam("begin_time", begin_time)
|
||||
@@ -297,6 +334,10 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
.process().getResultJSONArray(0);
|
||||
Map<String, List<Object>> datePlanMap = DataPlanQtyArray.stream().collect(Collectors.groupingBy(a -> ((JSONObject)a).getString("material_id")));
|
||||
|
||||
// 汇总所有预排量
|
||||
List<JSONObject> spendList = WQL.getWO("statistical_report_query_01").addParam("flag", "12")
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
for (int i = 0; i < mater_rows.size(); i++) {
|
||||
JSONObject mater = mater_rows.getJSONObject(i);
|
||||
String material_id = mater.getString("material_id");
|
||||
@@ -316,7 +357,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
|
||||
double canuse_num = now_ivt;
|
||||
//已开单重量
|
||||
jo22.put(material_id, String.format("%.2f", need_qty));
|
||||
// jo22.put(material_id, String.format("%.2f", need_qty));
|
||||
//2、排产需求量(未开工的工令重量+排产未生成工令日计划重量)根据bom计算需要多少原料库存重量:
|
||||
double bom_qty = 0;
|
||||
List<Object> needMaterInfo = needMaterMap.get(material_id);
|
||||
@@ -347,19 +388,16 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "4");
|
||||
map.put("ext_id", jsonMater.getString("ext_id"));
|
||||
//JSONObject num_jo = null;
|
||||
JSONObject num_jo = WQL.getWO("QL_ERP").addParamMap(map).setDbname("dataSource1").process().uniqueResult(0);
|
||||
|
||||
|
||||
// JSONObject num_jo = WQL.getWO("QL_ERP").addParamMap(map).setDbname("dataSource1").process().uniqueResult(0);
|
||||
|
||||
//合同在途
|
||||
double notqty = 0;
|
||||
if (ObjectUtil.isNotEmpty(num_jo)) {
|
||||
/*if (ObjectUtil.isNotEmpty(num_jo)) {
|
||||
notqty = num_jo.getDoubleValue("notqty");
|
||||
if (notqty < 0) {
|
||||
notqty = 0;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
jo6.put(material_id, String.format("%.2f", notqty));
|
||||
|
||||
//5、库/需差额量 :库存现存量-排产需求量
|
||||
@@ -406,6 +444,49 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 覆盖日期(含待检)
|
||||
double ivtNoinSum = ObjectUtil.isEmpty(ivtNoinMap.get(material_id)) ? 0 : ivtNoinMap.get(material_id);
|
||||
if (ivtNoinSum < 0 ) {
|
||||
jo10.put(material_id, DateUtil.offsetDay(date1, -1).toString().substring(0, 10));
|
||||
} else {
|
||||
List<Object> materDataPlanQty = datePlanMap.get(material_id);
|
||||
double needWeight;
|
||||
jo10.put(material_id, end_time.substring(0, 10));
|
||||
if (ObjectUtil.isNotEmpty(materDataPlanQty)){
|
||||
for (Object todayQty : materDataPlanQty) {
|
||||
JSONObject jsonQty = (JSONObject) todayQty;
|
||||
needWeight = jsonQty.getDoubleValue("qty");
|
||||
Date currentDate = ((JSONObject) todayQty).getDate("currentdate");
|
||||
if (ivtNoinSum < needWeight) {
|
||||
jo10.put(material_id, DateUtil.offsetDay(currentDate, -1).toString().substring(0, 10));
|
||||
break;
|
||||
} else {
|
||||
ivtNoinSum -= needWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 后续需求(覆盖日期(含待检)之后10天的排产需求量之和)
|
||||
String endDate = DateUtil.offsetDay(jo10.getDate(material_id), 10).toString().substring(0, 10);
|
||||
|
||||
JSONObject backNeed = WQL.getWO("statistical_report_query_01").addParam("flag", "6")
|
||||
.addParam("begin_date", jo10.getString(material_id))
|
||||
.addParam("end_date", endDate)
|
||||
.addParam("org_ids", org_ids_new)
|
||||
.addParam("material_id", material_id)
|
||||
.process().uniqueResult(0);
|
||||
|
||||
jo11.put(material_id, ObjectUtil.isEmpty(backNeed) ? "0.00" : String.format("%.2f",backNeed.getDoubleValue("qty")));
|
||||
|
||||
// 预排量
|
||||
List<JSONObject> spendList2 = spendList.stream()
|
||||
.filter(row -> row.getString("material_id").equals(material_id))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
jo12.put(material_id, ObjectUtil.isNotEmpty(spendList2) ? String.format("%.2f", spendList2.get(0).getDoubleValue("qty")) : "0.00");
|
||||
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("content", rows);
|
||||
@@ -455,6 +536,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
throw new BadRequestException("未查询到该产品 " + material_code + " 对应BOM信息");
|
||||
}
|
||||
row.put("1", row.getString("planstart_date"));
|
||||
row.put("4", row.getString("name"));
|
||||
row.put("2", row.getString("old_mark"));
|
||||
row.put("3", row.getString("product_num"));
|
||||
//查询该物料对应的bom明细
|
||||
@@ -498,6 +580,10 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
jsonResuft1.put("prop", "1");
|
||||
jsonResuft1.put("label", "日期");
|
||||
jsonResuft1.put("option", true);
|
||||
JSONObject jsonResuft5 = new JSONObject();
|
||||
jsonResuft5.put("prop", "4");
|
||||
jsonResuft5.put("label", "所属组织");
|
||||
jsonResuft5.put("option", true);
|
||||
JSONObject jsonResuft2 = new JSONObject();
|
||||
jsonResuft2.put("prop", "2");
|
||||
jsonResuft2.put("label", "牌号");
|
||||
@@ -507,6 +593,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
jsonResuft3.put("label", "批数");
|
||||
jsonResuft3.put("option", true);
|
||||
jonsResuftArr.add(jsonResuft1);
|
||||
jonsResuftArr.add(jsonResuft5);
|
||||
jonsResuftArr.add(jsonResuft2);
|
||||
jonsResuftArr.add(jsonResuft3);
|
||||
for (int i = 0; i < jsonArr.size(); i++) {
|
||||
|
||||
@@ -638,7 +638,8 @@
|
||||
ext.old_mark,
|
||||
plan.product_weight,
|
||||
plan.material_id,
|
||||
materialbase.material_code
|
||||
materialbase.material_code,
|
||||
dept.name
|
||||
FROM
|
||||
mps_bd_productdailyplan plan
|
||||
LEFT JOIN md_me_producmaterialext ext ON ext.material_id = plan.material_id
|
||||
@@ -663,11 +664,13 @@
|
||||
MAX(ext.old_mark) AS old_mark,
|
||||
SUM(wo.workorder_qty) AS product_weight,
|
||||
wo.material_id,
|
||||
MAX(mb.material_code) AS material_code
|
||||
MAX(mb.material_code) AS material_code,
|
||||
MAX(dept.name) AS name
|
||||
FROM
|
||||
pdm_bi_workorder wo
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = wo.material_id
|
||||
LEFT JOIN md_me_producmaterialext ext ON ext.material_id = wo.material_id
|
||||
LEFT JOIN sys_dept dept ON dept.dept_id = wo.org_id
|
||||
WHERE
|
||||
wo.`status` < 50
|
||||
AND
|
||||
@@ -787,5 +790,19 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "12"
|
||||
QUERY
|
||||
SELECT
|
||||
material_id,
|
||||
SUM(qty) AS qty
|
||||
FROM
|
||||
pdm_bi_spendrowqty
|
||||
|
||||
group by material_id
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,8 @@
|
||||
dtl.pcsn,
|
||||
dtl.receive_code,
|
||||
dtl.material_id,
|
||||
mst.source_name
|
||||
mst.source_name,
|
||||
mst.receive_date
|
||||
FROM
|
||||
PCS_RC_ReceiveDtl dtl
|
||||
inner JOIN pcs_rc_receivemst mst ON mst.receive_id = dtl.receive_id
|
||||
|
||||
Reference in New Issue
Block a user