|
@@ -3,19 +3,27 @@ package org.jeecg.modules.api.controller; |
|
@@ -3,19 +3,27 @@ package org.jeecg.modules.api.controller; |
|
3
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
3
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
4
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
4
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
6
|
+import io.swagger.annotations.ApiOperation;
|
|
6
|
import lombok.extern.slf4j.Slf4j;
|
7
|
import lombok.extern.slf4j.Slf4j;
|
|
7
|
import org.apache.shiro.SecurityUtils;
|
8
|
import org.apache.shiro.SecurityUtils;
|
|
8
|
import org.apache.shiro.subject.PrincipalCollection;
|
9
|
import org.apache.shiro.subject.PrincipalCollection;
|
|
9
|
import org.apache.shiro.subject.Subject;
|
10
|
import org.apache.shiro.subject.Subject;
|
|
10
|
import org.jeecg.common.api.vo.Result;
|
11
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
12
|
+import org.jeecg.common.aspect.annotation.AutoLog;
|
|
11
|
import org.jeecg.common.system.query.QueryGenerator;
|
13
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
12
|
import org.jeecg.common.system.util.JwtUtil;
|
14
|
import org.jeecg.common.system.util.JwtUtil;
|
|
13
|
import org.jeecg.common.system.vo.LoginUser;
|
15
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
16
|
+import org.jeecg.modules.erp.bidding_info.entity.TblBiddingShenq;
|
|
|
|
17
|
+import org.jeecg.modules.erp.bidding_info.service.ITblBiddingShenqService;
|
|
14
|
import org.jeecg.modules.erp.order_form.entity.TblOrderForm;
|
18
|
import org.jeecg.modules.erp.order_form.entity.TblOrderForm;
|
|
|
|
19
|
+import org.jeecg.modules.erp.order_form.form.OrderForm;
|
|
15
|
import org.jeecg.modules.erp.order_form.service.ITblOrderFormService;
|
20
|
import org.jeecg.modules.erp.order_form.service.ITblOrderFormService;
|
|
|
|
21
|
+import org.jeecg.modules.erp.product_design.entity.TblProductDesign;
|
|
|
|
22
|
+import org.jeecg.modules.erp.product_design.service.ITblProductDesignService;
|
|
16
|
import org.jeecg.modules.system.entity.SysUser;
|
23
|
import org.jeecg.modules.system.entity.SysUser;
|
|
17
|
import org.jeecg.modules.system.service.ISysUserService;
|
24
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
18
|
import org.springframework.beans.factory.annotation.Autowired;
|
25
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
26
|
+import org.springframework.transaction.annotation.Transactional;
|
|
19
|
import org.springframework.web.bind.annotation.*;
|
27
|
import org.springframework.web.bind.annotation.*;
|
|
20
|
|
28
|
|
|
21
|
import javax.servlet.http.HttpServletRequest;
|
29
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -32,6 +40,12 @@ public class ProductDesignController { |
|
@@ -32,6 +40,12 @@ public class ProductDesignController { |
|
32
|
@Autowired
|
40
|
@Autowired
|
|
33
|
private ITblOrderFormService tblOrderFormService;
|
41
|
private ITblOrderFormService tblOrderFormService;
|
|
34
|
|
42
|
|
|
|
|
43
|
+ @Autowired
|
|
|
|
44
|
+ private ITblProductDesignService tblProductDesignService;
|
|
|
|
45
|
+
|
|
|
|
46
|
+ @Autowired
|
|
|
|
47
|
+ private ITblBiddingShenqService tblBiddingShenqService;
|
|
|
|
48
|
+
|
|
35
|
//产品设计订单列表
|
49
|
//产品设计订单列表
|
|
36
|
@GetMapping(value = "/productDesignList")
|
50
|
@GetMapping(value = "/productDesignList")
|
|
37
|
public Result<IPage<TblOrderForm>> getProductDesignList(TblOrderForm tblOrderForm,
|
51
|
public Result<IPage<TblOrderForm>> getProductDesignList(TblOrderForm tblOrderForm,
|
|
@@ -40,7 +54,7 @@ public class ProductDesignController { |
|
@@ -40,7 +54,7 @@ public class ProductDesignController { |
|
40
|
HttpServletRequest req) {
|
54
|
HttpServletRequest req) {
|
|
41
|
|
55
|
|
|
42
|
String userNameByToken = JwtUtil.getUserNameByToken(req);
|
56
|
String userNameByToken = JwtUtil.getUserNameByToken(req);
|
|
43
|
- List<String> roleList = sysUserService.getRole(userNameByToken);
|
57
|
+// List<String> roleList = sysUserService.getRole(userNameByToken);
|
|
44
|
SysUser sysUser = sysUserService.getUserByName(userNameByToken);
|
58
|
SysUser sysUser = sysUserService.getUserByName(userNameByToken);
|
|
45
|
tblOrderForm.setDesigner(sysUser.getWorkNo());
|
59
|
tblOrderForm.setDesigner(sysUser.getWorkNo());
|
|
46
|
// QueryWrapper<TblOrderForm> queryWrapper = QueryGenerator.initQueryWrapper(tblOrderForm, req.getParameterMap());
|
60
|
// QueryWrapper<TblOrderForm> queryWrapper = QueryGenerator.initQueryWrapper(tblOrderForm, req.getParameterMap());
|
|
@@ -59,4 +73,75 @@ public class ProductDesignController { |
|
@@ -59,4 +73,75 @@ public class ProductDesignController { |
|
59
|
tblOrderFormService.updateDesignerByOrderId(tblOrderForm);
|
73
|
tblOrderFormService.updateDesignerByOrderId(tblOrderForm);
|
|
60
|
return Result.OK("分派成功!");
|
74
|
return Result.OK("分派成功!");
|
|
61
|
}
|
75
|
}
|
|
|
|
76
|
+
|
|
|
|
77
|
+ /**
|
|
|
|
78
|
+ * 添加
|
|
|
|
79
|
+ *
|
|
|
|
80
|
+ * @param tblOrderForm
|
|
|
|
81
|
+ * @return
|
|
|
|
82
|
+ */
|
|
|
|
83
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
84
|
+ @AutoLog(value = "产品设计图-添加")
|
|
|
|
85
|
+ @ApiOperation(value="产品设计图-添加", notes="产品设计图-添加")
|
|
|
|
86
|
+ @PostMapping(value = "/add")
|
|
|
|
87
|
+ public Result<String> add(@RequestBody OrderForm tblOrderForm,HttpServletRequest req) {
|
|
|
|
88
|
+
|
|
|
|
89
|
+ String userNameByToken = JwtUtil.getUserNameByToken(req);
|
|
|
|
90
|
+ SysUser sysUser = sysUserService.getUserByName(userNameByToken);
|
|
|
|
91
|
+
|
|
|
|
92
|
+ //保存产品设计
|
|
|
|
93
|
+ TblProductDesign tblProductDesign = new TblProductDesign();
|
|
|
|
94
|
+ tblProductDesign.setOrderId(tblOrderForm.getOrderId());
|
|
|
|
95
|
+ tblProductDesign.setDesignPic(tblOrderForm.getPics());
|
|
|
|
96
|
+ tblProductDesign.setDesignFile(tblOrderForm.getFiles());
|
|
|
|
97
|
+ tblProductDesignService.save(tblProductDesign);
|
|
|
|
98
|
+ //批量保存材料及外购件
|
|
|
|
99
|
+ List<TblBiddingShenq> biddingSqList = tblOrderForm.getBiddingSqList();
|
|
|
|
100
|
+ for (TblBiddingShenq biddingShenq:biddingSqList){
|
|
|
|
101
|
+ biddingShenq.setApplicant(sysUser.getWorkNo());
|
|
|
|
102
|
+ }
|
|
|
|
103
|
+ tblBiddingShenqService.saveBatch(biddingSqList);
|
|
|
|
104
|
+ //更新生产订单表中产品设计状态
|
|
|
|
105
|
+ TblOrderForm tblOrderForm1 = new TblOrderForm();
|
|
|
|
106
|
+ tblOrderForm1.setProductDesignStatus("1");
|
|
|
|
107
|
+ tblOrderForm1.setOrderId(tblOrderForm.getOrderId());
|
|
|
|
108
|
+ tblOrderFormService.updateProductDesignStatusByOrderId(tblOrderForm1);
|
|
|
|
109
|
+ return Result.OK("添加成功!");
|
|
|
|
110
|
+ }
|
|
|
|
111
|
+
|
|
|
|
112
|
+ /**
|
|
|
|
113
|
+ * 编辑
|
|
|
|
114
|
+ *
|
|
|
|
115
|
+ * @param tblOrderForm
|
|
|
|
116
|
+ * @return
|
|
|
|
117
|
+ */
|
|
|
|
118
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
119
|
+ @AutoLog(value = "产品设计图-编辑")
|
|
|
|
120
|
+ @ApiOperation(value="产品设计图-编辑", notes="产品设计图-编辑")
|
|
|
|
121
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
122
|
+ public Result<String> edit(@RequestBody OrderForm tblOrderForm,HttpServletRequest req) {
|
|
|
|
123
|
+
|
|
|
|
124
|
+ String userNameByToken = JwtUtil.getUserNameByToken(req);
|
|
|
|
125
|
+ SysUser sysUser = sysUserService.getUserByName(userNameByToken);
|
|
|
|
126
|
+
|
|
|
|
127
|
+ //删除材料及外购件
|
|
|
|
128
|
+ tblBiddingShenqService.deleteByOrdeId(tblOrderForm.getOrderId());
|
|
|
|
129
|
+ //批量保存材料及外购件
|
|
|
|
130
|
+ List<TblBiddingShenq> biddingSqList = tblOrderForm.getBiddingSqList();
|
|
|
|
131
|
+ for (TblBiddingShenq biddingShenq:biddingSqList){
|
|
|
|
132
|
+ biddingShenq.setApplicant(sysUser.getWorkNo());
|
|
|
|
133
|
+ }
|
|
|
|
134
|
+ tblBiddingShenqService.saveBatch(biddingSqList);
|
|
|
|
135
|
+
|
|
|
|
136
|
+ //保存产品设计
|
|
|
|
137
|
+ TblProductDesign tblProductDesign = new TblProductDesign();
|
|
|
|
138
|
+ //前端处理把产品设计的id传给生产订单id
|
|
|
|
139
|
+ tblProductDesign.setId(tblOrderForm.getId());
|
|
|
|
140
|
+ tblProductDesign.setOrderId(tblOrderForm.getOrderId());
|
|
|
|
141
|
+ tblProductDesign.setDesignPic(tblOrderForm.getPics());
|
|
|
|
142
|
+ tblProductDesign.setDesignFile(tblOrderForm.getFiles());
|
|
|
|
143
|
+ tblProductDesignService.updateById(tblProductDesign);
|
|
|
|
144
|
+// tblProductDesignService.updateByOrderId(tblProductDesign);
|
|
|
|
145
|
+ return Result.OK("编辑成功!");
|
|
|
|
146
|
+ }
|
|
62
|
} |
147
|
} |