diff --git a/.idea/libraries/Maven__org_mapstruct_mapstruct_1_1_0_Final.xml b/.idea/libraries/Maven__org_mapstruct_mapstruct_1_1_0_Final.xml
deleted file mode 100644
index 8c06db4..0000000
--- a/.idea/libraries/Maven__org_mapstruct_mapstruct_1_1_0_Final.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5dd275c..e4b18ea 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,94 +3,30 @@
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -156,6 +92,13 @@
+
+
+
@@ -243,7 +186,7 @@
-
+
@@ -279,20 +222,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -307,12 +236,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -365,22 +321,23 @@
-
+
+
-
+
@@ -576,6 +533,8 @@
+
+
1597716938734
@@ -604,7 +563,7 @@
-
+
@@ -623,36 +582,48 @@
+
+
+
+
-
-
+
+
-
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index 1be1d19..98f17de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,7 @@
3.0.5
4.1.19
1.2.22
+ 1.3.0.Final
@@ -241,6 +242,19 @@
1.0.0-SNAPSHOT
test
+
+
+
+ org.mapstruct
+ mapstruct-jdk8
+ ${org.mapstruct.version}
+
+
+
+ org.mapstruct
+ mapstruct-processor
+ ${org.mapstruct.version}
+
@@ -262,7 +276,7 @@
-
+
\ No newline at end of file
diff --git a/wms-parent.iml b/wms-parent.iml
index 717ec9a..05b3728 100644
--- a/wms-parent.iml
+++ b/wms-parent.iml
@@ -128,7 +128,6 @@
-
@@ -159,5 +158,14 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wms-produce-manage/pom.xml b/wms-produce-manage/pom.xml
index 61a3d6b..e623692 100644
--- a/wms-produce-manage/pom.xml
+++ b/wms-produce-manage/pom.xml
@@ -33,6 +33,16 @@
${project.version}
+
+ com.deer
+ wms-system-manage
+ ${project.version}
+
+
+ com.deer
+ wms-base-system
+ ${project.version}
+
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/constant/ProduceManagePublicMethod.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/constant/ProduceManagePublicMethod.java
index d67d045..d3f715e 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/constant/ProduceManagePublicMethod.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/constant/ProduceManagePublicMethod.java
@@ -42,4 +42,9 @@ public class ProduceManagePublicMethod {
String code = creatBatchDetCode(new Date(), 10, "1", "1");
System.out.println("----------"+code);
}
+
+ public static String getUUID(){
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ return uuid;
+ }
}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByOrderInfoMapper.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByOrderInfoMapper.java
index b0aa17e..788371d 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByOrderInfoMapper.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByOrderInfoMapper.java
@@ -1,6 +1,13 @@
package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfo;
+import com.deer.wms.produce.manage.model.MtAloneByOrderInfoParams;
+import com.deer.wms.produce.manage.model.MtAloneByOrderInfoVo;
import com.deer.wms.project.seed.core.mapper.Mapper;
+
+import java.util.List;
+
public interface MtAloneByOrderInfoMapper extends Mapper {
+ List findList(MtAloneByOrderInfoParams params);
+
}
\ No newline at end of file
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByProductInfoMapper.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByProductInfoMapper.java
index a95b3bf..c7c0664 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByProductInfoMapper.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/MtAloneByProductInfoMapper.java
@@ -2,5 +2,11 @@ package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.MtAloneByProductInfo;
import com.deer.wms.project.seed.core.mapper.Mapper;
+
+import java.util.List;
+
public interface MtAloneByProductInfoMapper extends Mapper {
+ void deleteByOrderInfoId(Integer id);
+
+ List findByOrderInfoId(Integer id);
}
\ No newline at end of file
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByOrderInfoMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByOrderInfoMapper.xml
index b198e4a..4707493 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByOrderInfoMapper.xml
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByOrderInfoMapper.xml
@@ -28,4 +28,27 @@
+
+
+
\ No newline at end of file
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByProductInfoMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByProductInfoMapper.xml
index 7944257..112c3e8 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByProductInfoMapper.xml
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/MtAloneByProductInfoMapper.xml
@@ -34,4 +34,15 @@
+
+
+ delete FROM mt_alone_by_product_info
+ WHERE order_info_id = #{id}
+
+
+
\ No newline at end of file
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapstruct/MtAloneByOrderInfoMapping.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapstruct/MtAloneByOrderInfoMapping.java
new file mode 100644
index 0000000..cdce8de
--- /dev/null
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapstruct/MtAloneByOrderInfoMapping.java
@@ -0,0 +1,16 @@
+package com.deer.wms.produce.manage.mapstruct;
+
+import com.deer.wms.produce.manage.model.MtAloneByOrderInfo;
+import com.deer.wms.produce.manage.model.MtAloneByOrderInfoVo;
+import org.mapstruct.Mapper;
+
+/**
+ * @Author weihongyang
+ * @Date 2020/8/21 16:24
+ * @Version 1.0
+ */
+@Mapper
+public interface MtAloneByOrderInfoMapping {
+
+ MtAloneByOrderInfoVo MtAloneByOrderInfoToMtAloneByOrderInfoVo(MtAloneByOrderInfo mtAloneByOrderInfo);
+}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfo.java
index e5334af..292dd67 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfo.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfo.java
@@ -1,5 +1,7 @@
package com.deer.wms.produce.manage.model;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
import java.util.Date;
import javax.persistence.*;
@@ -521,4 +523,11 @@ public class MtAloneByOrderInfo {
public void setNote(String note) {
this.note = note;
}
+
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
}
\ No newline at end of file
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfoParams.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfoParams.java
index 7a5b072..4588706 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfoParams.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfoParams.java
@@ -6,4 +6,24 @@ import com.deer.wms.project.seed.core.service.QueryParams;
* Created by on 2020/08/18.
*/
public class MtAloneByOrderInfoParams extends QueryParams {
+
+ private String beginTime;
+
+ private String endTime;
+
+ public String getBeginTime() {
+ return beginTime;
+ }
+
+ public void setBeginTime(String beginTime) {
+ this.beginTime = beginTime;
+ }
+
+ public String getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(String endTime) {
+ this.endTime = endTime;
+ }
}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfoVo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfoVo.java
new file mode 100644
index 0000000..41b169b
--- /dev/null
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneByOrderInfoVo.java
@@ -0,0 +1,21 @@
+package com.deer.wms.produce.manage.model;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author weihongyang
+ * @Date 2020/8/21 15:09
+ * @Version 1.0
+ */
+public class MtAloneByOrderInfoVo extends MtAloneByOrderInfo{
+ private List mtAloneByProductInfos;
+
+ public List getMtAloneByProductInfos() {
+ return mtAloneByProductInfos;
+ }
+
+ public void setMtAloneByProductInfos(List mtAloneByProductInfos) {
+ this.mtAloneByProductInfos = mtAloneByProductInfos;
+ }
+}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByOrderInfoService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByOrderInfoService.java
index a88709e..81dd998 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByOrderInfoService.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByOrderInfoService.java
@@ -3,6 +3,7 @@ package com.deer.wms.produce.manage.service;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfo;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfoParams;
+import com.deer.wms.produce.manage.model.MtAloneByOrderInfoVo;
import com.deer.wms.project.seed.core.service.Service;
import java.util.List;
@@ -12,5 +13,5 @@ import java.util.List;
public interface MtAloneByOrderInfoService extends Service {
-
+ List findList(MtAloneByOrderInfoParams params);
}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByProductInfoService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByProductInfoService.java
index 4bb4481..90ee021 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByProductInfoService.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneByProductInfoService.java
@@ -12,5 +12,7 @@ import java.util.List;
public interface MtAloneByProductInfoService extends Service {
+ void deleteByOrderInfoId(Integer id);
+ List findByOrderInfoId(Integer id);
}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByOrderInfoServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByOrderInfoServiceImpl.java
index fff230a..5a2e9ca 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByOrderInfoServiceImpl.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByOrderInfoServiceImpl.java
@@ -3,6 +3,7 @@ package com.deer.wms.produce.manage.service.impl;
import com.deer.wms.produce.manage.dao.MtAloneByOrderInfoMapper;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfo;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfoParams;
+import com.deer.wms.produce.manage.model.MtAloneByOrderInfoVo;
import com.deer.wms.produce.manage.service.MtAloneByOrderInfoService;
import com.deer.wms.project.seed.core.service.AbstractService;
@@ -22,5 +23,9 @@ public class MtAloneByOrderInfoServiceImpl extends AbstractService findList(MtAloneByOrderInfoParams params) {
+ return mtAloneByOrderInfoMapper.findList(params);
+ }
}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByProductInfoServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByProductInfoServiceImpl.java
index 782414c..ae507c3 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByProductInfoServiceImpl.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneByProductInfoServiceImpl.java
@@ -22,5 +22,13 @@ public class MtAloneByProductInfoServiceImpl extends AbstractService findByOrderInfoId(Integer id) {
+ return mtAloneByProductInfoMapper.findByOrderInfoId(id);
+ }
}
diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneByOrderInfoController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneByOrderInfoController.java
index ffd135c..d7a539e 100644
--- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneByOrderInfoController.java
+++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneByOrderInfoController.java
@@ -1,16 +1,25 @@
package com.deer.wms.produce.manage.web;
-import com.deer.wms.produce.manage.model.MtAloneByAShelf;
+import com.deer.wms.base.system.model.ClientManage;
+import com.deer.wms.base.system.model.ClientManageCriteria;
+import com.deer.wms.base.system.service.ClientManageService;
+import com.deer.wms.produce.manage.constant.ProduceManagePublicMethod;
+import com.deer.wms.produce.manage.mapstruct.MtAloneByOrderInfoMapping;
+import com.deer.wms.produce.manage.model.*;
+import com.deer.wms.produce.manage.service.MtAloneByProductInfoService;
import com.deer.wms.project.seed.annotation.OperateLog;
import com.deer.wms.project.seed.constant.SystemManageConstant;
import com.deer.wms.project.seed.core.result.CommonCode;
import com.deer.wms.project.seed.core.result.Result;
import com.deer.wms.project.seed.core.result.ResultGenerator;
-import com.deer.wms.produce.manage.model.MtAloneByOrderInfo;
-import com.deer.wms.produce.manage.model.MtAloneByOrderInfoParams;
import com.deer.wms.produce.manage.service.MtAloneByOrderInfoService;
import com.deer.wms.intercept.annotation.User;
import com.deer.wms.intercept.common.data.CurrentUser;
+import com.deer.wms.system.manage.model.user.UserInfo;
+import com.deer.wms.system.manage.model.user.UserInfoCriteria;
+import com.deer.wms.system.manage.model.user.UserInfoVO;
+import com.deer.wms.system.manage.model.user.UserListVO;
+import com.deer.wms.system.manage.service.UserInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -30,7 +39,7 @@ import java.util.List;
/**
* Created by on 2020/08/18.
*/
-@Api(description = "xxx接口")
+@Api(description = "订单接口")
@RestController
@RequestMapping("/mt/alone/by/order/infos")
public class MtAloneByOrderInfoController {
@@ -38,6 +47,18 @@ public class MtAloneByOrderInfoController {
@Autowired
private MtAloneByOrderInfoService mtAloneByOrderInfoService;
+ @Autowired
+ private ClientManageService clientManageService;
+
+ @Autowired
+ private UserInfoService userInfoService;
+
+ @Autowired
+ private MtAloneByProductInfoService mtAloneByProductInfoService;
+
+ @Autowired
+ private MtAloneByOrderInfoMapping mtAloneByOrderInfoMapping;
+
@OperateLog(description = "添加xxx", type = "增加")
@ApiOperation(value = "添加xxx", notes = "添加xxx")
@PostMapping("/add")
@@ -51,16 +72,22 @@ public class MtAloneByOrderInfoController {
return ResultGenerator.genSuccessResult();
}
- @OperateLog(description = "删除xxx", type = "删除")
- @ApiOperation(value = "删除xxx", notes = "删除xxx")
+ @OperateLog(description = "删除订单", type = "删除")
+ @ApiOperation(value = "删除订单", notes = "删除订单")
@DeleteMapping("/delete/{id}")
public Result delete(@PathVariable Integer Id) {
+ mtAloneByProductInfoService.deleteByOrderInfoId(Id);
mtAloneByOrderInfoService.deleteById(Id);
return ResultGenerator.genSuccessResult();
}
-
- @OperateLog(description = "修改xxx", type = "更新")
- @ApiOperation(value = "修改xxx", notes = "修改xxx")
+
+ /**
+ * 修改保存
+ * @param mtAloneByOrderInfo
+ * @return
+ */
+ @OperateLog(description = "修改订单", type = "更新")
+ @ApiOperation(value = "修改订单", notes = "修改订单")
@PostMapping("/update")
public Result update(@RequestBody MtAloneByOrderInfo mtAloneByOrderInfo) {
mtAloneByOrderInfo.setUpdateTime(new Date());
@@ -68,13 +95,32 @@ public class MtAloneByOrderInfoController {
return ResultGenerator.genSuccessResult();
}
+ /**
+ * 修改订单获取修改的数据并填充
+ * @param id
+ * @return
+ */
+ @GetMapping("/update/for/data/{id}")
+ public Result updateForData(@PathVariable Integer id){
+ MtAloneByOrderInfo mtAloneByOrderInfo = mtAloneByOrderInfoService.findById(id);
+ List mtAloneByProductInfos = mtAloneByProductInfoService.findByOrderInfoId(id);
+ MtAloneByOrderInfoVo mtAloneByOrderInfoVo = mtAloneByOrderInfoMapping.MtAloneByOrderInfoToMtAloneByOrderInfoVo(mtAloneByOrderInfo);
+ mtAloneByOrderInfoVo.setMtAloneByProductInfos(mtAloneByProductInfos);
+ return ResultGenerator.genSuccessResult(mtAloneByOrderInfoVo);
+ }
+
@GetMapping("/detail/{id}")
public Result detail(@PathVariable Integer id) {
MtAloneByOrderInfo mtAloneByOrderInfo = mtAloneByOrderInfoService.findById(id);
return ResultGenerator.genSuccessResult(mtAloneByOrderInfo);
}
+
+ /**
+ * 订单条件列表
+ */
@GetMapping("/list")
+ @ApiOperation(value = "查看订单", notes = "查看")
public Result list(MtAloneByOrderInfoParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
@@ -86,10 +132,48 @@ public class MtAloneByOrderInfoController {
params.setCompanyId(null);
}
PageHelper.startPage(params.getPageNum(), params.getPageSize());
- //List list = mtAloneByOrderInfoService.findList(params);
- List list = new ArrayList<>();
+ List list = mtAloneByOrderInfoService.findList(params);
PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo);
}
+ /**
+ * 添加订单的时候获取uuid作为订单编码
+ */
+ @PostMapping("get/order/code")
+ public Result getOrderCode(@ApiIgnore @User CurrentUser currentUser){
+ if(currentUser==null){
+ return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
+ }
+ String orderCode = ProduceManagePublicMethod.getUUID();
+ return ResultGenerator.genSuccessResult(orderCode);
+ }
+
+ /**
+ * 新增订单的获取客户编码
+ */
+ @PostMapping("get/client/code")
+ public Result getClientCode(@ApiIgnore @User CurrentUser currentUser){
+ if(currentUser==null){
+ return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
+ }
+ ClientManageCriteria clientManageCriteria = new ClientManageCriteria();
+ clientManageCriteria.setCompanyId(currentUser.getCompanyId());
+ List list = clientManageService.findList(clientManageCriteria);
+ return ResultGenerator.genSuccessResult(list);
+ }
+
+ /**
+ * 新增订单的获取跟单员
+ */
+ @PostMapping("get/follow/name")
+ public Result getFollowName(@ApiIgnore @User CurrentUser currentUser){
+ if(currentUser==null){
+ return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
+ }
+ UserInfoCriteria userInfoCriteria = new UserInfoCriteria();
+ userInfoCriteria.setCompanyId(currentUser.getCompanyId());
+ List list = userInfoService.findUserFormList(userInfoCriteria);
+ return ResultGenerator.genSuccessResult(list);
+ }
}