资质审核代码
parent
cb93cf45f2
commit
61c2c0cc56
@ -1,7 +1,74 @@
|
|||||||
package com.glxp.api.controller.purchase;
|
package com.glxp.api.controller.purchase;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.Log;
|
||||||
|
import com.glxp.api.common.enums.ResultEnum;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.constant.BusinessType;
|
||||||
|
import com.glxp.api.req.purchase.FilterCertRemindMsgRequest;
|
||||||
|
import com.glxp.api.res.purchase.SupCertRemindMsgResponse;
|
||||||
|
import com.glxp.api.service.purchase.SupCertRemindMsgService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资质预警信息接口
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
public class SupCertRemindMsgController {
|
public class SupCertRemindMsgController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SupCertRemindMsgService supCertRemindMsgService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资质预警信息列表
|
||||||
|
*
|
||||||
|
* @param filterCertRemindMsgRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/sup/cert/remind/msg/filter")
|
||||||
|
public BaseResponse filterList(FilterCertRemindMsgRequest filterCertRemindMsgRequest) {
|
||||||
|
List<SupCertRemindMsgResponse> list = supCertRemindMsgService.filterList(filterCertRemindMsgRequest);
|
||||||
|
PageInfo<SupCertRemindMsgResponse> pageInfo = new PageInfo<>(list);
|
||||||
|
return ResultVOUtils.page(pageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认消息
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param handleMsg 处理方式
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/sup/cert/remind/msg/confirmMsg")
|
||||||
|
@Log(title = "资质预警", businessType = BusinessType.UPDATE)
|
||||||
|
public BaseResponse confirmMsg(Integer id, String handleMsg) {
|
||||||
|
if (null == id || StrUtil.isBlank(handleMsg)) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||||
|
}
|
||||||
|
return supCertRemindMsgService.confirmMsg(id, handleMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忽略消息
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param ignoreStatus 忽略状态
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/sup/cert/remind/msg/ignoreMsg")
|
||||||
|
@Log(title = "资质预警", businessType = BusinessType.UPDATE)
|
||||||
|
public BaseResponse ignoreMsg(Integer id, Integer ignoreStatus) {
|
||||||
|
if (null == id || null == ignoreStatus) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||||
|
}
|
||||||
|
return supCertRemindMsgService.ignoreMsg(id, ignoreStatus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,113 @@
|
|||||||
package com.glxp.api.controller.purchase;
|
package com.glxp.api.controller.purchase;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.annotation.Log;
|
||||||
|
import com.glxp.api.common.enums.ResultEnum;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.constant.BusinessType;
|
||||||
|
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
||||||
|
import com.glxp.api.req.purchase.FilterCertSetsRequest;
|
||||||
|
import com.glxp.api.req.system.DeleteRequest;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.purchase.SupCertSetService;
|
||||||
|
import org.springframework.validation.BindingResult;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class SupCertSetController {
|
public class SupCertSetController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SupCertSetService supCertSetService;
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@GetMapping("/sup/cert/set/filter")
|
||||||
|
public BaseResponse filterCertSet(FilterCertSetsRequest filterCertSetsRequest,
|
||||||
|
BindingResult bindingResult) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SupCertSetEntity> supCertEntityList
|
||||||
|
= supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||||
|
PageInfo<SupCertSetEntity> pageInfo;
|
||||||
|
pageInfo = new PageInfo<>(supCertEntityList);
|
||||||
|
PageSimpleResponse<SupCertSetEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
pageSimpleResponse.setList(supCertEntityList);
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/sup/cert/set/add")
|
||||||
|
@Log(title = "资质证书", businessType = BusinessType.INSERT)
|
||||||
|
public BaseResponse addCertSet(@RequestBody SupCertSetEntity supCertSetEntity) {
|
||||||
|
if (supCertSetEntity == null) {
|
||||||
|
supCertSetEntity = new SupCertSetEntity();
|
||||||
|
}
|
||||||
|
//判断名字存在就返回
|
||||||
|
FilterCertSetsRequest filterCertSetsRequest=new FilterCertSetsRequest();
|
||||||
|
filterCertSetsRequest.setType(supCertSetEntity.getType());
|
||||||
|
filterCertSetsRequest.setName(supCertSetEntity.getName());
|
||||||
|
List<SupCertSetEntity> supCertEntityList = supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||||
|
if(supCertEntityList.size()>0){
|
||||||
|
return ResultVOUtils.error(999,"该证书名称已存在!");
|
||||||
|
}
|
||||||
|
supCertSetEntity.setUpdateTime(new Date());
|
||||||
|
if(supCertSetEntity.getType()==3){
|
||||||
|
if(supCertSetEntity.getFlbmList().size()>0){
|
||||||
|
String flbm = String.join(",", supCertSetEntity.getFlbmList());
|
||||||
|
supCertSetEntity.setFlbm(flbm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
supCertSetEntity.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
boolean b = supCertSetService.insertCertSet(supCertSetEntity);
|
||||||
|
return ResultVOUtils.success("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/sup/cert/set/update")
|
||||||
|
@Log(title = "资质证书", businessType = BusinessType.UPDATE)
|
||||||
|
public BaseResponse updateCertSet(@RequestBody SupCertSetEntity supCertSetEntity) {
|
||||||
|
if (CollUtil.isNotEmpty(supCertSetEntity.getFlbmList())) {
|
||||||
|
String flbm = supCertSetEntity.getFlbmList().stream().collect(Collectors.joining(","));
|
||||||
|
supCertSetEntity.setFlbm(flbm);
|
||||||
|
}
|
||||||
|
//判断名字存在就返回
|
||||||
|
FilterCertSetsRequest filterCertSetsRequest=new FilterCertSetsRequest();
|
||||||
|
filterCertSetsRequest.setType(supCertSetEntity.getType());
|
||||||
|
filterCertSetsRequest.setName(supCertSetEntity.getName());
|
||||||
|
filterCertSetsRequest.setId(supCertSetEntity.getId());
|
||||||
|
filterCertSetsRequest.setUpdateType(1);
|
||||||
|
List<SupCertSetEntity> supCertEntityList = supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||||
|
if(supCertEntityList.size()!=0){
|
||||||
|
return ResultVOUtils.error(999,"证书已存在!");
|
||||||
|
}
|
||||||
|
boolean b = supCertSetService.updateCertSet(supCertSetEntity);
|
||||||
|
return ResultVOUtils.success("修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/sup/cert/set/delete")
|
||||||
|
@Log(title = "资质证书", businessType = BusinessType.DELETE)
|
||||||
|
public BaseResponse deleteCertSet(@RequestBody DeleteRequest deleteRequest) {
|
||||||
|
|
||||||
|
boolean b = supCertSetService.deleteById(deleteRequest.getId());
|
||||||
|
return ResultVOUtils.success("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue