From e17db1a57b9788ab16c805e44b54a0324fea7da0 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期三, 21 六月 2023 17:54:20 +0800 Subject: [PATCH] 倒仓和粮食性质变更 --- igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java | 113 ++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 80 insertions(+), 33 deletions(-) diff --git a/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java b/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java index 72a7b16..af8e291 100644 --- a/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java +++ b/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java @@ -1,6 +1,5 @@ package com.ld.igds.inout.controller; -import ch.qos.logback.classic.pattern.ClassNameOnlyAbbreviator; import com.bstek.bdf2.core.business.IUser; import com.bstek.bdf2.core.model.DefaultDept; import com.ld.igds.check.dto.CheckItemData; @@ -19,6 +18,7 @@ import com.ld.igds.models.Depot; import com.ld.igds.models.DicTrigger; import com.ld.igds.models.InoutConf; +import com.ld.igds.models.InoutPrice; import com.ld.igds.util.ContextUtil; import com.ld.igds.util.DateUtil; import lombok.extern.slf4j.Slf4j; @@ -239,7 +239,12 @@ * @return */ @RequestMapping("/in-handle") - public ModelAndView inHandle() { + public ModelAndView inHandle(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) { + + //濡傛灉娌℃湁鎸囧畾鍦扮锛屼粠鐢ㄦ埛涓婁竴涓�夋嫨涓幏鍙� + if (StringUtils.isEmpty(sort)) { + sort = commonManager.getInoutWeightByClient(httpRequest); + } ModelAndView view = new ModelAndView(); @@ -263,15 +268,13 @@ // 褰撳墠娴佺▼鑺傜偣 view.addObject("progress", InoutConstant.PROGRESS_HANDLE); - // 绮鍝佺涓嬫媺妗� - List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger( - Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId()); - view.addObject("listFoodVariety", listFoodVariety); + // 杩滅▼鏅烘収鍗� + // 鑾峰彇鍑哄叆搴撹澶囬厤缃俊鎭� + List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId); + InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_80, InoutConstant.PROGRESS_WEIGHT_TAG, 1); + if (null != conf) conf.setSort(sort); + view.addObject("cardDto", conf); - // 绮绛夌骇涓嬫媺妗� - List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger( - Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId()); - view.addObject("listFoodLevel", listFoodLevel); view.setViewName("admin/inout/in-handle"); return view; @@ -322,6 +325,7 @@ /** * 鍑哄簱鐧昏 + * * @param sort 琛ㄧず浣跨敤鐨勫嚭鍏ュ簱璁惧閰嶅鍙凤紝涓嶄紶閫掗粯璁や负1 * @return */ @@ -449,7 +453,7 @@ view.addObject("type", InoutConstant.TYPE_OUT); // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤 - List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId); + List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //鍑哄簱娴佺▼ @@ -486,15 +490,15 @@ IUser user = ContextUtil.getLoginUser(); - String deptId = ContextUtil.subDeptId(user); + String deptId = ContextUtil.subDeptId(user); view.addObject(Constant.MODEL_KEY_LOGIN_USER, user); view.addObject("bizType", BizType.INOUT_OUT.getCode()); - view.addObject("deptId",deptId); + view.addObject("deptId", deptId); view.addObject("type", InoutConstant.TYPE_OUT); // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤 - List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId); + List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); @@ -528,7 +532,7 @@ */ @RequestMapping("/inout-query") public PageResponse<InoutData> inoutQuery(@RequestBody InoutParam param) { - if(null == param.getCompanyId()) param.setCompanyId(ContextUtil.getCompanyId()); + if (null == param.getCompanyId()) param.setCompanyId(ContextUtil.getCompanyId()); return inoutManager.inoutQuery(param); } @@ -604,6 +608,38 @@ } /** + * 鍑哄叆搴撶О閲嶇幆鑺傛彁浜� + * + * @param data + * @return + */ + @RequestMapping("/submit-weight") + @Transactional + public PageResponse<InoutData> submitWeight(@RequestBody InoutData data) throws Exception { + + if (null == data.getJjlx()) data.setJjlx("0"); + + if (InoutConstant.TYPE_IN.equals(data.getType())) { + return inoutManager.submitWeightIn(data); + } else { + return inoutManager.submitWeightOut(data); + } + } + + /** + * 鍑哄叆搴撶О閲嶇幆鑺傛彁浜わ紝璇锋敞鎰忥細鍊间粨鎸戞彁浜ょ殑鏁版嵁闈炲嚭鍏ュ簱娴佹按瀹屾暣淇℃伅锛屼笉鑳界洿鎺ヨ皟鐢╱pdate鏂规硶 + * + * @param data + * @return + */ + @RequestMapping("/submit-handle") + @Transactional + public PageResponse<InoutData> submitHandle(@RequestBody InoutData data) throws Exception { + + return inoutManager.submitHandle(data); + } + + /** * 鍗″洖鏀堕〉闈㈡彁浜わ紝濡傛灉鏄甯告祦绋嬪崱鍥炴敹鍒欒蛋姝e父瀹屾垚娴佺▼锛屽惁鍒欐墽琛屽垹闄ら�昏緫骞跺洖鏀跺崱 * * @param data @@ -614,22 +650,22 @@ return inoutManager.inoutBack(data); } - /** - * 鍖栭獙椤甸潰鏁版嵁鎻愪氦 - * - * @param data - * @return - */ - @RequestMapping("/update-check") - public PageResponse<InoutData> updateCheck(@RequestBody InoutData data) { - try { - return inoutManager.updateCheck(data); - } catch (Exception e) { - log.error("鍚庡彴寮傚父:{}", e); - return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), - "鍚庡彴寮傚父锛�" + e.getMessage(), null); - } - } +// /** +// * 鍖栭獙椤甸潰鏁版嵁鎻愪氦 +// * +// * @param data +// * @return +// */ +// @RequestMapping("/update-check") +// public PageResponse<InoutData> updateCheck(@RequestBody InoutData data) { +// try { +// return inoutManager.updateCheck(data); +// } catch (Exception e) { +// log.error("鍚庡彴寮傚父:{}", e); +// return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), +// "鍚庡彴寮傚父锛�" + e.getMessage(), null); +// } +// } /** * 鏍规嵁鍗″彿鍜岀被鍨嬶紝鐩存帴瀹屾垚褰撳墠娴佺▼ @@ -817,7 +853,7 @@ */ @RequestMapping("/get-check-item") public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutCheckParam param) { - return inoutManager.getCheckItemData(param); + return inoutManager.getCheckItemData(param); } /** @@ -826,9 +862,20 @@ * @param data * @return */ - @RequestMapping("/update-check1") + @RequestMapping("/update-check") public PageResponse<InoutCheckData> updateCheck1(@RequestBody InoutCheckData data) { return inoutManager.updateCheckData(data); } + + /** + * 鏍规嵁绮绛夌骇鍙婄伯椋熷搧绉嶈幏鍙栫伯椋熷畾浠� + * @param param + * @return + */ + @RequestMapping("/get-price") + public PageResponse<InoutPrice> getPrice(@RequestBody InoutCheckParam param) { + + return inoutManager.getPrice(param); + } } \ No newline at end of file -- Gitblit v1.9.3