Commit fc43ea0efed7e4c9fd01a06cd07a810db97b3462

Authored by 李泰瑜
2 parents bc505004 b121da7a

Merge branch 'develop4' of http://172.16.29.40:8010/wms/wms4 into develop4

ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue
@@ -154,6 +154,10 @@ @@ -154,6 +154,10 @@
154 </a-tag> 154 </a-tag>
155 </span> 155 </span>
156 156
  157 + <span slot="reason" slot-scope="reason">
  158 + <span v-html="solutionReason(reason)"></span>
  159 + </span>
  160 +
157 161
158 <template slot='htmlSlot' slot-scope='text'> 162 <template slot='htmlSlot' slot-scope='text'>
159 <div v-html='text'></div> 163 <div v-html='text'></div>
@@ -292,6 +296,12 @@ export default { @@ -292,6 +296,12 @@ export default {
292 dataIndex: 'remark' 296 dataIndex: 'remark'
293 }, 297 },
294 { 298 {
  299 + title: '原因',
  300 + align: 'center',
  301 + dataIndex: 'reason',
  302 + scopedSlots: {customRender: 'reason'}
  303 + },
  304 + {
295 title: '创建人', 305 title: '创建人',
296 align: 'center', 306 align: 'center',
297 dataIndex: 'createBy' 307 dataIndex: 'createBy'
@@ -465,6 +475,15 @@ export default { @@ -465,6 +475,15 @@ export default {
465 } 475 }
466 }) 476 })
467 return actions.join('') 477 return actions.join('')
  478 + },
  479 + solutionReason(value){
  480 + if (value == 'WMS删除') {
  481 + return '<span style="color:black">WMS删除</span>'
  482 + } else if (value == '上游删除') {
  483 + return '<span style="color:#0e36b9">上游删除</span>'
  484 + } else if (value == '回传删除') {
  485 + return '<span style="color:green">回传删除</span>'
  486 + }
468 } 487 }
469 } 488 }
470 } 489 }
huaheng-wms-core/src/main/java/org/jeecg/JeecgSystemApplication.java
1 package org.jeecg; 1 package org.jeecg;
2 2
3 -import java.net.Inet4Address;  
4 -import java.net.Inet6Address;  
5 -import java.net.InetAddress;  
6 -import java.net.NetworkInterface;  
7 -import java.net.SocketException;  
8 -import java.net.UnknownHostException; 3 +import java.net.*;
9 import java.util.Enumeration; 4 import java.util.Enumeration;
10 5
11 import javax.transaction.SystemException; 6 import javax.transaction.SystemException;
12 7
13 import org.jeecg.common.util.oConvertUtils; 8 import org.jeecg.common.util.oConvertUtils;
14 import org.springframework.boot.SpringApplication; 9 import org.springframework.boot.SpringApplication;
15 -//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;  
16 import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 10 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
17 import org.springframework.boot.autoconfigure.SpringBootApplication; 11 import org.springframework.boot.autoconfigure.SpringBootApplication;
18 import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; 12 import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
@@ -20,10 +14,12 @@ import org.springframework.boot.builder.SpringApplicationBuilder; @@ -20,10 +14,12 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
20 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 14 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
21 import org.springframework.cache.annotation.EnableCaching; 15 import org.springframework.cache.annotation.EnableCaching;
22 import org.springframework.context.ConfigurableApplicationContext; 16 import org.springframework.context.ConfigurableApplicationContext;
  17 +import org.springframework.context.annotation.ComponentScan;
  18 +import org.springframework.context.annotation.ComponentScan.Filter;
  19 +import org.springframework.context.annotation.FilterType;
23 import org.springframework.core.env.Environment; 20 import org.springframework.core.env.Environment;
24 21
25 import lombok.extern.slf4j.Slf4j; 22 import lombok.extern.slf4j.Slf4j;
26 -import net.bytebuddy.asm.Advice.This;  
27 23
28 /** 24 /**
29 * 单体启动类(采用此类启动为单体模式) 25 * 单体启动类(采用此类启动为单体模式)
@@ -32,6 +28,7 @@ import net.bytebuddy.asm.Advice.This; @@ -32,6 +28,7 @@ import net.bytebuddy.asm.Advice.This;
32 @EnableCaching 28 @EnableCaching
33 @SpringBootApplication 29 @SpringBootApplication
34 @EnableAutoConfiguration(exclude = {MongoAutoConfiguration.class}) 30 @EnableAutoConfiguration(exclude = {MongoAutoConfiguration.class})
  31 +@ComponentScan(excludeFilters = {@Filter(type = FilterType.REGEX, pattern = {"org.jeecg.config.mybatis.MybatisInterceptor"})})
35 public class JeecgSystemApplication extends SpringBootServletInitializer { 32 public class JeecgSystemApplication extends SpringBootServletInitializer {
36 33
37 @Override 34 @Override
@@ -46,17 +43,13 @@ public class JeecgSystemApplication extends SpringBootServletInitializer { @@ -46,17 +43,13 @@ public class JeecgSystemApplication extends SpringBootServletInitializer {
46 String port = env.getProperty("server.port"); 43 String port = env.getProperty("server.port");
47 String profiles = env.getProperty("spring.profiles.active"); 44 String profiles = env.getProperty("spring.profiles.active");
48 String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path")); 45 String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
49 - log.info("\n----------------------------------------------------------\n\t"  
50 - + "Application HUAHENG WMS4 is running! Access urls:\n\n\t"  
51 - + "WEB Local: \thttp://localhost:" + port + path + "/index.html\n\t"  
52 - + "API Local: \thttp://localhost:" + port + path + "/\n\n\t"  
53 - + "WEB External: \thttp://" + ip + ":" + port + path + "/index.html\n\t"  
54 - + "API External: \thttp://" + ip + ":" + port + path + "/\n\n\t"  
55 - + "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n\n\t"  
56 - + "The following profiles are active: [" + profiles + "]\n" 46 + log.info("\n----------------------------------------------------------\n\t" + "Application HUAHENG WMS4 is running! Access urls:\n\n\t"
  47 + + "WEB Local: \thttp://localhost:" + port + path + "/index.html\n\t" + "API Local: \thttp://localhost:" + port + path + "/\n\n\t"
  48 + + "WEB External: \thttp://" + ip + ":" + port + path + "/index.html\n\t" + "API External: \thttp://" + ip + ":" + port + path + "/\n\n\t"
  49 + + "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n\n\t" + "The following profiles are active: [" + profiles + "]\n"
57 + "----------------------------------------------------------"); 50 + "----------------------------------------------------------");
58 } 51 }
59 - 52 +
60 public static InetAddress getLocalHostExactAddress() { 53 public static InetAddress getLocalHostExactAddress() {
61 try { 54 try {
62 InetAddress inetAddress = null; 55 InetAddress inetAddress = null;
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java
@@ -34,6 +34,7 @@ import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; @@ -34,6 +34,7 @@ import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
34 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; 34 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
35 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; 35 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
36 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; 36 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
  37 +import org.jeecg.modules.wms.receipt.receiptHeaderHistory.service.IReceiptHeaderHistoryService;
37 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; 38 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
38 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; 39 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
39 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; 40 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
@@ -62,6 +63,8 @@ public class ErpServiceImpl implements IErpService { @@ -62,6 +63,8 @@ public class ErpServiceImpl implements IErpService {
62 @Resource 63 @Resource
63 private IReceiptHeaderService receiptHeaderService; 64 private IReceiptHeaderService receiptHeaderService;
64 @Resource 65 @Resource
  66 + private IReceiptHeaderHistoryService receiptHeaderHistoryService;
  67 + @Resource
65 private IShipmentHeaderService shipmentHeaderService; 68 private IShipmentHeaderService shipmentHeaderService;
66 @Resource 69 @Resource
67 private IMaterialService materialService; 70 private IMaterialService materialService;
@@ -203,7 +206,7 @@ public class ErpServiceImpl implements IErpService { @@ -203,7 +206,7 @@ public class ErpServiceImpl implements IErpService {
203 if (receiptHeader == null) { 206 if (receiptHeader == null) {
204 return Result.error("入库单取消, 没有找到入库单"); 207 return Result.error("入库单取消, 没有找到入库单");
205 } 208 }
206 - boolean success = receiptHeaderService.delMain(String.valueOf(receiptHeader.getId())); 209 + boolean success = receiptHeaderService.delMain(String.valueOf(receiptHeader.getId()),QuantityConstant.UPSTREAM_DELETE_RECEIPT);
207 if (!success) { 210 if (!success) {
208 return Result.error("入库单取消失败"); 211 return Result.error("入库单取消失败");
209 } 212 }
@@ -441,6 +444,7 @@ public class ErpServiceImpl implements IErpService { @@ -441,6 +444,7 @@ public class ErpServiceImpl implements IErpService {
441 if (!success) { 444 if (!success) {
442 throw new ServiceException("回传入库单失败, 更新入库单头失败"); 445 throw new ServiceException("回传入库单失败, 更新入库单头失败");
443 } 446 }
  447 + receiptHeaderService.delMain(receiptHeader.getId().toString(),QuantityConstant.BACK_DELETE_RECEIPT);
444 return Result.ok("回传入库单成功"); 448 return Result.ok("回传入库单成功");
445 } 449 }
446 450
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/ReceiptController.java
@@ -51,22 +51,4 @@ public class ReceiptController extends HuahengBaseController { @@ -51,22 +51,4 @@ public class ReceiptController extends HuahengBaseController {
51 }); 51 });
52 return result; 52 return result;
53 } 53 }
54 -  
55 - @AutoLog(value = "PDA入库-快速入库")  
56 - @ApiOperation(value = "PDA入库-快速入库", notes = "快速入库")  
57 - @PostMapping("/quickReceipt")  
58 - @ResponseBody  
59 - @ApiLogger(apiName = "PDA入库-快速入库", from = "PDA")  
60 - public Result<?> quickReceipt(@RequestBody QuickReceiptBean bean, HttpServletRequest req) {  
61 - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);  
62 - bean.setWarehouseCode(warehouseCode);  
63 -  
64 - Result<?> result = handleMultiProcess("quickReceipt", new MultiProcessListener() {  
65 - @Override  
66 - public Result<?> doProcess() {  
67 - return mobileService.quickReceipt(bean, warehouseCode);  
68 - }  
69 - });  
70 - return result;  
71 - }  
72 } 54 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
@@ -41,7 +41,7 @@ public class WcsController extends HuahengBaseController { @@ -41,7 +41,7 @@ public class WcsController extends HuahengBaseController {
41 @ResponseBody 41 @ResponseBody
42 @ApiLogger(apiName = "仓位分配", from = "WCS") 42 @ApiLogger(apiName = "仓位分配", from = "WCS")
43 public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain, HttpServletRequest req) { 43 public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain, HttpServletRequest req) {
44 - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); 44 + String warehouseCode = warecellDomain.getWarehouseCode();
45 if (StringUtils.isEmpty(warehouseCode)) { 45 if (StringUtils.isEmpty(warehouseCode)) {
46 return Result.error("仓位分配, 仓库号为空"); 46 return Result.error("仓位分配, 仓库号为空");
47 } 47 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/config/HuahengBatisInterceptor.java 0 → 100644
  1 +package org.jeecg.modules.wms.framework.config;
  2 +
  3 +import java.lang.reflect.Field;
  4 +import java.util.Date;
  5 +import java.util.Properties;
  6 +
  7 +import org.apache.ibatis.binding.MapperMethod;
  8 +import org.apache.ibatis.executor.Executor;
  9 +import org.apache.ibatis.mapping.MappedStatement;
  10 +import org.apache.ibatis.mapping.SqlCommandType;
  11 +import org.apache.ibatis.plugin.*;
  12 +import org.apache.shiro.SecurityUtils;
  13 +import org.jeecg.common.system.vo.LoginUser;
  14 +import org.jeecg.common.util.oConvertUtils;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import lombok.extern.slf4j.Slf4j;
  18 +
  19 +@Slf4j
  20 +@Component
  21 +@Intercepts({@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})})
  22 +public class HuahengBatisInterceptor implements Interceptor {
  23 +
  24 + @Override
  25 + public Object intercept(Invocation invocation) throws Throwable {
  26 + MappedStatement mappedStatement = (MappedStatement)invocation.getArgs()[0];
  27 + String sqlId = mappedStatement.getId();
  28 + log.debug("------sqlId------" + sqlId);
  29 + SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
  30 + Object parameter = invocation.getArgs()[1];
  31 + log.debug("------sqlCommandType------" + sqlCommandType);
  32 +
  33 + if (parameter == null) {
  34 + return invocation.proceed();
  35 + }
  36 + if (SqlCommandType.INSERT == sqlCommandType) {
  37 + LoginUser sysUser = this.getLoginUser();
  38 + Field[] fields = oConvertUtils.getAllFields(parameter);
  39 + for (Field field : fields) {
  40 + log.debug("------field.name------" + field.getName());
  41 + try {
  42 + if ("createBy".equals(field.getName())) {
  43 + field.setAccessible(true);
  44 + Object local_createBy = field.get(parameter);
  45 + field.setAccessible(false);
  46 + if (local_createBy == null || local_createBy.equals("")) {
  47 + if (sysUser != null) {
  48 + // 登录人账号
  49 + field.setAccessible(true);
  50 + field.set(parameter, sysUser.getRealname());
  51 + field.setAccessible(false);
  52 + }
  53 + }
  54 + }
  55 + // 注入创建时间
  56 + if ("createTime".equals(field.getName())) {
  57 + field.setAccessible(true);
  58 + Object local_createDate = field.get(parameter);
  59 + field.setAccessible(false);
  60 + if (local_createDate == null || local_createDate.equals("")) {
  61 + field.setAccessible(true);
  62 + field.set(parameter, new Date());
  63 + field.setAccessible(false);
  64 + }
  65 + }
  66 + // 注入部门编码
  67 + if ("sysOrgCode".equals(field.getName())) {
  68 + field.setAccessible(true);
  69 + Object local_sysOrgCode = field.get(parameter);
  70 + field.setAccessible(false);
  71 + if (local_sysOrgCode == null || local_sysOrgCode.equals("")) {
  72 + // 获取登录用户信息
  73 + if (sysUser != null) {
  74 + field.setAccessible(true);
  75 + field.set(parameter, sysUser.getOrgCode());
  76 + field.setAccessible(false);
  77 + }
  78 + }
  79 + }
  80 + } catch (Exception e) {
  81 + }
  82 + }
  83 + }
  84 + if (SqlCommandType.UPDATE == sqlCommandType) {
  85 + LoginUser sysUser = this.getLoginUser();
  86 + Field[] fields = null;
  87 + if (parameter instanceof MapperMethod.ParamMap) {
  88 + MapperMethod.ParamMap<?> p = (MapperMethod.ParamMap<?>)parameter;
  89 + // update-begin-author:scott date:20190729 for:批量更新报错issues/IZA3Q--
  90 + if (p.containsKey("et")) {
  91 + parameter = p.get("et");
  92 + } else {
  93 + parameter = p.get("param1");
  94 + }
  95 + // update-end-author:scott date:20190729 for:批量更新报错issues/IZA3Q-
  96 +
  97 + // update-begin-author:scott date:20190729 for:更新指定字段时报错 issues/#516-
  98 + if (parameter == null) {
  99 + return invocation.proceed();
  100 + }
  101 + // update-end-author:scott date:20190729 for:更新指定字段时报错 issues/#516-
  102 +
  103 + fields = oConvertUtils.getAllFields(parameter);
  104 + } else {
  105 + fields = oConvertUtils.getAllFields(parameter);
  106 + }
  107 +
  108 + for (Field field : fields) {
  109 + log.debug("------field.name------" + field.getName());
  110 + try {
  111 + if ("updateBy".equals(field.getName())) {
  112 + // 获取登录用户信息
  113 + if (sysUser != null) {
  114 + // 登录账号
  115 + field.setAccessible(true);
  116 + field.set(parameter, sysUser.getRealname());
  117 + field.setAccessible(false);
  118 + }
  119 + }
  120 + if ("updateTime".equals(field.getName())) {
  121 + field.setAccessible(true);
  122 + field.set(parameter, new Date());
  123 + field.setAccessible(false);
  124 + }
  125 + } catch (Exception e) {
  126 + e.printStackTrace();
  127 + }
  128 + }
  129 + }
  130 + return invocation.proceed();
  131 + }
  132 +
  133 + @Override
  134 + public Object plugin(Object target) {
  135 + return Plugin.wrap(target, this);
  136 + }
  137 +
  138 + @Override
  139 + public void setProperties(Properties properties) {
  140 + // TODO Auto-generated method stub
  141 + }
  142 +
  143 + // update-begin--Author:scott Date:20191213 for:关于使用Quzrtz 开启线程任务, #465
  144 + private LoginUser getLoginUser() {
  145 + LoginUser sysUser = null;
  146 + try {
  147 + sysUser = SecurityUtils.getSubject().getPrincipal() != null ? (LoginUser)SecurityUtils.getSubject().getPrincipal() : null;
  148 + } catch (Exception e) {
  149 + sysUser = null;
  150 + }
  151 + return sysUser;
  152 + }
  153 +
  154 +}
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
@@ -9,6 +9,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -9,6 +9,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9 import lombok.extern.slf4j.Slf4j; 9 import lombok.extern.slf4j.Slf4j;
10 import org.jeecg.common.system.base.controller.JeecgController; 10 import org.jeecg.common.system.base.controller.JeecgController;
11 import org.jeecg.common.api.vo.Result; 11 import org.jeecg.common.api.vo.Result;
  12 +import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean;
  13 +import org.jeecg.modules.wms.api.mobile.service.IMobileService;
  14 +import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger;
  15 +import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
12 import org.jeecg.utils.HuahengJwtUtil; 16 import org.jeecg.utils.HuahengJwtUtil;
13 import org.jeecg.modules.wms.api.erp.service.IErpService; 17 import org.jeecg.modules.wms.api.erp.service.IErpService;
14 import org.jeecg.modules.wms.config.material.entity.Material; 18 import org.jeecg.modules.wms.config.material.entity.Material;
@@ -64,6 +68,9 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec @@ -64,6 +68,9 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
64 @Autowired 68 @Autowired
65 private IReceiptHeaderService receiptHeaderService; 69 private IReceiptHeaderService receiptHeaderService;
66 70
  71 + @Resource
  72 + private IMobileService mobileService;
  73 +
67 @Autowired 74 @Autowired
68 private IReceiptDetailService receiptDetailService; 75 private IReceiptDetailService receiptDetailService;
69 @Resource 76 @Resource
@@ -134,7 +141,7 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec @@ -134,7 +141,7 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
134 @RequiresPermissions("receiptHeader:delete") 141 @RequiresPermissions("receiptHeader:delete")
135 @DeleteMapping(value = "/delete") 142 @DeleteMapping(value = "/delete")
136 public Result<String> delete(@RequestParam(name = "id", required = true) String id) { 143 public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
137 - receiptHeaderService.delMain(id); 144 + receiptHeaderService.delMain(id,QuantityConstant.WMS_DELETE_RECEIPT);
138 return Result.OK("删除成功!"); 145 return Result.OK("删除成功!");
139 } 146 }
140 147
@@ -345,4 +352,17 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec @@ -345,4 +352,17 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
345 Result result = erpService.backReceipt(receiptHeader); 352 Result result = erpService.backReceipt(receiptHeader);
346 return result; 353 return result;
347 } 354 }
  355 +
  356 + @AutoLog(value = "PDA入库-快速入库")
  357 + @ApiOperation(value = "PDA入库-快速入库", notes = "快速入库")
  358 + @PostMapping("/quickReceipt")
  359 + @ResponseBody
  360 + @ApiLogger(apiName = "PDA入库-快速入库", from = "PDA")
  361 + public Result<?> quickReceipt(@RequestBody QuickReceiptBean bean, HttpServletRequest req) {
  362 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  363 + bean.setWarehouseCode(warehouseCode);
  364 +
  365 + return mobileService.quickReceipt(bean, warehouseCode);
  366 +
  367 + }
348 } 368 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/IReceiptHeaderService.java
@@ -17,9 +17,9 @@ import java.util.List; @@ -17,9 +17,9 @@ import java.util.List;
17 public interface IReceiptHeaderService extends IService<ReceiptHeader> { 17 public interface IReceiptHeaderService extends IService<ReceiptHeader> {
18 18
19 /** 19 /**
20 - * 删除一对多 20 + * 删除一对多 reason进入历史单据的原因
21 */ 21 */
22 - public boolean delMain(String id); 22 + public boolean delMain(String id,String reason);
23 23
24 /** 24 /**
25 * 批量删除一对多 25 * 批量删除一对多
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
@@ -52,15 +52,21 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl&lt;ReceiptHeaderMapper, R @@ -52,15 +52,21 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl&lt;ReceiptHeaderMapper, R
52 @Resource 52 @Resource
53 private IReceiptHeaderHistoryService receiptHeaderHistoryService; 53 private IReceiptHeaderHistoryService receiptHeaderHistoryService;
54 54
  55 + /**
  56 + * @param id 入库单主表id
  57 + * @param reason 进入历史单据的原因
  58 + * @return
  59 + */
55 @Override 60 @Override
56 @Transactional 61 @Transactional
57 - public boolean delMain(String id) { 62 + public boolean delMain(String id,String reason) {
58 ReceiptHeader receiptHeader = getById(id); 63 ReceiptHeader receiptHeader = getById(id);
59 if (receiptHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { 64 if (receiptHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) {
60 throw new ServiceException("不能删除非新建状态单据"); 65 throw new ServiceException("不能删除非新建状态单据");
61 } 66 }
62 - receiptHeaderHistoryService.saveById(id); 67 + receiptHeaderHistoryService.saveById(id,reason);
63 boolean success = receiptDetailMapper.deleteByMainId(id); 68 boolean success = receiptDetailMapper.deleteByMainId(id);
  69 +
64 if (!success) { 70 if (!success) {
65 return success; 71 return success;
66 } 72 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/entity/ReceiptHeaderHistory.java
@@ -76,6 +76,10 @@ public class ReceiptHeaderHistory implements Serializable { @@ -76,6 +76,10 @@ public class ReceiptHeaderHistory implements Serializable {
76 @Excel(name = "入库单备注", width = 15) 76 @Excel(name = "入库单备注", width = 15)
77 @ApiModelProperty(value = "入库单备注") 77 @ApiModelProperty(value = "入库单备注")
78 private String remark; 78 private String remark;
  79 + /** 来源信息 */
  80 + @Excel(name = "来源信息", width = 15)
  81 + @ApiModelProperty(value = "来源信息")
  82 + private String reason;
79 /** 备用字段1 */ 83 /** 备用字段1 */
80 @Excel(name = "备用字段1", width = 15) 84 @Excel(name = "备用字段1", width = 15)
81 @ApiModelProperty(value = "备用字段1") 85 @ApiModelProperty(value = "备用字段1")
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/IReceiptHeaderHistoryService.java
@@ -29,6 +29,7 @@ public interface IReceiptHeaderHistoryService extends IService&lt;ReceiptHeaderHist @@ -29,6 +29,7 @@ public interface IReceiptHeaderHistoryService extends IService&lt;ReceiptHeaderHist
29 /** 29 /**
30 * 根据删除的入库单主表ID新增历史入库单记录 30 * 根据删除的入库单主表ID新增历史入库单记录
31 * @param id 31 * @param id
  32 + * @param reason 进入历史单据的原因
32 */ 33 */
33 - void saveById(String id); 34 + void saveById(String id,String reason);
34 } 35 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/impl/ReceiptHeaderHistoryServiceImpl.java
@@ -68,9 +68,10 @@ public class ReceiptHeaderHistoryServiceImpl extends ServiceImpl&lt;ReceiptHeaderHi @@ -68,9 +68,10 @@ public class ReceiptHeaderHistoryServiceImpl extends ServiceImpl&lt;ReceiptHeaderHi
68 /** 68 /**
69 * 根据删除的入库单主表ID新增历史入库单记录 69 * 根据删除的入库单主表ID新增历史入库单记录
70 * @param id 70 * @param id
  71 + * @param reason 进入历史单据的原因
71 */ 72 */
72 @Override 73 @Override
73 - public void saveById(String id) { 74 + public void saveById(String id,String reason) {
74 ReceiptHeader receiptHeader = receiptHeaderService.getById(id); 75 ReceiptHeader receiptHeader = receiptHeaderService.getById(id);
75 ReceiptHeaderHistory receiptHeaderHistory = new ReceiptHeaderHistory(); 76 ReceiptHeaderHistory receiptHeaderHistory = new ReceiptHeaderHistory();
76 receiptHeaderHistory.setCode(receiptHeader.getCode()); 77 receiptHeaderHistory.setCode(receiptHeader.getCode());
@@ -84,6 +85,7 @@ public class ReceiptHeaderHistoryServiceImpl extends ServiceImpl&lt;ReceiptHeaderHi @@ -84,6 +85,7 @@ public class ReceiptHeaderHistoryServiceImpl extends ServiceImpl&lt;ReceiptHeaderHi
84 receiptHeaderHistory.setTotalqty(receiptHeader.getTotalqty()); 85 receiptHeaderHistory.setTotalqty(receiptHeader.getTotalqty());
85 receiptHeaderHistory.setTotallines(receiptHeader.getTotallines()); 86 receiptHeaderHistory.setTotallines(receiptHeader.getTotallines());
86 receiptHeaderHistory.setRemark(receiptHeader.getRemark()); 87 receiptHeaderHistory.setRemark(receiptHeader.getRemark());
  88 + receiptHeaderHistory.setReason(reason);
87 receiptHeaderHistory.setUserdef1(receiptHeader.getUserdef1()); 89 receiptHeaderHistory.setUserdef1(receiptHeader.getUserdef1());
88 receiptHeaderHistory.setUserdef2(receiptHeader.getUserdef2()); 90 receiptHeaderHistory.setUserdef2(receiptHeader.getUserdef2());
89 receiptHeaderHistory.setUserdef3(receiptHeader.getUserdef3()); 91 receiptHeaderHistory.setUserdef3(receiptHeader.getUserdef3());
huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java
@@ -10,8 +10,6 @@ import org.jeecg.common.exception.JeecgBootException; @@ -10,8 +10,6 @@ import org.jeecg.common.exception.JeecgBootException;
10 import org.jeecg.common.util.oConvertUtils; 10 import org.jeecg.common.util.oConvertUtils;
11 import org.jeecg.modules.wms.framework.aspectj.dto.ApiAuthentication; 11 import org.jeecg.modules.wms.framework.aspectj.dto.ApiAuthentication;
12 import org.jeecg.modules.wms.framework.aspectj.dto.RSA256Key; 12 import org.jeecg.modules.wms.framework.aspectj.dto.RSA256Key;
13 -import org.springframework.beans.factory.annotation.Autowired;  
14 -import org.springframework.core.env.Environment;  
15 13
16 import com.auth0.jwt.JWT; 14 import com.auth0.jwt.JWT;
17 import com.auth0.jwt.JWTVerifier; 15 import com.auth0.jwt.JWTVerifier;
@@ -21,7 +19,6 @@ import com.auth0.jwt.interfaces.DecodedJWT; @@ -21,7 +19,6 @@ import com.auth0.jwt.interfaces.DecodedJWT;
21 19
22 import cn.hutool.core.date.DatePattern; 20 import cn.hutool.core.date.DatePattern;
23 import cn.hutool.core.date.DateUtil; 21 import cn.hutool.core.date.DateUtil;
24 -import net.bytebuddy.asm.Advice.This;  
25 22
26 public class HuahengJwtUtil { 23 public class HuahengJwtUtil {
27 24
@@ -158,8 +155,8 @@ public class HuahengJwtUtil { @@ -158,8 +155,8 @@ public class HuahengJwtUtil {
158 public static void main(String[] args) throws Exception { 155 public static void main(String[] args) throws Exception {
159 ApiAuthentication apiAuthentication = new ApiAuthentication(); 156 ApiAuthentication apiAuthentication = new ApiAuthentication();
160 // 生成TOKEN必填参数 157 // 生成TOKEN必填参数
161 - apiAuthentication.setOperator("TanYibin"); // Token提供方  
162 - apiAuthentication.setAudience("ACS001"); // Token使用方 158 + apiAuthentication.setOperator("youjie"); // Token提供方
  159 + apiAuthentication.setAudience("pda"); // Token使用方
163 apiAuthentication.setExpireDateTime(DateUtil.parse("2099-12-31 23:59:59", DatePattern.NORM_DATETIME_PATTERN)); // Token失效时间 160 apiAuthentication.setExpireDateTime(DateUtil.parse("2099-12-31 23:59:59", DatePattern.NORM_DATETIME_PATTERN)); // Token失效时间
164 161
165 String tokenString = sign(apiAuthentication); 162 String tokenString = sign(apiAuthentication);
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
@@ -707,4 +707,10 @@ public class QuantityConstant { @@ -707,4 +707,10 @@ public class QuantityConstant {
707 public static final String ERP_PASSWORD = "123123"; 707 public static final String ERP_PASSWORD = "123123";
708 public static final String ERP_LCID = "2052"; 708 public static final String ERP_LCID = "2052";
709 public static final String ERP_ServerUrl = "http://erptest.gani.com.cn/K3Cloud/"; 709 public static final String ERP_ServerUrl = "http://erptest.gani.com.cn/K3Cloud/";
  710 +
  711 + public static final String UPSTREAM_DELETE_RECEIPT="上游删除";
  712 + public static final String BACK_DELETE_RECEIPT="回传删除";
  713 + public static final String WMS_DELETE_RECEIPT="WMS删除";
  714 +
  715 +
710 } 716 }