完善关键零部件型号库申请流程
This commit is contained in:
+143
@@ -0,0 +1,143 @@
|
||||
package com.jero.modules.activiti.process.part.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.Translation;
|
||||
import com.jero.modules.activiti.process.part.entity.ProcessPartTypeApplyRecord;
|
||||
import com.jero.modules.activiti.process.part.service.IProcessPartTypeApplyRecordService;
|
||||
import com.jero.modules.laws.part.entity.LawsPartRelevance;
|
||||
import com.jero.modules.laws.part.entity.LawsPartType;
|
||||
import com.jero.modules.laws.part.service.ILawsPartTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Api(tags = "业务支持-关键零部件型号库流程表")
|
||||
@RestController
|
||||
@RequestMapping("/laws/processPartTypeApplyRecord")
|
||||
@Slf4j
|
||||
public class ProcessPartTypeApplyRecordController {
|
||||
|
||||
@Resource
|
||||
private IProcessPartTypeApplyRecordService processPartTypeApplyRecordService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsPartType
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件型号库-分页列表查询")
|
||||
@ApiOperation(value = "业务支持-关键零部件型号库-分页列表查询", notes = "业务支持-关键零部件型号库-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperationSupport(order = 1)
|
||||
// @RequiresPermissions("keyPartBindingManage:search")
|
||||
public Result<List<ProcessPartTypeApplyRecord>> queryList(ProcessPartTypeApplyRecord processPartTypeApplyRecord,
|
||||
HttpServletRequest req) {
|
||||
List<ProcessPartTypeApplyRecord> pageList = processPartTypeApplyRecordService.queryList(processPartTypeApplyRecord, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param lawsPartType
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件型号库-详情")
|
||||
@ApiOperation(value = "业务支持-关键零部件型号库-详情", notes = "业务支持-关键零部件型号库-详情")
|
||||
@GetMapping(value = "/queryById")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Translation
|
||||
public Result<ProcessPartTypeApplyRecord> queryById(ProcessPartTypeApplyRecord processPartTypeApplyRecord) {
|
||||
ProcessPartTypeApplyRecord result = processPartTypeApplyRecordService.queryById(processPartTypeApplyRecord.getId());
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件型号库-删除")
|
||||
@ApiOperation(value = "业务支持-关键零部件型号库-删除", notes = "业务支持-关键零部件型号库-删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/delete")
|
||||
// @RequiresPermissions("keyPartBindingManage:delete")
|
||||
public Result<?> delete(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
this.processPartTypeApplyRecordService.deleteById(map.get("id"));
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件型号库-批量删除")
|
||||
@ApiOperation(value = "业务支持-关键零部件型号库-批量删除", notes = "业务支持-关键零部件型号库-批量删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
// @RequiresPermissions("keyPartBindingManage:batchDel")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
this.processPartTypeApplyRecordService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param lawsPartType
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件型号库-新增")
|
||||
@ApiOperation(value = "业务支持-关键零部件型号库-新增", notes = "业务支持-关键零部件型号库-新增")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@PostMapping(value = "/add")
|
||||
// @RequiresPermissions("keyPartBindingManage:add")
|
||||
public Result<T> add(@Validated @RequestBody ProcessPartTypeApplyRecord processPartTypeApplyRecord) {
|
||||
String id = processPartTypeApplyRecordService.add(processPartTypeApplyRecord);
|
||||
return Result.OK(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsPartType
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件型号库-编辑")
|
||||
@ApiOperation(value = "业务支持-关键零部件型号库-编辑", notes = "业务支持-关键零部件型号库-编辑")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@PostMapping(value = "/edit")
|
||||
// @RequiresPermissions("keyPartBindingManage:import")
|
||||
public Result<T> edit(@Validated @RequestBody ProcessPartTypeApplyRecord processPartTypeApplyRecord) {
|
||||
this.processPartTypeApplyRecordService.edit(processPartTypeApplyRecord);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
}
|
||||
+7
@@ -1,8 +1,14 @@
|
||||
package com.jero.modules.activiti.process.part.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.jero.modules.activiti.process.part.entity.ProcessPartTypeApplyRecord;
|
||||
import com.jero.modules.laws.part.entity.LawsPartType;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author
|
||||
@@ -12,6 +18,7 @@ import com.jero.modules.activiti.process.part.entity.ProcessPartTypeApplyRecord;
|
||||
*/
|
||||
public interface ProcessPartTypeApplyRecordMapper extends BaseMapper<ProcessPartTypeApplyRecord> {
|
||||
|
||||
List<ProcessPartTypeApplyRecord> pageList(@Param(Constants.WRAPPER) QueryWrapper<ProcessPartTypeApplyRecord> queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+36
@@ -4,4 +4,40 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.activiti.process.part.mapper.ProcessPartTypeApplyRecordMapper">
|
||||
|
||||
<select id="pageList"
|
||||
resultType="com.jero.modules.activiti.process.part.entity.ProcessPartTypeApplyRecord">
|
||||
select
|
||||
l2.reg_part_name_en,
|
||||
l2.reg_part_name_cn,
|
||||
l2.form_type,
|
||||
l2.system_code,
|
||||
l2.decision_requirement,
|
||||
l2.classification,
|
||||
l2.applicable_market,
|
||||
l2.parts_certified_deliverables,
|
||||
l2.responsible_department,
|
||||
l2.responsible_module,
|
||||
l2.remark,
|
||||
l2.fnd_gpc,
|
||||
l1.part_num,
|
||||
l1.part_relevance_id,
|
||||
l1.part_name,
|
||||
l1.production_factory,
|
||||
l1.applicable_vehicle_type,
|
||||
l1.technical_feature,
|
||||
l1.already_part_num_id,
|
||||
l1.already_part_num,
|
||||
l1.status,
|
||||
l1.success_time,
|
||||
l1.create_by,
|
||||
l1.last_id,
|
||||
l1.create_time,
|
||||
s3.id as dep_id
|
||||
from process_part_type_apply_record l1
|
||||
left join laws_part_relevance l2 on l1.part_relevance_id = l2.id and l2.del_flag = 0
|
||||
left join sys_user s1 on s1.username = l1.create_by
|
||||
left join sys_user_depart s2 on s2.user_id = s1.id
|
||||
left join sys_depart s3 on s3.id = s2.dep_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+14
@@ -3,6 +3,9 @@ package com.jero.modules.activiti.process.part.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.activiti.process.part.entity.ProcessPartTypeApplyRecord;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_standard_compliance_check】的数据库操作Service
|
||||
@@ -10,4 +13,15 @@ import com.jero.modules.activiti.process.part.entity.ProcessPartTypeApplyRecord;
|
||||
*/
|
||||
public interface IProcessPartTypeApplyRecordService extends IService<ProcessPartTypeApplyRecord> {
|
||||
|
||||
List<ProcessPartTypeApplyRecord> queryList(ProcessPartTypeApplyRecord lawsPartType, HttpServletRequest req);
|
||||
|
||||
ProcessPartTypeApplyRecord queryById(String id);
|
||||
|
||||
void deleteById(String id);
|
||||
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
String add(ProcessPartTypeApplyRecord processPartTypeApplyRecord);
|
||||
|
||||
void edit(ProcessPartTypeApplyRecord processPartTypeApplyRecord);
|
||||
}
|
||||
|
||||
+88
@@ -1,11 +1,25 @@
|
||||
package com.jero.modules.activiti.process.part.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.activiti.process.part.entity.ProcessPartTypeApplyRecord;
|
||||
import com.jero.modules.activiti.process.part.mapper.ProcessPartTypeApplyRecordMapper;
|
||||
import com.jero.modules.activiti.process.part.service.IProcessPartTypeApplyRecordService;
|
||||
import com.jero.modules.laws.part.entity.LawsPartRelevance;
|
||||
import com.jero.modules.laws.part.service.ILawsPartRelevanceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
@@ -17,6 +31,80 @@ import org.springframework.stereotype.Service;
|
||||
public class ProcessPartTypeApplyRecordServiceImpl extends ServiceImpl<ProcessPartTypeApplyRecordMapper, ProcessPartTypeApplyRecord>
|
||||
implements IProcessPartTypeApplyRecordService {
|
||||
|
||||
@Resource
|
||||
private ProcessPartTypeApplyRecordMapper processPartTypeApplyRecordMapper;
|
||||
@Resource
|
||||
private ILawsPartRelevanceService lawsPartRelevanceService;
|
||||
|
||||
@Override
|
||||
public List<ProcessPartTypeApplyRecord> queryList(ProcessPartTypeApplyRecord lawsPartType, HttpServletRequest req) {
|
||||
QueryWrapper<ProcessPartTypeApplyRecord> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(lawsPartType, req.getParameterMap());
|
||||
queryWrapper.eq("l1.del_flag","0");
|
||||
queryWrapper.orderByDesc("l1.create_time");
|
||||
List<ProcessPartTypeApplyRecord> re = processPartTypeApplyRecordMapper.pageList(queryWrapper);
|
||||
return re;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ProcessPartTypeApplyRecord queryById(String id) {
|
||||
ProcessPartTypeApplyRecord processPartTypeApplyRecord = getById(id);
|
||||
if(Objects.isNull(processPartTypeApplyRecord)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
LawsPartRelevance lawsPartRelevance = lawsPartRelevanceService.getById(processPartTypeApplyRecord.getPartRelevanceId());
|
||||
if(Objects.isNull(lawsPartRelevance)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
processPartTypeApplyRecord.setRegPartNameCn(lawsPartRelevance.getRegPartNameCn());
|
||||
processPartTypeApplyRecord.setRegPartNameEn(lawsPartRelevance.getRegPartNameEn());
|
||||
processPartTypeApplyRecord.setFormType(lawsPartRelevance.getFormType());
|
||||
processPartTypeApplyRecord.setDecisionRequirement(lawsPartRelevance.getDecisionRequirement());
|
||||
processPartTypeApplyRecord.setClassification(lawsPartRelevance.getClassification());
|
||||
processPartTypeApplyRecord.setApplicableMarket(lawsPartRelevance.getApplicableMarket());
|
||||
processPartTypeApplyRecord.setPartsCertifiedDeliverables(lawsPartRelevance.getPartsCertifiedDeliverables());
|
||||
processPartTypeApplyRecord.setResponsibleDepartment(lawsPartRelevance.getResponsibleDepartment());
|
||||
processPartTypeApplyRecord.setResponsibleModule(lawsPartRelevance.getResponsibleModule());
|
||||
return processPartTypeApplyRecord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
ProcessPartTypeApplyRecord processPartTypeApplyRecord = getById(id);
|
||||
if(Objects.isNull(processPartTypeApplyRecord)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public void deleteByIds(List<String> ids) {
|
||||
for (String id : ids) {
|
||||
deleteById(id);
|
||||
}
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String add(ProcessPartTypeApplyRecord processPartTypeApplyRecord) {
|
||||
save(processPartTypeApplyRecord);
|
||||
return processPartTypeApplyRecord.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(ProcessPartTypeApplyRecord processPartTypeApplyRecord) {
|
||||
ProcessPartTypeApplyRecord processPartTypeApplyRecordOld = getById(processPartTypeApplyRecord.getId());
|
||||
if(Objects.isNull(processPartTypeApplyRecordOld)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(!Objects.equals(processPartTypeApplyRecord.getCreateBy(),sysUser.getUsername())){
|
||||
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||
}
|
||||
updateById(processPartTypeApplyRecord);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user