Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -189,4 +189,9 @@ public class CustomerbaseDto implements Serializable {
|
||||
* 送货单打印模板号
|
||||
*/
|
||||
private String shd_print_no;
|
||||
|
||||
/**
|
||||
* 送货单明细数
|
||||
*/
|
||||
private String shd_dtl_num;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
cust_code AS value,
|
||||
cust_name AS value,
|
||||
cust_name AS label
|
||||
FROM
|
||||
MD_CS_TransportationBase
|
||||
|
||||
@@ -695,6 +695,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String Description = param.getString("Description"); // 来源卷位置
|
||||
String DateOfFGInbound = param.getString("DateOfFGInbound"); // 来源卷位置
|
||||
String box_type = param.getString("Attribute1"); // 木箱料号
|
||||
String box_length = param.getString("Attribute2"); // 木箱料号
|
||||
String box_width = param.getString("Attribute3"); // 木箱料号
|
||||
String box_high = param.getString("Attribute4"); // 木箱料号
|
||||
|
||||
JSONArray details = param.getJSONArray("details");
|
||||
|
||||
@@ -723,6 +726,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
jo.put("package_box_sn", PackageBoxSN);
|
||||
jo.put("sap_pcsn", sap_pcsn);
|
||||
jo.put("box_type", box_type);
|
||||
jo.put("box_length", box_length);
|
||||
jo.put("box_width", box_width);
|
||||
jo.put("box_high", box_high);
|
||||
jo.put("quanlity_in_box", QuanlityInBox);
|
||||
jo.put("box_weight", BoxWeight);
|
||||
jo.put("quality_guaran_period", QualityGuaranPeriod);
|
||||
|
||||
Binary file not shown.
@@ -176,4 +176,10 @@ public interface CheckOutBillService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
void downloadExcel(HttpServletResponse response, Map whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 获取分配明细条数
|
||||
* @param whereJson /
|
||||
*/
|
||||
JSONObject getDisNum(Map whereJson);
|
||||
}
|
||||
|
||||
@@ -211,4 +211,11 @@ public class CheckOutBillController {
|
||||
checkOutBillService.downloadExcel(response,whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDisNum")
|
||||
@Log("获取分配明细条数")
|
||||
@ApiOperation("获取分配明细条数")
|
||||
public ResponseEntity<Object> getDisNum(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(checkOutBillService.getDisNum(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2132,11 +2132,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
WQLObject custTab = WQLObject.getWQLObject("MD_CS_CustomerBase"); // 客户基本信息表
|
||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库主表
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); // 子卷包装关系表
|
||||
|
||||
JSONObject jsonMst = mstTab.query("iostorinv_id = '" + MapUtil.getStr(whereJson, "iostorinv_id") + "'").uniqueResult(0);
|
||||
String cust_code = jsonMst.getString("cust_code");
|
||||
|
||||
JSONObject jsonCust = custTab.query("cust_code = '" + cust_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCust)) throw new BadRequestException("客户不存在");
|
||||
|
||||
int j = Integer.parseInt((String) whereJson.get("j"));
|
||||
//1.根据出入库主表中 收货单位 查询客户表中的模板路径
|
||||
@@ -2149,41 +2151,57 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
// WriteSheet sheet = EasyExcel.writerSheet().build();
|
||||
// 5.单组填充
|
||||
HashMap<String, Object> oneMap = new HashMap<>();
|
||||
oneMap.put("vbeln", "");
|
||||
oneMap.put("consignee", jsonMst.getString("consignee"));
|
||||
oneMap.put("receiver", jsonMst.getString("receiver"));
|
||||
oneMap.put("receiptaddress", jsonMst.getString("receiptaddress"));
|
||||
oneMap.put("receiptphone", jsonMst.getString("receiptphone"));
|
||||
oneMap.put("logisticscompany", jsonMst.getString("logisticscompany"));
|
||||
oneMap.put("drivername", jsonMst.getString("drivername"));
|
||||
oneMap.put("carno", jsonMst.getString("carno"));
|
||||
oneMap.put("driverphone", jsonMst.getString("driverphone"));
|
||||
oneMap.put("contractno", jsonMst.getString("contractno"));
|
||||
oneMap.put("all_box", "");
|
||||
oneMap.put("bill_code", jsonMst.getString("bill_code")); // 出库单号
|
||||
oneMap.put("create_date", DateUtil.today()); // 出库日期
|
||||
oneMap.put("consignee", jsonMst.getString("consignee")); // 客户
|
||||
oneMap.put("receiptaddress", jsonMst.getString("receiptaddress")); // 客户地址
|
||||
oneMap.put("trans_code", jsonMst.getString("trans_code")); // 承运公司
|
||||
oneMap.put("receiptaddress2", jsonMst.getString("receiptaddress")); // 收货地址
|
||||
oneMap.put("receiptphone", jsonMst.getString("receiver") +"/"+jsonMst.getString("receiptphone")); // 客户电话
|
||||
oneMap.put("deliveryphone", jsonMst.getString("deliveryname") +"/"+jsonMst.getString("deliveryphone") ); // 承运人电话
|
||||
// 总箱数
|
||||
/* 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());
|
||||
oneMap.put("all_qty", "");
|
||||
oneMap.put("deliveryaddress", jsonMst.getString("deliveryaddress"));
|
||||
oneMap.put("deliveryname", jsonMst.getString("deliveryname"));
|
||||
oneMap.put("deliveryphone", jsonMst.getString("deliveryphone"));
|
||||
oneMap.put("deliveryphone", jsonMst.getString("deliveryphone"));*/
|
||||
// 6.多组填充
|
||||
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()) {
|
||||
double all_qty = 0;
|
||||
ArrayList<HashMap<String, Object>> flData = new ArrayList<>();
|
||||
WriteSheet sheet = EasyExcel.writerSheet().build();
|
||||
for (int i = 0; i < dtlArr.size(); i++) {
|
||||
JSONObject json = dtlArr.getJSONObject(i);
|
||||
HashMap<String, Object> mapFL = new HashMap<>();
|
||||
JSONObject jsonSub = subTab.query("package_box_sn = '" + json.getString("box_no") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSub)) throw new BadRequestException("没有查询到子卷包装");
|
||||
|
||||
mapFL.put("index", i + 1);
|
||||
mapFL.put("source_bill_code", json.getString("source_bill_code"));
|
||||
// 规格: 厚度*幅宽
|
||||
String material_spec = jsonSub.getString("thickness") + "*" + jsonSub.getString("width");
|
||||
// 箱号
|
||||
String box_no = json.getString("box_no");
|
||||
String sub_box_no = "";
|
||||
if (ObjectUtil.isNotEmpty(box_no)) {
|
||||
sub_box_no = box_no.substring(box_no.lastIndexOf("@")+1, box_no.length());
|
||||
}
|
||||
|
||||
HashMap<String, Object> mapFL = new HashMap<>();
|
||||
// 明细
|
||||
String date_of_production = jsonSub.getString("date_of_production").replaceAll("[[\\s-:punct:]]", "");
|
||||
mapFL.put("date_of_production", date_of_production); // 批号 : 子卷包装生产日期
|
||||
mapFL.put("material_name", json.getString("material_name"));
|
||||
mapFL.put("material_spec", json.getString("material_spec"));
|
||||
mapFL.put("qty", json.getString("real_qty"));
|
||||
mapFL.put("remark", json.getString("remark"));
|
||||
mapFL.put("material_spec", material_spec);
|
||||
mapFL.put("qty_unit_name", "KG");
|
||||
mapFL.put("box_no", sub_box_no);
|
||||
mapFL.put("qty", NumberUtil.round(json.getString("qty"), 2).doubleValue());
|
||||
flData.add(mapFL);
|
||||
all_qty = NumberUtil.add(String.valueOf(all_qty), json.getString("qty")).doubleValue();
|
||||
}
|
||||
oneMap.put("all_qty",all_qty);
|
||||
workBook.fill(oneMap, sheet);
|
||||
workBook.fill(new FillWrapper("data", flData), sheet);
|
||||
workBook.finish();
|
||||
@@ -2192,22 +2210,42 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
double ceil = Math.ceil(div);
|
||||
Integer integer = Integer.valueOf(String.valueOf(NumberUtil.round(ceil, 0)));
|
||||
|
||||
double all_qty = 0;
|
||||
ArrayList<HashMap<String, Object>> flData = new ArrayList<>();
|
||||
for (int i = j * shd_dtl_num; i < (j + 1) * shd_dtl_num; i++) {
|
||||
if (i == dtlArr.size()) {
|
||||
break;
|
||||
}
|
||||
|
||||
JSONObject json = dtlArr.getJSONObject(i);
|
||||
JSONObject jsonSub = subTab.query("package_box_sn = '" + json.getString("box_no") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSub)) throw new BadRequestException("没有查询到子卷包装");
|
||||
|
||||
// 规格: 厚度*幅宽
|
||||
String material_spec = jsonSub.getString("thickness") + "*" + jsonSub.getString("width");
|
||||
// 箱号
|
||||
String box_no = json.getString("box_no");
|
||||
String sub_box_no = "";
|
||||
if (ObjectUtil.isNotEmpty(box_no)) {
|
||||
sub_box_no = box_no.substring(box_no.lastIndexOf("@")+1, box_no.length());
|
||||
}
|
||||
|
||||
HashMap<String, Object> mapFL = new HashMap<>();
|
||||
mapFL.put("index", i + 1);
|
||||
mapFL.put("source_bill_code", json.getString("source_bill_code"));
|
||||
// 明细
|
||||
String date_of_production = jsonSub.getString("date_of_production").replaceAll("[[\\s-:punct:]]", "");
|
||||
mapFL.put("date_of_production", date_of_production); // 批号 : 子卷包装生产日期
|
||||
mapFL.put("material_name", json.getString("material_name"));
|
||||
mapFL.put("material_spec", json.getString("material_spec"));
|
||||
mapFL.put("qty", json.getString("real_qty"));
|
||||
mapFL.put("remark", json.getString("remark"));
|
||||
mapFL.put("material_spec", material_spec);
|
||||
mapFL.put("qty_unit_name", "KG");
|
||||
mapFL.put("box_no", sub_box_no);
|
||||
mapFL.put("qty", NumberUtil.round(json.getString("qty"), 2).doubleValue());
|
||||
flData.add(mapFL);
|
||||
|
||||
// 计算合计重量
|
||||
all_qty = NumberUtil.add(String.valueOf(all_qty), json.getString("qty")).doubleValue();
|
||||
|
||||
}
|
||||
oneMap.put("all_qty",all_qty);
|
||||
WriteSheet sheet = EasyExcel.writerSheet(0).build();
|
||||
workBook.fill(oneMap, sheet);
|
||||
workBook.fill(new FillWrapper("data", flData), sheet);
|
||||
@@ -2215,6 +2253,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDisNum(Map whereJson) {
|
||||
JSONArray dtlArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "3").addParam("iostorinv_id", MapUtil.getStr(whereJson, "iostorinv_id")).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("num", dtlArr.size());
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新主表状态
|
||||
*
|
||||
|
||||
@@ -84,20 +84,40 @@
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
SUM(dis.real_qty) AS qty,
|
||||
dis.box_no,
|
||||
MAX(mater.material_name) AS material_name
|
||||
FROM
|
||||
ST_IVT_IOStorInvDtl dtl
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dtl.material_id
|
||||
ST_IVT_IOStorInvDis dis
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
|
||||
OPTION 输入.iostorinv_id <> ""
|
||||
dtl.iostorinv_id = 输入.iostorinv_id
|
||||
dis.iostorinv_id = 输入.iostorinv_id
|
||||
ENDOPTION
|
||||
|
||||
group by dis.box_no
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
count(*) AS num
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
WHERE
|
||||
1 = 1
|
||||
|
||||
OPTION 输入.iostorinv_id <> ""
|
||||
dis.iostorinv_id = 输入.iostorinv_id
|
||||
ENDOPTION
|
||||
|
||||
group by dis.struct_id
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
Reference in New Issue
Block a user