From 2b7d6339d1ff61ab767340fdc4ef59603dc9e6e5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期四, 31 三月 2022 09:07:45 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/controller/MatCodeController.java | 46 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/MatCodeController.java b/src/main/java/com/zy/asrs/controller/MatCodeController.java
index e001475..5c3823d 100644
--- a/src/main/java/com/zy/asrs/controller/MatCodeController.java
+++ b/src/main/java/com/zy/asrs/controller/MatCodeController.java
@@ -14,10 +14,12 @@
import com.core.common.R;
import com.zy.asrs.entity.MatCode;
import com.zy.asrs.entity.MatCodePrint;
+import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.service.MatCodeService;
import com.zy.asrs.utils.VersionUtils;
import com.zy.common.CodeRes;
import com.zy.common.config.AdminInterceptor;
+import com.zy.common.model.KeyValueVo;
import com.zy.common.utils.BarcodeUtils;
import com.zy.common.utils.QrCode;
import com.zy.common.utils.excel.matcode.MatCodeExcel;
@@ -40,6 +42,40 @@
@Autowired
private MatCodeService matCodeService;
+
+ /*************************************** xm-select ***********************************************/
+
+ // xm-select 鎼滅储鍟嗗搧鍒楄〃
+ @RequestMapping("/mat/all/get/kv")
+ @ManagerAuth
+ public R getMatDataKV(@RequestParam(required = false) String condition) {
+ Wrapper<MatCode> wrapper = new EntityWrapper<MatCode>()
+ .andNew().like("mat_no", condition).or().like("mat_name", condition)
+ .orderBy("appe_time", false);
+ List<MatCode> mats = matCodeService.selectPage(new Page<>(1, 30), wrapper).getRecords();
+ List<KeyValueVo> valueVos = new ArrayList<>();
+ for (MatCode mat : mats) {
+ KeyValueVo vo = new KeyValueVo();
+ vo.setName(mat.getMatNo() + " - " + mat.getMatName());
+ vo.setValue(mat.getMatNo());
+ valueVos.add(vo);
+ }
+ return R.ok().add(valueVos);
+ }
+
+ @RequestMapping(value = "/matCode/covert/{id}/auth")
+ @ManagerAuth
+ public R covert(@PathVariable("id") String id) {
+ MatCode matCode = matCodeService.selectById(String.valueOf(id));
+ if (matCode == null) {
+ return R.ok();
+ }
+ OrderDetl orderDetl = new OrderDetl();
+ VersionUtils.setOrderDetl(orderDetl, matCode);
+ orderDetl.setAnfme(0.0D);
+ return R.ok().add(orderDetl);
+ }
+
@RequestMapping(value = "/matCode/{id}/auth")
@ManagerAuth
@@ -123,7 +159,7 @@
// 瀵煎嚭
@RequestMapping(value = "/matCode/export/auth")
- @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "鐗╂枡缂栫爜鏁版嵁瀵煎嚭")
+ @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "鍟嗗搧缂栧彿鏁版嵁瀵煎嚭")
public void export(@RequestParam(required = false) String fileName,
@RequestParam(required = false) Integer rowCount,
HttpServletResponse response) throws Exception {
@@ -138,7 +174,7 @@
}
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
- fileName = URLEncoder.encode(Cools.isEmpty(fileName)?"鐗╂枡缂栫爜":fileName, "UTF-8");
+ fileName = URLEncoder.encode(Cools.isEmpty(fileName)?"鍟嗗搧缂栧彿":fileName, "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), MatCodeExcel.class)
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
@@ -148,7 +184,7 @@
// 瀵煎叆
@RequestMapping(value = "/matCode/import/auth")
- @ManagerAuth(memo = "鐗╂枡缂栫爜鏁版嵁瀵煎叆")
+ @ManagerAuth(memo = "鍟嗗搧缂栧彿鏁版嵁瀵煎叆")
@Transactional
public R matCodeImport(MultipartFile file) throws IOException, InterruptedException {
MatCodeExcelListener listener = new MatCodeExcelListener(getUserId());
@@ -158,7 +194,7 @@
// 鎵撳嵃
@RequestMapping(value = "/matCode/print/auth")
- @ManagerAuth(memo = "鐗╂枡缂栫爜鎵撳嵃")
+ @ManagerAuth(memo = "鍟嗗搧缂栧彿鎵撳嵃")
public R matCodePrint(@RequestParam(value = "param[]") String[] param) {
if(Cools.isEmpty(param)) {
return R.parse(CodeRes.EMPTY);
@@ -179,7 +215,7 @@
}
@RequestMapping(value = "/macCode/code/auth")
-// @ManagerAuth(memo = "鐗╂枡缂栫爜鏉″舰鐮佽幏鍙�(type:1(鏉″舰鐮�);2(浜岀淮鐮�)")
+// @ManagerAuth(memo = "鍟嗗搧缂栧彿鏉″舰鐮佽幏鍙�(type:1(鏉″舰鐮�);2(浜岀淮鐮�)")
public R matCodeBarcode(@RequestParam(defaultValue = "1") Integer type
, @RequestParam String param
, HttpServletResponse response) throws Exception {
--
Gitblit v1.9.1