kangwei : 隐患风险对象、采购计划统计接口、

正在显示 41 个修改的文件 包含 1144 行增加218 行删除
package com.skua;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
......
......@@ -10,7 +10,9 @@ import com.skua.core.context.BaseContextHandler;
import com.skua.modules.edu.entity.Paper;
import com.skua.modules.edu.entity.Question;
import com.skua.modules.edu.entity.QuestionOption;
import com.skua.modules.edu.entity.UserPaper;
import com.skua.modules.edu.service.IPaperService;
import com.skua.modules.edu.service.IUserPaperService;
import com.skua.modules.edu.vo.PaperVO;
import com.skua.modules.edu.vo.UserPaperVO;
import com.skua.modules.guest.util.DateUtil;
......@@ -41,6 +43,9 @@ public class UserPaperController {
@Autowired
private IPaperService paperService;
@Autowired
private IUserPaperService userPaperService;
// 我的 考试
......@@ -71,14 +76,19 @@ public class UserPaperController {
@GetMapping(value = "/startExam")
public Result<PaperVO> startExam(@RequestParam(name="id",required=true) String id) {
Result<PaperVO> result = new Result<PaperVO>();
PaperVO paperVO = paperService.queryById(id);
if(paperVO == null) {
result.error500("未找到对应实体");
}else if( paperVO!= null && !"1".equals(paperVO.getSendStatus() ) ) {
result.error500("试卷未发布!");
Boolean flag = paperService.checkExamCount(id,BaseContextHandler.getUserId());
if(flag){
PaperVO paperVO = paperService.queryById(id);
if(paperVO == null) {
result.error500("未找到对应实体");
}else if( paperVO!= null && !"1".equals(paperVO.getSendStatus() ) ) {
result.error500("试卷未发布!");
}else{
result.setResult(paperVO);
result.setSuccess(true);
}
}else{
result.setResult(paperVO);
result.setSuccess(true);
result.error500("考试次数已用完!不能参加考试");
}
return result;
}
......@@ -113,13 +123,37 @@ public class UserPaperController {
// 提交试卷submitPaper
//历史试卷 history
// 我的 考试
@AutoLog(value = "在线考试--历史试卷列表")
@ApiOperation(value="在线考试--历史试卷列表", notes="在线考试--历史试卷列表")
@GetMapping(value = "/historyList")
public Result<IPage<UserPaper>> historyList(
@RequestParam(name="paperId",required=true) String paperId,
@RequestParam(name="userId") String userId,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<UserPaper>> result = new Result<IPage<UserPaper>>();
QueryWrapper<UserPaper> queryWrapper = new QueryWrapper<>() ;// QueryGenerator.initQueryWrapper(paperAnswer, req.getParameterMap());
Page<UserPaper> page = new Page<UserPaper>(pageNo, pageSize);
queryWrapper.eq("paper_id",paperId);
if(userId == null ){
userId = BaseContextHandler.getUserId();
}
queryWrapper.eq("user_id",userId);//已发布的状态
IPage<UserPaper> pageList = userPaperService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
//历史试卷详情 history_detail
@AutoLog(value = "在线考试--历史试卷详情(复习)")
@ApiOperation(value="在线考试--历史试卷详情(复习)", notes="在线考试--历史试卷详情(复习)")
@GetMapping(value = "/historyDetail")
public Result<PaperVO> historyDetail(@RequestParam(name="paperId",required=true) String paperId,@RequestParam(name="userId",required=true) String userId) {
public Result<PaperVO> historyDetail(@RequestParam(name="userPaperId",required=true) String userPaperId) {
Result<PaperVO> result = new Result<PaperVO>();
PaperVO paperVO = paperService.queryPaperByPaperIdAndUserId(paperId,userId);
PaperVO paperVO = paperService.queryPaperByUserPaperId(userPaperId);
if(paperVO == null) {
result.error500("未找到对应实体");
}else if( paperVO!= null && !"1".equals(paperVO.getSendStatus() ) ) {
......
......@@ -95,6 +95,9 @@ public class Paper {
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "开始次数")
private Integer examCount;
/**上传人*/
@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 UserPaper {
/**试卷编号*/
@Excel(name = "试卷编号", width = 15)
@ApiModelProperty(value = "试卷编号")
@Dict(dictTable = "edu_paper", dicCode = "id",dicText = "paper_title")
private String paperId;
/**部门编号*/
@Excel(name = "部门编号", width = 15)
......
......@@ -23,6 +23,6 @@ public interface QuestionMapper extends BaseMapper<Question> {
* @param paperId
* @return
*/
public List<Question> selectListByPaperIdAndUserId(@Param("paperId") String paperId,@Param("userId") String userId);
public List<Question> selectListByPaperIdAndUserId(@Param("paperId") String paperId,@Param("userPaperId") String userPaperId);
}
......
......@@ -17,4 +17,14 @@ public interface UserPaperMapper extends BaseMapper<UserPaper> {
* @return
*/
public String queryPaperScore(@Param("userPaperId") String userPaperId);
/***
* 根据试卷编号、用户编号查询最近的考试记录
* @param paperId
* @param userId
* @return
*/
public UserPaper queryLastOne(String paperId, String userId);
public int queryPaperCount(String paperId, String userId);
}
......
......@@ -15,7 +15,7 @@
select ua.answer 'user_answer' , pq.score, q.*
from edu_paper_question pq
left join edu_question q on pq.question_id = q.id
left join edu_user_answer ua on pq.question_id = ua.question_id and ua.user_id = #{userId}
left join edu_user_answer ua on pq.question_id = ua.question_id and ua.user_paper_id = #{userPaperId}
where pq.paper_id = #{paperId}
</select>
......
......@@ -7,4 +7,14 @@
select IFNULL(sum(score ),'0') as 'score' from edu_user_answer where user_paper_id = #{userPaperId}
</select>
<select id="queryLastOne" resultType="com.skua.modules.edu.entity.UserPaper">
select t.* from edu_user_answer t where t.paper_id = #{paperId} and t.user_id = #{userId}
</select>
<select id="queryPaperCount" resultType="java.lang.Integer">
select IFNULL(count(1 ),'0') as 'userExamCount' from edu_user_answer where paper_id = #{paperId} and user_id = #{userId}
</select>
</mapper>
\ No newline at end of file
......
......@@ -39,13 +39,21 @@ public interface IPaperService extends IService<Paper> {
/***
* 根据用户编号、试卷编号查询试题集合 包含用户答案 、试题分值
* @param paperId
* @param userPaperId
* @return
*/
public PaperVO queryPaperByPaperIdAndUserId( String paperId, String userId);
public PaperVO queryPaperByUserPaperId( String userPaperId);
/***
* 交卷
* @param paperVO
*/
public String submitPaper(UserPaperVO paperVO);
/***
* 根据试卷编号、用户编号,校验考试次数
* @param paperId
* @param userId
* @return
*/
public Boolean checkExamCount(String paperId, String userId);
}
......
......@@ -114,16 +114,19 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
/**
* 根据用户编号、试卷编号查询试题集合 包含用户答案 、试题分值
* @param paperId
* @param userId
* @param userPaperId
* @return
*/
public PaperVO queryPaperByPaperIdAndUserId( String paperId, String userId){
Paper paper = this.baseMapper.selectById(paperId);
public PaperVO queryPaperByUserPaperId( String userPaperId){
Paper paper = null;
UserPaper userPaper = userPaperMapper.selectById(userPaperId ) ;
if(userPaper != null ) paper = this.baseMapper.selectById(userPaper.getPaperId());
PaperVO paperVO = new PaperVO();//
if( paper != null ){
BeanUtils.copyProperties(paper, paperVO);
List<Question> questionList = questionMapper.selectListByPaperIdAndUserId(paperId , userId);
List<Question> questionList = questionMapper.selectListByPaperIdAndUserId(userPaper.getPaperId() , userPaperId);
List<QuestionOption> optionList = null;
if(questionList != null && !questionList.isEmpty()){
// 创建Gson实例
......@@ -139,6 +142,21 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
return paperVO;
}
/***
* 根据试卷编号、用户编号,校验考试次数
* @param paperId
* @param userId
* @return
*/
public Boolean checkExamCount(String paperId, String userId){
int userExamCount = userPaperMapper.queryPaperCount(paperId , userId);
Paper paper = this.baseMapper.selectById(paperId ) ;
int examCount = 100;
if(paper != null ){
return paper.getExamCount() > userExamCount;
}
return false;
}
/***
* 交卷
......
......@@ -15,11 +15,13 @@ import com.skua.core.query.QueryGenerator;
import com.skua.core.service.ISequenceService;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.erp.entity.DistributContract;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.service.IDistributContractService;
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 com.skua.modules.erp.service.IPurchaseMaterialService;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
......@@ -51,19 +53,8 @@ import io.swagger.annotations.ApiOperation;
public class DistributContractController {
@Autowired
private IDistributContractService distributContractService;
/**
* <pre>
* 分页列表查询
* </pre>
* @param distributContract
* @param pageNo
* @param pageSize
* @param req
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@Autowired
private IPurchaseMaterialService purchaseMaterialService ;
@AutoLog(value = "erp分销合同-分页列表查询")
@ApiOperation(value="erp分销合同-分页列表查询", notes="erp分销合同-分页列表查询")
......@@ -81,15 +72,6 @@ public class DistributContractController {
return result;
}
/**
* <pre>
* 添加
* </pre>
* @param distributContract
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp分销合同-添加")
@ApiOperation(value="erp分销合同-添加", notes="erp分销合同-添加")
@PostMapping(value = "/add")
......@@ -104,15 +86,7 @@ public class DistributContractController {
}
return result;
}
/**
* <pre>
* 编辑
* </pre>
* @param distributContract
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp分销合同-编辑")
@ApiOperation(value="erp分销合同-编辑", notes="erp分销合同-编辑")
@PutMapping(value = "/edit")
......@@ -131,15 +105,7 @@ public class DistributContractController {
return result;
}
/**
* <pre>
* 通过id删除
* </pre>
* @param id
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp分销合同-通过id删除")
@ApiOperation(value="erp分销合同-通过id删除", notes="erp分销合同-通过id删除")
@DeleteMapping(value = "/delete")
......@@ -153,15 +119,7 @@ public class DistributContractController {
return Result.ok("删除成功!");
}
/**
* <pre>
* 批量删除
* </pre>
* @param ids
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp分销合同-批量删除")
@ApiOperation(value="erp分销合同-批量删除", notes="erp分销合同-批量删除")
@DeleteMapping(value = "/deleteBatch")
......@@ -175,15 +133,7 @@ public class DistributContractController {
}
return result;
}
/**
* <pre>
* 通过id查询
* </pre>
* @param id
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp分销合同-通过id查询")
@ApiOperation(value="erp分销合同-通过id查询", notes="erp分销合同-通过id查询")
@GetMapping(value = "/queryById")
......@@ -199,79 +149,35 @@ public class DistributContractController {
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<DistributContract> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
DistributContract distributContract = JSON.parseObject(deString, DistributContract.class);
queryWrapper = QueryGenerator.initQueryWrapper(distributContract, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
@AutoLog(value = "erp分销合同-采购物料列表")
@ApiOperation(value="erp分销合同-采购物料列表", notes="erp分销合同-采购物料列表")
@GetMapping(value = "/purchaseMaterialList")
public Result<IPage<PurchaseMaterial>> queryPageByPurchaseMaterialList(
@RequestParam(name="goodCode") String goodCode,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<PurchaseMaterial>> result = new Result<IPage<PurchaseMaterial>>();
Page<PurchaseMaterial> page = new Page<>(pageNo, pageSize);
IPage<PurchaseMaterial> pageList = purchaseMaterialService.queryByPage(page,goodCode,BaseContextHandler.getRealDepartId());
result.setSuccess(true);
result.setResult(pageList);
return result;
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<DistributContract> pageList = distributContractService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "erp分销合同列表");
mv.addObject(NormalExcelConstants.CLASS, DistributContract.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("erp分销合同列表数据", "导出人: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<DistributContract> listDistributContracts = ExcelImportUtil.importExcel(file.getInputStream(), DistributContract.class, params);
distributContractService.saveBatch(listDistributContracts);
return Result.ok("文件导入成功!数据行数:" + listDistributContracts.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("文件导入失败!");
}
@AutoLog(value = "erp分销合同-根据货号查询采购合同物料清单")
@ApiOperation(value="erp分销合同-根据货号查询采购合同物料清单", notes="erp分销合同-根据货号查询采购合同物料清单")
@GetMapping(value = "/queryMaterialByGoodCode")
public Result<PurchaseMaterial> queryMaterialByGoodCode(@RequestParam(name="goodCode") String goodCode) {
Result<PurchaseMaterial> result = new Result<PurchaseMaterial>();
List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.queryMaterialByGoodCode(goodCode,BaseContextHandler.getRealDepartId());
result.setSuccess(true);
if(purchaseMaterialList != null && !purchaseMaterialList.isEmpty()){
result.setResult(purchaseMaterialList.get(0));
}
return result;
}
}
......
......@@ -9,6 +9,9 @@ import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.modules.equipment.service.IEquipmentSparepartService;
import com.skua.modules.erp.entity.ApproveRecord;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.service.IDistributMaterialService;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.supplies.entity.EquipmentSparepartSupplies;
import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService;
import com.skua.modules.system.entity.SysUser;
......@@ -20,10 +23,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* @auther kangwei
* @create ${year}-09-20-10:18
*/
@Slf4j
@Api(tags="ert通用方法")
@RestController("rrpCommonController")
......@@ -31,11 +30,16 @@ import javax.servlet.http.HttpServletRequest;
public class ErpCommonController {
@Autowired
private IEquipmentSparepartSuppliesService sparepartSuppliesService;//物料serivce
@Autowired
private IPurchaseMaterialService purchaseMaterialService;
@Autowired
private IDistributMaterialService distributMaterialService;
@AutoLog(value = "ERP-物料列表")
@ApiOperation(value = "ERP-物料列表", notes = "ERP-物料列表")
@RequestMapping(value = "/sparepartList", method = RequestMethod.GET)
public Result<IPage<EquipmentSparepartSupplies>> departUserList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
public Result<IPage<EquipmentSparepartSupplies>> sparepartList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<IPage<EquipmentSparepartSupplies>> result = new Result<IPage<EquipmentSparepartSupplies>>();
Page<EquipmentSparepartSupplies> page = new Page<EquipmentSparepartSupplies>(pageNo, pageSize);
......@@ -46,4 +50,40 @@ public class ErpCommonController {
result.setResult(pageList);
return result;
}
@AutoLog(value = "ERP-采购合同--物料清单")
@ApiOperation(value = "ERP-采购合同--物料清单", notes = "ERP-采购合同--物料清单")
@RequestMapping(value = "/purchaseMaterialList", method = RequestMethod.GET)
public Result<IPage<PurchaseMaterial>> purchaseMaterialList(
@RequestParam(name = "goodCode") String goodCode,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<IPage<PurchaseMaterial>> result = new Result<IPage<PurchaseMaterial>>();
Page<PurchaseMaterial> page = new Page<PurchaseMaterial>(pageNo, pageSize);
String depId = BaseContextHandler.getRealDepartId();//临时参数
// String username = req.getParameter("username");
IPage<PurchaseMaterial> pageList = purchaseMaterialService.queryByPage(page,goodCode, depId);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/* @AutoLog(value = "ERP-采购合同--物料清单")
@ApiOperation(value = "ERP-采购合同--物料清单", notes = "ERP-采购合同--物料清单")
@RequestMapping(value = "/distributMaterialList", method = RequestMethod.GET)
public Result<IPage<EquipmentSparepartSupplies>> distributMaterialList(
@RequestParam(name = "goodCode") String goodCode,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<IPage<EquipmentSparepartSupplies>> result = new Result<IPage<EquipmentSparepartSupplies>>();
Page<EquipmentSparepartSupplies> page = new Page<EquipmentSparepartSupplies>(pageNo, pageSize);
String depId = BaseContextHandler.getRealDepartId();//临时参数
// String username = req.getParameter("username");
IPage<EquipmentSparepartSupplies> pageList = distributMaterialService.queryByPage(page,goodCode, depId);
result.setSuccess(true);
result.setResult(pageList);
return result;
}*/
}
......
......@@ -12,11 +12,14 @@ 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.PurchaseMaterial;
import com.skua.modules.erp.entity.PurchasePlan;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.service.IPurchasePlanService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import com.skua.modules.erp.vo.PurchasePlanVO;
import com.skua.modules.guest.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
......@@ -50,19 +53,8 @@ import io.swagger.annotations.ApiOperation;
public class PurchasePlanController {
@Autowired
private IPurchasePlanService purchasePlanService;
/**
* <pre>
* 分页列表查询
* </pre>
* @param purchasePlanVO
* @param pageNo
* @param pageSize
* @param req
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@Autowired
private IPurchaseMaterialService purchaseMaterialService;
@AutoLog(value = "erp采购计划表-分页列表查询")
@ApiOperation(value="erp采购计划表-分页列表查询", notes="erp采购计划表-分页列表查询")
......@@ -126,6 +118,8 @@ public class PurchasePlanController {
queryWrapper.like("apply_user", purchasePlan.getApplyUser());
}*/
queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(","));
queryWrapper.gt("status" , "0");// >0
queryWrapper.ne("status" , "2"); // 不等于2
queryWrapper.orderByDesc("create_time");
IPage<PurchasePlan> pageList = purchasePlanService.page(page, queryWrapper);
result.setSuccess(true);
......@@ -133,15 +127,6 @@ public class PurchasePlanController {
return result;
}
/**
* <pre>
* 添加
* </pre>
* @param purchasePlan
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp采购计划表-添加")
@ApiOperation(value="erp采购计划表-添加", notes="erp采购计划表-添加")
@PostMapping(value = "/add")
......@@ -295,4 +280,38 @@ public class PurchasePlanController {
@AutoLog(value = "erp采购计划表-按物料统计列表")
@ApiOperation(value="erp采购计划表-按物料统计列表", notes="erp采购计划表-按物料统计列表")
@GetMapping(value = "/statisticsList")
public Result<IPage<PurchaseMaterial>> statisticsList(PurchasePlanSearchVO purchasePlanSearchVO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<PurchaseMaterial>> result = new Result<IPage<PurchaseMaterial>>();
Page<PurchaseMaterial> page = new Page<PurchaseMaterial>(pageNo, pageSize);
//purchasePlanSearchVO.setDepats();
purchasePlanSearchVO.setDeparts(BaseContextHandler.getDeparts());
IPage<PurchaseMaterial> pageList = purchaseMaterialService.statisticsPage(page,purchasePlanSearchVO);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "erp采购计划表-统计详情")
@ApiOperation(value="erp采购计划表-统计详情", notes="erp采购计划表-统计详情")
@GetMapping(value = "/statisticsDetail")
public Result<IPage<PurchaseMaterial>> statisticsDetail(PurchasePlanSearchVO purchasePlanSearchVO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<PurchaseMaterial>> result = new Result<IPage<PurchaseMaterial>>();
Page<PurchaseMaterial> page = new Page<PurchaseMaterial>(pageNo, pageSize);
purchasePlanSearchVO.setDeparts(BaseContextHandler.getDeparts());
IPage<PurchaseMaterial> pageList = purchaseMaterialService.statisticsPageBySparepartId(page,purchasePlanSearchVO);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
}
......
package com.skua.modules.erp.controller.web;
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.Warehousing;
import com.skua.modules.erp.service.IWarehousingService;
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("webWarehousingController")
@RequestMapping("/web/erp/warehousing")
public class WarehousingController {
@Autowired
private IWarehousingService warehousingService;
@AutoLog(value = "采购入库-分页列表查询")
@ApiOperation(value="采购入库-分页列表查询", notes="采购入库-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<Warehousing>> queryPageList(Warehousing warehousing,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<Warehousing>> result = new Result<IPage<Warehousing>>();
QueryWrapper<Warehousing> queryWrapper = QueryGenerator.initQueryWrapper(warehousing, req.getParameterMap());
Page<Warehousing> page = new Page<Warehousing>(pageNo, pageSize);
IPage<Warehousing> pageList = warehousingService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "采购入库-添加")
@ApiOperation(value="采购入库-添加", notes="采购入库-添加")
@PostMapping(value = "/add")
public Result<Warehousing> add(@RequestBody Warehousing warehousing) {
Result<Warehousing> result = new Result<Warehousing>();
try {
warehousingService.save(warehousing);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
@AutoLog(value = "采购入库-编辑")
@ApiOperation(value="采购入库-编辑", notes="采购入库-编辑")
@PutMapping(value = "/edit")
public Result<Warehousing> edit(@RequestBody Warehousing warehousing) {
Result<Warehousing> result = new Result<Warehousing>();
Warehousing warehousingEntity = warehousingService.getById(warehousing.getId());
if(warehousingEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = warehousingService.updateById(warehousing);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
}
}
return result;
}
@AutoLog(value = "采购入库-通过id删除")
@ApiOperation(value="采购入库-通过id删除", notes="采购入库-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
warehousingService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
}
return Result.ok("删除成功!");
}
@AutoLog(value = "采购入库-批量删除")
@ApiOperation(value="采购入库-批量删除", notes="采购入库-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<Warehousing> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<Warehousing> result = new Result<Warehousing>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
this.warehousingService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
@AutoLog(value = "采购入库-通过id查询")
@ApiOperation(value="采购入库-通过id查询", notes="采购入库-通过id查询")
@GetMapping(value = "/queryById")
public Result<Warehousing> queryById(@RequestParam(name="id",required=true) String id) {
Result<Warehousing> result = new Result<Warehousing>();
Warehousing warehousing = warehousingService.getById(id);
if(warehousing==null) {
result.error500("未找到对应实体");
}else {
result.setResult(warehousing);
result.setSuccess(true);
}
return result;
}
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<Warehousing> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
Warehousing warehousing = JSON.parseObject(deString, Warehousing.class);
queryWrapper = QueryGenerator.initQueryWrapper(warehousing, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<Warehousing> pageList = warehousingService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "采购入库列表");
mv.addObject(NormalExcelConstants.CLASS, Warehousing.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("采购入库列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@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<Warehousing> listWarehousings = ExcelImportUtil.importExcel(file.getInputStream(), Warehousing.class, params);
warehousingService.saveBatch(listWarehousings);
return Result.ok("文件导入成功!数据行数:" + listWarehousings.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("文件导入失败!");
}
}
......@@ -67,6 +67,14 @@ public class ERPPurchaseContract {
@Excel(name = "使用机构编码集合", width = 15)
@ApiModelProperty(value = "使用机构编码集合")
private java.lang.String departs;
/**入库仓库编号*/
@Excel(name = "入库仓库编号", width = 15)
@ApiModelProperty(value = "入库仓库编号")
@Dict(dicCode = "id", dicText = "warehouse_name", dictTable = "supplies_warehouse")
private java.lang.String inWarehouseId;
/**合同附件*/
@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;
......@@ -36,7 +37,7 @@ public class PurchaseMaterial {
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
private java.lang.String sparepartTypeId;
private java.lang.String sparepartType;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
......@@ -44,7 +45,7 @@ public class PurchaseMaterial {
/**物料编号*/
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private java.lang.String goodNum;
private java.lang.String goodCode;
/**供应商id*/
@Excel(name = "供应商id", width = 15)
@ApiModelProperty(value = "供应商id")
......@@ -52,11 +53,11 @@ public class PurchaseMaterial {
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private java.lang.String specifications;
private java.lang.String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private java.lang.String unit;
private java.lang.String measuringUnit;
/**计划采购数量*/
@Excel(name = "计划采购数量", width = 15)
@ApiModelProperty(value = "计划采购数量")
......@@ -65,8 +66,34 @@ public class PurchaseMaterial {
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private java.lang.String unitPrice;
@Excel(name = "总价", width = 15)
@ApiModelProperty(value = "总价")
private String totalPrice;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String remarks;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartCode;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@TableField(exist=false)
@ApiModelProperty(value = "物料名称")
private String sparepartName;
@TableField(exist=false)
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@TableField(exist=false)
@ApiModelProperty(value = "厂站名称")
private String departName;
}
......
......@@ -95,6 +95,7 @@ public class PurchasePlan implements Serializable{
@Excel(name = "删除标识,0:有效,1:删除", width = 15)
@ApiModelProperty(value = "删除标识,0:有效,1:删除")
private Integer delFlag;
/**审批意见*/
@ApiModelProperty(value = "审批意见")
private String approveMessage;
}
......
......@@ -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;
......@@ -36,11 +37,13 @@ public class PurchasePlanItem implements Serializable{
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
//@Dict(dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text")
private String sparepartType;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
//@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name")
private String sparepartId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
......@@ -81,7 +84,6 @@ public class PurchasePlanItem implements Serializable{
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@TableField(exist=false)
@ApiModelProperty(value = "物料名称")
private String sparepartName;
}
......
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_warehousing")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_warehousing对象", description="采购入库")
public class Warehousing {
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**厂站*/
@Excel(name = "厂站", width = 15)
@ApiModelProperty(value = "厂站")
private java.lang.String departId;
/**入库类型*/
@Excel(name = "入库类型", width = 15)
@ApiModelProperty(value = "入库类型")
private java.lang.String inType;
/**收货人*/
@Excel(name = "收货人", width = 15)
@ApiModelProperty(value = "收货人")
private java.lang.String receiver;
/**入库时间*/
@Excel(name = "入库时间", width = 15)
@ApiModelProperty(value = "入库时间")
private java.lang.String inDate;
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
private java.lang.String sparepartType;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private java.lang.String sparepartId;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private java.lang.String goodNum;
/**供应商id*/
@Excel(name = "供应商id", width = 15)
@ApiModelProperty(value = "供应商id")
private java.lang.String supplierId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private java.lang.String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private java.lang.String measuringUnit;
/**计划采购数量*/
@Excel(name = "计划采购数量", width = 15)
@ApiModelProperty(value = "计划采购数量")
private java.lang.String materialNum;
/**到货日期*/
@Excel(name = "到货日期", width = 15)
@ApiModelProperty(value = "到货日期")
private java.lang.String arrivalDate;
/**外观情况*/
@Excel(name = "外观情况", width = 15)
@ApiModelProperty(value = "外观情况")
private java.lang.String appearanceInfo;
/**货物与合同清单匹配情况*/
@Excel(name = "货物与合同清单匹配情况", width = 15)
@ApiModelProperty(value = "货物与合同清单匹配情况")
private java.lang.String matchedInfo;
/**处理意见*/
@Excel(name = "处理意见", width = 15)
@ApiModelProperty(value = "处理意见")
private java.lang.String handleMsg;
/**送货/供方人员签字*/
@Excel(name = "送货/供方人员签字", width = 15)
@ApiModelProperty(value = "送货/供方人员签字")
private java.lang.String senderSign;
/**收货人员签字*/
@Excel(name = "收货人员签字", width = 15)
@ApiModelProperty(value = "收货人员签字")
private java.lang.String receiverSign;
/**确认状态 0 未确认、1 部分确认、2全部确认*/
@Excel(name = "确认状态 0 未确认、1 部分确认、2全部确认", width = 15)
@ApiModelProperty(value = "确认状态 0 未确认、1 部分确认、2全部确认")
private java.lang.String confirmStatus;
/**分享地址*/
@Excel(name = "分享地址", width = 15)
@ApiModelProperty(value = "分享地址")
private java.lang.String shareUrl;
/**分销合同*/
@Excel(name = "分销合同", width = 15)
@ApiModelProperty(value = "分销合同")
private java.lang.String distributContract;
/**采购合同*/
@Excel(name = "采购合同", width = 15)
@ApiModelProperty(value = "采购合同")
private java.lang.String purchaseContract;
/**采购单价*/
@Excel(name = "采购单价", width = 15)
@ApiModelProperty(value = "采购单价")
private java.lang.String purchasePrice;
/**分销单价*/
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "分销单价")
private java.lang.String distributPrice;
/**采购总价*/
@Excel(name = "采购总价", width = 15)
@ApiModelProperty(value = "采购总价")
private java.lang.String purchaseTotalPrice;
/**分销总价*/
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "分销总价")
private java.lang.String distributTotalPrice;
/**到货验收时间*/
@Excel(name = "到货验收时间", width = 15)
@ApiModelProperty(value = "到货验收时间")
private java.lang.String acceptancesTime;
/**申请人*/
@Excel(name = "申请人", width = 15)
@ApiModelProperty(value = "申请人")
private java.lang.String applyUser;
/**申请时间*/
@Excel(name = "申请时间", width = 15)
@ApiModelProperty(value = "申请时间")
private java.lang.String applyTime;
/**审批人*/
@Excel(name = "审批人", width = 15)
@ApiModelProperty(value = "审批人")
private java.lang.String approveUser;
/**审批时间*/
@Excel(name = "审批时间", width = 15)
@ApiModelProperty(value = "审批时间")
private java.lang.String approveTime;
/**审批意见*/
@Excel(name = "审批意见", width = 15)
@ApiModelProperty(value = "审批意见")
private java.lang.String approveMessage;
/**审核状态*/
@Excel(name = "审核状态", width = 15)
@ApiModelProperty(value = "审核状态")
private java.lang.String approveState;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String remark;
/**创建人id*/
@Excel(name = "创建人id", width = 15)
@ApiModelProperty(value = "创建人id")
private java.lang.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 java.util.Date createTime;
/**修改人id*/
@Excel(name = "修改人id", width = 15)
@ApiModelProperty(value = "修改人id")
private java.lang.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 java.util.Date updateTime;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private java.lang.String createDept;
/**所属公司*/
@Excel(name = "所属公司", width = 15)
@ApiModelProperty(value = "所属公司")
private java.lang.String createCmpy;
/**删除标识,0:有效,1:删除*/
@Excel(name = "删除标识,0:有效,1:删除", width = 15)
@ApiModelProperty(value = "删除标识,0:有效,1:删除")
private java.lang.Integer delFlag;
}
......@@ -14,4 +14,6 @@ public interface DistributMaterialMapper extends BaseMapper<DistributMaterial> {
public void delByContractId( @Param("contractId") String contractId);
List<DistributMaterial> queryListByContractId( @Param("contractId") String contractId);
}
......
......@@ -2,6 +2,10 @@ package com.skua.modules.erp.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.DistributContract;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -23,5 +27,46 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> {
* @param contractId
* @return
*/
public List<PurchaseMaterial> queryListByContractId( @Param("contractId") String contractId);
List<PurchaseMaterial> queryListByContractId( @Param("contractId") String contractId);
/***
* 分页查询采购物料清单
* @param page
* @param goodCode
* @param departId
* @return
*/
IPage<PurchaseMaterial> queryByPage(@Param("page")Page<PurchaseMaterial> page, @Param("goodCode")String goodCode, @Param("departId")String departId);
/***
* 统计分页
* @param page
* @param purchasePlanSearchVO
* @return
*/
IPage<PurchaseMaterial> statisticsPage(@Param("page")Page<PurchaseMaterial> page, @Param("ev")PurchasePlanSearchVO purchasePlanSearchVO);
/***
* 查询某一物料的的采购计划物料清单
* @param page
* @return
*/
IPage<PurchaseMaterial> statisticsPageBySparepartId(@Param("page")Page<PurchaseMaterial> page, @Param("ev")PurchasePlanSearchVO purchasePlanSearchVO);
/***
* 根据货号查询采购合同物料清单
* @param goodCode
* @param departId
* @return
*/
List<PurchaseMaterial> queryByList( @Param("goodCode")String goodCode, @Param("departId")String departId);
/***
* 查询某一物料的的采购计划物料清单
* @param page
* @param sparepartId
* @param departs
* @return
*/
IPage<PurchaseMaterial> statisticsPageBySparepartId(@Param("page")Page<PurchaseMaterial> page, @Param("sparepartId")Integer sparepartId, @Param("departs")String departs);
}
......
package com.skua.modules.erp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.Warehousing;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 采购入库
*/
public interface WarehousingMapper extends BaseMapper<Warehousing> {
}
......@@ -10,9 +10,96 @@
<!-- 根据计划编号获取采购清单列表 -->
<select id="queryListByContractId" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name', m.* from erp_purchase_material m
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', m.* from erp_purchase_material m
left join equipment_sparepart_supplies ss on m.sparepart_id = ss.id
left join equipment_sparepart_type st on m.id = sparepart_type_id
left join equipment_sparepart_type st on st.id = m.sparepart_type
left join ajh_supplier_manage sm on sm.id = m.supplier_id
where m.contract_id = #{contractId}
</select>
<!-- 分页查询拥有权限的采购合同物料清单-->
<select id="queryByPage" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.*
from (
select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id and pc.departs like '%13%'
<if test="goodCode != null and goodCode != ''">
AND m.good_code like concat('%', #{goodCode}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
AND pc.departs like concat('%', #{departId}, '%')
</if>
) aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join ajh_supplier_manage sm on sm.id = aaa.supplier_id
</select>
<select id="queryByList" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.*
from (
select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id and pc.departs like '%13%'
<if test="goodCode != null and goodCode != ''">
AND m.good_code like concat('%', #{goodCode}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
AND pc.departs like concat('%', #{departId}, '%')
</if>
) aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join ajh_supplier_manage sm on sm.id = aaa.supplier_id
</select>
<!-- 统计查询-->
<select id="statisticsPage" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select ss.sparepart_name,ss.sparepart_type,ss.specification,ss.measuring_unit, aaa.* from (
select pi.sparepart_id,sum(pi.purchase_num ) as 'purchase_num' , sum(pi.total_price) 'total_price'
from erp_purchase_plan_item pi ,erp_purchase_plan pp
where
pp.id = pi.plan_id
<if test="ev.applyYear != null ">
and pp.apply_year = #{ev.applyYear}
</if>
<if test="ev.departId != null ">
and pp.depart_id = #{ev.departId}
</if>
<if test="ev.startTime != null ">
and pp.apply_time &gt;= #{ev.startTime}
</if>
<if test="ev.endTime != null ">
and pp.apply_time &lt;= #{ev.startTime}
</if>
and pp.depart_id in (#{departs})
-- and pi.sparepart_name like '%%' and pi.sparepart_type ='123'
group by pi.sparepart_id
)aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
</select>
<select id="statisticsPageBySparepartId" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select st.item_text as 'sparepart_type_name' , d.depart_name , aaa.*
from (
select pi.* ,pp.depart_id
from erp_purchase_plan_item pi ,erp_purchase_plan pp
where
pp.id = pi.plan_id and pp.sparepart_id=#{ev.sparepartId}
<if test="ev.applyYear != null ">
and pp.apply_year = #{ev.applyYear}
</if>
<if test="ev.departId != null ">
and pp.depart_id = #{ev.departId}
</if>
<if test="ev.startTime != null ">
and pp.apply_time &gt;= #{ev.startTime}
</if>
<if test="ev.endTime != null ">
and pp.apply_time &lt;= #{ev.startTime}
</if>
and pp.depart_id in (#{departs})
)aaa
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join sys_depart d on d.id = aaa.depart_id
</select>
</mapper>
\ No newline at end of file
......
......@@ -11,9 +11,11 @@
<!-- 根据计划编号获取采购清单列表 -->
<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 = pi.sparepart_type
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.WarehousingMapper">
</mapper>
\ No newline at end of file
package com.skua.modules.erp.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.DistributContract;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import java.util.List;
/**
* 采购物料清单
*/
public interface IPurchaseMaterialService extends IService<PurchaseMaterial> {
/***
* 分页查询采购物料清单
* @param page
* @param goodCode
* @param departId
* @return
*/
IPage<PurchaseMaterial> queryByPage(Page<PurchaseMaterial> page, String goodCode, String departId);
/***
* 根据货号查询采购合同物料清单
* @param goodCode
* @param departId
* @return
*/
List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId);
/***
* 统计分页:按照物料分组
* @param page
* @param purchasePlanSearchVO
* @return
*/
IPage<PurchaseMaterial> statisticsPage(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO);
/***
* 查询某一物料的的采购计划物料清单
* @param page
* @return
*/
IPage<PurchaseMaterial> statisticsPageBySparepartId(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO);
}
......
package com.skua.modules.erp.service;
import com.skua.modules.erp.entity.Warehousing;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 采购入库
*/
public interface IWarehousingService extends IService<Warehousing> {
}
......@@ -105,7 +105,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
*/
@Transactional
public void auditPurchaseContract(PurchaseContractVO purchaseContractVO){
boolean inStock =false;
//保存
//purchasePlan.getApproveState() 审批状态 1通过2不通过
if("1".equals( purchaseContractVO.getApproveState() )){
......@@ -113,6 +113,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
}
if("2".equals( purchaseContractVO.getApproveState() )){
purchaseContractVO.setStatus( "4" );
inStock = true;
}
this.baseMapper.updateById( purchaseContractVO ) ;
......@@ -128,5 +129,9 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
//审批记录
ApproveRecord record = new ApproveRecord( "CGHT", purchaseContractVO.getApplyUser(), purchaseContractVO.getId(), BaseContextHandler.getUserId(), purchaseContractVO.getApproveMessage(), purchaseContractVO.getApproveState());
recordMapper.insert( record ) ;
// 审核通过,生成入库单据、物料单
if(inStock ){
}
}
}
......
package com.skua.modules.erp.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* 采购物料清单
*/
@Service
public class PurchaseMaterialServiceImpl extends ServiceImpl<PurchaseMaterialMapper, PurchaseMaterial> implements IPurchaseMaterialService {
/***
* 分页查询采购物料清单
* @param page
* @param goodCode
* @param departId
* @return
*/
public IPage<PurchaseMaterial> queryByPage(Page<PurchaseMaterial> page, String goodCode, String departId){
return this.baseMapper.queryByPage(page,goodCode,departId);
}
/***
* 根据货号查询采购合同物料清单
* @param goodCode
* @param departId
* @return
*/
public List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId){
return this.baseMapper.queryByList(goodCode,departId);
}
/***
* 统计分页
* @param page
* @param purchasePlanSearchVO
* @return
*/
public IPage<PurchaseMaterial> statisticsPage(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO){
return this.baseMapper.statisticsPage(page,purchasePlanSearchVO);
}
/***
* 查询某一物料的的采购计划物料清单
* @param page
* @return
*/
public IPage<PurchaseMaterial> statisticsPageBySparepartId(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO){
return this.baseMapper.statisticsPageBySparepartId(page,purchasePlanSearchVO);
}
}
......
......@@ -114,7 +114,7 @@ public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, Pur
*/
@Transactional
public void auditPurchasePlan(PurchasePlanVO purchasePlanVO){
boolean warehousing = false;//是否入库
//保存
//purchasePlan.getApproveState() 审批状态 1通过2不通过
if("1".equals( purchasePlanVO.getApproveState() )){
......@@ -122,6 +122,8 @@ public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, Pur
}
if("2".equals( purchasePlanVO.getApproveState() )){
purchasePlanVO.setStatus( "4" );
//发送入库单据,物料库存增加
warehousing = true;
}
this.baseMapper.updateById( purchasePlanVO ) ;
......@@ -137,5 +139,10 @@ public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, Pur
//审批记录
ApproveRecord record = new ApproveRecord( "CGJH", purchasePlanVO.getApplyUser(), purchasePlanVO.getId(), BaseContextHandler.getUserId(), purchasePlanVO.getApproveMessage(), purchasePlanVO.getApproveState());
recordMapper.insert( record ) ;
if(warehousing){//创建入库单据、入库物料单
}
}
}
......
package com.skua.modules.erp.service.impl;
import com.skua.modules.erp.entity.Warehousing;
import com.skua.modules.erp.mapper.WarehousingMapper;
import com.skua.modules.erp.service.IWarehousingService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 采购入库
*/
@Service
public class WarehousingServiceImpl extends ServiceImpl<WarehousingMapper, Warehousing> implements IWarehousingService {
}
package com.skua.modules.erp.vo;
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 org.jeecgframework.poi.excel.annotation.Excel;
/**
* @auther kangwei
* @create 2024-09-24-15:14
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="PurchasePlanSearch采购计划统计查询对象", description="PurchasePlanSearch采购计划统计查询对象")
public class PurchasePlanSearchVO {
/**厂站*/
@ApiModelProperty(value = "厂站")
private String departId;
@ApiModelProperty(value = "物料编号")
public String sparepartId;
@ApiModelProperty(value = "权限下的部门编号集合")
private String departs;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "计划年份")
private String applyYear;
@ApiModelProperty(value = "物料类别编号")
private String sparepartType;
@ApiModelProperty(value = "物料名称")
private String sparepartName;
}
......@@ -27,10 +27,7 @@ public class PurchasePlanVO extends PurchasePlan {
@ApiModelProperty(value = "采购计划物料清单集合")
private List<PurchasePlanItem> planItemList = null;
/**审批意见*/
@TableField(exist=false)
@ApiModelProperty(value = "审批意见")
private String approveMessage;
/**审批状态*/
@TableField(exist=false)
@ApiModelProperty(value = "审批状态 1通过2不通过")
......
package com.skua.modules.safe.controller;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -13,12 +14,15 @@ import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.query.QueryGenerator;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.zxing.QRCodeUtil;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.skua.modules.safe.service.IDangerLevelManageService;
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 com.skua.modules.system.mapper.SysConfigMapper;
import com.skua.modules.system.service.ISysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
......@@ -28,6 +32,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
......@@ -46,7 +51,10 @@ import io.swagger.annotations.ApiOperation;
public class DangerLevelManageController {
@Autowired
private IDangerLevelManageService dangerLevelManageService;
@Value("${skua.path.upload}")
private String uploadpath;
@Autowired
private ISysConfigService configService;
/**
* 分页列表查询
* @param dangerLevelManage
......@@ -82,7 +90,10 @@ public class DangerLevelManageController {
public Result<DangerLevelManage> add(@RequestBody DangerLevelManage dangerLevelManage) {
Result<DangerLevelManage> result = new Result<DangerLevelManage>();
try {
dangerLevelManageService.save(dangerLevelManage);
dangerLevelManage.setQrCode( this.createQR( dangerLevelManage.getId())) ;
dangerLevelManageService.updateById( dangerLevelManage ) ;
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
......@@ -105,6 +116,8 @@ public class DangerLevelManageController {
if(dangerLevelManageEntity==null) {
result.error500("未找到对应实体");
}else {
dangerLevelManage.setQrCode( this.createQR( dangerLevelManage.getId())) ;
dangerLevelManageService.updateById( dangerLevelManage ) ;
boolean ok = dangerLevelManageService.updateById(dangerLevelManage);
//TODO 返回false说明什么?
if(ok) {
......@@ -114,6 +127,24 @@ public class DangerLevelManageController {
return result;
}
/***
* 生成二维码图片
* @param dangerLevelId
* @return
*/
private String createQR(String dangerLevelId){
String qrCodePath = "files"+ File.separator+"qrcode"+File.separator+dangerLevelId+".png";
try {
String qrUrl = configService.queryValueByKey("DANGER_LEVLE_QRURL");
QRCodeUtil.encode(qrUrl, "", uploadpath+File.separator+qrCodePath, true);
} catch (Exception e) {
log.error("生成二维码失败");
qrCodePath = null;
}
return qrCodePath;
}
/**
* 通过id删除
......
......@@ -61,7 +61,7 @@ public class APPDangerInspectionController {
BeanUtils.copyProperties(dangerInspection , dangerLevelManageVO);
//查询:上次巡检时间
DangerInspectionRecord inspectionRecord = inspectionRecordService.queryOneByDangerId( id,"2" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录
DangerInspectionRecord inspectionRecord = inspectionRecordService.queryOneByDangerId( id,null ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录
if(inspectionRecord != null ){
dangerLevelManageVO.setLastInspectionTime( inspectionRecord.getReportDate() );
dangerLevelManageVO.setLastInspectionStatus( inspectionRecord.getStatus());
......@@ -142,6 +142,7 @@ public class APPDangerInspectionController {
public Result<DangerInspectInfo> updateDangerInspectionInfo(@RequestBody DangerInspectionInfo dangerInspectionInfo) {
Result<DangerInspectInfo> result = new Result<DangerInspectInfo>();
try {
dangerInspectionInfo.setStatus("2");
inspectionInfoService.updateDangerInspectionInfo(dangerInspectionInfo);
result.success("添加成功!");
} catch (Exception e) {
......
......@@ -11,10 +11,13 @@ import com.skua.modules.safe.entity.DangerInspectionRecord;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.skua.modules.safe.service.IDangerInspectionItemService;
import com.skua.modules.safe.service.IDangerInspectionRecordService;
import com.skua.modules.safe.vo.DangerInspectionRecordVO;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -31,11 +34,8 @@ import java.util.List;
public class APPDangerInspectionRecordController {
@Autowired
private IDangerInspectionRecordService dangerInspectionRecordService;
@Autowired
private IDangerInspectionRecordService inspectionRecordService ;//巡检对象
/**
* <pre>
* 分页列表查询
......@@ -51,7 +51,7 @@ public class APPDangerInspectionRecordController {
@AutoLog(value = "隐患排查记录-分页列表查询")
@ApiOperation(value="隐患排查记录-分页列表查询", notes="隐患排查记录-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<DangerInspectionRecord>> queryPageList(DangerInspectionRecord dangerInspectionRecord,
public Result<IPage<DangerInspectionRecord>> queryPageList(DangerInspectionRecordVO dangerInspectionRecord,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
......@@ -78,17 +78,17 @@ public class APPDangerInspectionRecordController {
* <pre>
* 扫描二维码进入:风险点详情
* </pre>
* @param dangerInspectionRecord
* @param inspectionRecordId
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "扫描二维码进入:风险点详情")
@ApiOperation(value="扫描二维码进入:风险点详情", notes="扫描二维码进入:风险点详情")
@AutoLog(value = "隐患排查记录:风险点详情")
@ApiOperation(value="隐患排查记录:风险点详情", notes="隐患排查记录:风险点详情")
@GetMapping(value = "/detail")
public Result<DangerLevelManage> queryById(DangerInspectionRecord dangerInspectionRecord) {
Result<DangerLevelManage> result = new Result<DangerLevelManage>();
DangerLevelManage dangerLevelManage = inspectionRecordService.queryListByDangerId(dangerInspectionRecord.getDangerId(),dangerInspectionRecord.getStartTime(),dangerInspectionRecord.getEndDate());
public Result<DangerLevelManageVO> queryById(@RequestParam(name="id") String inspectionRecordId) {
Result<DangerLevelManageVO> result = new Result<DangerLevelManageVO>();
DangerLevelManageVO dangerLevelManage = inspectionRecordService.queryListByRecordId(inspectionRecordId);
if(dangerLevelManage == null) {
result.error500("未找到对应实体");
}else {
......@@ -97,4 +97,6 @@ public class APPDangerInspectionRecordController {
}
return result;
}
//Statistics
}
\ No newline at end of file
......
......@@ -46,4 +46,11 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio
* @return
*/
public List<DangerInspectionInfo> queryInspectionInfoByDangerId(String dangerId ,String userId);
/***
* 根据巡检记录编号获取巡检对象集合
* @param inspectionRecordId
* @return
*/
public DangerLevelManageVO queryListByRecordId(String inspectionRecordId);
}
......
......@@ -2,6 +2,7 @@ package com.skua.modules.safe.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.safe.entity.*;
import com.skua.modules.safe.mapper.*;
import com.skua.modules.safe.service.IDangerInspectionRecordService;
......@@ -42,10 +43,16 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
public DangerInspectionRecord queryOneByDangerId(String dangerId,String status,String userId){
LambdaQueryWrapper<DangerInspectionRecord> queryWrapper = new LambdaQueryWrapper<DangerInspectionRecord>();
queryWrapper.eq(DangerInspectionRecord::getDangerId, dangerId);
queryWrapper.eq(DangerInspectionRecord::getStatus , status);
if(status != null ){
queryWrapper.eq(DangerInspectionRecord::getStatus , status);
}
queryWrapper.eq(DangerInspectionRecord::getReportUser , userId);
queryWrapper.orderByDesc(DangerInspectionRecord::getCreateTime);//添加排序
return this.baseMapper.selectOne(queryWrapper);
List<DangerInspectionRecord> dangerInspectionRecordList = this.baseMapper.selectList(queryWrapper);
if(dangerInspectionRecordList != null && !dangerInspectionRecordList.isEmpty()){
return dangerInspectionRecordList.get(0);
}
return null;
}
/***
......@@ -67,6 +74,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
dangerInspection.setDangerId( dangerId );
dangerInspection.setStatus( status);
dangerInspection.setReportUser( userId );
dangerInspection.setReportDate(DateUtil.getCurrentDate());
this.baseMapper.insert( dangerInspection ) ;
......@@ -158,6 +166,43 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
return inspectionInfoList;
}
/***
* 根据巡检记录编号获取巡检对象集合
* @param inspectionRecordId
* @return
*/
public DangerLevelManageVO queryListByRecordId(String inspectionRecordId){
DangerInspectionRecord dangerInspectionRecord = this.baseMapper.selectById(inspectionRecordId);
DangerLevelManageVO dangerLevelManageVO = new DangerLevelManageVO();
DangerLevelManage dangerLevelManage = null;//
if(dangerInspectionRecord != null ){
dangerLevelManage = dangerLevelManageMapper.selectById(dangerInspectionRecord.getDangerId());
BeanUtils.copyProperties(dangerLevelManage, dangerLevelManageVO);
}
//巡查对象
LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>();
queryWrapper.eq(DangerInspectionInfo::getInspectionRecordId, inspectionRecordId);
queryWrapper.orderByAsc(DangerInspectionInfo::getCreateTime );
List<DangerInspectionInfo> inspectionInfoList = dangerInspectionInfoMapper.selectList(queryWrapper);
if(inspectionInfoList != null && !inspectionInfoList.isEmpty()){
LambdaQueryWrapper<DangerInspectionItem> queryItemWrapper = new LambdaQueryWrapper<DangerInspectionItem>();
List<DangerInspectionItem> itemList = null;
for( DangerInspectionInfo info : inspectionInfoList){
queryItemWrapper.eq(DangerInspectionItem::getInspectionInfoId, info.getId());
queryItemWrapper.orderByAsc(DangerInspectionItem::getCreateTime );
itemList = dangerInspectionItemMapper.selectList(queryItemWrapper);
if(itemList != null ) info.setInspectionItemList( itemList ) ;
}
dangerLevelManageVO.setInspectionInfoList( inspectionInfoList );
}
return dangerLevelManageVO;
}
/***
* 查询巡查集合
......@@ -178,8 +223,6 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
queryWrapper.orderByAsc(DangerInspectionInfo::getCreateTime );
List<DangerInspectionInfo> inspectionInfoList = dangerInspectionInfoMapper.selectList(queryWrapper);
if(inspectionInfoList != null && !inspectionInfoList.isEmpty()){
LambdaQueryWrapper<DangerInspectionItem> queryItemWrapper = new LambdaQueryWrapper<DangerInspectionItem>();
......@@ -194,9 +237,6 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
dangerLevelManageVO.setInspectionInfoList( inspectionInfoList );
}
return dangerLevelManageVO;
}
......
package com.skua.modules.safe.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.modules.safe.entity.DangerInspectionRecord;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 检查内容对象
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="DangerInspectionRecord隐患风险查询对象", description="检查内容对象")
public class DangerInspectionRecordVO {
/**风险等级编号*/
@Excel(name = "风险等级编号", width = 15)
@ApiModelProperty(value = "风险等级编号")
private String dangerId;
@ApiModelProperty(value = "巡检记录编号")
private String inspectionRecord;
@TableField(exist=false)
@ApiModelProperty(value = "条件:开始时间")
private String startTime;
@TableField(exist=false)
@ApiModelProperty(value = "条件:结束时间")
private String endTime;
}
......@@ -24,4 +24,16 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip
public List<EquipmentInExcel> queryExport(QueryWrapper<EquipmentIn> queryWrapper) {
return equipmentInMapper.queryExport(queryWrapper);
}
/***
* 新增录入
* @param equipmentIn
* @return
*/
public int saveEquipmentIn(EquipmentIn equipmentIn){
return 0 ;
}
}
......
package com.skua.modules.system.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.system.entity.SysRole;
import java.util.List;
import java.util.Map;
/**
* 角色表 服务类
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!