From 69cd9f59a0fabf12f8c9147fcba7f69817a870b3 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期一, 06 十一月 2023 23:40:59 +0800 Subject: [PATCH] 更新仓内抓拍2 --- igds-inout/src/main/java/com/ld/igds/inout/view/InoutReportPR.java | 417 ++++++++++++++++++++++++++++++----------------------------- 1 files changed, 211 insertions(+), 206 deletions(-) diff --git a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutReportPR.java b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutReportPR.java index 2433d52..6ac1dd2 100644 --- a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutReportPR.java +++ b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutReportPR.java @@ -19,237 +19,242 @@ import com.ld.igds.util.DateUtil; /** - * * @author: andy.jia * @description: * @version: * @data:2020骞�3鏈�13鏃� - * */ @Component public class InoutReportPR { - @Autowired - private HInoutReportService hiberReportService; - @Autowired - private JInoutReportService jdbcReportService; - @Autowired - private SysDeptService sysDeptService; + @Autowired + private HInoutReportService hiberReportService; + @Autowired + private JInoutReportService jdbcReportService; + @Autowired + private SysDeptService sysDeptService; - /** - * inoutReportPR#getQuery 鏍规嵁鎶ヨ〃绫诲瀷锛岃幏鍙栭粯璁ゆ煡璇俊鎭紝姣斿琛ㄥご淇℃伅绛� - * - * @param - * @return - */ - @DataProvider - public Map<String, Object> getQuery(Map<String, Object> param) { - Map<String, Object> result = new HashMap<String, Object>(); - //鑾峰彇鍙傛暟涓姤琛ㄧ被鍨� - String type = (String)param.get("type"); - //鑾峰彇鍙傛暟涓垎搴撶紪鐮� - String deptId = (String)param.get("deptId"); - //鑾峰彇鍒嗗簱缂栫爜瀵瑰簲鐨勫垎搴撳悕绉� - String deptName = ""; - List<DefaultDept> defaultDepts = sysDeptService.getCacheDept(ContextUtil.getCompanyId()); - for (DefaultDept defaultDept : defaultDepts) { - if(defaultDept.getId().equals(deptId)){ - deptName = defaultDept.getName(); - } - } - if ("INOUT_DETAIL".equals(type)) { - result.put("title", "鍑哄叆搴撴槑缁嗘眹鎬�"); - if (StringUtils.isNotEmpty(deptName)) { - result.put("title", deptName + "鍑哄叆搴撴槑缁嗘眹鎬�"); - result.put("deptId", deptId); - } + /** + * inoutReportPR#getQuery 鏍规嵁鎶ヨ〃绫诲瀷锛岃幏鍙栭粯璁ゆ煡璇俊鎭紝姣斿琛ㄥご淇℃伅绛� + * + * @param + * @return + */ + @DataProvider + public Map<String, Object> getQuery(Map<String, Object> param) { + Map<String, Object> result = new HashMap<String, Object>(); + //鑾峰彇鍙傛暟涓姤琛ㄧ被鍨� + String type = (String) param.get("type"); + //鑾峰彇鍙傛暟涓垎搴撶紪鐮� + String deptId = (String) param.get("deptId"); + //鑾峰彇鍒嗗簱缂栫爜瀵瑰簲鐨勫垎搴撳悕绉� + String deptName = ""; + List<DefaultDept> defaultDepts = sysDeptService.getCacheDept(ContextUtil.getCompanyId()); + for (DefaultDept defaultDept : defaultDepts) { + if (defaultDept.getId().equals(deptId)) { + deptName = defaultDept.getName(); + } + } + if ("INOUT_DETAIL".equals(type)) { + result.put("title", "鍑哄叆搴撴槑缁嗘眹鎬�"); + if (StringUtils.isNotEmpty(deptName)) { + result.put("title", deptName + "鍑哄叆搴撴槑缁嗘眹鎬�"); + result.put("deptId", deptId); + } - result.put("unit", "鍗冨厠锛圞G锛�"); - result.put("end", new Date()); - Date start = DateUtil.getNewByDay(new Date(), -30); - result.put("start", start); + result.put("unit", "鍗冨厠锛圞G锛�"); + result.put("end", new Date()); + Date start = DateUtil.getNewByDay(new Date(), -30); + result.put("start", start); - result.put("timeDesc", - DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" - + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); - } + result.put("timeDesc", + DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" + + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); + } - /** - * 姣忔棩鍑哄簱缁熻 - */ - if ("OUT_DAY".equals(type)) { - result.put("title", "姣忔棩鍑哄簱姹囨��"); - if (StringUtils.isNotEmpty(deptName)) { - result.put("title", deptName + "姣忔棩鍑哄簱姹囨��"); - result.put("deptId", deptId); - } + /** + * 姣忔棩鍑哄簱缁熻 + */ + if ("OUT_DAY".equals(type)) { + result.put("title", "姣忔棩鍑哄簱姹囨��"); + if (StringUtils.isNotEmpty(deptName)) { + result.put("title", deptName + "姣忔棩鍑哄簱姹囨��"); + result.put("deptId", deptId); + } - result.put("unit", "鍗冨厠锛圞G锛�"); - result.put("day", new Date()); - result.put("timeDesc", - DateFormatUtils.format(new Date(), "yyyy-MM-dd")); - result.put("type", InoutConstant.TYPE_OUT); - } + result.put("unit", "鍗冨厠锛圞G锛�"); + result.put("day", new Date()); + result.put("timeDesc", + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); + result.put("type", InoutConstant.TYPE_OUT); + } - /** - * 姣忔棩鍏ュ簱姹囨�荤粺璁� - */ - if ("IN_DAY".equals(type)) { - result.put("title", "姣忔棩鍏ュ簱姹囨��"); - if (StringUtils.isNotEmpty(deptName)) { - result.put("title", deptName + "姣忔棩鍏ュ簱姹囨��"); - result.put("deptId", deptId); - } + /** + * 姣忔棩鍏ュ簱姹囨�荤粺璁� + */ + if ("IN_DAY".equals(type)) { + result.put("title", "姣忔棩鍏ュ簱姹囨��"); + if (StringUtils.isNotEmpty(deptName)) { + result.put("title", deptName + "姣忔棩鍏ュ簱姹囨��"); + result.put("deptId", deptId); + } - result.put("unit", "鍗冨厠锛圞G锛�"); - result.put("day", new Date()); - result.put("timeDesc", - DateFormatUtils.format(new Date(), "yyyy-MM-dd")); - result.put("type", InoutConstant.TYPE_IN); - } - /** - * 鍒嗕粨鏀舵敮瀛� - */ - if ("INOUTDEPOT".equals(type)) { - result.put("title", "鍒嗕粨绮补鏀舵敮瀛�"); - if (StringUtils.isNotEmpty(deptName)) { - result.put("title", deptName + "鍒嗕粨绮补鏀舵敮瀛�"); - result.put("deptId", deptId); - } - result.put("end", new Date()); - Date start = DateUtil.getNewByDay(new Date(), -30); - result.put("start", start); + result.put("unit", "鍗冨厠锛圞G锛�"); + result.put("day", new Date()); + result.put("timeDesc", + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); + result.put("type", InoutConstant.TYPE_IN); + } + /** + * 鍒嗕粨鏀舵敮瀛� + */ + if ("INOUTDEPOT".equals(type)) { + result.put("title", "鍒嗕粨绮补鏀舵敮瀛�"); + if (StringUtils.isNotEmpty(deptName)) { + result.put("title", deptName + "鍒嗕粨绮补鏀舵敮瀛�"); + result.put("deptId", deptId); + } + result.put("end", new Date()); + Date start = DateUtil.getNewByDay(new Date(), -30); + result.put("start", start); - result.put("timeDesc", - DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" - + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); - result.put("unit", "鍗冨厠锛圞G锛�"); - } - /** - * 鍒嗗搧绉嶆敹鏀瓨 - */ - if ("INOUTFOODVARIETY".equals(type)) { - result.put("title", "鍒嗗搧绉嶇伯娌规敹鏀瓨"); - if (StringUtils.isNotEmpty(deptName)) { - result.put("title", deptName + "鍒嗗搧绉嶇伯娌规敹鏀瓨"); - result.put("deptId", deptId); - } - result.put("end", new Date()); - Date start = DateUtil.getNewByDay(new Date(), -30); - result.put("start", start); + result.put("timeDesc", + DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" + + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); + result.put("unit", "鍗冨厠锛圞G锛�"); + } + /** + * 鍒嗗搧绉嶆敹鏀瓨 + */ + if ("INOUTFOODVARIETY".equals(type)) { + result.put("title", "鍒嗗搧绉嶇伯娌规敹鏀瓨"); + if (StringUtils.isNotEmpty(deptName)) { + result.put("title", deptName + "鍒嗗搧绉嶇伯娌规敹鏀瓨"); + result.put("deptId", deptId); + } + result.put("end", new Date()); + Date start = DateUtil.getNewByDay(new Date(), -30); + result.put("start", start); - result.put("timeDesc", - DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" - + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); - result.put("unit", "鍗冨厠锛圞G锛�"); - } - if ("INOUT_SHIP_DETAIL".equals(type)) { - result.put("title", "鑸硅繍鏄庣粏姹囨��"); - if (StringUtils.isNotEmpty(deptName)) { - result.put("title", deptName + "鑸硅繍鏄庣粏姹囨��"); - result.put("deptId", deptId); - } + result.put("timeDesc", + DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" + + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); + result.put("unit", "鍗冨厠锛圞G锛�"); + } + if ("INOUT_SHIP_DETAIL".equals(type)) { + result.put("title", "鑸硅繍鏄庣粏姹囨��"); + if (StringUtils.isNotEmpty(deptName)) { + result.put("title", deptName + "鑸硅繍鏄庣粏姹囨��"); + result.put("deptId", deptId); + } - result.put("unit", "鍗冨厠锛圞G锛�"); - result.put("end", new Date()); - Date start = DateUtil.getNewByDay(new Date(), -30); - result.put("start", start); + result.put("unit", "鍗冨厠锛圞G锛�"); + result.put("end", new Date()); + Date start = DateUtil.getNewByDay(new Date(), -30); + result.put("start", start); - result.put("timeDesc", - DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" - + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); - } - return result; - } + result.put("timeDesc", + DateFormatUtils.format(start, "yyyy-MM-dd") + " 鎴嚦锛�" + + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); + } + return result; + } - /** - * 鍑哄叆搴撴眹鎬昏〃 - * inoutReportPR#listRecord 鎶ヨ〃鏁版嵁锛屽彧鑾峰彇宸茬粡瀹屾垚鐨勶紝骞朵笖闈炲紓甯告暟鎹拰鍒犻櫎鏁版嵁 - * - * @param param - * @return - */ - @DataProvider - public List<InoutRecord> listRecord(Map<String, Object> param) - throws Exception { + /** + * 鍑哄叆搴撴眹鎬昏〃 + * inoutReportPR#listRecord 鎶ヨ〃鏁版嵁锛屽彧鑾峰彇宸茬粡瀹屾垚鐨勶紝骞朵笖闈炲紓甯告暟鎹拰鍒犻櫎鏁版嵁 + * + * @param param + * @return + */ + @DataProvider + public List<InoutRecord> listRecord(Map<String, Object> param) + throws Exception { - if (null == param) { - param = new HashMap<String, Object>(); - param.put("progress", InoutConstant.PROGRESS_RECORD); - } + if (null == param) { + param = new HashMap<String, Object>(); + param.put("progress", InoutConstant.PROGRESS_RECORD); + } - List<InoutRecord> result = hiberReportService.listRecord(param); - if (null == result || result.isEmpty()) - return result; + List<InoutRecord> result = hiberReportService.listRecord(param); + if (null == result || result.isEmpty()) + return result; - // 娣诲姞缁熻淇℃伅 - double emptyWeightSum = 0.0, fullWeightSum = 0.0, deWetSum = 0.0, deImpuritySum = 0.0, deHandleSum = 0.0, deOtherSum = 0.0, deSumSum = 0.0, netWeightSum = 0.0, settleWeightSum = 0.0; - int index = 1; - for (InoutRecord record : result) { - record.setRemarks(String.valueOf(index)); - emptyWeightSum += record.getEmptyWeight(); - fullWeightSum += record.getFullWeight(); - deWetSum += record.getDeWet(); - deImpuritySum += record.getDeImpurity(); - deHandleSum += record.getDeHandle(); - deOtherSum += record.getDeOther(); - deSumSum += record.getDeSum(); - netWeightSum += record.getNetWeight(); - settleWeightSum += record.getSettleWeight(); - index ++; - } - InoutRecord sum = new InoutRecord(); - sum.setId("鍚堣"); - sum.setEmptyWeight(emptyWeightSum); - sum.setFullWeight(fullWeightSum); - sum.setDeWet(deWetSum); - sum.setDeImpurity(deImpuritySum); - sum.setDeHandle(deHandleSum); - sum.setDeOther(deOtherSum); - sum.setDeSum(deSumSum); - sum.setNetWeight(netWeightSum); - sum.setSettleWeight(settleWeightSum); - result.add(sum); - - return result; - } + // 娣诲姞缁熻淇℃伅 + double emptyWeightSum = 0.0, fullWeightSum = 0.0, deCheck = 0.0, addCheck = 0.0, deWetSum = 0.0, deImpuritySum = 0.0, deHandleSum = 0.0, deOtherSum = 0.0, deSumSum = 0.0, netWeightSum = 0.0, settleWeightSum = 0.0; + int index = 1; + for (InoutRecord record : result) { + record.setRemarks(String.valueOf(index)); + emptyWeightSum += record.getEmptyWeight(); + fullWeightSum += record.getFullWeight(); + deCheck += record.getDeCheck(); + addCheck += record.getAddCheck(); +// deWetSum += record.getDeWet(); +// deImpuritySum += record.getDeImpurity(); + deHandleSum += record.getDeHandle(); + deOtherSum += record.getDeOther(); + // deSumSum += record.getDeSum(); + netWeightSum += record.getNetWeight(); + settleWeightSum += record.getSettleWeight(); + index++; + } + InoutRecord sum = new InoutRecord(); + sum.setId("鍚堣"); + sum.setEmptyWeight(emptyWeightSum); + sum.setFullWeight(fullWeightSum); + sum.setAddCheck(addCheck); + sum.setDeCheck(deCheck); +// sum.setDeWet(deWetSum); +// sum.setDeImpurity(deImpuritySum); + sum.setDeHandle(deHandleSum); + sum.setDeOther(deOtherSum); + // sum.setDeSum(deSumSum); + sum.setNetWeight(netWeightSum); + sum.setSettleWeight(settleWeightSum); + result.add(sum); - /** - * inoutReportPR#inoutDepotData 鍒嗕粨绮补鏀舵敮瀛� - * @param param - * @return - */ - @DataProvider - public List<ReportInoutDepotData> inoutDepotData(Map<String, Object> param)throws Exception { - List<ReportInoutDepotData> result = jdbcReportService.getInoutDepotData(param); - return result; - } - /** - * inoutReportPR#inoutFoodVarietyData 鍒嗗搧绉嶇伯娌规敹鏀瓨 - * @param param - * @return - */ - @DataProvider - public List<ReportInoutDepotData> inoutFoodVarietyData(Map<String, Object> param) - throws Exception { - List<ReportInoutDepotData> result = jdbcReportService.getFoodVarietyData(param); - return result; - } + return result; + } - /** - * 鑸硅繍鏄庣粏姹囨�� - * inoutReportPR#listShipDetail - * - * @param param - * @return - */ - @DataProvider - public List<ReportInoutShipData> listShipDetail(Map<String, Object> param) throws Exception { + /** + * inoutReportPR#inoutDepotData 鍒嗕粨绮补鏀舵敮瀛� + * + * @param param + * @return + */ + @DataProvider + public List<ReportInoutDepotData> inoutDepotData(Map<String, Object> param) throws Exception { + List<ReportInoutDepotData> result = jdbcReportService.getInoutDepotData(param); + return result; + } - if (null == param) { - param = new HashMap<String, Object>(); - } + /** + * inoutReportPR#inoutFoodVarietyData 鍒嗗搧绉嶇伯娌规敹鏀瓨 + * + * @param param + * @return + */ + @DataProvider + public List<ReportInoutDepotData> inoutFoodVarietyData(Map<String, Object> param) + throws Exception { + List<ReportInoutDepotData> result = jdbcReportService.getFoodVarietyData(param); + return result; + } - return jdbcReportService.listShipDetail(param); - } + /** + * 鑸硅繍鏄庣粏姹囨�� + * inoutReportPR#listShipDetail + * + * @param param + * @return + */ + @DataProvider + public List<ReportInoutShipData> listShipDetail(Map<String, Object> param) throws Exception { + + if (null == param) { + param = new HashMap<String, Object>(); + } + + return jdbcReportService.listShipDetail(param); + } } -- Gitblit v1.9.3