Commit 02fe9ad0 by liuyang

2024-10-08 委外出库单

parent 8a017efa
......@@ -76,7 +76,11 @@ public class ServiceHGKC014B extends ServiceEPBase {
//List<String> contractCodes = ObjectUtils.listKey(resultMaps, HGKC014A.FIELD_CONTRACT_CODE);
List<HGKC014A> hgkc014AList = HGKCTools.HgKc014a.getByParentId((Arrays.asList(Long.parseLong(paramMap.get("parentId").toString()))));
for (Map resultMap: resultMaps) {
DaoUtils.update(HGSC010A.UPDATE, resultMap);
HGSC010A hgsc010a = new HGSC010A();
hgsc010a.fromMap(resultMap);
hgsc010a.setRemainingQty(hgsc010a.getRemainingQty().subtract(hgsc010a.getDepositQty()));
hgsc010a.setRemainingWeight(hgsc010a.getRemainingWeight().subtract(hgsc010a.getDepositWeight()));
DaoUtils.update(HGSC010A.UPDATE, hgsc010a);
HGKC014A hgkc014a = new HGKC014A();
hgkc014a.fromMap(resultMap);
List<HGKC014A> hgkc014As = new ArrayList<>();
......
......@@ -72,7 +72,11 @@ public class ServiceHGKC015B extends ServiceEPBase {
//List<String> contractCodes = ObjectUtils.listKey(resultMaps, HGKC014A.FIELD_CONTRACT_CODE);
List<HGKC015A> hgkc015AList = HGKCTools.HgKc015a.getByParentId((Arrays.asList(Long.parseLong(paramMap.get("parentId").toString()))));
for (Map resultMap: resultMaps) {
DaoUtils.update(HGSC010B.UPDATE, resultMap);
HGSC010B hgsc010B = new HGSC010B();
hgsc010B.fromMap(resultMap);
hgsc010B.setRemainingQty(hgsc010B.getRemainingQty().subtract(hgsc010B.getOutQty()));
hgsc010B.setRemainingWeight(hgsc010B.getRemainingWeight().subtract(hgsc010B.getOutWeight()));
DaoUtils.update(HGSC010B.UPDATE, hgsc010B);
HGKC015A hgkc015a = new HGKC015A();
hgkc015a.fromMap(resultMap);
List<HGKC015A> hgkc015As = new ArrayList<>();
......
......@@ -81,8 +81,8 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentIds">
PARENT_ID IN <iterate close=")" open="(" conjunction="," property="parentIds">#parentIds[]#</iterate>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
......
......@@ -81,8 +81,8 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentIds">
PARENT_ID IN <iterate close=")" open="(" conjunction="," property="parentIds">#parentIds[]#</iterate>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
......
......@@ -1200,12 +1200,12 @@ public class HGKCTools {
public static class HgKc014 {
public static List<HGKC014> getByParentId(List<Long> parentIds) {
if (Objects.isNull(parentIds)){
public static List<HGKC014> getByParentId(List<Long> ids) {
if (Objects.isNull(ids)){
return new ArrayList<>();
}
Map<String, Object> paramMap = new HashMap();
paramMap.put("parentIds", parentIds);
paramMap.put("ids", ids);
paramMap.put("deleteFlag", 0);
List<HGKC014> list = DaoBase.getInstance().query(HGKC014.QUERY, paramMap);
return CollectionUtils.isEmpty(list)? null : list;
......@@ -1263,7 +1263,7 @@ public class HGKCTools {
return new ArrayList<>();
}
Map<String, Object> paramMap = new HashMap();
paramMap.put("parentIds", parentIds);
paramMap.put("ids", parentIds);
paramMap.put("deleteFlag", 0);
List<HGKC015> list = DaoBase.getInstance().query(HGKC015.QUERY, paramMap);
return CollectionUtils.isEmpty(list)? null : list;
......
......@@ -131,22 +131,33 @@ function selectFunc() {
message("请选择一条委外入库单");
return;
}
JSColorbox.open({
href: "HGKC014B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + rows[0].companyCode +
"&inqu_status-0-companyName=" + rows[0].companyName +
"&inqu_status-0-whCode=" + rows[0].whCode +
"&inqu_status-0-whName=" + rows[0].whName +
"&inqu_status-0-depositCode=" + rows[0].depositCode +
"&inqu_status-0-parentId=" + rows[0].id ,
title: "<div style='text-align: center;'>委外入库详情</div>",
width: "90%",
height: "80%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
let flag = true;
rows.forEach(function (item,index){
if (item.status == '1'){
message("选中的第" + (index + 1) + "行\"状态\"\"已提交\",不能进行操作!");
flag = false;
return;
}
});
})
if (flag){
JSColorbox.open({
href: "HGKC014B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + rows[0].companyCode +
"&inqu_status-0-companyName=" + rows[0].companyName +
"&inqu_status-0-whCode=" + rows[0].whCode +
"&inqu_status-0-whName=" + rows[0].whName +
"&inqu_status-0-depositCode=" + rows[0].depositCode +
"&inqu_status-0-parentId=" + rows[0].id ,
title: "<div style='text-align: center;'>委外入库详情</div>",
width: "90%",
height: "80%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
}
});
}
}
let save = function (btnNode) {
......@@ -217,5 +228,3 @@ function updateStatus() {
});
}
}
......@@ -26,8 +26,8 @@ $(function () {
remainingQty = remainingQty - depositQty;
resultGrid.setCellValue(e.items[0],"depositUnitWeight",remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"depositWeight",depositQty * remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"remainingQty",remainingQty);
resultGrid.setCellValue(e.items[0],"remainingWeight",remainingQty * remainingUnitWeight);
//resultGrid.setCellValue(e.items[0],"remainingQty",remainingQty);
//resultGrid.setCellValue(e.items[0],"remainingWeight",remainingQty * remainingUnitWeight);
}else if (e.field == "depositWeight"){
let depositWeight = e.items[0]['depositWeight'];
let remainingWeight = e.items[0]['remainingWeight'];
......@@ -38,9 +38,9 @@ $(function () {
}
remainingWeight = remainingWeight - depositWeight;
resultGrid.setCellValue(e.items[0],"depositUnitWeight",remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"depositQty",depositWeight / remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"remainingQty",remainingWeight / remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"remainingWeight",remainingWeight);
resultGrid.setCellValue(e.items[0],"depositQty",(depositWeight / remainingUnitWeight).toFixed(0));
//resultGrid.setCellValue(e.items[0],"remainingQty",remainingWeight / remainingUnitWeight);
//resultGrid.setCellValue(e.items[0],"remainingWeight",remainingWeight);
}
});
......@@ -106,6 +106,7 @@ let saveResult = function () {
$.each(rows, function (index, item) {
let depositQty = item.get("depositQty");
let depositWeight = item.get("depositWeight");
let remainingQty = item.get("remainingQty");
if (isBlank(depositQty) || !isNumber(depositQty) || depositQty <= 0) {
message("选中的第" + (index + 1) + "行\"入库数量\",不能为空并且不能为0!");
flag = false;
......@@ -116,6 +117,11 @@ let saveResult = function () {
flag = false;
return false;
}
if (depositQty > remainingQty) {
message("选中的第" + (index + 1) + "行\"入库数量\",不能大于\"剩余数量\"!");
flag = false;
return false;
}
});
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %><%--
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/9/30
......@@ -6,6 +6,7 @@
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
......
......@@ -138,22 +138,32 @@ function selectFunc() {
message("请选择一条委外入库单");
return;
}
JSColorbox.open({
href: "HGKC015B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + rows[0].companyCode +
"&inqu_status-0-companyName=" + rows[0].companyName +
"&inqu_status-0-whCode=" + rows[0].whCode +
"&inqu_status-0-whName=" + rows[0].whName +
"&inqu_status-0-outCode=" + rows[0].outCode +
"&inqu_status-0-parentId=" + rows[0].id ,
title: "<div style='text-align: center;'>委外出库详情</div>",
width: "90%",
height: "80%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
let flag = true;
rows.forEach(function (item,index){
if (item.status == '1'){
message("选中的第" + (index + 1) + "行\"状态\"\"已提交\",不能进行操作!");
flag = false;
return;
}
});
})
if (flag){
JSColorbox.open({
href: "HGKC015B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + rows[0].companyCode +
"&inqu_status-0-companyName=" + rows[0].companyName +
"&inqu_status-0-whCode=" + rows[0].whCode +
"&inqu_status-0-whName=" + rows[0].whName +
"&inqu_status-0-outCode=" + rows[0].outCode +
"&inqu_status-0-parentId=" + rows[0].id ,
title: "<div style='text-align: center;'>委外出库详情</div>",
width: "90%",
height: "80%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
}
});
}
}
let save = function (btnNode) {
......
......@@ -26,8 +26,8 @@ $(function () {
remainingQty = remainingQty - outQty;
resultGrid.setCellValue(e.items[0],"outUnitWeight",remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"outWeight",outQty * remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"remainingQty",remainingQty);
resultGrid.setCellValue(e.items[0],"remainingWeight",remainingQty * remainingUnitWeight);
//resultGrid.setCellValue(e.items[0],"remainingQty",remainingQty);
//resultGrid.setCellValue(e.items[0],"remainingWeight",remainingQty * remainingUnitWeight);
}else if (e.field == "outWeight"){
let outWeight = e.items[0]['outWeight'];
let remainingWeight = e.items[0]['remainingWeight'];
......@@ -38,9 +38,9 @@ $(function () {
}
remainingWeight = remainingWeight - outWeight;
resultGrid.setCellValue(e.items[0],"outUnitWeight",remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"outQty",outWeight / remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"remainingQty",remainingWeight / remainingUnitWeight);
resultGrid.setCellValue(e.items[0],"remainingWeight",remainingWeight);
resultGrid.setCellValue(e.items[0],"outQty",(outWeight / remainingUnitWeight).toFixed(0));
//resultGrid.setCellValue(e.items[0],"remainingQty",remainingWeight / remainingUnitWeight);
//resultGrid.setCellValue(e.items[0],"remainingWeight",remainingWeight);
}
});
......@@ -116,6 +116,11 @@ let saveResult = function () {
flag = false;
return false;
}
if (outQty > outWeight) {
message("选中的第" + (index + 1) + "行\"出库数量\",不能大于\"剩余数量\"!");
flag = false;
return false;
}
});
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment