yxh
2026-08-12 ace3af57e7fa29e9808dedaba5b21a5c964a060c
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java
@@ -6,6 +6,7 @@
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;
@@ -50,7 +51,7 @@
    /**
     * 查询外围单位人员列表
     */
    //@PreAuthorize("@ss.hasPermi('project:externalperson:list')")
    //// @PreAuthorize("@ss.hasPermi('project:externalperson:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceExternalperson serviceExternalperson) {
        logger.info("询外围单位人员列表的入参为 :{}", serviceExternalperson);
@@ -62,7 +63,7 @@
    /**
     * 导出外围单位人员列表
     */
    //@PreAuthorize("@ss.hasPermi('project:externalperson:export')")
    //// @PreAuthorize("@ss.hasPermi('project:externalperson:export')")
    @Log(title = "外围单位人员", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceExternalperson serviceExternalperson) {
@@ -74,7 +75,7 @@
    /**
     * 获取外围单位人员详细信息
     */
    //@PreAuthorize("@ss.hasPermi('project:externalperson:query')")
    //// @PreAuthorize("@ss.hasPermi('project:externalperson:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceExternalpersonService.getById(id));
@@ -83,11 +84,26 @@
    /**
     * 新增外围单位人员
     */
    //@PreAuthorize("@ss.hasPermi('project:externalperson:add')")
    //// @PreAuthorize("@ss.hasPermi('project:externalperson:add')")
    @Log(title = "外围单位人员", businessType = BusinessType.INSERT)
    @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);
@@ -100,7 +116,7 @@
    /**
     * 修改外围单位人员
     */
    //@PreAuthorize("@ss.hasPermi('project:externalperson:edit')")
    //// @PreAuthorize("@ss.hasPermi('project:externalperson:edit')")
    @Log(title = "外围单位人员", businessType = BusinessType.UPDATE)
    @PostMapping("/editZJInfo")
    @RepeatSubmit
@@ -111,7 +127,7 @@
    /**
     * 删除外围单位人员
     */
    //@PreAuthorize("@ss.hasPermi('project:externalperson:remove')")
    //// @PreAuthorize("@ss.hasPermi('project:externalperson:remove')")
    @Log(title = "外围单位人员", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
@@ -127,4 +143,9 @@
    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));
    }
}