rev:合同台账修改
This commit is contained in:
@@ -423,7 +423,7 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
// 未到货重量
|
||||
erp.put("qty_zt", erp.getString("qty_zt"));
|
||||
// 处理状态: 合同未到货重量 = 0则为【完成】; 合同未到货重量 = 合同重量则为【生成】;否则为【采购中】
|
||||
if (erp.getString("qty_zt").equals("0")) {
|
||||
if (erp.getDoubleValue("qty_zt") == 0) {
|
||||
erp.put("proc_status","完成");
|
||||
} else if (erp.getDoubleValue("qty_zt") == erp.getDoubleValue("qty_ht")) {
|
||||
erp.put("proc_status","生成");
|
||||
@@ -454,6 +454,14 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
// 合计金额:合计重量 * 含税单价
|
||||
erp.put("allqty", allqty);
|
||||
erp.put("all_valmoney", NumberUtil.mul(allqty, erp.getDoubleValue("norigtaxprice")));
|
||||
// 备注:取随机一条采购订单备注
|
||||
JSONObject jsonProc = procList.stream()
|
||||
.filter(row -> row.getString("contract_no").equals(erp.getString("vbillcode"))
|
||||
&& row.getString("item_id").equals(erp.getString("item_id"))
|
||||
)
|
||||
.findFirst().orElse(null);
|
||||
erp.put("remark", ObjectUtil.isNotEmpty(jsonProc) ? jsonProc.getString("remark") : "");
|
||||
|
||||
resultList.add(erp);
|
||||
}
|
||||
|
||||
@@ -553,9 +561,17 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
@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);
|
||||
// 查询是否有采购订单
|
||||
JSONArray resultJSONArray = tab.query("contract_no = '" + whereJson.getString("contract_no") + "' and item_id = '" + whereJson.getString("item_id") + "'")
|
||||
.getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(resultJSONArray)) {
|
||||
throw new BadRequestException("当前合同没有采购订单不可备注!");
|
||||
}
|
||||
|
||||
// 根据合同号 和 物料ID 查询修改对应的数据
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("remark", whereJson.getString("remark1"));
|
||||
tab.update(param,"contract_no = '"+whereJson.getString("contract_no")+"' and item_id = '"+whereJson.getString("item_id")+"'");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -628,7 +644,7 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
// 未到货重量
|
||||
erp.put("qty_zt", erp.getString("qty_zt"));
|
||||
// 处理状态: 合同未到货重量 = 0则为【完成】; 合同未到货重量 = 合同重量则为【生成】;否则为【采购中】
|
||||
if (erp.getString("qty_zt").equals("0")) {
|
||||
if (erp.getDoubleValue("qty_zt") == 0) {
|
||||
erp.put("proc_status","完成");
|
||||
} else if (erp.getDoubleValue("qty_zt") == erp.getDoubleValue("qty_ht")) {
|
||||
erp.put("proc_status","生成");
|
||||
@@ -659,6 +675,13 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
// 合计金额:合计重量 * 含税单价
|
||||
erp.put("allqty", allqty);
|
||||
erp.put("all_valmoney", NumberUtil.mul(allqty, erp.getDoubleValue("norigtaxprice")));
|
||||
// 备注:取随机一条采购订单备注
|
||||
JSONObject jsonProc = procList.stream()
|
||||
.filter(row -> row.getString("contract_no").equals(erp.getString("vbillcode"))
|
||||
&& row.getString("item_id").equals(erp.getString("item_id"))
|
||||
)
|
||||
.findFirst().orElse(null);
|
||||
erp.put("remark", ObjectUtil.isNotEmpty(jsonProc) ? jsonProc.getString("remark") : "");
|
||||
resultList.add(erp);
|
||||
}
|
||||
|
||||
@@ -695,6 +718,7 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
|
||||
dtl_map.put("账龄", jo.getString("honour_days"));
|
||||
dtl_map.put("合计重量", NumberUtil.round(jo.getDoubleValue("allqty"), 3));
|
||||
dtl_map.put("合计金额", NumberUtil.round(jo.getDoubleValue("all_valmoney"), 3));
|
||||
dtl_map.put("内容", jo.getString("remark"));
|
||||
list.add(dtl_map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
|
||||
Reference in New Issue
Block a user