Browse Source

feat: 驿站人员增加新字段逻辑

zhangying 10 months ago
parent
commit
6f9db638a6

+ 6 - 1
src/main/java/com/hz/employmentsite/controller/baseSettings/SiteUserController.java

@@ -7,6 +7,7 @@ import com.hz.employmentsite.filter.exception.RespGenerstor;
 import com.hz.employmentsite.model.SelectProps;
 import com.hz.employmentsite.services.service.AccountService;
 import com.hz.employmentsite.services.service.baseSettings.SiteUserService;
+import com.hz.employmentsite.util.DateUtils;
 import com.hz.employmentsite.util.ExcelHelper;
 import com.hz.employmentsite.vo.baseSettings.SiteUserVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +32,9 @@ public class SiteUserController {
     @Autowired
     private ExcelHelper excelHelper;
 
+    @Autowired
+    private DateUtils dateUtils;
+
     @ResponseBody
     @GetMapping("/getList")
     public BaseResponse<PageInfo<SiteUserVo>> getList(@RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,
@@ -80,7 +84,7 @@ public class SiteUserController {
                                @RequestParam(required = false) String siteID) throws Exception{
         PageInfo<SiteUserVo> result = userInfoService.getList(pageIndex, pageSize, siteUserIDList, siteUserName, siteID, null, null, null);
         ExcelHelper.ExcelData data = excelHelper.new ExcelData();
-        data.setTitles(Arrays.asList(new String[]{"序号", "工号", "人员名称", "角色", "性别", "联系电话", "身份证号", "所属驿站"}));
+        data.setTitles(Arrays.asList(new String[]{"序号", "工号", "人员名称", "角色", "性别", "联系电话", "年龄", "身份证号", "所属驿站"}));
         int i = 0;
         List<List<Object>> rowsData= new ArrayList();
         for (SiteUserVo item : result.getList()) {
@@ -92,6 +96,7 @@ public class SiteUserController {
             row.add(item.roleName);
             row.add(item.genderName);
             row.add(item.mobile);
+            row.add(dateUtils.getAgeForIdCard(item.getIdCard()));
             row.add(item.idCard);
             row.add(item.siteName);
             rowsData.add(row);

+ 1 - 0
src/main/java/com/hz/employmentsite/mapper/PcSiteUserMapper.java

@@ -27,6 +27,7 @@ public interface PcSiteUserMapper {
 
     List<String> selectByIdCard(@Param("idCard") String idCard);
 
+    List<String> selectBySocialSecurityCard(@Param("socialSecurityCard") String socialSecurityCard);
 
     int updateByExampleSelective(@Param("row") PcSiteUser row, @Param("example") PcSiteUserExample example);
 

+ 130 - 0
src/main/java/com/hz/employmentsite/model/PcSiteUser.java

@@ -29,6 +29,32 @@ public class PcSiteUser {
 
     private String IDCard;
 
+    private String SocialSecurityCard;
+
+    private Integer Age;
+
+    private String FinishSchool;
+
+    private String Profession;
+
+    private String NativePlace;
+
+    private String Email;
+
+    private String Address;
+
+    private Integer Nation;
+
+    private Integer PoliticsStatusID;
+
+    private Integer CultureRank;
+
+    private Integer IsFullTime;
+
+    private Integer OccupationalCategory;
+
+    private Integer OccupationalLevel;
+
     public String getSiteUserID() {
         return siteUserID;
     }
@@ -132,4 +158,108 @@ public class PcSiteUser {
     public void setIDCard(String IDCard) {
         this.IDCard = IDCard == null ? null : IDCard.trim();
     }
+
+    public String getSocialSecurityCard() {
+        return SocialSecurityCard;
+    }
+
+    public void setSocialSecurityCard(String socialSecurityCard) {
+        SocialSecurityCard = socialSecurityCard;
+    }
+
+    public Integer getAge() {
+        return Age;
+    }
+
+    public void setAge(Integer age) {
+        Age = age;
+    }
+
+    public Integer getNation() {
+        return Nation;
+    }
+
+    public void setNation(Integer nation) {
+        Nation = nation;
+    }
+
+    public Integer getPoliticsStatusID() {
+        return PoliticsStatusID;
+    }
+
+    public void setPoliticsStatusID(Integer politicsStatusID) {
+        PoliticsStatusID = politicsStatusID;
+    }
+
+    public Integer getCultureRank() {
+        return CultureRank;
+    }
+
+    public void setCultureRank(Integer cultureRank) {
+        CultureRank = cultureRank;
+    }
+
+    public String getFinishSchool() {
+        return FinishSchool;
+    }
+
+    public void setFinishSchool(String finishSchool) {
+        FinishSchool = finishSchool;
+    }
+
+    public String getProfession() {
+        return Profession;
+    }
+
+    public void setProfession(String profession) {
+        Profession = profession;
+    }
+
+    public Integer getIsFullTime() {
+        return IsFullTime;
+    }
+
+    public void setIsFullTime(Integer isFullTime) {
+        IsFullTime = isFullTime;
+    }
+
+    public Integer getOccupationalCategory() {
+        return OccupationalCategory;
+    }
+
+    public void setOccupationalCategory(Integer occupationalCategory) {
+        OccupationalCategory = occupationalCategory;
+    }
+
+    public Integer getOccupationalLevel() {
+        return OccupationalLevel;
+    }
+
+    public void setOccupationalLevel(Integer occupationalLevel) {
+        OccupationalLevel = occupationalLevel;
+    }
+
+    public String getNativePlace() {
+        return NativePlace;
+    }
+
+    public void setNativePlace(String nativePlace) {
+        NativePlace = nativePlace;
+    }
+
+    public String getEmail() {
+        return Email;
+    }
+
+    public void setEmail(String email) {
+        Email = email;
+    }
+
+    public String getAddress() {
+        return Address;
+    }
+
+    public void setAddress(String address) {
+        Address = address;
+    }
 }

+ 42 - 1
src/main/java/com/hz/employmentsite/services/impl/baseSettings/SiteUserImpl.java

@@ -103,10 +103,14 @@ public class SiteUserImpl implements SiteUserService {
     public Integer save(SiteUserVo data, String userId) {
         int result = 0;
 
-        // 手机号查重
+        // 重要信息查重
         List<String> byMobileSiteId = pcSiteUserMapper.selectByMobile(data.mobile);
         List<String> byUserNoSiteId = pcSiteUserMapper.selectByUserNo(data.userNo);
         List<String> byIdCardSiteId = pcSiteUserMapper.selectByIdCard(data.idCard);
+        List<String> bySocialSecurityCard = new ArrayList<>();
+        if (!data.getSocialSecurityCard().isEmpty() && !data.getSocialSecurityCard().isBlank()) {
+            bySocialSecurityCard = pcSiteUserMapper.selectBySocialSecurityCard(data.socialSecurityCard);
+        }
 
         SiteUserVo record = get(data.siteUserID);
         PcSiteUser dbData = record == null ? null : pcSiteUserMapper.selectByPrimaryKey(record.siteUserID);
@@ -126,6 +130,12 @@ public class SiteUserImpl implements SiteUserService {
             if (!byIdCardSiteId.isEmpty()) {
                 throw new BaseException("500", "该身份证已绑定其他驿站人员");
             }
+            // 社保卡非必填
+            if (!data.getSocialSecurityCard().isEmpty() && !data.getSocialSecurityCard().isBlank()) {
+                if (!bySocialSecurityCard.isEmpty()) {
+                    throw new BaseException("500", "该社保卡已绑定其他驿站人员");
+                }
+            }
 
             //添加
             //处理用户表
@@ -152,6 +162,19 @@ public class SiteUserImpl implements SiteUserService {
             dbData.setMobile(data.getMobile());
             dbData.setUserNo(data.getUserNo());
             dbData.setIDCard(data.getIdCard());
+            dbData.setSocialSecurityCard(data.getSocialSecurityCard());
+            dbData.setFinishSchool(data.getFinishSchool());
+            dbData.setProfession(data.getProfession());
+            dbData.setNativePlace(data.getNativePlace());
+            dbData.setEmail(data.getEmail());
+            dbData.setAddress(data.getAddress());
+            dbData.setNation(data.getNation());
+            dbData.setPoliticsStatusID(data.getPoliticsStatusID());
+            dbData.setCultureRank(data.getCultureRank());
+            dbData.setIsFullTime(data.getIsFullTime());
+            dbData.setOccupationalCategory(data.getOccupationalCategory());
+            dbData.setOccupationalLevel(data.getOccupationalLevel());
+
             dbData.setCreateUserID(userId);
             dbData.setCreateTime(new Date());
             result += pcSiteUserMapper.insert(dbData);
@@ -166,6 +189,12 @@ public class SiteUserImpl implements SiteUserService {
             if (!byIdCardSiteId.isEmpty() && !byIdCardSiteId.contains(data.siteUserID)) {
                 throw new BaseException("500", "该身份证已绑定其他驿站人员");
             }
+            // 社保卡非必填
+            if (!data.getSocialSecurityCard().isEmpty() && !data.getSocialSecurityCard().isBlank()) {
+                if (!bySocialSecurityCard.isEmpty() && !bySocialSecurityCard.contains(data.siteUserID)) {
+                    throw new BaseException("500", "该社保卡已绑定其他驿站人员");
+                }
+            }
 
             //修改
             //处理用户表
@@ -189,6 +218,18 @@ public class SiteUserImpl implements SiteUserService {
             dbData.setMobile(data.mobile);
             dbData.setUserNo(data.userNo);
             dbData.setIDCard(data.idCard);
+            dbData.setSocialSecurityCard(data.socialSecurityCard);
+            dbData.setFinishSchool(data.finishSchool);
+            dbData.setProfession(data.profession);
+            dbData.setNativePlace(data.nativePlace);
+            dbData.setEmail(data.email);
+            dbData.setAddress(data.address);
+            dbData.setNation(data.nation);
+            dbData.setPoliticsStatusID(data.politicsStatusID);
+            dbData.setCultureRank(data.cultureRank);
+            dbData.setIsFullTime(data.isFullTime);
+            dbData.setOccupationalCategory(data.occupationalCategory);
+            dbData.setOccupationalLevel(data.occupationalLevel);
             dbData.setUpdateBy(userId);
             dbData.setUpdateTime(new Date());
             result += pcSiteUserMapper.updateByPrimaryKey(dbData);

+ 21 - 0
src/main/java/com/hz/employmentsite/vo/baseSettings/SiteUserVo.java

@@ -25,6 +25,27 @@ public class SiteUserVo {
     public String userNo;
     public String idCard;
 
+    public String socialSecurityCard;
+    public Integer age;
+    public String finishSchool;
+    public String profession;
+    public String nativePlace;
+    public String email;
+    public String address;
+
+    public Integer nation;
+    public String nationName;
+    public Integer politicsStatusID;
+    public String politicsStatusName;
+    public Integer cultureRank;
+    public String cultureRankName;
+    public Integer isFullTime;
+    public String isFullTimeName;
+    public Integer occupationalCategory;
+    public String occupationalCategoryName;
+    public Integer occupationalLevel;
+    public String occupationalLevelName;
+
     public String userID;
     //注意:roleID已用于绑定用户表sys_user中用户类型字典,非角色类型数据
     public Integer roleID;

+ 230 - 34
src/main/resources/mapping/PcSiteUserMapper.xml

@@ -109,16 +109,24 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.hz.employmentsite.model.PcSiteUser">
-    insert into pc_site_user (SiteUserID, SiteUserName, UserID, 
-      SiteID, Gender, Mobile, 
-      RoleID, CreateUserID, CreateTime, 
-      UpdateBy, UpdateTime, UserNo, 
-      IDCard)
-    values (#{siteUserID,jdbcType=VARCHAR}, #{siteUserName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, 
-      #{siteID,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, #{mobile,jdbcType=VARCHAR}, 
-      #{roleID,jdbcType=INTEGER}, #{createUserID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{userNo,jdbcType=VARCHAR}, 
-      #{IDCard,jdbcType=VARCHAR})
+    insert into pc_site_user (SiteUserID, SiteUserName, UserID,
+                              SiteID, Gender, Mobile,
+                              RoleID, CreateUserID, CreateTime,
+                              UpdateBy, UpdateTime, UserNo,
+                              IDCard, SocialSecurityCard, Age,
+                              Nation, PoliticsStatusID, CultureRank,
+                              FinishSchool, Profession, IsFullTime,
+                              OccupationalCategory, OccupationalLevel, NativePlace,
+                              Email, Address)
+    values (#{siteUserID,jdbcType=VARCHAR}, #{siteUserName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR},
+            #{siteID,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, #{mobile,jdbcType=VARCHAR},
+            #{roleID,jdbcType=INTEGER}, #{createUserID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+            #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{userNo,jdbcType=VARCHAR},
+            #{IDCard,jdbcType=VARCHAR}, #{SocialSecurityCard,jdbcType=VARCHAR}, #{Age,jdbcType=INTEGER},
+            #{Nation,jdbcType=INTEGER}, #{PoliticsStatusID,jdbcType=INTEGER}, #{CultureRank,jdbcType=INTEGER},
+            #{FinishSchool,jdbcType=VARCHAR}, #{Profession,jdbcType=VARCHAR}, #{IsFullTime,jdbcType=INTEGER},
+            #{OccupationalCategory,jdbcType=INTEGER}, #{OccupationalLevel,jdbcType=INTEGER},
+            #{NativePlace,jdbcType=VARCHAR}, #{Email,jdbcType=VARCHAR}, #{Address,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.hz.employmentsite.model.PcSiteUser">
     insert into pc_site_user
@@ -162,6 +170,45 @@
       <if test="IDCard != null">
         IDCard,
       </if>
+      <if test="SocialSecurityCard != null">
+        SocialSecurityCard,
+      </if>
+      <if test="Age != null">
+        Age,
+      </if>
+      <if test="Nation != null">
+        Nation,
+      </if>
+      <if test="PoliticsStatusID != null">
+        PoliticsStatusID,
+      </if>
+      <if test="CultureRank != null">
+        CultureRank,
+      </if>
+      <if test="FinishSchool != null">
+        FinishSchool,
+      </if>
+      <if test="Profession != null">
+        Profession,
+      </if>
+      <if test="IsFullTime != null">
+        IsFullTime,
+      </if>
+      <if test="OccupationalCategory != null">
+        OccupationalCategory,
+      </if>
+      <if test="OccupationalLevel != null">
+        OccupationalLevel,
+      </if>
+      <if test="NativePlace != null">
+        NativePlace,
+      </if>
+      <if test="Email != null">
+        Email,
+      </if>
+      <if test="Address != null">
+        Address,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="siteUserID != null">
@@ -203,6 +250,45 @@
       <if test="IDCard != null">
         #{IDCard,jdbcType=VARCHAR},
       </if>
+      <if test="SocialSecurityCard != null">
+        #{SocialSecurityCard,jdbcType=VARCHAR},
+      </if>
+      <if test="Age != null">
+        #{Age,jdbcType=INTEGER},
+      </if>
+      <if test="Nation != null">
+        #{Nation,jdbcType=INTEGER},
+      </if>
+      <if test="PoliticsStatusID != null">
+        #{PoliticsStatusID,jdbcType=INTEGER},
+      </if>
+      <if test="CultureRank != null">
+        #{CultureRank,jdbcType=INTEGER},
+      </if>
+      <if test="FinishSchool != null">
+        #{FinishSchool,jdbcType=VARCHAR},
+      </if>
+      <if test="Profession != null">
+        #{Profession,jdbcType=VARCHAR},
+      </if>
+      <if test="IsFullTime != null">
+        #{IsFullTime,jdbcType=INTEGER},
+      </if>
+      <if test="OccupationalCategory != null">
+        #{OccupationalCategory,jdbcType=INTEGER},
+      </if>
+      <if test="OccupationalLevel != null">
+        #{OccupationalLevel,jdbcType=INTEGER},
+      </if>
+      <if test="NativePlace != null">
+        #{NativePlace,jdbcType=VARCHAR},
+      </if>
+      <if test="Email != null">
+        #{Email,jdbcType=VARCHAR},
+      </if>
+      <if test="Address != null">
+        #{Address,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.hz.employmentsite.model.PcSiteUserExample" resultType="java.lang.Long">
@@ -253,6 +339,45 @@
       <if test="row.IDCard != null">
         IDCard = #{row.IDCard,jdbcType=VARCHAR},
       </if>
+      <if test="row.SocialSecurityCard != null">
+        SocialSecurityCard = #{row.SocialSecurityCard,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Age != null">
+        Age = #{row.Age,jdbcType=INTEGER},
+      </if>
+      <if test="row.Nation != null">
+        Nation = #{row.Nation,jdbcType=INTEGER},
+      </if>
+      <if test="row.PoliticsStatusID != null">
+        PoliticsStatusID = #{row.PoliticsStatusID,jdbcType=INTEGER},
+      </if>
+      <if test="row.CultureRank != null">
+        CultureRank = #{row.CultureRank,jdbcType=INTEGER},
+      </if>
+      <if test="row.FinishSchool != null">
+        FinishSchool = #{row.FinishSchool,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Profession != null">
+        Profession = #{row.Profession,jdbcType=VARCHAR},
+      </if>
+      <if test="row.IsFullTime != null">
+        IsFullTime = #{row.IsFullTime,jdbcType=INTEGER},
+      </if>
+      <if test="row.OccupationalCategory != null">
+        OccupationalCategory = #{row.OccupationalCategory,jdbcType=INTEGER},
+      </if>
+      <if test="row.OccupationalLevel != null">
+        OccupationalLevel = #{row.OccupationalLevel,jdbcType=INTEGER},
+      </if>
+      <if test="row.NativePlace != null">
+        NativePlace = #{row.NativePlace,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Email != null">
+        Email = #{row.Email,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Address != null">
+        Address = #{row.Address,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -261,18 +386,31 @@
   <update id="updateByExample" parameterType="map">
     update pc_site_user
     set SiteUserID = #{row.siteUserID,jdbcType=VARCHAR},
-      SiteUserName = #{row.siteUserName,jdbcType=VARCHAR},
-      UserID = #{row.userID,jdbcType=VARCHAR},
-      SiteID = #{row.siteID,jdbcType=VARCHAR},
-      Gender = #{row.gender,jdbcType=INTEGER},
-      Mobile = #{row.mobile,jdbcType=VARCHAR},
-      RoleID = #{row.roleID,jdbcType=INTEGER},
-      CreateUserID = #{row.createUserID,jdbcType=VARCHAR},
-      CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
-      UpdateBy = #{row.updateBy,jdbcType=VARCHAR},
-      UpdateTime = #{row.updateTime,jdbcType=TIMESTAMP},
-      UserNo = #{row.userNo,jdbcType=VARCHAR},
-      IDCard = #{row.IDCard,jdbcType=VARCHAR}
+    SiteUserName = #{row.siteUserName,jdbcType=VARCHAR},
+    UserID = #{row.userID,jdbcType=VARCHAR},
+    SiteID = #{row.siteID,jdbcType=VARCHAR},
+    Gender = #{row.gender,jdbcType=INTEGER},
+    Mobile = #{row.mobile,jdbcType=VARCHAR},
+    RoleID = #{row.roleID,jdbcType=INTEGER},
+    CreateUserID = #{row.createUserID,jdbcType=VARCHAR},
+    CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
+    UpdateBy = #{row.updateBy,jdbcType=VARCHAR},
+    UpdateTime = #{row.updateTime,jdbcType=TIMESTAMP},
+    UserNo = #{row.userNo,jdbcType=VARCHAR},
+    IDCard = #{row.IDCard,jdbcType=VARCHAR},
+    SocialSecurityCard = #{row.SocialSecurityCard,jdbcType=VARCHAR},
+    Age = #{row.Age,jdbcType=INTEGER},
+    Nation = #{row.Nation,jdbcType=INTEGER},
+    PoliticsStatusID = #{row.PoliticsStatusID,jdbcType=INTEGER},
+    CultureRank = #{row.CultureRank,jdbcType=INTEGER},
+    FinishSchool = #{row.FinishSchool,jdbcType=VARCHAR},
+    Profession = #{row.Profession,jdbcType=VARCHAR},
+    IsFullTime = #{row.IsFullTime,jdbcType=VARCHAR},
+    OccupationalCategory = #{row.OccupationalCategory,jdbcType=INTEGER},
+    OccupationalLevel = #{row.OccupationalLevel,jdbcType=INTEGER},
+    NativePlace = #{row.NativePlace,jdbcType=VARCHAR},
+    Email = #{row.Email,jdbcType=VARCHAR},
+    Address = #{row.Address,jdbcType=VARCHAR}
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -316,23 +454,75 @@
       <if test="IDCard != null">
         IDCard = #{IDCard,jdbcType=VARCHAR},
       </if>
+      <if test="row.SocialSecurityCard != null">
+        SocialSecurityCard = #{row.SocialSecurityCard,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Age != null">
+        Age = #{row.Age,jdbcType=INTEGER},
+      </if>
+      <if test="row.Nation != null">
+        Nation = #{row.Nation,jdbcType=INTEGER},
+      </if>
+      <if test="row.PoliticsStatusID != null">
+        PoliticsStatusID = #{row.PoliticsStatusID,jdbcType=INTEGER},
+      </if>
+      <if test="row.CultureRank != null">
+        CultureRank = #{row.CultureRank,jdbcType=INTEGER},
+      </if>
+      <if test="row.FinishSchool != null">
+        FinishSchool = #{row.FinishSchool,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Profession != null">
+        Profession = #{row.Profession,jdbcType=VARCHAR},
+      </if>
+      <if test="row.IsFullTime != null">
+        IsFullTime = #{row.IsFullTime,jdbcType=INTEGER},
+      </if>
+      <if test="row.OccupationalCategory != null">
+        OccupationalCategory = #{row.OccupationalCategory,jdbcType=INTEGER},
+      </if>
+      <if test="row.OccupationalLevel != null">
+        OccupationalLevel = #{row.OccupationalLevel,jdbcType=INTEGER},
+      </if>
+      <if test="row.NativePlace != null">
+        NativePlace = #{row.NativePlace,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Email != null">
+        Email = #{row.Email,jdbcType=VARCHAR},
+      </if>
+      <if test="row.Address != null">
+        Address = #{row.Address,jdbcType=VARCHAR},
+      </if>
     </set>
     where SiteUserID = #{siteUserID,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.hz.employmentsite.model.PcSiteUser">
     update pc_site_user
-    set SiteUserName = #{siteUserName,jdbcType=VARCHAR},
-        UserID       = #{userID,jdbcType=VARCHAR},
-        SiteID       = #{siteID,jdbcType=VARCHAR},
-        Gender       = #{gender,jdbcType=INTEGER},
-        Mobile       = #{mobile,jdbcType=VARCHAR},
-        RoleID       = #{roleID,jdbcType=INTEGER},
-        CreateUserID = #{createUserID,jdbcType=VARCHAR},
-        CreateTime   = #{createTime,jdbcType=TIMESTAMP},
-        UpdateBy     = #{updateBy,jdbcType=VARCHAR},
-        UpdateTime   = #{updateTime,jdbcType=TIMESTAMP},
-        UserNo       = #{userNo,jdbcType=VARCHAR},
-        IDCard       = #{IDCard,jdbcType=VARCHAR}
+    set SiteUserName         = #{siteUserName,jdbcType=VARCHAR},
+        UserID               = #{userID,jdbcType=VARCHAR},
+        SiteID               = #{siteID,jdbcType=VARCHAR},
+        Gender               = #{gender,jdbcType=INTEGER},
+        Mobile               = #{mobile,jdbcType=VARCHAR},
+        RoleID               = #{roleID,jdbcType=INTEGER},
+        CreateUserID         = #{createUserID,jdbcType=VARCHAR},
+        CreateTime           = #{createTime,jdbcType=TIMESTAMP},
+        UpdateBy             = #{updateBy,jdbcType=VARCHAR},
+        UpdateTime           = #{updateTime,jdbcType=TIMESTAMP},
+        UserNo               = #{userNo,jdbcType=VARCHAR},
+        IDCard               = #{IDCard,jdbcType=VARCHAR},
+        SocialSecurityCard   = #{SocialSecurityCard,jdbcType=VARCHAR},
+        Age                  = #{Age,jdbcType=INTEGER},
+        Nation               = #{Nation,jdbcType=INTEGER},
+        PoliticsStatusID     = #{PoliticsStatusID,jdbcType=INTEGER},
+        CultureRank          = #{CultureRank,jdbcType=INTEGER},
+        FinishSchool         = #{FinishSchool,jdbcType=VARCHAR},
+        Profession           = #{Profession,jdbcType=VARCHAR},
+        IsFullTime           = #{IsFullTime,jdbcType=VARCHAR},
+        OccupationalCategory = #{OccupationalCategory,jdbcType=INTEGER},
+        OccupationalLevel    = #{OccupationalLevel,jdbcType=INTEGER},
+        NativePlace          = #{NativePlace,jdbcType=VARCHAR},
+        Email                = #{Email,jdbcType=VARCHAR},
+        Address              = #{Address,jdbcType=VARCHAR}
     where SiteUserID = #{siteUserID,jdbcType=VARCHAR}
   </update>
 
@@ -353,4 +543,10 @@
     from pc_site_user
     where idCard = #{idCard,jdbcType=VARCHAR}
   </select>
+
+  <select id="selectBySocialSecurityCard" resultType="String">
+    select SiteUserID
+    from pc_site_user
+    where SocialSecurityCard = #{socialSecurityCard,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 27 - 3
src/main/resources/mapping/cquery/SiteUserCQuery.xml

@@ -3,11 +3,35 @@
 <mapper namespace="com.hz.employmentsite.mapper.cquery.UserInfoCQuery">
     <select id="getList" resultType="com.hz.employmentsite.vo.baseSettings.SiteUserVo">
         select siteUser.*,dic_userRole.Name as RoleName,dic_gender.Name as GenderName,site.SiteName
-        ,inSites.InstitutionID as institutionID,site.regionCode
+        ,inSites.InstitutionID as institutionID,site.regionCode, dic_fullTime.Name as isFullTimeName
+        ,dic_occ_cat.Name as occupationalCategoryName, dic_occ_level.Name as occupationalLevelName
+        ,dic_nation.Name as nationName, dic_politicsStatus.Name as politicsStatusName
+        ,dic_culture.Name as cultureRankName
         from pc_site_user siteUser
         left join pc_site site on siteUser.siteID = site.siteID
-        left join (select * from sys_dictionary_item where DictionaryCode ='UserType' ) dic_userRole  on siteUser.RoleID = dic_userRole.Value
-        left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender  on siteUser.Gender = dic_gender.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='UserType' ) dic_userRole on siteUser.RoleID
+        = dic_userRole.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender on siteUser.Gender =
+        dic_gender.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='IsFullTime' ) dic_fullTime on
+        siteUser.IsFullTime
+        =
+        dic_fullTime.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='OccupationalCategory' ) dic_occ_cat on
+        siteUser.OccupationalCategory =
+        dic_occ_cat.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='OccupationalLevel' ) dic_occ_level on
+        siteUser.OccupationalLevel =
+        dic_occ_level.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='NationType' ) dic_nation on
+        siteUser.Nation =
+        dic_nation.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='PoliticsStatus' ) dic_politicsStatus on
+        siteUser.PoliticsStatusID =
+        dic_politicsStatus.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='CultureLevel' ) dic_culture on
+        siteUser.CultureRank =
+        dic_culture.Value
         left join pc_site_institution inSites on site.SiteID = inSites.SiteID
         left join pc_institution institution on inSites.institutionID = institution.InstitutionID
         where 1=1

+ 38 - 1
vue/src/views/baseSettings/siteUser/detail.vue

@@ -10,15 +10,34 @@
       <a-descriptions-item label="用户类型">{{ siteUserInfo.roleName }}</a-descriptions-item>
       <a-descriptions-item label="所属驿站">{{ siteUserInfo.siteName }}</a-descriptions-item>
     </a-descriptions>
+    <a-divider orientation="left">其他信息</a-divider>
+    <a-descriptions bordered>
+      <a-descriptions-item label="社保卡号">{{ siteUserInfo.socialSecurityCard }}</a-descriptions-item>
+      <a-descriptions-item label="民族">{{ siteUserInfo.nationName }}</a-descriptions-item>
+      <a-descriptions-item label="政治面貌">{{ siteUserInfo.politicsStatusName }}</a-descriptions-item>
+      <a-descriptions-item label="最高学历">{{ siteUserInfo.cultureRankName }}</a-descriptions-item>
+      <a-descriptions-item label="毕业院校">{{ siteUserInfo.finishSchool }}</a-descriptions-item>
+      <a-descriptions-item label="专业">{{ siteUserInfo.profession }}</a-descriptions-item>
+      <a-descriptions-item label="是否全日制">{{ siteUserInfo.isFullTimeName }}</a-descriptions-item>
+      <a-descriptions-item label="职业资格类别">{{ siteUserInfo.occupationalCategoryName }}</a-descriptions-item>
+      <a-descriptions-item label="职业资格等级">{{ siteUserInfo.occupationalLevelName }}</a-descriptions-item>
+      <a-descriptions-item label="籍贯">{{ siteUserInfo.nativePlace }}</a-descriptions-item>
+      <a-descriptions-item label="邮箱">{{ siteUserInfo.email }}</a-descriptions-item>
+      <a-descriptions-item label="住址">{{ siteUserInfo.address }}</a-descriptions-item>
+    </a-descriptions>
+    <a-divider orientation="left">相片</a-divider>
+    <b-upload-file :fileRefId="siteUserInfo.siteUserID" :readonly="true" :multiple="true"
+                   :setFileList="setFileList" :accept="'.pdf,.png,.jpg'"></b-upload-file>
   </div>
 </template>
 
 <script setup lang="ts">
-import {onMounted, reactive} from "vue";
+import {onMounted, reactive, ref} from "vue";
 import {getSiteUserByID} from "@/api/baseSettings/userInfo";
 
 // 站点人员信息
 const siteUserInfo = reactive({
+  siteUserID: "",
   siteUserName: "",
   genderName: "",
   mobile: "",
@@ -26,8 +45,26 @@ const siteUserInfo = reactive({
   idCard: "",
   roleName: "",
   siteName: "",
+  socialSecurityCard: "",
+  finishSchool: "",
+  profession: "",
+  nativePlace: "",
+  email: "",
+  address: "",
+  nationName: "",
+  politicsStatusName: "",
+  cultureRankName: "",
+  isFullTimeName: "",
+  occupationalCategoryName: "",
+  occupationalLevelName: "",
 })
 
+// 文件列表
+const fileList = ref();
+const setFileList = (files) => {
+  fileList.value = files;
+};
+
 // 站点人员数据加载
 function loadData(siteUserID: string) {
   getSiteUserByID(siteUserID).then((result: any) => {

+ 156 - 3
vue/src/views/baseSettings/siteUser/edit.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="card-edit">
     <a-form :model="dataModel" autocomplete="off" @finish="onFinish">
-      <a-divider orientation="left">站点人员管理</a-divider>
+      <a-divider orientation="left">站点人员基本信息</a-divider>
       <a-row type="flex">
         <a-col :span="7">
           <a-form-item label="姓名" name="siteUserName" :label-col="{span:7}" :rules="[{ required: true, message: '请输入人员姓名!' }]">
@@ -32,8 +32,8 @@
           </a-form-item>
         </a-col>
         <a-col :span="8">
-          <a-form-item label="身份证" name="idCard" :label-col="{span:7}"
-                       :rules="[{ required: true, message: '请输入身份证!' }]">
+          <a-form-item label="身份证" name="idCard" :label-col="{span:7}"
+                       :rules="[{ required: true, message: '请输入身份证!' }]">
             <label v-if="opCategory==3">{{ dataModel.idCard }}</label>
             <a-input v-model:value="dataModel.idCard" placeholder=""/>
           </a-form-item>
@@ -59,6 +59,96 @@
           </a-form-item>
         </a-col>
       </a-row>
+      <a-divider orientation="left">其他信息</a-divider>
+      <a-row type="flex">
+        <a-col :span="7">
+          <a-form-item label="社保卡号" name="socialSecurityCard" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.socialSecurityCard }}</label>
+            <a-input v-model:value="dataModel.socialSecurityCard" placeholder=""/>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="民族" name="nation" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.nation }}</label>
+            <a-select ref="select" v-model:value="dataModel.nation" :options="nationList"
+                      :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="政治面貌" name="cultureRank" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.politicsStatusID }}</label>
+            <a-select ref="select" v-model:value="dataModel.politicsStatusID" :options="politicsStatusList"
+                      :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row type="flex">
+        <a-col :span="7">
+          <a-form-item label="最高学历" name="cultureRank" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.cultureRank }}</label>
+            <a-select ref="select" v-model:value="dataModel.cultureRank" :options="cultureRankList"
+                      :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="毕业院校" name="finishSchool" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.finishSchool }}</label>
+            <a-input v-model:value="dataModel.finishSchool" placeholder=""/>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="专业" name="profession" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.profession }}</label>
+            <a-input v-model:value="dataModel.profession" placeholder=""/>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row type="flex">
+        <a-col :span="7">
+          <a-form-item label="是否全日制" name="isFullTime" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.isFullTime }}</label>
+            <a-select ref="select" v-model:value="dataModel.isFullTime" :options="isFullTimeList"
+                      :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="职业资格类别" name="occupationalCategory" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.occupationalCategory }}</label>
+            <a-select ref="select" v-model:value="dataModel.occupationalCategory" :options="occupationalCategoryList"
+                      :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="职业资格等级" name="occupationalLevel" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.occupationalLevel }}</label>
+            <a-select ref="select" v-model:value="dataModel.occupationalLevel" :options="occupationalLevelList"
+                      :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row type="flex">
+        <a-col :span="7">
+          <a-form-item label="籍贯" name="nativePlace" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.nativePlace }}</label>
+            <a-input v-model:value="dataModel.nativePlace" placeholder=""/>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="邮箱" name="email" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.email }}</label>
+            <a-input v-model:value="dataModel.email" placeholder=""/>
+          </a-form-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-item label="住址" name="address" :label-col="{span:7}">
+            <label v-if="opCategory==3">{{ dataModel.address }}</label>
+            <a-input v-model:value="dataModel.address" placeholder=""/>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-divider orientation="left">相片</a-divider>
+      <b-upload-file :fileRefId="dataModel.siteUserID" :readonly="false" :multiple="true"
+                     :setFileList="setFileList" :accept="'.pdf,.png,.jpg'" :disabled="opCategory==3"></b-upload-file>
       <a-form-item class="buttom-btns">
         <a-button @click="onClose">取消</a-button>
         <a-button type="primary" html-type="submit">提交</a-button>
@@ -102,7 +192,19 @@ export default defineComponent({
     });
     const allSites = ref<any>([]);
     const genderList = ref<SelectProps["options"]>();
+    const nationList = ref<SelectProps["options"]>();
     const roleList = ref<SelectProps["options"]>([]);
+    const politicsStatusList = ref<SelectProps["options"]>();
+    const cultureRankList = ref<SelectProps["options"]>();
+    const isFullTimeList = ref<SelectProps["options"]>();
+    const occupationalCategoryList = ref<SelectProps["options"]>();
+    const occupationalLevelList = ref<SelectProps["options"]>();
+
+
+    const fileList = ref();
+    const setFileList = (files) => {
+      fileList.value = files;
+    };
 
     const getAllSites = () => {
       getSiteList({pageIndex:1,pageSize:9999}).then((result :any) => {
@@ -118,10 +220,41 @@ export default defineComponent({
       roleList.value = operateType==1?[{name:"驿站工作者",value:3}]:roleResult;
       // console.log("roleList",roleList.value);
     }
+    const getNationList = async function () {
+      const nationResult: any = await getSysDictionaryList("NationType");
+      nationList.value = nationResult;
+    }
+    const getPoliticsStatusList = async function () {
+      const politicsStatusResult: any = await getSysDictionaryList("PoliticsStatus");
+      politicsStatusList.value = politicsStatusResult;
+    }
+    const getIsFullTimeList = async function () {
+      const result: any = await getSysDictionaryList("IsFullTime");
+      isFullTimeList.value = result;
+    }
+    const getOccupationalCategoryList = async function () {
+      const result: any = await getSysDictionaryList("OccupationalCategory");
+      occupationalCategoryList.value = result;
+    }
+    const getOccupationalLevelList = async function () {
+      const result: any = await getSysDictionaryList("OccupationalLevel");
+      occupationalLevelList.value = result;
+    }
+    const getCultureRankList = async function () {
+      const result: any = await getSysDictionaryList("CultureLevel");
+      cultureRankList.value = result;
+    }
+
 
     const loadData = (siteUserID: string,operateType:number) => {
       getAllSites();
       getGenderList();
+      getNationList()
+      getPoliticsStatusList()
+      getIsFullTimeList()
+      getOccupationalCategoryList()
+      getOccupationalLevelList()
+      getCultureRankList()
       getRoleList(operateType);
       opCategory.value = operateType;
       getSiteUserByID(siteUserID).then((result: any) => {
@@ -154,6 +287,18 @@ export default defineComponent({
       }
     }
 
+    function emailValidate() {
+      if (!formData.dataModel.email) {
+        return;
+      }
+      isAllowCommit.value = true;
+      let pattern = /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/;
+      if (!pattern.test(formData.dataModel.email)) {
+        message.error("输入的邮箱格式有误!");
+        isAllowCommit.value = false;
+      }
+    }
+
     const onClose = (reload: any) => {
       tabsViewStore.closeCurrentTabByPath('/baseSettings/user/add');
       tabsViewStore.closeCurrentTabByPath('/baseSettings/user/edit');
@@ -163,6 +308,7 @@ export default defineComponent({
     const onFinish = () => {
       mobileValidate();
       idCardValidate();
+      emailValidate();
       if(isAllowCommit.value){
         saveSiteUser(formData.dataModel).then(result => {
           if (result) {
@@ -187,6 +333,13 @@ export default defineComponent({
       genderList,
       roleList,
       onSelectChange,
+      setFileList,
+      nationList,
+      politicsStatusList,
+      cultureRankList,
+      isFullTimeList,
+      occupationalCategoryList,
+      occupationalLevelList,
     };
   },
   created() {

+ 27 - 0
vue/src/views/baseSettings/siteUser/index.vue

@@ -110,6 +110,11 @@ export default defineComponent({
       {title: '用户类型', dataIndex: 'roleName', key: 'roleName',width:120, align: "center"},
       {title: '性别', dataIndex: 'genderName', key: 'genderName', align: "center"},
       {title: '联系电话', dataIndex: 'mobile', key: 'mobile', align: "center"},
+      {
+        title: '年龄', dataIndex: 'age', key: 'age', align: "center", customRender: item => {
+          return calculateAge(item.record.idCard);
+        }
+      },
       {title: '身份证号', dataIndex: 'idCard', key: 'idCard', align: "center"},
       {title: '所属驿站', dataIndex: 'siteName', key: 'siteName', align: "center"},
       {title: '操作', key: 'operation', fixed: 'right', width: 150, align: "center"},
@@ -140,6 +145,28 @@ export default defineComponent({
       showTotal: total => getPaginationTotalTitle(total)
     }));
 
+    const calculateAge = (idCardNumber) => {
+      if (!idCardNumber) {
+        return 0;
+      }
+
+      // 假设身份证号中出生日期的格式为YYYYMMDD
+      const birthYear = parseInt(idCardNumber.substring(6, 10), 10);
+      const birthMonth = parseInt(idCardNumber.substring(10, 12), 10);
+      const birthDay = parseInt(idCardNumber.substring(12, 14), 10);
+      // 获取当前日期
+      const currentDate = new Date();
+      const currentYear = currentDate.getFullYear();
+      const currentMonth = currentDate.getMonth() + 1; // 月份从 0 开始
+      const currentDay = currentDate.getDate();
+      // 计算年龄
+      let age = currentYear - birthYear;
+      if (currentMonth < birthMonth || (currentMonth === birthMonth && currentDay < birthDay)) {
+        age--; // 生日还未过,减去一岁
+      }
+      return age;
+    }
+
     const getAllSites = () => {
       getSiteList(searchParams).then((result :any) => {
         allSites.value = result.list;