731e974e 康伟

kangwei: 在线考试,题库提供新接口

          采购计划相关接口
1 个父辈 d6473e16
正在显示 27 个修改的文件 包含 958 行增加12 行删除
...@@ -8,6 +8,8 @@ import java.io.UnsupportedEncodingException; ...@@ -8,6 +8,8 @@ import java.io.UnsupportedEncodingException;
8 import java.net.URLDecoder; 8 import java.net.URLDecoder;
9 import javax.servlet.http.HttpServletRequest; 9 import javax.servlet.http.HttpServletRequest;
10 import javax.servlet.http.HttpServletResponse; 10 import javax.servlet.http.HttpServletResponse;
11
12 import com.baomidou.mybatisplus.extension.service.additional.query.impl.QueryChainWrapper;
11 import com.skua.core.api.vo.Result; 13 import com.skua.core.api.vo.Result;
12 import com.skua.core.aspect.annotation.AutoLog; 14 import com.skua.core.aspect.annotation.AutoLog;
13 import com.skua.core.context.BaseContextHandler; 15 import com.skua.core.context.BaseContextHandler;
...@@ -69,6 +71,21 @@ public class QuestionDBController { ...@@ -69,6 +71,21 @@ public class QuestionDBController {
69 * @Description: TODO(这里描述这个方法的需求变更情况) 71 * @Description: TODO(这里描述这个方法的需求变更情况)
70 */ 72 */
71 73
74 @AutoLog(value = "在线考试-题库-列表查询")
75 @ApiOperation(value="在线考试-题库-列表查询", notes="在线考试-题库-列表查询")
76 @GetMapping(value = "/qbList")
77 public Result<List<QuestionDB>> queryPageList(QuestionDB questionDB, HttpServletRequest req) {
78 Result<List<QuestionDB>> result = new Result<List<QuestionDB>>();
79 QueryWrapper<QuestionDB> queryWrapper = QueryGenerator.initQueryWrapper(questionDB, req.getParameterMap());
80 List<QuestionDB> questionDBList = questionDBService.list(queryWrapper);
81 result.setSuccess(true);
82 result.setResult(questionDBList);
83 return result;
84 }
85
86
87
88
72 @AutoLog(value = "在线考试-题库-分页列表查询") 89 @AutoLog(value = "在线考试-题库-分页列表查询")
73 @ApiOperation(value="在线考试-题库-分页列表查询", notes="在线考试-题库-分页列表查询") 90 @ApiOperation(value="在线考试-题库-分页列表查询", notes="在线考试-题库-分页列表查询")
74 @GetMapping(value = "/list") 91 @GetMapping(value = "/list")
...@@ -154,7 +171,6 @@ public class QuestionDBController { ...@@ -154,7 +171,6 @@ public class QuestionDBController {
154 if( flag ){ 171 if( flag ){
155 return Result.error("删除失败!该题库下有试题,不能删除!"); 172 return Result.error("删除失败!该题库下有试题,不能删除!");
156 } 173 }
157
158 questionDBService.removeById(id); 174 questionDBService.removeById(id);
159 } catch (Exception e) { 175 } catch (Exception e) {
160 log.error("删除失败",e.getMessage()); 176 log.error("删除失败",e.getMessage());
...@@ -220,7 +236,7 @@ public class QuestionDBController { ...@@ -220,7 +236,7 @@ public class QuestionDBController {
220 * @Description: TODO(这里描述这个方法的需求变更情况) 236 * @Description: TODO(这里描述这个方法的需求变更情况)
221 */ 237 */
222 238
223 @RequestMapping(value = "/exportXls") 239 /*@RequestMapping(value = "/exportXls")
224 public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { 240 public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
225 // Step.1 组装查询条件 241 // Step.1 组装查询条件
226 QueryWrapper<QuestionDB> queryWrapper = null; 242 QueryWrapper<QuestionDB> queryWrapper = null;
...@@ -244,7 +260,7 @@ public class QuestionDBController { ...@@ -244,7 +260,7 @@ public class QuestionDBController {
244 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("在线考试-题库列表数据", "导出人:Jeecg", "导出信息")); 260 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("在线考试-题库列表数据", "导出人:Jeecg", "导出信息"));
245 mv.addObject(NormalExcelConstants.DATA_LIST, pageList); 261 mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
246 return mv; 262 return mv;
247 } 263 }*/
248 264
249 /** 265 /**
250 * <pre> 266 * <pre>
...@@ -256,7 +272,7 @@ public class QuestionDBController { ...@@ -256,7 +272,7 @@ public class QuestionDBController {
256 * @author 开发者姓名, 开发时间 272 * @author 开发者姓名, 开发时间
257 * @Description: TODO(这里描述这个方法的需求变更情况) 273 * @Description: TODO(这里描述这个方法的需求变更情况)
258 */ 274 */
259 @RequestMapping(value = "/importExcel", method = RequestMethod.POST) 275 /*@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
260 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { 276 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
261 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; 277 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
262 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); 278 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
...@@ -282,6 +298,6 @@ public class QuestionDBController { ...@@ -282,6 +298,6 @@ public class QuestionDBController {
282 } 298 }
283 } 299 }
284 return Result.ok("文件导入失败!"); 300 return Result.ok("文件导入失败!");
285 } 301 }*/
286 302
287 } 303 }
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId; 6 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName; 7 import com.baomidou.mybatisplus.annotation.TableName;
8 import com.baomidou.mybatisplus.annotation.TableField; 8 import com.baomidou.mybatisplus.annotation.TableField;
9 import com.skua.core.aspect.annotation.Dict;
9 import io.swagger.annotations.ApiModel; 10 import io.swagger.annotations.ApiModel;
10 import io.swagger.annotations.ApiModelProperty; 11 import io.swagger.annotations.ApiModelProperty;
11 import lombok.Data; 12 import lombok.Data;
...@@ -32,6 +33,7 @@ public class Paper { ...@@ -32,6 +33,7 @@ public class Paper {
32 /**部门编号*/ 33 /**部门编号*/
33 @Excel(name = "部门编号", width = 15) 34 @Excel(name = "部门编号", width = 15)
34 @ApiModelProperty(value = "部门编号") 35 @ApiModelProperty(value = "部门编号")
36 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
35 private String departId; 37 private String departId;
36 /**试卷标题*/ 38 /**试卷标题*/
37 @Excel(name = "试卷标题", width = 15) 39 @Excel(name = "试卷标题", width = 15)
......
...@@ -52,7 +52,7 @@ public class Question { ...@@ -52,7 +52,7 @@ public class Question {
52 /**试题解析*/ 52 /**试题解析*/
53 @Excel(name = "试题解析", width = 15) 53 @Excel(name = "试题解析", width = 15)
54 @ApiModelProperty(value = "试题解析") 54 @ApiModelProperty(value = "试题解析")
55 private String analyze; 55 private String analyzes;
56 /**备注*/ 56 /**备注*/
57 @Excel(name = "备注", width = 15) 57 @Excel(name = "备注", width = 15)
58 @ApiModelProperty(value = "备注") 58 @ApiModelProperty(value = "备注")
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId; 6 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName; 7 import com.baomidou.mybatisplus.annotation.TableName;
8 import com.baomidou.mybatisplus.annotation.TableField; 8 import com.baomidou.mybatisplus.annotation.TableField;
9 import com.skua.core.aspect.annotation.Dict;
9 import io.swagger.annotations.ApiModel; 10 import io.swagger.annotations.ApiModel;
10 import io.swagger.annotations.ApiModelProperty; 11 import io.swagger.annotations.ApiModelProperty;
11 import lombok.Data; 12 import lombok.Data;
...@@ -32,6 +33,7 @@ public class QuestionDB { ...@@ -32,6 +33,7 @@ public class QuestionDB {
32 /**厂id*/ 33 /**厂id*/
33 @Excel(name = "厂id", width = 15) 34 @Excel(name = "厂id", width = 15)
34 @ApiModelProperty(value = "厂id") 35 @ApiModelProperty(value = "厂id")
36 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
35 private String departId; 37 private String departId;
36 /**创建人编号*/ 38 /**创建人编号*/
37 @Excel(name = "创建人编号", width = 15) 39 @Excel(name = "创建人编号", width = 15)
......
...@@ -51,7 +51,7 @@ public class QuestionVO implements Serializable{ ...@@ -51,7 +51,7 @@ public class QuestionVO implements Serializable{
51 /**试题解析*/ 51 /**试题解析*/
52 @Excel(name = "试题解析", width = 15) 52 @Excel(name = "试题解析", width = 15)
53 @ApiModelProperty(value = "试题解析") 53 @ApiModelProperty(value = "试题解析")
54 private String analyze; 54 private String analyzes;
55 /**备注*/ 55 /**备注*/
56 @Excel(name = "备注", width = 15) 56 @Excel(name = "备注", width = 15)
57 @ApiModelProperty(value = "备注") 57 @ApiModelProperty(value = "备注")
......
1 package com.skua.modules.erp.controller;
2
3 import java.util.Arrays;
4 import java.util.List;
5 import java.util.Map;
6 import java.io.IOException;
7 import java.io.UnsupportedEncodingException;
8 import java.net.URLDecoder;
9 import javax.servlet.http.HttpServletRequest;
10 import javax.servlet.http.HttpServletResponse;
11 import com.skua.core.api.vo.Result;
12 import com.skua.core.aspect.annotation.AutoLog;
13 import com.skua.core.context.BaseContextHandler;
14 import com.skua.core.query.QueryGenerator;
15 import com.skua.core.service.ISequenceService;
16 import com.skua.core.util.ConvertUtils;
17 import com.skua.modules.erp.entity.ApproveRecord;
18 import com.skua.modules.erp.service.IApproveRecordService;
19 import java.util.Date;
20 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
21 import com.baomidou.mybatisplus.core.metadata.IPage;
22 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
23 import lombok.extern.slf4j.Slf4j;
24
25 import org.jeecgframework.poi.excel.ExcelImportUtil;
26 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
27 import org.jeecgframework.poi.excel.entity.ExportParams;
28 import org.jeecgframework.poi.excel.entity.ImportParams;
29 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
30
31 import org.springframework.beans.factory.annotation.Autowired;
32 import org.springframework.web.bind.annotation.*;
33 import org.springframework.web.multipart.MultipartFile;
34 import org.springframework.web.multipart.MultipartHttpServletRequest;
35 import org.springframework.web.servlet.ModelAndView;
36 import com.alibaba.fastjson.JSON;
37 import io.swagger.annotations.Api;
38 import io.swagger.annotations.ApiOperation;
39
40 /**
41 * <pre>
42 * 审批记录表
43 * </pre>
44 * @author 开发者姓名
45 * @version V0.1, 开发时间
46 */
47 @Slf4j
48 @Api(tags="审批记录表")
49 @RestController("webApproveRecordController")
50 @RequestMapping("/web/erp/approveRecord")
51 public class ApproveRecordController {
52 @Autowired
53 private IApproveRecordService approveRecordService;
54
55 /**
56 * <pre>
57 * 分页列表查询
58 * </pre>
59 * @param approveRecord
60 * @param pageNo
61 * @param pageSize
62 * @param req
63 * @return
64 * @author 开发者姓名, 开发时间
65 * @Description: TODO(这里描述这个方法的需求变更情况)
66 */
67
68 @AutoLog(value = "审批记录表-分页列表查询")
69 @ApiOperation(value="审批记录表-分页列表查询", notes="审批记录表-分页列表查询")
70 @GetMapping(value = "/list")
71 public Result<IPage<ApproveRecord>> queryPageList(ApproveRecord approveRecord,
72 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
74 HttpServletRequest req) {
75 Result<IPage<ApproveRecord>> result = new Result<IPage<ApproveRecord>>();
76 QueryWrapper<ApproveRecord> queryWrapper = QueryGenerator.initQueryWrapper(approveRecord, req.getParameterMap());
77 Page<ApproveRecord> page = new Page<ApproveRecord>(pageNo, pageSize);
78 IPage<ApproveRecord> pageList = approveRecordService.page(page, queryWrapper);
79 result.setSuccess(true);
80 result.setResult(pageList);
81 return result;
82 }
83
84 /**
85 * <pre>
86 * 添加
87 * </pre>
88 * @param approveRecord
89 * @return
90 * @author 开发者姓名, 开发时间
91 * @Description: TODO(这里描述这个方法的需求变更情况)
92 */
93 @AutoLog(value = "审批记录表-添加")
94 @ApiOperation(value="审批记录表-添加", notes="审批记录表-添加")
95 @PostMapping(value = "/add")
96 public Result<ApproveRecord> add(@RequestBody ApproveRecord approveRecord) {
97 Result<ApproveRecord> result = new Result<ApproveRecord>();
98 try {
99 approveRecordService.save(approveRecord);
100 result.success("添加成功!");
101 } catch (Exception e) {
102 log.error(e.getMessage(),e);
103 result.error500("操作失败");
104 }
105 return result;
106 }
107 /**
108 * <pre>
109 * 编辑
110 * </pre>
111 * @param approveRecord
112 * @return
113 * @author 开发者姓名, 开发时间
114 * @Description: TODO(这里描述这个方法的需求变更情况)
115 */
116 @AutoLog(value = "审批记录表-编辑")
117 @ApiOperation(value="审批记录表-编辑", notes="审批记录表-编辑")
118 @PutMapping(value = "/edit")
119 public Result<ApproveRecord> edit(@RequestBody ApproveRecord approveRecord) {
120 Result<ApproveRecord> result = new Result<ApproveRecord>();
121 ApproveRecord approveRecordEntity = approveRecordService.getById(approveRecord.getId());
122 if(approveRecordEntity==null) {
123 result.error500("未找到对应实体");
124 }else {
125 boolean ok = approveRecordService.updateById(approveRecord);
126 //TODO 返回false说明什么?
127 if(ok) {
128 result.success("修改成功!");
129 }
130 }
131
132 return result;
133 }
134 /**
135 * <pre>
136 * 通过id删除
137 * </pre>
138 * @param id
139 * @return
140 * @author 开发者姓名, 开发时间
141 * @Description: TODO(这里描述这个方法的需求变更情况)
142 */
143 @AutoLog(value = "审批记录表-通过id删除")
144 @ApiOperation(value="审批记录表-通过id删除", notes="审批记录表-通过id删除")
145 @DeleteMapping(value = "/delete")
146 public Result<?> delete(@RequestParam(name="id",required=true) String id) {
147 try {
148 approveRecordService.removeById(id);
149 } catch (Exception e) {
150 log.error("删除失败",e.getMessage());
151 return Result.error("删除失败!");
152 }
153 return Result.ok("删除成功!");
154 }
155
156 /**
157 * <pre>
158 * 批量删除
159 * </pre>
160 * @param ids
161 * @return
162 * @author 开发者姓名, 开发时间
163 * @Description: TODO(这里描述这个方法的需求变更情况)
164 */
165 @AutoLog(value = "审批记录表-批量删除")
166 @ApiOperation(value="审批记录表-批量删除", notes="审批记录表-批量删除")
167 @DeleteMapping(value = "/deleteBatch")
168 public Result<ApproveRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
169 Result<ApproveRecord> result = new Result<ApproveRecord>();
170 if(ids==null || "".equals(ids.trim())) {
171 result.error500("参数不识别!");
172 }else {
173 this.approveRecordService.removeByIds(Arrays.asList(ids.split(",")));
174 result.success("删除成功!");
175 }
176 return result;
177 }
178 /**
179 * <pre>
180 * 通过id查询
181 * </pre>
182 * @param id
183 * @return
184 * @author 开发者姓名, 开发时间
185 * @Description: TODO(这里描述这个方法的需求变更情况)
186 */
187 @AutoLog(value = "审批记录表-通过id查询")
188 @ApiOperation(value="审批记录表-通过id查询", notes="审批记录表-通过id查询")
189 @GetMapping(value = "/queryById")
190 public Result<ApproveRecord> queryById(@RequestParam(name="id",required=true) String id) {
191 Result<ApproveRecord> result = new Result<ApproveRecord>();
192 ApproveRecord approveRecord = approveRecordService.getById(id);
193 if(approveRecord==null) {
194 result.error500("未找到对应实体");
195 }else {
196 result.setResult(approveRecord);
197 result.setSuccess(true);
198 }
199 return result;
200 }
201
202 /**
203 * <pre>
204 * 导出excel
205 * </pre>
206 * @param request
207 * @param response
208 * @return
209 * @author 开发者姓名, 开发时间
210 * @Description: TODO(这里描述这个方法的需求变更情况)
211 */
212
213 @RequestMapping(value = "/exportXls")
214 public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
215 // Step.1 组装查询条件
216 QueryWrapper<ApproveRecord> queryWrapper = null;
217 try {
218 String paramsStr = request.getParameter("paramsStr");
219 if (ConvertUtils.isNotEmpty(paramsStr)) {
220 String deString = URLDecoder.decode(paramsStr, "UTF-8");
221 ApproveRecord approveRecord = JSON.parseObject(deString, ApproveRecord.class);
222 queryWrapper = QueryGenerator.initQueryWrapper(approveRecord, request.getParameterMap());
223 }
224 } catch (UnsupportedEncodingException e) {
225 e.printStackTrace();
226 }
227
228 //Step.2 AutoPoi 导出Excel
229 ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
230 List<ApproveRecord> pageList = approveRecordService.list(queryWrapper);
231 //导出文件名称
232 mv.addObject(NormalExcelConstants.FILE_NAME, "审批记录表列表");
233 mv.addObject(NormalExcelConstants.CLASS, ApproveRecord.class);
234 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("审批记录表列表数据", "导出人:Jeecg", "导出信息"));
235 mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
236 return mv;
237 }
238
239 /**
240 * <pre>
241 * 通过excel导入数据
242 * </pre>
243 * @param request
244 * @param response
245 * @return
246 * @author 开发者姓名, 开发时间
247 * @Description: TODO(这里描述这个方法的需求变更情况)
248 */
249 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
250 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
251 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
252 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
253 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
254 MultipartFile file = entity.getValue();// 获取上传文件对象
255 ImportParams params = new ImportParams();
256 params.setTitleRows(2);
257 params.setHeadRows(1);
258 params.setNeedSave(true);
259 try {
260 List<ApproveRecord> listApproveRecords = ExcelImportUtil.importExcel(file.getInputStream(), ApproveRecord.class, params);
261 approveRecordService.saveBatch(listApproveRecords);
262 return Result.ok("文件导入成功!数据行数:" + listApproveRecords.size());
263 } catch (Exception e) {
264 log.error(e.getMessage(),e);
265 return Result.error("文件导入失败:"+e.getMessage());
266 } finally {
267 try {
268 file.getInputStream().close();
269 } catch (IOException e) {
270 e.printStackTrace();
271 }
272 }
273 }
274 return Result.ok("文件导入失败!");
275 }
276
277 }
1 package com.skua.modules.erp.entity;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName;
8 import com.baomidou.mybatisplus.annotation.TableField;
9 import com.skua.core.aspect.annotation.Dict;
10 import io.swagger.annotations.ApiModel;
11 import io.swagger.annotations.ApiModelProperty;
12 import lombok.Data;
13 import lombok.EqualsAndHashCode;
14 import lombok.experimental.Accessors;
15 import com.fasterxml.jackson.annotation.JsonFormat;
16 import org.springframework.format.annotation.DateTimeFormat;
17 import org.jeecgframework.poi.excel.annotation.Excel;
18
19 /**
20 * 审批记录表
21 */
22 @Data
23 @TableName("erp_approve_record")
24 @EqualsAndHashCode(callSuper = false)
25 @Accessors(chain = true)
26 @ApiModel(value="erp_approve_record对象", description="审批记录表")
27 public class ApproveRecord implements Serializable{
28
29 /**主键*/
30 @TableId(type = IdType.ID_WORKER_STR)
31 @ApiModelProperty(value = "主键")
32 private String id;
33 /**审核类型:采购计划CGJH;采购合同CGHT;分销合同:FXHT*/
34 @Excel(name = "审核类型:采购计划CGJH;采购合同CGHT;分销合同:FXHT", width = 15)
35 @ApiModelProperty(value = "审核类型:采购计划CGJH;采购合同CGHT;分销合同:FXHT")
36 private String approveType;
37 /**申请人*/
38 @Excel(name = "申请人", width = 15)
39 @ApiModelProperty(value = "申请人")
40 @Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
41 private String applyUser;
42 /**申请单号*/
43 @Excel(name = "申请单号", width = 15)
44 @ApiModelProperty(value = "申请单号")
45 private String applyId;
46 /**审批人*/
47 @Excel(name = "审批人", width = 15)
48 @ApiModelProperty(value = "审批人")
49 @Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
50 private String approveUser;
51 /**审批人*/
52 @Excel(name = "审批意见", width = 15)
53 @ApiModelProperty(value = "审批意见")
54 private String approveMessage;
55 /**审批状态*/
56 @Excel(name = "审批状态", width = 15)
57 @ApiModelProperty(value = "审批状态")
58 @Dict( dicCode="equip_audit_state")
59 private String approveState;
60 /**创建人*/
61 @Excel(name = "创建人", width = 15)
62 @ApiModelProperty(value = "创建人")
63 private String createBy;
64 /**创建时间*/
65 @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
66 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
67 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
68 @ApiModelProperty(value = "创建时间")
69 private Date createTime;
70
71
72 public ApproveRecord() {
73 }
74
75 public ApproveRecord(String approveType, String applyUser, String applyId, String approveUser, String approveMessage, String approveState) {
76 this.approveType = approveType;
77 this.applyUser = applyUser;
78 this.applyId = applyId;
79 this.approveUser = approveUser;
80 this.approveMessage = approveMessage;
81 this.approveState = approveState;
82 }
83 }
1 package com.skua.modules.erp.entity;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import java.util.List;
6
7 import com.baomidou.mybatisplus.annotation.IdType;
8 import com.baomidou.mybatisplus.annotation.TableId;
9 import com.baomidou.mybatisplus.annotation.TableName;
10 import com.baomidou.mybatisplus.annotation.TableField;
11 import com.skua.core.aspect.annotation.Dict;
12 import io.swagger.annotations.ApiModel;
13 import io.swagger.annotations.ApiModelProperty;
14 import lombok.Data;
15 import lombok.EqualsAndHashCode;
16 import lombok.experimental.Accessors;
17 import com.fasterxml.jackson.annotation.JsonFormat;
18 import org.springframework.format.annotation.DateTimeFormat;
19 import org.jeecgframework.poi.excel.annotation.Excel;
20
21 /**
22 * erp采购计划表
23 */
24 @Data
25 @TableName("erp_purchase_plan")
26 @EqualsAndHashCode(callSuper = false)
27 @Accessors(chain = true)
28 @ApiModel(value="erp_purchase_plan对象", description="erp采购计划表")
29 public class PurchasePlan implements Serializable{
30
31 /**主键*/
32 @TableId(type = IdType.ID_WORKER_STR)
33 @ApiModelProperty(value = "主键")
34 private String id;
35 /**厂站*/
36 @Excel(name = "厂站", width = 15)
37 @ApiModelProperty(value = "厂站")
38 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
39 private String departId;
40 /**计划编号*/
41 @Excel(name = "计划编号", width = 15)
42 @ApiModelProperty(value = "计划编号")
43 private String planCode;
44 /**计划名称*/
45 @Excel(name = "计划名称", width = 15)
46 @ApiModelProperty(value = "计划名称")
47 private String planName;
48 /**申请人*/
49 @Excel(name = "申请人", width = 15)
50 @ApiModelProperty(value = "申请人")
51 @Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
52 private String applyUser;
53 /**申请时间*/
54 @Excel(name = "申请时间", width = 15)
55 @ApiModelProperty(value = "申请时间")
56 private String applyTime;
57 /**计划年份*/
58 @Excel(name = "计划年份", width = 15)
59 @ApiModelProperty(value = "计划年份")
60 private String applyYear;
61 /**申请状态:0 未发布、1 已发布(审核通知) 2 审核通过,3 审核驳回*/
62 @Excel(name = "申请状态:0 未发布、1 已发布(审核通知)2 审核驳回 3 审核通过", width = 15)
63 @ApiModelProperty(value = "申请状态:0 未发布、1 已发布(审核通知)2 审核驳回 3 审核通过,")
64 @Dict( dicCode="purchase_plan_status")
65 private String status;
66 /**创建人id*/
67 @Excel(name = "创建人id", width = 15)
68 @ApiModelProperty(value = "创建人id")
69 private String createBy;
70 /**创建时间*/
71 @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
72 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
73 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
74 @ApiModelProperty(value = "创建时间")
75 private Date createTime;
76 /**修改人id*/
77 @Excel(name = "修改人id", width = 15)
78 @ApiModelProperty(value = "修改人id")
79 private String updateBy;
80 /**修改时间*/
81 @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
82 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
83 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
84 @ApiModelProperty(value = "修改时间")
85 private Date updateTime;
86 /**所属部门*/
87 @Excel(name = "所属部门", width = 15)
88 @ApiModelProperty(value = "所属部门")
89 private String createDept;
90 /**所属公司*/
91 @Excel(name = "所属公司", width = 15)
92 @ApiModelProperty(value = "所属公司")
93 private String createCmpy;
94 /**删除标识,0:有效,1:删除*/
95 @Excel(name = "删除标识,0:有效,1:删除", width = 15)
96 @ApiModelProperty(value = "删除标识,0:有效,1:删除")
97 private Integer delFlag;
98
99 @TableField(exist=false)
100 @ApiModelProperty(value = "删除标识,0:有效,1:删除")
101 private List<PurchasePlanItem> planItemList ;
102
103 /**审批人*/
104 @TableField(exist=false)
105 @ApiModelProperty(value = "审批意见")
106 private String approveMessage;
107 /**审批状态*/
108 @TableField(exist=false)
109 @ApiModelProperty(value = "审批状态 1通过2不通过")
110 private String approveState;
111 }
1 package com.skua.modules.erp.entity;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName;
8 import com.baomidou.mybatisplus.annotation.TableField;
9 import io.swagger.annotations.ApiModel;
10 import io.swagger.annotations.ApiModelProperty;
11 import lombok.Data;
12 import lombok.EqualsAndHashCode;
13 import lombok.experimental.Accessors;
14 import com.fasterxml.jackson.annotation.JsonFormat;
15 import org.springframework.format.annotation.DateTimeFormat;
16 import org.jeecgframework.poi.excel.annotation.Excel;
17
18 /**
19 * 采购计划物料清单
20 */
21 @Data
22 @TableName("erp_purchase_plan_item")
23 @EqualsAndHashCode(callSuper = false)
24 @Accessors(chain = true)
25 @ApiModel(value="erp_purchase_plan_item对象", description="采购计划物料清单")
26 public class PurchasePlanItem implements Serializable{
27
28 /**主键*/
29 @TableId(type = IdType.ID_WORKER_STR)
30 @ApiModelProperty(value = "主键")
31 private String id;
32 /**采购计划编号*/
33 @Excel(name = "采购计划编号", width = 15)
34 @ApiModelProperty(value = "采购计划编号")
35 private String planId;
36 /**物料类别编号*/
37 @Excel(name = "物料类别编号", width = 15)
38 @ApiModelProperty(value = "物料类别编号")
39 private String sparepartTypeId;
40
41
42 /**物料编号*/
43 @Excel(name = "物料编号", width = 15)
44 @ApiModelProperty(value = "物料编号")
45 private String sparepartId;
46 /**规格型号*/
47 @Excel(name = "规格型号", width = 15)
48 @ApiModelProperty(value = "规格型号")
49 private String specifications;
50 /**计量单位*/
51 @Excel(name = "计量单位", width = 15)
52 @ApiModelProperty(value = "计量单位")
53 private String unit;
54 /**计划采购数量*/
55 @Excel(name = "计划采购数量", width = 15)
56 @ApiModelProperty(value = "计划采购数量")
57 private String purchaseNum;
58 /**单价*/
59 @Excel(name = "单价", width = 15)
60 @ApiModelProperty(value = "单价")
61 private String unitPrice;
62 /**备注*/
63 @Excel(name = "备注", width = 15)
64 @ApiModelProperty(value = "备注")
65 private String remarks;
66 /**版本号*/
67 @Excel(name = "版本号", width = 15)
68 @ApiModelProperty(value = "版本号")
69 private Integer versions;
70
71
72
73 @ApiModelProperty(value = "总价")
74 private String totalPrice;
75
76 @TableField(exist=false)
77 @ApiModelProperty(value = "物料类别名称")
78 private String sparepartCode;
79
80 @TableField(exist=false)
81 @ApiModelProperty(value = "物料类别名称")
82 private String sparepartTypeName;
83
84 @TableField(exist=false)
85 @ApiModelProperty(value = "物料名称")
86 private String sparepartName;
87 }
1 package com.skua.modules.erp.mapper;
2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.erp.entity.ApproveRecord;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
8
9 /**
10 * 审批记录表
11 */
12 public interface ApproveRecordMapper extends BaseMapper<ApproveRecord> {
13
14 }
1 package com.skua.modules.erp.mapper;
2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.erp.entity.PurchasePlanItem;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
8
9 /**
10 * 采购计划物料清单
11 */
12 public interface PurchasePlanItemMapper extends BaseMapper<PurchasePlanItem> {
13
14
15 /***
16 * 根据计划编号删除清单集合
17 * @param planId
18 * @return
19 */
20 public int delByPlanId( @Param("planId") String planId);
21
22 /***
23 * 根据计划编号获取采购清单列表
24 * @param planId
25 * @return
26 */
27 public List<PurchasePlanItem> queryListByPlanId(@Param("planId") String planId);
28 }
1 package com.skua.modules.erp.mapper;
2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.erp.entity.PurchasePlan;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
8
9 /**
10 * erp采购计划表
11 */
12 public interface PurchasePlanMapper extends BaseMapper<PurchasePlan> {
13
14 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.erp.mapper.ApproveRecordMapper">
4
5 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.erp.mapper.PurchasePlanItemMapper">
4
5
6 <!-- 根据计划编号删除清单集合 -->
7 <delete id="delByPlanId" >
8 DELETE from erp_purchase_plan_item where plan_id = #{planId}
9 </delete>
10
11 <!-- 根据计划编号获取采购清单列表 -->
12 <select id="queryListByPlanId" resultType="com.skua.modules.erp.entity.PurchasePlanItem">
13 select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name', pi.* from erp_purchase_plan_item pi
14
15 left join equipment_sparepart_supplies ss on pi.sparepart_id = ss.id
16 left join equipment_sparepart_type st on st.id = sparepart_type_id
17 where pi.plan_id = #{planId}
18 </select>
19 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.erp.mapper.PurchasePlanMapper">
4
5 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.skua.modules.erp.service;
2
3 import com.skua.modules.erp.entity.ApproveRecord;
4 import com.baomidou.mybatisplus.extension.service.IService;
5
6 /**
7 * 审批记录表
8 */
9 public interface IApproveRecordService extends IService<ApproveRecord> {
10
11 }
1 package com.skua.modules.erp.service;
2
3 import com.skua.modules.erp.entity.PurchasePlanItem;
4 import com.baomidou.mybatisplus.extension.service.IService;
5
6 /**
7 * 采购计划物料清单
8 */
9 public interface IPurchasePlanItemService extends IService<PurchasePlanItem> {
10
11 }
1 package com.skua.modules.erp.service;
2
3 import com.skua.modules.erp.entity.PurchasePlan;
4 import com.baomidou.mybatisplus.extension.service.IService;
5 import com.skua.modules.erp.entity.PurchasePlanItem;
6
7 import java.util.List;
8
9 /**
10 * erp采购计划表
11 */
12 public interface IPurchasePlanService extends IService<PurchasePlan> {
13
14 /***
15 * 新增
16 * @param purchasePlan
17 * @return
18 */
19 public int savePurchasePlan(PurchasePlan purchasePlan);
20
21 /***
22 * 修改
23 * @param purchasePlan
24 * @return
25 */
26 public boolean updatePurchasePlan(PurchasePlan purchasePlan);
27
28 /***
29 * 删除
30 * @param planId
31 * @return
32 */
33 public int delPurchasePlan(String planId);
34
35 /***
36 * 根据编号获取采购计划
37 * @param planId
38 * @return
39 */
40 public PurchasePlan queryById(String planId);
41
42 /**
43 * 根据编号获取采购清单集合
44 * @param planId
45 * @return
46 */
47 public List<PurchasePlanItem> queryItemListByPlanId(String planId);
48
49 /***
50 * 审批 采购计划
51 * @param purchasePlan
52 */
53 public void auditPurchasePlan(PurchasePlan purchasePlan);
54 }
1 package com.skua.modules.erp.service.impl;
2
3 import com.skua.modules.erp.entity.ApproveRecord;
4 import com.skua.modules.erp.mapper.ApproveRecordMapper;
5 import com.skua.modules.erp.service.IApproveRecordService;
6 import org.springframework.stereotype.Service;
7
8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
10 /**
11 * 审批记录表
12 */
13 @Service
14 public class ApproveRecordServiceImpl extends ServiceImpl<ApproveRecordMapper, ApproveRecord> implements IApproveRecordService {
15
16 }
1 package com.skua.modules.erp.service.impl;
2
3 import com.skua.modules.erp.entity.PurchasePlanItem;
4 import com.skua.modules.erp.mapper.PurchasePlanItemMapper;
5 import com.skua.modules.erp.service.IPurchasePlanItemService;
6 import org.springframework.stereotype.Service;
7
8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
10 /**
11 * 采购计划物料清单
12 */
13 @Service
14 public class PurchasePlanItemServiceImpl extends ServiceImpl<PurchasePlanItemMapper, PurchasePlanItem> implements IPurchasePlanItemService {
15
16 }
1 package com.skua.modules.erp.service.impl;
2
3 import com.skua.core.context.BaseContextHandler;
4 import com.skua.modules.erp.entity.ApproveRecord;
5 import com.skua.modules.erp.entity.PurchasePlan;
6 import com.skua.modules.erp.entity.PurchasePlanItem;
7 import com.skua.modules.erp.mapper.ApproveRecordMapper;
8 import com.skua.modules.erp.mapper.PurchasePlanItemMapper;
9 import com.skua.modules.erp.mapper.PurchasePlanMapper;
10 import com.skua.modules.erp.service.IPurchasePlanService;
11 import org.springframework.stereotype.Service;
12
13 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
14 import org.springframework.transaction.annotation.Transactional;
15
16 import javax.annotation.Resource;
17 import java.util.List;
18
19 /**
20 * erp采购计划表
21 */
22 @Service
23 public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, PurchasePlan> implements IPurchasePlanService {
24
25 @Resource
26 private PurchasePlanItemMapper planItemMapper ;
27
28 @Resource
29 private ApproveRecordMapper recordMapper ;
30 /***
31 * 新增
32 * @param purchasePlan
33 * @return
34 */
35 @Transactional
36 public int savePurchasePlan(PurchasePlan purchasePlan){
37 int count = this.baseMapper.insert( purchasePlan );
38 if(count > 0 && purchasePlan.getPlanItemList() != null && !purchasePlan.getPlanItemList().isEmpty()){
39 for(PurchasePlanItem planItem : purchasePlan.getPlanItemList()){
40 planItem.setPlanId( purchasePlan.getId() );
41 planItemMapper.insert( planItem );
42 }
43 }
44 return count;
45 }
46
47 /***
48 * 修改
49 * @param purchasePlan
50 * @return
51 */
52 @Transactional
53 public boolean updatePurchasePlan(PurchasePlan purchasePlan){
54 int count = this.baseMapper.updateById( purchasePlan );
55
56 // ge根据计划编号删除清单集合
57 planItemMapper.delByPlanId(purchasePlan.getId() ) ;
58
59 if( purchasePlan.getPlanItemList() != null && !purchasePlan.getPlanItemList().isEmpty()){
60 for(PurchasePlanItem planItem : purchasePlan.getPlanItemList()){
61 planItem.setPlanId( purchasePlan.getId() );
62 planItemMapper.insert( planItem );
63 }
64 }
65 return count > 0 ? true :false;
66 }
67
68 /***
69 * 删除
70 * @param planId
71 * @return
72 */
73 @Transactional
74 public int delPurchasePlan(String planId){
75 int count = this.baseMapper.deleteById( planId );
76 // ge根据计划编号删除清单集合
77 planItemMapper.delByPlanId( planId ) ;
78 return count;
79 }
80
81 /***
82 * 根据编号获取采购计划
83 * @param planId
84 * @return
85 */
86 @Transactional
87 public PurchasePlan queryById(String planId){
88 PurchasePlan purchasePlan = this.baseMapper.selectById( planId );
89
90 List<PurchasePlanItem> planItemList = planItemMapper.queryListByPlanId( planId );
91 if(purchasePlan != null ){
92 purchasePlan.setPlanItemList( planItemList );
93 }
94
95 return purchasePlan;
96 }
97
98 /**
99 * 根据编号获取采购清单集合
100 * @param planId
101 * @return
102 */
103 public List<PurchasePlanItem> queryItemListByPlanId(String planId){
104 List<PurchasePlanItem> planItemList = planItemMapper.queryListByPlanId( planId );
105 return planItemList;
106 }
107 /***
108 * 审批 采购计划
109 * @param purchasePlan
110 */
111 @Transactional
112 public void auditPurchasePlan(PurchasePlan purchasePlan){
113
114 //保存
115 //purchasePlan.getApproveState() 审批状态 1通过2不通过
116 if("1".equals( purchasePlan.getApproveState() )){
117 purchasePlan.setStatus( "3" );
118 }
119 if("2".equals( purchasePlan.getApproveState() )){
120 purchasePlan.setStatus( "4" );
121 }
122
123 this.baseMapper.updateById( purchasePlan ) ;
124 //审批记录
125 ApproveRecord record = new ApproveRecord( "CGJH", purchasePlan.getApplyUser(), purchasePlan.getId(), BaseContextHandler.getUserId(), purchasePlan.getApproveMessage(), purchasePlan.getApproveState());
126 recordMapper.insert( record ) ;
127 }
128 }
1 package com.skua.modules.erp.vo;
2
3 public enum ApproveType {
4
5 /** 已处理 */
6 YCL("5"),
7 /** 处理中(已发起工单) */
8 CLZ("3"),
9 /** 未处理 */
10 NO("0") ;
11
12 //0 未发布、1 已发布(审核通知) 2 审核通过,3 审核驳回
13
14 private String value;
15 private ApproveType(String code) {
16 this.value = code;
17 }
18
19 public String getValue() {
20 return value;
21 }
22
23 public void setStatusCode(String code) {
24 this.value = code;
25 }
26 }
...@@ -68,7 +68,7 @@ public class BaseUtil { ...@@ -68,7 +68,7 @@ public class BaseUtil {
68 /** 68 /**
69 * 获取前一天的日期 69 * 获取前一天的日期
70 * 70 *
71 * @param args 71 * @param
72 */ 72 */
73 public static String dateString() { 73 public static String dateString() {
74 Date dNow = new Date(); // 当前时间 74 Date dNow = new Date(); // 当前时间
...@@ -132,7 +132,7 @@ public class BaseUtil { ...@@ -132,7 +132,7 @@ public class BaseUtil {
132 /** 132 /**
133 * 字符串日期转时间戳 133 * 字符串日期转时间戳
134 * 134 *
135 * @param args 135 * @param
136 */ 136 */
137 public static Long getlastTime(String str_date) { 137 public static Long getlastTime(String str_date) {
138 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 138 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
...@@ -56,9 +56,15 @@ public class APPDangerInspectionController { ...@@ -56,9 +56,15 @@ public class APPDangerInspectionController {
56 Result<DangerLevelManage> result = new Result<DangerLevelManage>(); 56 Result<DangerLevelManage> result = new Result<DangerLevelManage>();
57 DangerLevelManage dangerInspection = dangerLevelManageService.getById(id); 57 DangerLevelManage dangerInspection = dangerLevelManageService.getById(id);
58 //查询:上次巡检时间 58 //查询:上次巡检时间
59 DangerInspectionRecord inspection = inspectionRecordService.queryOneByDangerId( id,"2" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录 59 DangerInspectionRecord inspectionRecord = inspectionRecordService.queryOneByDangerId( id,"2" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录
60 if(inspection != null ){ 60 if(inspectionRecord != null ){
61 dangerInspection.setLastInspectionTime( inspection.getReportDate() ); 61 dangerInspection.setLastInspectionTime( inspectionRecord.getReportDate() );
62 dangerInspection.setLastInspectionStatus( inspectionRecord.getStatus());
63 String dangerId = id;
64 if(inspectionRecord.getStatus() != "2"){
65 List<DangerInspectionInfo> inspectionInfoList = inspectionRecordService.queryInspectionInfoByDangerId(dangerId ,BaseContextHandler.getUserId());
66 dangerInspection.setInspectionInfoList( inspectionInfoList ) ;
67 }
62 }else{ 68 }else{
63 dangerInspection = new DangerLevelManage(); 69 dangerInspection = new DangerLevelManage();
64 dangerInspection.setLastInspectionTime(""); 70 dangerInspection.setLastInspectionTime("");
......
...@@ -135,6 +135,12 @@ public class DangerLevelManage implements Serializable{ ...@@ -135,6 +135,12 @@ public class DangerLevelManage implements Serializable{
135 @ApiModelProperty(value = "上次巡检时间") 135 @ApiModelProperty(value = "上次巡检时间")
136 private String lastInspectionTime; 136 private String lastInspectionTime;
137 137
138
139 @TableField(exist=false)
140 @ApiModelProperty(value = "上次巡检状态 ")
141 private String lastInspectionStatus;
142
143
138 @TableField(exist=false) 144 @TableField(exist=false)
139 @ApiModelProperty(value = "巡检内容对象集合") 145 @ApiModelProperty(value = "巡检内容对象集合")
140 private List<DangerInspectionInfo> inspectionInfoList; 146 private List<DangerInspectionInfo> inspectionInfoList;
......
...@@ -36,4 +36,13 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio ...@@ -36,4 +36,13 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio
36 * @return 36 * @return
37 */ 37 */
38 public DangerLevelManage queryListByDangerId(String dangerId, String startTime, String endDate); 38 public DangerLevelManage queryListByDangerId(String dangerId, String startTime, String endDate);
39
40
41 /***
42 * 根据检查点编号,获取用户的巡检检查集合
43 * @param dangerId
44 * @param userId
45 * @return
46 */
47 public List<DangerInspectionInfo> queryInspectionInfoByDangerId(String dangerId ,String userId);
39 } 48 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!