rev:1.合同台账修改 2.混合料质检喷雾工序加质检抽样标签打印
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
输入.cmaterialvid TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.return_code TYPEAS s_string
|
||||
输入.no_ids TYPEAS f_string
|
||||
|
||||
|
||||
|
||||
@@ -178,6 +179,21 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "8"
|
||||
QUERY
|
||||
SELECT
|
||||
pp.*
|
||||
FROM
|
||||
PURCHASE_CONTRACT_VIEW pp
|
||||
WHERE
|
||||
1=1
|
||||
OPTION 输入.no_ids <> ""
|
||||
pp.VBILLCODE in 输入.no_ids
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +108,14 @@ public class PcsIfPurchaseorderprocController {
|
||||
return new ResponseEntity<>(pcsIfPurchaseorderprocService.ledgerQuery(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveRemark")
|
||||
@Log("修改备注")
|
||||
@ApiOperation("修改备注")
|
||||
public ResponseEntity<Object> saveRemark(@RequestBody JSONObject whereJson){
|
||||
pcsIfPurchaseorderprocService.saveRemark(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/receiveQuery")
|
||||
@Log("到货通知单查询")
|
||||
@ApiOperation("到货通知单查询")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.wms.pcs.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pcs.service.dto.PcsIfPurchaseorderprocDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -91,4 +92,10 @@ public interface PcsIfPurchaseorderprocService {
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> receiveQuery(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 修改备注
|
||||
* @param whereJson /
|
||||
*/
|
||||
void saveRemark(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
@@ -188,7 +189,7 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
public Map<String, Object> ledgerQuery(Map whereJson, Pageable page) {
|
||||
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("flag", "11");
|
||||
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
||||
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
||||
if (!ObjectUtil.isEmpty(material_code)) {
|
||||
@@ -202,28 +203,29 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
if (!ObjectUtil.isEmpty(vbillcode)) {
|
||||
map.put("vbillcode", "%" + vbillcode + "%");
|
||||
}
|
||||
JSONObject json = WQL.getWO("QPCS_IF_PURCHASEORDERPROC02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "remst.input_time desc");
|
||||
JSONArray jsonArray = json.getJSONArray("content");
|
||||
JSONArray content = new JSONArray();
|
||||
// 处理延迟天数: 最后一次到货时间 - 合同要求履约时间
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
// 如果未到货重量小于0 put0
|
||||
double notqty = jsonObject.getDoubleValue("notqty");
|
||||
if (notqty < 0) {
|
||||
jsonObject.put("notqty", "0");
|
||||
}
|
||||
String input_time = jsonObject.getString("input_time");
|
||||
String honor_time = jsonObject.getString("honor_time");
|
||||
if (ObjectUtil.isNotEmpty(input_time) && ObjectUtil.isNotEmpty(honor_time)) {
|
||||
String suInput_time = input_time.substring(0, 10);
|
||||
String suHonor_time = honor_time.substring(0, 10);
|
||||
long delayDay = getDaySize(suHonor_time, suInput_time);
|
||||
jsonObject.put("delayDay", delayDay + "");
|
||||
}
|
||||
content.add(jsonObject);
|
||||
JSONObject json = WQL.getWO("QPCS_IF_PURCHASEORDERPROC02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "oder.VBILLCODE");
|
||||
|
||||
List<JSONObject> content = json.getJSONArray("content").toJavaList(JSONObject.class);
|
||||
|
||||
String no_ids = content.stream()
|
||||
.filter(row -> ObjectUtil.isNotEmpty(row.getString("contract_no")))
|
||||
.map(row -> row.getString("contract_no"))
|
||||
.collect(Collectors.joining("','"));
|
||||
|
||||
// 查询erp视图
|
||||
List<JSONObject> ja = WQL.getWO("QERP").setDbname("dataSource1").addParam("flag", "8").addParam("no_ids", "('"+no_ids+"')").process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
JSONObject jsonObject = content.get(i);
|
||||
|
||||
List<JSONObject> collect = ja.stream()
|
||||
.filter(row -> row.getString("vbillcode").equals(jsonObject.getString("contract_no"))
|
||||
&& row.getString("material_code").equals("item_code"))
|
||||
.collect(Collectors.toList());
|
||||
jsonObject.put("subscribedate", ObjectUtil.isNotEmpty(collect) ? collect.get(0).getString("subscribedate") : "");
|
||||
}
|
||||
json.put("content", content);
|
||||
|
||||
json.put("content",content);
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -234,6 +236,14 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveRemark(JSONObject whereJson) {
|
||||
WQLObject tab = WQLObject.getWQLObject("PCS_IF_PurchaseOrderProc");
|
||||
JSONObject jsonObject = tab.query("id = '" + whereJson.getString("id") + "'").uniqueResult(0);
|
||||
jsonObject.put("remark", whereJson.getString("remark"));
|
||||
tab.update(jsonObject);
|
||||
}
|
||||
|
||||
public static long getDaySize(String start_datetime, String end_datetime) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date();
|
||||
|
||||
@@ -123,6 +123,75 @@
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "11"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
oder.id,
|
||||
oder.contract_no,
|
||||
supp.supp_name,
|
||||
mater.material_name,
|
||||
mater.material_code,
|
||||
oder.PRICE_TAX,
|
||||
oder.QTY,
|
||||
oder.QTY * oder.PRICE_TAX AS money,
|
||||
oder.QTY - redtl.allqty AS notqty,
|
||||
supp.honour_days,
|
||||
LEFT(remst.input_time,10) as input_time,
|
||||
dtl.receive_qty,
|
||||
dtl.receive_qty * oder.PRICE_TAX AS valmoney,
|
||||
DATE_ADD(LEFT(remst.input_time,10),INTERVAL supp.honour_days DAY) AS plan_date,
|
||||
redtl.allqty,
|
||||
redtl.allqty * oder.PRICE_TAX AS all_valmoney,
|
||||
oder.remark
|
||||
FROM
|
||||
PCS_IF_PurchaseOrderProc oder
|
||||
LEFT JOIN PCS_RC_ReceiveDtl dtl ON dtl.source_billdtl_id = oder.id AND dtl.source_bill_code = oder.vbillcode
|
||||
LEFT JOIN md_cs_supplierbase supp ON oder.VEND_ID = supp.ext_id
|
||||
LEFT JOIN md_me_materialbase mater ON oder.ITEM_ID = mater.ext_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sum( a.receive_qty ) AS allqty,
|
||||
max(a.source_billdtl_id) AS source_billdtl_id,
|
||||
max( a.material_id ) AS material_id,
|
||||
max( a.pcsn ) AS pcsn,
|
||||
max( a.receive_id ) AS receive_id
|
||||
FROM
|
||||
PCS_RC_ReceiveDtl a
|
||||
LEFT JOIN PCS_IF_PurchaseOrderProc p ON a.source_billdtl_id = p.id AND a.source_bill_code = p.vbillcode
|
||||
GROUP BY
|
||||
a.source_billdtl_id
|
||||
)
|
||||
AS redtl ON redtl.source_billdtl_id = dtl.source_billdtl_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
p.input_time,p.receive_id,p.is_delete
|
||||
FROM
|
||||
PCS_RC_ReceiveMst p WHERE p.is_delete = '0' ORDER BY p.input_time desc LIMIT 1
|
||||
) AS remst ON remst.receive_id = dtl.receive_id
|
||||
WHERE
|
||||
oder.dr = '0'
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
oder.CREATE_DATE >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
oder.CREATE_DATE <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vbillcode <> ""
|
||||
oder.vbillcode like 输入.vbillcode
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.material_code <> ""
|
||||
(mater.material_code like 输入.material_code or
|
||||
mater.material_name like 输入.material_code )
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
|
||||
Binary file not shown.
@@ -101,6 +101,14 @@ public class WorkOrderController {
|
||||
public ResponseEntity<Object> getDepts(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(workOrdereService.getDepts(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("获取数据")
|
||||
@ApiOperation("获取数据")
|
||||
@PostMapping("/getInfo")
|
||||
public ResponseEntity<Object> getInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(workOrdereService.getInfo(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
|
||||
@@ -77,4 +77,11 @@ public interface WorkOrdereService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
void download(Map whereJson, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject getInfo(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -888,7 +888,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
@Override
|
||||
public JSONArray getDepts(Map json) {
|
||||
HashMap<String, String> map = new HashMap<>(json);
|
||||
map.put("flag", "14");
|
||||
map.put("flag", "14");
|
||||
JSONArray ret = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).process().getResultJSONArray(0);
|
||||
return ret;
|
||||
}
|
||||
@@ -1009,4 +1009,11 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getInfo(JSONObject whereJson) {
|
||||
whereJson.put("print_name", SecurityUtils.getNickName());
|
||||
whereJson.put("print_date", DateUtil.today());
|
||||
return whereJson;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user