rev : 子卷包装关系修改增加权限、成品库存增加库存状态筛选、出库管理加按照订单木箱规格导出excel

This commit is contained in:
2023-06-02 18:11:41 +08:00
parent e046519a80
commit f76b6c3e0e
9 changed files with 274 additions and 28 deletions

View File

@@ -53,10 +53,12 @@ public class StructivtServiceImpl implements StructivtService {
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
String package_box_sn = MapUtil.getStr(whereJson, "package_box_sn");
String sale_order_name = MapUtil.getStr(whereJson, "sale_order_name");
String ivt_status = MapUtil.getStr(whereJson, "ivt_status");
JSONObject map = new JSONObject();
map.put("flag", "1");
map.put("stor_id", stor_id);
map.put("sect_id", sect_id);
map.put("ivt_status", ivt_status);
if (StrUtil.isNotEmpty(material)) {
map.put("material", "%" + material + "%");
}

View File

@@ -20,6 +20,7 @@
输入.sect_id TYPEAS s_string
输入.pcsn TYPEAS s_string
输入.sap_pcsn TYPEAS s_string
输入.ivt_status TYPEAS s_string
输入.sale_order_name TYPEAS s_string
输入.package_box_sn TYPEAS s_string
输入.in_stor_id TYPEAS f_string
@@ -108,6 +109,18 @@
sub.sale_order_name like 输入.sale_order_name
ENDOPTION
OPTION 输入.ivt_status = "canuse_qty"
ivt.canuse_qty > 0
ENDOPTION
OPTION 输入.ivt_status = "warehousing_qty"
ivt.warehousing_qty > 0
ENDOPTION
OPTION 输入.ivt_status = "frozen_qty"
ivt.frozen_qty > 0
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF

View File

@@ -229,4 +229,14 @@ public interface CheckOutBillService {
* @param whereJson /
*/
void outReturn(JSONObject whereJson);
/**
* 导出数据
*
* @param map 待导出的数据
* @param response /
* @throws IOException /
*/
void download(Map map, HttpServletResponse response) throws IOException;
}

View File

@@ -274,4 +274,11 @@ public class CheckOutBillController {
checkOutBillService.outReturn(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void download(@RequestParam Map map,HttpServletResponse response) throws IOException {
checkOutBillService.download(map, response);
}
}

View File

@@ -18,6 +18,7 @@ import org.apache.commons.lang.text.StrBuilder;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.utils.FileUtil;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
@@ -669,6 +670,75 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
bean.uploadMES(param);
}
@Override
public void download(Map whereJson, HttpServletResponse response) throws IOException {
HashMap<String, String> map = new HashMap<>(whereJson);
map.put("flag", "111");
if (StrUtil.isNotEmpty(map.get("bill_code"))) {
map.put("bill_code", "%" + map.get("bill_code") + "%");
}
if (StrUtil.isNotEmpty(map.get("buss_type"))) {
map.put("buss_type", whereJson.get("buss_type") + "%");
}
if (StrUtil.isNotEmpty(map.get("io_type"))) {
map.put("io_type", map.get("io_type"));
}
if (StrUtil.isNotEmpty(map.get("is_upload"))) {
map.put("is_upload", map.get("is_upload"));
}
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
map.put("pcsn", "%" + map.get("pcsn") + "%");
}
if (StrUtil.isNotEmpty(map.get("material_code"))) {
map.put("material_code", "%" + map.get("material_code") + "%");
}
if (StrUtil.isNotEmpty(map.get("vbeln"))) {
map.put("vbeln", "%" + map.get("vbeln") + "%");
}
if (StrUtil.isNotEmpty(map.get("width"))) {
map.put("width", "%" + map.get("width") + "%");
}
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
map.put("pcsn", "%" + map.get("pcsn") + "%");
}
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
}
if (StrUtil.isNotEmpty(map.get("cust_code"))) {
map.put("cust_code", "%" + map.get("cust_code") + "%");
}
JSONArray resultJSONArray = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).process().getResultJSONArray(0);
List<Map<String, Object>> list = new ArrayList<>();
for (int i = 0; i < resultJSONArray.size(); i++) {
JSONObject jsonObject = resultJSONArray.getJSONObject(i);
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("单据号", jsonObject.getString("bill_code"));
mp.put("仓库", jsonObject.getString("stor_name"));
if (StrUtil.equals(jsonObject.getString("bill_type"), "1001")) mp.put("业务类型", "发货出库");
if (StrUtil.equals(jsonObject.getString("bill_type"), "1002")) mp.put("业务类型", "报废出库");
if (StrUtil.equals(jsonObject.getString("bill_type"), "1003")) mp.put("业务类型", "改切出库");
if (StrUtil.equals(jsonObject.getString("bill_type"), "1004")) mp.put("业务类型", "调拨出库");
if (StrUtil.equals(jsonObject.getString("bill_type"), "1005")) mp.put("业务类型", "拆箱出库");
if (StrUtil.equals(jsonObject.getString("bill_type"), "1009")) mp.put("业务类型", "手工出库");
mp.put("业务日期", jsonObject.getString("biz_date"));
mp.put("总重量", jsonObject.getString("qty"));
mp.put("客户编码", jsonObject.getString("cust_code"));
mp.put("客户名称", jsonObject.getString("cust_name"));
mp.put("交货单号", jsonObject.getString("vbeln"));
mp.put("订单及行号", jsonObject.getString("sale_order_name"));
mp.put("规格", jsonObject.getString("spec"));
mp.put("物流公司", jsonObject.getString("wl_cust_name"));
mp.put("运费", jsonObject.getString("estimated_freight"));
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(JSONObject whereJson) {

View File

@@ -154,6 +154,96 @@
ENDPAGEQUERY
ENDIF
IF 输入.flag = "111"
QUERY
SELECT
MAX(ios.bill_code) AS bill_code,
MAX(ios.stor_name) AS stor_name,
MAX(ios.bill_type) AS bill_type,
MAX(ios.biz_date) AS biz_date,
sum(dis.real_qty) AS qty,
MAX(cu.cust_code) AS cust_code,
MAX(cu.cust_name) AS cust_name,
MAX(dtl.vbeln) AS vbeln,
sub.sale_order_name,
CONCAT(sub.thickness,'*',sub.width) AS spec,
MAX(tr.cust_name) AS wl_cust_name,
MAX(ios.estimated_freight) AS estimated_freight
FROM
st_ivt_iostorinvdis dis
LEFT JOIN st_ivt_iostorinvdtl dtl ON dis.iostorinvdtl_id = dtl.iostorinvdtl_id
LEFT JOIN ST_IVT_IOStorInv ios ON ios.iostorinv_id = dtl.iostorinv_id
LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code
LEFT JOIN md_cs_transportationbase tr ON ios.trans_code = tr.cust_code
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = dis.box_no AND dis.pcsn = sub.container_name
WHERE
ios.io_type = '1'
AND ios.is_delete = '0'
OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code
ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
OPTION 输入.cust_code <> ""
(cu.cust_code like 输入.cust_code or
cu.cust_simple_name like 输入.cust_code)
ENDOPTION
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.is_upload <> ""
ios.is_upload = 输入.is_upload
ENDOPTION
OPTION 输入.io_type <> ""
ios.io_type = 输入.io_type
ENDOPTION
OPTION 输入.vbeln <> ""
dtl.vbeln like 输入.vbeln
ENDOPTION
OPTION 输入.width <> ""
dtl.width like 输入.width
ENDOPTION
OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode
ENDOPTION
OPTION 输入.bill_status <> ""
ios.bill_status = 输入.bill_status
ENDOPTION
OPTION 输入.begin_time <> ""
ios.input_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time
ENDOPTION
GROUP BY sub.sale_order_name,spec
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "2"
QUERY
SELECT