041dcd38 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 d42c6390 731e974e
正在显示 27 个修改的文件 包含 958 行增加12 行删除
......@@ -8,6 +8,8 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.QueryChainWrapper;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
......@@ -69,6 +71,21 @@ public class QuestionDBController {
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "在线考试-题库-列表查询")
@ApiOperation(value="在线考试-题库-列表查询", notes="在线考试-题库-列表查询")
@GetMapping(value = "/qbList")
public Result<List<QuestionDB>> queryPageList(QuestionDB questionDB, HttpServletRequest req) {
Result<List<QuestionDB>> result = new Result<List<QuestionDB>>();
QueryWrapper<QuestionDB> queryWrapper = QueryGenerator.initQueryWrapper(questionDB, req.getParameterMap());
List<QuestionDB> questionDBList = questionDBService.list(queryWrapper);
result.setSuccess(true);
result.setResult(questionDBList);
return result;
}
@AutoLog(value = "在线考试-题库-分页列表查询")
@ApiOperation(value="在线考试-题库-分页列表查询", notes="在线考试-题库-分页列表查询")
@GetMapping(value = "/list")
......@@ -154,7 +171,6 @@ public class QuestionDBController {
if( flag ){
return Result.error("删除失败!该题库下有试题,不能删除!");
}
questionDBService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
......@@ -220,7 +236,7 @@ public class QuestionDBController {
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/exportXls")
/*@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<QuestionDB> queryWrapper = null;
......@@ -244,7 +260,7 @@ public class QuestionDBController {
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("在线考试-题库列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
}*/
/**
* <pre>
......@@ -256,7 +272,7 @@ public class QuestionDBController {
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
/*@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
......@@ -282,6 +298,6 @@ public class QuestionDBController {
}
}
return Result.ok("文件导入失败!");
}
}*/
}
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -32,6 +33,7 @@ public class Paper {
/**部门编号*/
@Excel(name = "部门编号", width = 15)
@ApiModelProperty(value = "部门编号")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**试卷标题*/
@Excel(name = "试卷标题", width = 15)
......
......@@ -52,7 +52,7 @@ public class Question {
/**试题解析*/
@Excel(name = "试题解析", width = 15)
@ApiModelProperty(value = "试题解析")
private String analyze;
private String analyzes;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -32,6 +33,7 @@ public class QuestionDB {
/**厂id*/
@Excel(name = "厂id", width = 15)
@ApiModelProperty(value = "厂id")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**创建人编号*/
@Excel(name = "创建人编号", width = 15)
......
......@@ -51,7 +51,7 @@ public class QuestionVO implements Serializable{
/**试题解析*/
@Excel(name = "试题解析", width = 15)
@ApiModelProperty(value = "试题解析")
private String analyze;
private String analyzes;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
......
package com.skua.modules.erp.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.service.ISequenceService;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.erp.entity.ApproveRecord;
import com.skua.modules.erp.service.IApproveRecordService;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* <pre>
* 审批记录表
* </pre>
* @author 开发者姓名
* @version V0.1, 开发时间
*/
@Slf4j
@Api(tags="审批记录表")
@RestController("webApproveRecordController")
@RequestMapping("/web/erp/approveRecord")
public class ApproveRecordController {
@Autowired
private IApproveRecordService approveRecordService;
/**
* <pre>
* 分页列表查询
* </pre>
* @param approveRecord
* @param pageNo
* @param pageSize
* @param req
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "审批记录表-分页列表查询")
@ApiOperation(value="审批记录表-分页列表查询", notes="审批记录表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ApproveRecord>> queryPageList(ApproveRecord approveRecord,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<ApproveRecord>> result = new Result<IPage<ApproveRecord>>();
QueryWrapper<ApproveRecord> queryWrapper = QueryGenerator.initQueryWrapper(approveRecord, req.getParameterMap());
Page<ApproveRecord> page = new Page<ApproveRecord>(pageNo, pageSize);
IPage<ApproveRecord> pageList = approveRecordService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* <pre>
* 添加
* </pre>
* @param approveRecord
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "审批记录表-添加")
@ApiOperation(value="审批记录表-添加", notes="审批记录表-添加")
@PostMapping(value = "/add")
public Result<ApproveRecord> add(@RequestBody ApproveRecord approveRecord) {
Result<ApproveRecord> result = new Result<ApproveRecord>();
try {
approveRecordService.save(approveRecord);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
/**
* <pre>
* 编辑
* </pre>
* @param approveRecord
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "审批记录表-编辑")
@ApiOperation(value="审批记录表-编辑", notes="审批记录表-编辑")
@PutMapping(value = "/edit")
public Result<ApproveRecord> edit(@RequestBody ApproveRecord approveRecord) {
Result<ApproveRecord> result = new Result<ApproveRecord>();
ApproveRecord approveRecordEntity = approveRecordService.getById(approveRecord.getId());
if(approveRecordEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = approveRecordService.updateById(approveRecord);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
}
}
return result;
}
/**
* <pre>
* 通过id删除
* </pre>
* @param id
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "审批记录表-通过id删除")
@ApiOperation(value="审批记录表-通过id删除", notes="审批记录表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
approveRecordService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
}
return Result.ok("删除成功!");
}
/**
* <pre>
* 批量删除
* </pre>
* @param ids
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "审批记录表-批量删除")
@ApiOperation(value="审批记录表-批量删除", notes="审批记录表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<ApproveRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<ApproveRecord> result = new Result<ApproveRecord>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
this.approveRecordService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* <pre>
* 通过id查询
* </pre>
* @param id
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "审批记录表-通过id查询")
@ApiOperation(value="审批记录表-通过id查询", notes="审批记录表-通过id查询")
@GetMapping(value = "/queryById")
public Result<ApproveRecord> queryById(@RequestParam(name="id",required=true) String id) {
Result<ApproveRecord> result = new Result<ApproveRecord>();
ApproveRecord approveRecord = approveRecordService.getById(id);
if(approveRecord==null) {
result.error500("未找到对应实体");
}else {
result.setResult(approveRecord);
result.setSuccess(true);
}
return result;
}
/**
* <pre>
* 导出excel
* </pre>
* @param request
* @param response
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<ApproveRecord> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
ApproveRecord approveRecord = JSON.parseObject(deString, ApproveRecord.class);
queryWrapper = QueryGenerator.initQueryWrapper(approveRecord, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<ApproveRecord> pageList = approveRecordService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "审批记录表列表");
mv.addObject(NormalExcelConstants.CLASS, ApproveRecord.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("审批记录表列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* <pre>
* 通过excel导入数据
* </pre>
* @param request
* @param response
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<ApproveRecord> listApproveRecords = ExcelImportUtil.importExcel(file.getInputStream(), ApproveRecord.class, params);
approveRecordService.saveBatch(listApproveRecords);
return Result.ok("文件导入成功!数据行数:" + listApproveRecords.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
}
package com.skua.modules.erp.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 审批记录表
*/
@Data
@TableName("erp_approve_record")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_approve_record对象", description="审批记录表")
public class ApproveRecord implements Serializable{
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
/**审核类型:采购计划CGJH;采购合同CGHT;分销合同:FXHT*/
@Excel(name = "审核类型:采购计划CGJH;采购合同CGHT;分销合同:FXHT", width = 15)
@ApiModelProperty(value = "审核类型:采购计划CGJH;采购合同CGHT;分销合同:FXHT")
private String approveType;
/**申请人*/
@Excel(name = "申请人", width = 15)
@ApiModelProperty(value = "申请人")
@Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
private String applyUser;
/**申请单号*/
@Excel(name = "申请单号", width = 15)
@ApiModelProperty(value = "申请单号")
private String applyId;
/**审批人*/
@Excel(name = "审批人", width = 15)
@ApiModelProperty(value = "审批人")
@Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
private String approveUser;
/**审批人*/
@Excel(name = "审批意见", width = 15)
@ApiModelProperty(value = "审批意见")
private String approveMessage;
/**审批状态*/
@Excel(name = "审批状态", width = 15)
@ApiModelProperty(value = "审批状态")
@Dict( dicCode="equip_audit_state")
private String approveState;
/**创建人*/
@Excel(name = "创建人", width = 15)
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
public ApproveRecord() {
}
public ApproveRecord(String approveType, String applyUser, String applyId, String approveUser, String approveMessage, String approveState) {
this.approveType = approveType;
this.applyUser = applyUser;
this.applyId = applyId;
this.approveUser = approveUser;
this.approveMessage = approveMessage;
this.approveState = approveState;
}
}
package com.skua.modules.erp.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* erp采购计划表
*/
@Data
@TableName("erp_purchase_plan")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_purchase_plan对象", description="erp采购计划表")
public class PurchasePlan implements Serializable{
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
/**厂站*/
@Excel(name = "厂站", width = 15)
@ApiModelProperty(value = "厂站")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**计划编号*/
@Excel(name = "计划编号", width = 15)
@ApiModelProperty(value = "计划编号")
private String planCode;
/**计划名称*/
@Excel(name = "计划名称", width = 15)
@ApiModelProperty(value = "计划名称")
private String planName;
/**申请人*/
@Excel(name = "申请人", width = 15)
@ApiModelProperty(value = "申请人")
@Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
private String applyUser;
/**申请时间*/
@Excel(name = "申请时间", width = 15)
@ApiModelProperty(value = "申请时间")
private String applyTime;
/**计划年份*/
@Excel(name = "计划年份", width = 15)
@ApiModelProperty(value = "计划年份")
private String applyYear;
/**申请状态:0 未发布、1 已发布(审核通知) 2 审核通过,3 审核驳回*/
@Excel(name = "申请状态:0 未发布、1 已发布(审核通知)2 审核驳回 3 审核通过", width = 15)
@ApiModelProperty(value = "申请状态:0 未发布、1 已发布(审核通知)2 审核驳回 3 审核通过,")
@Dict( dicCode="purchase_plan_status")
private String status;
/**创建人id*/
@Excel(name = "创建人id", width = 15)
@ApiModelProperty(value = "创建人id")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**修改人id*/
@Excel(name = "修改人id", width = 15)
@ApiModelProperty(value = "修改人id")
private String updateBy;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private String createDept;
/**所属公司*/
@Excel(name = "所属公司", width = 15)
@ApiModelProperty(value = "所属公司")
private String createCmpy;
/**删除标识,0:有效,1:删除*/
@Excel(name = "删除标识,0:有效,1:删除", width = 15)
@ApiModelProperty(value = "删除标识,0:有效,1:删除")
private Integer delFlag;
@TableField(exist=false)
@ApiModelProperty(value = "删除标识,0:有效,1:删除")
private List<PurchasePlanItem> planItemList ;
/**审批人*/
@TableField(exist=false)
@ApiModelProperty(value = "审批意见")
private String approveMessage;
/**审批状态*/
@TableField(exist=false)
@ApiModelProperty(value = "审批状态 1通过2不通过")
private String approveState;
}
package com.skua.modules.erp.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 采购计划物料清单
*/
@Data
@TableName("erp_purchase_plan_item")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_purchase_plan_item对象", description="采购计划物料清单")
public class PurchasePlanItem implements Serializable{
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
/**采购计划编号*/
@Excel(name = "采购计划编号", width = 15)
@ApiModelProperty(value = "采购计划编号")
private String planId;
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
private String sparepartTypeId;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private String sparepartId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private String specifications;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String unit;
/**计划采购数量*/
@Excel(name = "计划采购数量", width = 15)
@ApiModelProperty(value = "计划采购数量")
private String purchaseNum;
/**单价*/
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private String unitPrice;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remarks;
/**版本号*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private Integer versions;
@ApiModelProperty(value = "总价")
private String totalPrice;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartCode;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@TableField(exist=false)
@ApiModelProperty(value = "物料名称")
private String sparepartName;
}
package com.skua.modules.erp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.ApproveRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 审批记录表
*/
public interface ApproveRecordMapper extends BaseMapper<ApproveRecord> {
}
package com.skua.modules.erp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.PurchasePlanItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 采购计划物料清单
*/
public interface PurchasePlanItemMapper extends BaseMapper<PurchasePlanItem> {
/***
* 根据计划编号删除清单集合
* @param planId
* @return
*/
public int delByPlanId( @Param("planId") String planId);
/***
* 根据计划编号获取采购清单列表
* @param planId
* @return
*/
public List<PurchasePlanItem> queryListByPlanId(@Param("planId") String planId);
}
package com.skua.modules.erp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.PurchasePlan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* erp采购计划表
*/
public interface PurchasePlanMapper extends BaseMapper<PurchasePlan> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.erp.mapper.ApproveRecordMapper">
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.erp.mapper.PurchasePlanItemMapper">
<!-- 根据计划编号删除清单集合 -->
<delete id="delByPlanId" >
DELETE from erp_purchase_plan_item where plan_id = #{planId}
</delete>
<!-- 根据计划编号获取采购清单列表 -->
<select id="queryListByPlanId" resultType="com.skua.modules.erp.entity.PurchasePlanItem">
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name', pi.* from erp_purchase_plan_item pi
left join equipment_sparepart_supplies ss on pi.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = sparepart_type_id
where pi.plan_id = #{planId}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.erp.mapper.PurchasePlanMapper">
</mapper>
\ No newline at end of file
package com.skua.modules.erp.service;
import com.skua.modules.erp.entity.ApproveRecord;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 审批记录表
*/
public interface IApproveRecordService extends IService<ApproveRecord> {
}
package com.skua.modules.erp.service;
import com.skua.modules.erp.entity.PurchasePlanItem;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 采购计划物料清单
*/
public interface IPurchasePlanItemService extends IService<PurchasePlanItem> {
}
package com.skua.modules.erp.service;
import com.skua.modules.erp.entity.PurchasePlan;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.erp.entity.PurchasePlanItem;
import java.util.List;
/**
* erp采购计划表
*/
public interface IPurchasePlanService extends IService<PurchasePlan> {
/***
* 新增
* @param purchasePlan
* @return
*/
public int savePurchasePlan(PurchasePlan purchasePlan);
/***
* 修改
* @param purchasePlan
* @return
*/
public boolean updatePurchasePlan(PurchasePlan purchasePlan);
/***
* 删除
* @param planId
* @return
*/
public int delPurchasePlan(String planId);
/***
* 根据编号获取采购计划
* @param planId
* @return
*/
public PurchasePlan queryById(String planId);
/**
* 根据编号获取采购清单集合
* @param planId
* @return
*/
public List<PurchasePlanItem> queryItemListByPlanId(String planId);
/***
* 审批 采购计划
* @param purchasePlan
*/
public void auditPurchasePlan(PurchasePlan purchasePlan);
}
package com.skua.modules.erp.service.impl;
import com.skua.modules.erp.entity.ApproveRecord;
import com.skua.modules.erp.mapper.ApproveRecordMapper;
import com.skua.modules.erp.service.IApproveRecordService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 审批记录表
*/
@Service
public class ApproveRecordServiceImpl extends ServiceImpl<ApproveRecordMapper, ApproveRecord> implements IApproveRecordService {
}
package com.skua.modules.erp.service.impl;
import com.skua.modules.erp.entity.PurchasePlanItem;
import com.skua.modules.erp.mapper.PurchasePlanItemMapper;
import com.skua.modules.erp.service.IPurchasePlanItemService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 采购计划物料清单
*/
@Service
public class PurchasePlanItemServiceImpl extends ServiceImpl<PurchasePlanItemMapper, PurchasePlanItem> implements IPurchasePlanItemService {
}
package com.skua.modules.erp.service.impl;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.erp.entity.ApproveRecord;
import com.skua.modules.erp.entity.PurchasePlan;
import com.skua.modules.erp.entity.PurchasePlanItem;
import com.skua.modules.erp.mapper.ApproveRecordMapper;
import com.skua.modules.erp.mapper.PurchasePlanItemMapper;
import com.skua.modules.erp.mapper.PurchasePlanMapper;
import com.skua.modules.erp.service.IPurchasePlanService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* erp采购计划表
*/
@Service
public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, PurchasePlan> implements IPurchasePlanService {
@Resource
private PurchasePlanItemMapper planItemMapper ;
@Resource
private ApproveRecordMapper recordMapper ;
/***
* 新增
* @param purchasePlan
* @return
*/
@Transactional
public int savePurchasePlan(PurchasePlan purchasePlan){
int count = this.baseMapper.insert( purchasePlan );
if(count > 0 && purchasePlan.getPlanItemList() != null && !purchasePlan.getPlanItemList().isEmpty()){
for(PurchasePlanItem planItem : purchasePlan.getPlanItemList()){
planItem.setPlanId( purchasePlan.getId() );
planItemMapper.insert( planItem );
}
}
return count;
}
/***
* 修改
* @param purchasePlan
* @return
*/
@Transactional
public boolean updatePurchasePlan(PurchasePlan purchasePlan){
int count = this.baseMapper.updateById( purchasePlan );
// ge根据计划编号删除清单集合
planItemMapper.delByPlanId(purchasePlan.getId() ) ;
if( purchasePlan.getPlanItemList() != null && !purchasePlan.getPlanItemList().isEmpty()){
for(PurchasePlanItem planItem : purchasePlan.getPlanItemList()){
planItem.setPlanId( purchasePlan.getId() );
planItemMapper.insert( planItem );
}
}
return count > 0 ? true :false;
}
/***
* 删除
* @param planId
* @return
*/
@Transactional
public int delPurchasePlan(String planId){
int count = this.baseMapper.deleteById( planId );
// ge根据计划编号删除清单集合
planItemMapper.delByPlanId( planId ) ;
return count;
}
/***
* 根据编号获取采购计划
* @param planId
* @return
*/
@Transactional
public PurchasePlan queryById(String planId){
PurchasePlan purchasePlan = this.baseMapper.selectById( planId );
List<PurchasePlanItem> planItemList = planItemMapper.queryListByPlanId( planId );
if(purchasePlan != null ){
purchasePlan.setPlanItemList( planItemList );
}
return purchasePlan;
}
/**
* 根据编号获取采购清单集合
* @param planId
* @return
*/
public List<PurchasePlanItem> queryItemListByPlanId(String planId){
List<PurchasePlanItem> planItemList = planItemMapper.queryListByPlanId( planId );
return planItemList;
}
/***
* 审批 采购计划
* @param purchasePlan
*/
@Transactional
public void auditPurchasePlan(PurchasePlan purchasePlan){
//保存
//purchasePlan.getApproveState() 审批状态 1通过2不通过
if("1".equals( purchasePlan.getApproveState() )){
purchasePlan.setStatus( "3" );
}
if("2".equals( purchasePlan.getApproveState() )){
purchasePlan.setStatus( "4" );
}
this.baseMapper.updateById( purchasePlan ) ;
//审批记录
ApproveRecord record = new ApproveRecord( "CGJH", purchasePlan.getApplyUser(), purchasePlan.getId(), BaseContextHandler.getUserId(), purchasePlan.getApproveMessage(), purchasePlan.getApproveState());
recordMapper.insert( record ) ;
}
}
package com.skua.modules.erp.vo;
public enum ApproveType {
/** 已处理 */
YCL("5"),
/** 处理中(已发起工单) */
CLZ("3"),
/** 未处理 */
NO("0") ;
//0 未发布、1 已发布(审核通知) 2 审核通过,3 审核驳回
private String value;
private ApproveType(String code) {
this.value = code;
}
public String getValue() {
return value;
}
public void setStatusCode(String code) {
this.value = code;
}
}
......@@ -68,7 +68,7 @@ public class BaseUtil {
/**
* 获取前一天的日期
*
* @param args
* @param
*/
public static String dateString() {
Date dNow = new Date(); // 当前时间
......@@ -132,7 +132,7 @@ public class BaseUtil {
/**
* 字符串日期转时间戳
*
* @param args
* @param
*/
public static Long getlastTime(String str_date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
......@@ -56,9 +56,15 @@ public class APPDangerInspectionController {
Result<DangerLevelManage> result = new Result<DangerLevelManage>();
DangerLevelManage dangerInspection = dangerLevelManageService.getById(id);
//查询:上次巡检时间
DangerInspectionRecord inspection = inspectionRecordService.queryOneByDangerId( id,"2" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录
if(inspection != null ){
dangerInspection.setLastInspectionTime( inspection.getReportDate() );
DangerInspectionRecord inspectionRecord = inspectionRecordService.queryOneByDangerId( id,"2" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录
if(inspectionRecord != null ){
dangerInspection.setLastInspectionTime( inspectionRecord.getReportDate() );
dangerInspection.setLastInspectionStatus( inspectionRecord.getStatus());
String dangerId = id;
if(inspectionRecord.getStatus() != "2"){
List<DangerInspectionInfo> inspectionInfoList = inspectionRecordService.queryInspectionInfoByDangerId(dangerId ,BaseContextHandler.getUserId());
dangerInspection.setInspectionInfoList( inspectionInfoList ) ;
}
}else{
dangerInspection = new DangerLevelManage();
dangerInspection.setLastInspectionTime("");
......
......@@ -135,6 +135,12 @@ public class DangerLevelManage implements Serializable{
@ApiModelProperty(value = "上次巡检时间")
private String lastInspectionTime;
@TableField(exist=false)
@ApiModelProperty(value = "上次巡检状态 ")
private String lastInspectionStatus;
@TableField(exist=false)
@ApiModelProperty(value = "巡检内容对象集合")
private List<DangerInspectionInfo> inspectionInfoList;
......
......@@ -36,4 +36,13 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio
* @return
*/
public DangerLevelManage queryListByDangerId(String dangerId, String startTime, String endDate);
/***
* 根据检查点编号,获取用户的巡检检查集合
* @param dangerId
* @param userId
* @return
*/
public List<DangerInspectionInfo> queryInspectionInfoByDangerId(String dangerId ,String userId);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!