diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index b2edce4..e36e57d 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -14,8 +14,11 @@ import com.glxp.api.req.purchase.certRequest; import com.glxp.api.req.system.DeleteCompanyFileRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.auth.registComPerResponse; +import com.glxp.api.service.auth.AuthAdminService; import com.glxp.api.service.sup.UserCertService; import com.glxp.api.service.sup.UserCertSetService; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Value; @@ -42,12 +45,18 @@ import java.util.List; @ApiIgnore @RestController public class SupCertController { + @Resource + private AuthAdminService authAdminService; @Resource private UserCertService userCertService; @Value("${file_path}") private String filePath; @Resource private UserCertSetService userCertSetService; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + @Resource + private SystemPDFModuleService systemPDFModuleService; @ApiOperation(value = "获取供应商资质信息",response = UserCertEntity.class) @@ -92,6 +101,21 @@ public class SupCertController { return ResultVOUtils.success("成功"); } + + + //首营预览文件 + @ApiOperation(value = "上传注册人文件",response = BaseResponse.class) + @PostMapping("/udiwms/image/register/file") + public BaseResponse uploadRegisterFile(@RequestBody FilterImageRequest filterImageRequest) { + List urlList = Arrays.asList(filterImageRequest.getImageUrl().split(",")); + List list = new ArrayList<>(); + for (String obj : urlList) { + String url = filterImageRequest.getCertFileUrl() + obj; + list.add(url); + } + return ResultVOUtils.success(list); + } + //修改 @ApiOperation(value = "修改资质证书",response = BaseResponse.class) @PostMapping("/sup/info/updateCert") @@ -117,21 +141,4 @@ public class SupCertController { return ResultVOUtils.success("修改成功"); } - - @ApiOperation(value = "上传注册人文件",response = BaseResponse.class) - @PostMapping("/udiwms/image/register/file") - public BaseResponse uploadRegisterFile(@RequestBody FilterImageRequest filterImageRequest) { - List urlList = Arrays.asList(filterImageRequest.getImageUrl().split(",")); - List list = new ArrayList<>(); - for (String obj : urlList) { - String url = filterImageRequest.getCertFileUrl() + obj; - list.add(url); - } - return ResultVOUtils.success(list); - } - - - - - } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java index 8c27f1f..f33b4b1 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java @@ -1,7 +1,74 @@ 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 javax.annotation.Resource; +import java.util.List; + +/** + * 资质预警信息接口 + */ +@Slf4j @RestController public class SupCertRemindMsgController { + + @Resource + private SupCertRemindMsgService supCertRemindMsgService; + + /** + * 查询资质预警信息列表 + * + * @param filterCertRemindMsgRequest + * @return + */ + @GetMapping("/sup/cert/remind/msg/filter") + public BaseResponse filterList(FilterCertRemindMsgRequest filterCertRemindMsgRequest) { + List list = supCertRemindMsgService.filterList(filterCertRemindMsgRequest); + PageInfo 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); + } } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java index dd36679..23a3a0e 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java @@ -1,7 +1,113 @@ 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 javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + @RestController 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 supCertEntityList + = supCertSetService.filterCertSets(filterCertSetsRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(supCertEntityList); + PageSimpleResponse 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 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 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("删除成功!"); + } + }