ww
			
			
		
		
							parent
							
								
									9dcb7db864
								
							
						
					
					
						commit
						55e1481c21
					
				| @ -0,0 +1,110 @@ | |||||||
|  | package com.glxp.api.controller.purchase; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.util.IdUtil; | ||||||
|  | import com.github.pagehelper.PageInfo; | ||||||
|  | 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.entity.purchase.SupCertEntity; | ||||||
|  | import com.glxp.api.entity.sup.UserCertEntity; | ||||||
|  | import com.glxp.api.req.purchase.FilterImageRequest; | ||||||
|  | import com.glxp.api.req.purchase.FilterSupCertRequest; | ||||||
|  | import com.glxp.api.req.purchase.certRequest; | ||||||
|  | import com.glxp.api.req.system.DeleteCompanyFileRequest; | ||||||
|  | import com.glxp.api.res.PageSimpleResponse; | ||||||
|  | import com.glxp.api.service.sup.UserCertService; | ||||||
|  | import org.springframework.beans.factory.annotation.Value; | ||||||
|  | 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.io.File; | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author : zhangsan | ||||||
|  |  * @date : 2023/5/18 9:38 | ||||||
|  |  * @modyified By : | ||||||
|  |  */ | ||||||
|  | @RestController | ||||||
|  | public class SupCertController { | ||||||
|  |     @Resource | ||||||
|  |     private UserCertService userCertService; | ||||||
|  |     @Value("${file_path}") | ||||||
|  |     private String filePath; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/sup/company/cert/filterList") | ||||||
|  |     public BaseResponse filterCompanyCert(certRequest certRequest , BindingResult bindingResult){ | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  |         List<UserCertEntity> userCertEntities = userCertService.selectBybId(certRequest); | ||||||
|  |         PageInfo<UserCertEntity> pageInfo; | ||||||
|  |         pageInfo = new PageInfo<>(userCertEntities); | ||||||
|  |         PageSimpleResponse<UserCertEntity> pageSimpleResponse = new PageSimpleResponse<>(); | ||||||
|  |         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||||
|  |         pageSimpleResponse.setList(userCertEntities); | ||||||
|  |         return ResultVOUtils.success(pageSimpleResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     //资质证书添加
 | ||||||
|  |     @PostMapping("/sup/company/cert/isertCert") | ||||||
|  |     public BaseResponse isertCert(@RequestBody UserCertEntity userCert){ | ||||||
|  |         userCert.setCreateTime(new Date()); | ||||||
|  |         userCert.setUpdateTime(new Date()); | ||||||
|  |         userCert.setStatus(0+""); | ||||||
|  |         userCert.setId(IdUtil.getSnowflakeNextId()); | ||||||
|  |         userCertService.insertCert(userCert); | ||||||
|  |         return ResultVOUtils.success("成功"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     //删除
 | ||||||
|  |     @PostMapping("/sup/company/cert/deleteCert") | ||||||
|  |     public BaseResponse deleteCert(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest){ | ||||||
|  |         boolean b = userCertService.deleteById(deleteCompanyFileRequest.getId()); | ||||||
|  |         String URL = filePath + "/register/file/image2/" + deleteCompanyFileRequest.getFilePath(); | ||||||
|  |         File file = new File(URL); | ||||||
|  |         if (file.exists() && file.isFile()) { | ||||||
|  |             file.delete(); | ||||||
|  |         } | ||||||
|  |         return ResultVOUtils.success("成功"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     //修改
 | ||||||
|  |     @PostMapping("/sup/info/updateCert") | ||||||
|  |     public BaseResponse updateCert(@RequestBody UserCertEntity userCert){ | ||||||
|  | 
 | ||||||
|  |         if (userCert.getValidDate() != null && userCert.getExpireDate() != null) { | ||||||
|  |             if (userCert.getValidDate().getTime() > userCert.getExpireDate().getTime()) { | ||||||
|  |                 return ResultVOUtils.error(999, "生效期不能小于失效期!"); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         userCertService.updateCert(userCert); | ||||||
|  | 
 | ||||||
|  |         return ResultVOUtils.success("修改成功"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/image/register/file") | ||||||
|  |     public BaseResponse uploadRegisterFile(@RequestBody FilterImageRequest filterImageRequest) { | ||||||
|  |         List<String> urlList = Arrays.asList(filterImageRequest.getImageUrl().split(",")); | ||||||
|  |         List<String> list = new ArrayList<>(); | ||||||
|  |         for (String obj : urlList) { | ||||||
|  |             String url = filterImageRequest.getCertFileUrl() + obj; | ||||||
|  |             list.add(url); | ||||||
|  |         } | ||||||
|  |         return ResultVOUtils.success(list); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,14 @@ | |||||||
|  | package com.glxp.api.req.auth; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class loginmobileRequest extends ListPageRequest { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private String mobile; | ||||||
|  | 
 | ||||||
|  |     private String checkCode; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,59 @@ | |||||||
|  | package com.glxp.api.res.auth; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.entity.sup.UserCertEntity; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author : zhangsan | ||||||
|  |  * @date : 2023/5/17 17:51 | ||||||
|  |  * @modyified By : | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class registComPerResponse { | ||||||
|  | 
 | ||||||
|  |     private String id; | ||||||
|  |     private String name; | ||||||
|  |     private String tel; | ||||||
|  |     private String realName; | ||||||
|  |     private String qq; | ||||||
|  |     private String weChat; | ||||||
|  |     private String companyName; | ||||||
|  | 
 | ||||||
|  |     //企业类型
 | ||||||
|  |     private String bussinessStatus; | ||||||
|  |     private String creditNum; | ||||||
|  |     private String legalPerson; | ||||||
|  |     private String legalIdCard; | ||||||
|  |     private String registerAddress; | ||||||
|  |     private String contactWay; | ||||||
|  |     private String email; | ||||||
|  |     private String mobile; | ||||||
|  |     private String remark; | ||||||
|  |     private String upId; | ||||||
|  |     private String urId; | ||||||
|  |     private String ucId; | ||||||
|  |     private List<UserCertEntity> list; | ||||||
|  |     private String key; | ||||||
|  |     private String checkStatus; | ||||||
|  |     private String ucstatus; | ||||||
|  |     private String xemail; | ||||||
|  |     private String reason; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -1,8 +1,11 @@ | |||||||
| package com.glxp.api.service.sup; | package com.glxp.api.service.sup; | ||||||
| 
 | 
 | ||||||
|  | import com.glxp.api.entity.sup.UserCompanyEntity; | ||||||
| import com.glxp.api.entity.sup.UserPersonEntity; | import com.glxp.api.entity.sup.UserPersonEntity; | ||||||
| import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||||
| public interface UserPersonService extends IService<UserPersonEntity>{ | public interface UserPersonService extends IService<UserPersonEntity>{ | ||||||
|  |     int insert(UserPersonEntity userPerson); | ||||||
| 
 | 
 | ||||||
|  |     boolean update(UserPersonEntity userPerson); | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,12 +1,33 @@ | |||||||
| package com.glxp.api.service.sup.impl; | package com.glxp.api.service.sup.impl; | ||||||
| 
 | 
 | ||||||
|  | import com.glxp.api.res.auth.registComPerResponse; | ||||||
| import com.glxp.api.service.sup.UserRegisterService; | import com.glxp.api.service.sup.UserRegisterService; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
| import com.glxp.api.entity.sup.UserRegisterEntity; | import com.glxp.api.entity.sup.UserRegisterEntity; | ||||||
| import com.glxp.api.dao.sup.UserRegisterMapper; | import com.glxp.api.dao.sup.UserRegisterMapper; | ||||||
| 
 | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | 
 | ||||||
| @Service | @Service | ||||||
| public class UserRegisterServiceImpl extends ServiceImpl<UserRegisterMapper, UserRegisterEntity> implements UserRegisterService { | public class UserRegisterServiceImpl extends ServiceImpl<UserRegisterMapper, UserRegisterEntity> implements UserRegisterService { | ||||||
| 
 | 
 | ||||||
|  |     @Resource | ||||||
|  |     UserRegisterMapper userRegisterMapper; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public int insert(UserRegisterEntity userRegister) { | ||||||
|  |         return userRegisterMapper.insert(userRegister); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public registComPerResponse selectAllInfo(String companyId) { | ||||||
|  |         return userRegisterMapper.selectAllInfo(companyId); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean update(UserRegisterEntity userRegisterEntity) { | ||||||
|  |         return userRegisterMapper.updateById(userRegisterEntity)>0; | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
					Loading…
					
					
				
		Reference in New Issue