From 0a4c32ca70dd7543596ac7234b06db343917f65e Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期一, 19 六月 2023 14:53:58 +0800
Subject: [PATCH] 新建接口
---
igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java | 200 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 140 insertions(+), 60 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 53ee2c0..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;
@@ -450,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);
//鍑哄簱娴佺▼
@@ -487,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);
@@ -529,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);
}
@@ -605,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
@@ -615,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);
+// }
+// }
/**
* 鏍规嵁鍗″彿鍜岀被鍨嬶紝鐩存帴瀹屾垚褰撳墠娴佺▼
@@ -649,34 +684,34 @@
}
}
- /**
- * 鏍规嵁鍏ュ簱鏁版嵁淇℃伅锛岃幏鍙栨鏌ラ」淇℃伅锛屽鏋滃綋鍓嶆暟鎹凡缁忔娴嬪畬鎴愶紝鏌ヨ妫�娴嬬粨鏋滐紝濡傛灉娌℃湁妫�娴嬪畬鎴愬垯鏍规嵁妫�娴嬮」閰嶇疆鑾峰彇闇�瑕佹娴嬬殑椤圭洰淇℃伅
- *
- * @param data
- * @return
- */
- @RequestMapping("/get-check-item")
- public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutData data) {
- try {
- return inoutManager.getCheckItem(data);
- } catch (Exception e) {
- log.error("鍚庡彴寮傚父:{}", e);
- return new PageResponse<List<CheckItemData>>(
- RespCodeEnum.CODE_1111.getCode(), "鍚庡彴寮傚父锛�" + e.getMessage());
- }
- }
+// /**
+// * 鏍规嵁鍏ュ簱鏁版嵁淇℃伅锛岃幏鍙栨鏌ラ」淇℃伅锛屽鏋滃綋鍓嶆暟鎹凡缁忔娴嬪畬鎴愶紝鏌ヨ妫�娴嬬粨鏋滐紝濡傛灉娌℃湁妫�娴嬪畬鎴愬垯鏍规嵁妫�娴嬮」閰嶇疆鑾峰彇闇�瑕佹娴嬬殑椤圭洰淇℃伅
+// *
+// * @param data
+// * @return
+// */
+// @RequestMapping("/get-check-item")
+// public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutData data) {
+// try {
+// return inoutManager.getCheckItem(data);
+// } catch (Exception e) {
+// log.error("鍚庡彴寮傚父:{}", e);
+// return new PageResponse<List<CheckItemData>>(
+// RespCodeEnum.CODE_1111.getCode(), "鍚庡彴寮傚父锛�" + e.getMessage());
+// }
+// }
- /**
- * 鍒嗛〉鑾峰彇鏁版嵁淇℃伅
- *
- * @param param
- * @return
- */
- @RequestMapping("/page-check-data")
- public PageResponse<Page<InoutData>> pageCheckData(
- @RequestBody InoutParam param) {
- return inoutManager.pageCheckData(param);
- }
+// /**
+// * 鍒嗛〉鑾峰彇鏁版嵁淇℃伅
+// *
+// * @param param
+// * @return
+// */
+// @RequestMapping("/page-check-data")
+// public PageResponse<Page<InoutData>> pageCheckData(
+// @RequestBody InoutParam param) {
+// return inoutManager.pageCheckData(param);
+// }
/**
* 閬撻椄鎺у埗
@@ -777,7 +812,7 @@
}
/**
- * 鍒嗛〉鑾峰彇鎵︽牱璁板綍淇℃伅
+ * 鍒嗛〉鑾峰彇鎵︽牱鏁版嵁
*
* @param param
* @return
@@ -788,7 +823,7 @@
}
/**
- * 鎵︽牱椤甸潰鎻愪氦
+ * 鎵︽牱椤甸潰鎻愪氦鏇存柊
*
* @param data
* @return
@@ -798,4 +833,49 @@
return inoutManager.updateSampleData(data);
}
+
+ /**
+ * 鍒嗛〉鑾峰彇鍖栭獙鏁版嵁
+ *
+ * @param param
+ * @return
+ */
+ @RequestMapping("/page-check-data")
+ public PageResponse<Page<InoutCheckData>> pageCheckData(@RequestBody InoutCheckParam param) {
+ return inoutManager.pageCheckData(param);
+ }
+
+ /**
+ * 鑾峰彇鍖栭獙椤逛俊鎭�
+ *
+ * @param param
+ * @return
+ */
+ @RequestMapping("/get-check-item")
+ public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutCheckParam param) {
+ return inoutManager.getCheckItemData(param);
+ }
+
+ /**
+ * 鍖栭獙椤甸潰鎻愪氦鏇存柊
+ *
+ * @param data
+ * @return
+ */
+ @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