| | |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.domain.BaseOnlyvalue; |
| | | import com.ruoyi.project.domain.ServiceDonatebaseinfo; |
| | | import com.ruoyi.project.service.IBaseOnlyvalueService; |
| | | import com.ruoyi.web.controller.common.OnlyValueCommon; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceExternalperson serviceExternalperson) { |
| | | //校验人员类型、身份证 |
| | | String usertype = serviceExternalperson.getUsertype(); |
| | | |
| | | if (usertype == null || usertype.isEmpty()) |
| | | { |
| | | return AjaxResult.error("新增人员需要确定人员类型!"); |
| | | } |
| | | if (!"org".equals(usertype)){ |
| | | String idcardno = serviceExternalperson.getIdcardno(); |
| | | List<ServiceExternalperson> existpsersons = serviceExternalpersonService.getInfoByIDCardNo(idcardno); |
| | | if (existpsersons.size() > 0) { |
| | | return AjaxResult.error("新增人员身份证" + idcardno + "已存在,人员信息不能重复添加!"); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(serviceExternalperson.getUserno())) { |
| | | String zj = onlyValueCommon.addOnlyValue("zj"); |
| | | String formattedNumber = String.format("%05d", zj); |
| | |
| | | public AjaxResult getInfoByUserNo(@PathVariable("userno") String userno) { |
| | | return AjaxResult.success(serviceExternalpersonService.getInfoByUserNo(userno)); |
| | | } |
| | | |
| | | @GetMapping(value = "/getInfoByIDCardNo/{idcardno}") |
| | | public AjaxResult getInfoByIDCardNo(@PathVariable("idcardno") String idcardno) { |
| | | return AjaxResult.success(serviceExternalpersonService.getInfoByIDCardNo(idcardno)); |
| | | } |
| | | } |