代码更新
This commit is contained in:
@@ -177,7 +177,7 @@
|
|||||||
dtl.bill_status IN ('30','40')
|
dtl.bill_status IN ('30','40')
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
ORDER BY
|
ORDER BY
|
||||||
dtl.box_no
|
dtl.box_no,dtl.pcsn
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.nl.modules.wql.WQL;
|
|||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.modules.wql.util.WqlUtil;
|
import org.nl.modules.wql.util.WqlUtil;
|
||||||
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
||||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||||
import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
|
import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
|
||||||
@@ -4625,24 +4626,74 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配明细
|
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配明细
|
||||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); // 子卷包装关系表
|
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); // 子卷包装关系表
|
||||||
WQLObject tranTab = WQLObject.getWQLObject("MD_CS_TransportationBase"); // 物流公司表
|
WQLObject tranTab = WQLObject.getWQLObject("MD_CS_TransportationBase"); // 物流公司表
|
||||||
|
WQLObject storTab = WQLObject.getWQLObject("st_ivt_bsrealstorattr"); // 实物仓库表
|
||||||
|
|
||||||
JSONObject jsonMst = mstTab.query("iostorinv_id = '" + MapUtil.getStr(whereJson, "iostorinv_id") + "'").uniqueResult(0);
|
JSONObject jsonMst = mstTab.query("iostorinv_id = '" + MapUtil.getStr(whereJson, "iostorinv_id") + "'").uniqueResult(0);
|
||||||
String cust_code = jsonMst.getString("cust_code");
|
String cust_code = jsonMst.getString("cust_code");
|
||||||
|
|
||||||
JSONObject jsonCust = custTab.query("cust_code = '" + cust_code + "'").uniqueResult(0);
|
JSONObject jsonCust = custTab.query("cust_code = '" + cust_code + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(jsonCust)) throw new BadRequestException("客户不存在");
|
String bill_type = jsonMst.getString("bill_type");
|
||||||
|
|
||||||
int j = Integer.parseInt((String) whereJson.get("j"));
|
int j = Integer.parseInt((String) whereJson.get("j"));
|
||||||
//1.根据出入库主表中 收货单位 查询客户表中的模板路径
|
|
||||||
String code_template = jsonCust.getString("shd_print_no");
|
HashMap<String, Object> oneMap = new HashMap<>();
|
||||||
// 2.获取输出流
|
// 2.获取输出流
|
||||||
ServletOutputStream outputStream = response.getOutputStream();
|
ServletOutputStream outputStream = response.getOutputStream();
|
||||||
// 3.创建模板工作簿
|
String code_template = "";
|
||||||
ExcelWriter workBook = EasyExcel.write(outputStream, null).withTemplate(code_template).build();
|
int shd_dtl_num = 0; // 送货单明细数
|
||||||
// 4.获取第一个sheet
|
|
||||||
// WriteSheet sheet = EasyExcel.writerSheet().build();
|
// 调拨发货单
|
||||||
|
if (StrUtil.equals(bill_type, "1004")) {
|
||||||
|
shd_dtl_num = 44;
|
||||||
|
//1.获取系统参数模板地址
|
||||||
|
code_template = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("allot_order").getValue();
|
||||||
|
|
||||||
// 5.单组填充
|
// 5.单组填充
|
||||||
HashMap<String, Object> oneMap = new HashMap<>();
|
JSONObject jsonDtl = dtlTab.query("iostorinv_id = '" + jsonMst.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonDtl)) {
|
||||||
|
// 调拨单号
|
||||||
|
oneMap.put("vbeln", jsonMst.getString("bill_code"));
|
||||||
|
// 调出仓库
|
||||||
|
oneMap.put("out_stor", jsonMst.getString("stor_code"));
|
||||||
|
// 调入仓库
|
||||||
|
JSONObject jsonStor = storTab.query("stor_id = '" + jsonMst.getString("out_stor_id") + "'").uniqueResult(0);
|
||||||
|
oneMap.put("in_stor", jsonStor.getString("stor_code"));
|
||||||
|
|
||||||
|
}
|
||||||
|
String pageNow = String.valueOf(j + 1); // 页码
|
||||||
|
oneMap.put("page", pageNow + "/" + MapUtil.getStr(whereJson, "pageNum"));
|
||||||
|
oneMap.put("consignee", jsonMst.getString("consignee")); // 收货单位
|
||||||
|
oneMap.put("receiver", jsonMst.getString("receiver")); // 收货人
|
||||||
|
String receiptaddress = jsonMst.getString("receiptaddress");
|
||||||
|
oneMap.put("receiptaddress", receiptaddress); // 收货地址
|
||||||
|
oneMap.put("receiptphone", jsonMst.getString("receiptphone")); // 收货人联系电话
|
||||||
|
// 物流公司
|
||||||
|
JSONObject jsonTran = tranTab.query("cust_code = '" + jsonMst.getString("trans_code") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonTran)) {
|
||||||
|
oneMap.put("logisticscompany", jsonTran.getString("cust_name"));
|
||||||
|
}
|
||||||
|
oneMap.put("drivername", jsonMst.getString("drivername")); // 司机
|
||||||
|
oneMap.put("carno", jsonMst.getString("carno")); // 车牌号
|
||||||
|
oneMap.put("driverphone", jsonMst.getString("driverphone")); // 司机联系电话
|
||||||
|
// 总箱数
|
||||||
|
JSONArray jsonAllBox = WQL.getWO("ST_OUTIVT02").addParam("flag", "4").addParam("iostorinv_id", MapUtil.getStr(whereJson, "iostorinv_id")).process().getResultJSONArray(0);
|
||||||
|
oneMap.put("all_box", jsonAllBox.size());
|
||||||
|
// 总毛重
|
||||||
|
double all_box_qty = 0;
|
||||||
|
for (int t = 0; t < jsonAllBox.size(); t++) {
|
||||||
|
JSONObject json = jsonAllBox.getJSONObject(t);
|
||||||
|
all_box_qty = NumberUtil.add(all_box_qty, json.getDoubleValue("box_qty"));
|
||||||
|
}
|
||||||
|
oneMap.put("all_box_qty", NumberUtil.round(all_box_qty, 2).toString());
|
||||||
|
oneMap.put("deliveryaddress", jsonMst.getString("deliveryaddress")); // 送货方地址
|
||||||
|
oneMap.put("deliveryname", jsonMst.getString("deliveryname")); // 送货方联系人
|
||||||
|
oneMap.put("deliveryphone", jsonMst.getString("deliveryphone")); // 送货方联系电话
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(jsonCust)) throw new BadRequestException("客户不存在");
|
||||||
|
shd_dtl_num = jsonCust.getIntValue("shd_dtl_num");
|
||||||
|
//1.根据出入库主表中 收货单位 查询客户表中的模板路径
|
||||||
|
code_template = jsonCust.getString("shd_print_no");
|
||||||
|
|
||||||
JSONObject jsonDtl = dtlTab.query("iostorinv_id = '" + jsonMst.getString("iostorinv_id") + "'").uniqueResult(0);
|
JSONObject jsonDtl = dtlTab.query("iostorinv_id = '" + jsonMst.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(jsonDtl)) {
|
if (ObjectUtil.isNotEmpty(jsonDtl)) {
|
||||||
@@ -4691,11 +4742,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
oneMap.put("deliveryaddress", jsonMst.getString("deliveryaddress")); // 送货方地址
|
oneMap.put("deliveryaddress", jsonMst.getString("deliveryaddress")); // 送货方地址
|
||||||
oneMap.put("deliveryname", jsonMst.getString("deliveryname")); // 送货方联系人
|
oneMap.put("deliveryname", jsonMst.getString("deliveryname")); // 送货方联系人
|
||||||
oneMap.put("deliveryphone", jsonMst.getString("deliveryphone")); // 送货方联系电话
|
oneMap.put("deliveryphone", jsonMst.getString("deliveryphone")); // 送货方联系电话
|
||||||
|
}
|
||||||
|
|
||||||
// 6.多组填充
|
// 6.多组填充
|
||||||
JSONArray dtlArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "3").addParam("iostorinv_id", MapUtil.getStr(whereJson, "iostorinv_id")).process().getResultJSONArray(0);
|
JSONArray dtlArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "3").addParam("iostorinv_id", MapUtil.getStr(whereJson, "iostorinv_id")).process().getResultJSONArray(0);
|
||||||
|
|
||||||
int shd_dtl_num = jsonCust.getIntValue("shd_dtl_num"); // 送货单明细数
|
|
||||||
|
|
||||||
if (shd_dtl_num > dtlArr.size()) {
|
if (shd_dtl_num > dtlArr.size()) {
|
||||||
double all_qty = 0;
|
double all_qty = 0;
|
||||||
@@ -4738,6 +4789,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
/* if (ObjectUtil.isNotEmpty(order_no)) {
|
/* if (ObjectUtil.isNotEmpty(order_no)) {
|
||||||
oneMap.put("order_no",order_no.substring(0,order_no.indexOf("-")));
|
oneMap.put("order_no",order_no.substring(0,order_no.indexOf("-")));
|
||||||
}*/
|
}*/
|
||||||
|
ExcelWriter workBook = EasyExcel.write(outputStream, null).withTemplate(code_template).build();
|
||||||
|
|
||||||
oneMap.put("all_qty", all_qty); // 合计
|
oneMap.put("all_qty", all_qty); // 合计
|
||||||
workBook.fill(oneMap, sheet);
|
workBook.fill(oneMap, sheet);
|
||||||
workBook.fill(new FillWrapper("data", flData), sheet);
|
workBook.fill(new FillWrapper("data", flData), sheet);
|
||||||
@@ -4789,9 +4842,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// 订单号
|
// 订单号
|
||||||
/* if (ObjectUtil.isNotEmpty(order_no)) {
|
ExcelWriter workBook = EasyExcel.write(outputStream, null).withTemplate(code_template).build();
|
||||||
oneMap.put("order_no",order_no.substring(0,order_no.indexOf("-")));
|
|
||||||
}*/
|
|
||||||
oneMap.put("all_qty", all_qty); // 合计
|
oneMap.put("all_qty", all_qty); // 合计
|
||||||
WriteSheet sheet = EasyExcel.writerSheet(0).build();
|
WriteSheet sheet = EasyExcel.writerSheet(0).build();
|
||||||
workBook.fill(oneMap, sheet);
|
workBook.fill(oneMap, sheet);
|
||||||
|
|||||||
@@ -183,7 +183,7 @@
|
|||||||
OPTION 输入.unassign_flag <> ""
|
OPTION 输入.unassign_flag <> ""
|
||||||
iosdtl.unassign_qty >0
|
iosdtl.unassign_qty >0
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
order by iosdtl.seq_no
|
order by iosdtl.box_no,iosdtl.pcsn
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
@@ -399,7 +399,7 @@
|
|||||||
dis.work_status <= 输入.bill_status
|
dis.work_status <= 输入.bill_status
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
order by attr.layer_num ASC,attr.row_num ASC,attr.col_num ASC
|
order by dis.box_no,dis.pcsn
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.ST_INV_IN_TYPE"
|
v-for="item in dict.ST_INV_IN_TYPE"
|
||||||
|
:disabled="item.value === '0003'"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
|
|||||||
@@ -453,10 +453,12 @@ export default {
|
|||||||
if (!this.flagnow) {
|
if (!this.flagnow) {
|
||||||
item.edit = true
|
item.edit = true
|
||||||
this.form.tableData.splice(-1, 0, item)
|
this.form.tableData.splice(-1, 0, item)
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item.edit = true
|
item.edit = true
|
||||||
this.form.tableData.splice(-1, 0, item)
|
this.form.tableData.splice(-1, 0, item)
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.form.detail_count = this.form.tableData.length
|
this.form.detail_count = this.form.tableData.length
|
||||||
|
|||||||
@@ -465,9 +465,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
printExcel(jo) {
|
printExcel(jo) {
|
||||||
|
if (jo.bill_type !== '1004') {
|
||||||
if (jo.shd_dtl_num === '') {
|
if (jo.shd_dtl_num === '') {
|
||||||
return this.crud.notify('客户为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
return this.crud.notify('客户为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jo.bill_type === '1004') {
|
||||||
|
jo.shd_dtl_num = 44
|
||||||
|
}
|
||||||
checkoutbill.getDisNum({ 'iostorinv_id': jo.iostorinv_id }).then(res => {
|
checkoutbill.getDisNum({ 'iostorinv_id': jo.iostorinv_id }).then(res => {
|
||||||
const j = Math.ceil(res.num / jo.shd_dtl_num)
|
const j = Math.ceil(res.num / jo.shd_dtl_num)
|
||||||
debugger
|
debugger
|
||||||
|
|||||||
Reference in New Issue
Block a user