java110 3 lat temu
rodzic
commit
55d21ed65e

+ 63 - 31
java110-bean/src/main/java/com/java110/dto/examineStaffValue/ExamineStaffValueDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.examineStaffValue;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,16 +16,18 @@ import java.util.Date;
 public class ExamineStaffValueDto extends PageDto implements Serializable {
 
     private String ownerName;
-private String esvId;
-private String esId;
-private String staffName;
-private String ownerId;
-private String communityId;
-private String projectId;
-private String examineValue;
-private String staffId;
-private String roomId;
-private String roomName;
+    private String esvId;
+    private String esId;
+    private String staffName;
+    private String ownerId;
+    private String communityId;
+    private String projectId;
+    private String examineValue;
+    private String staffId;
+    private String roomId;
+    private String roomName;
+
+    private int esYear;
 
 
     private Date createTime;
@@ -35,67 +38,88 @@ private String roomName;
     public String getOwnerName() {
         return ownerName;
     }
-public void setOwnerName(String ownerName) {
+
+    public void setOwnerName(String ownerName) {
         this.ownerName = ownerName;
     }
-public String getEsvId() {
+
+    public String getEsvId() {
         return esvId;
     }
-public void setEsvId(String esvId) {
+
+    public void setEsvId(String esvId) {
         this.esvId = esvId;
     }
-public String getEsId() {
+
+    public String getEsId() {
         return esId;
     }
-public void setEsId(String esId) {
+
+    public void setEsId(String esId) {
         this.esId = esId;
     }
-public String getStaffName() {
+
+    public String getStaffName() {
         return staffName;
     }
-public void setStaffName(String staffName) {
+
+    public void setStaffName(String staffName) {
         this.staffName = staffName;
     }
-public String getOwnerId() {
+
+    public String getOwnerId() {
         return ownerId;
     }
-public void setOwnerId(String ownerId) {
+
+    public void setOwnerId(String ownerId) {
         this.ownerId = ownerId;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getProjectId() {
+
+    public String getProjectId() {
         return projectId;
     }
-public void setProjectId(String projectId) {
+
+    public void setProjectId(String projectId) {
         this.projectId = projectId;
     }
-public String getExamineValue() {
+
+    public String getExamineValue() {
         return examineValue;
     }
-public void setExamineValue(String examineValue) {
+
+    public void setExamineValue(String examineValue) {
         this.examineValue = examineValue;
     }
-public String getStaffId() {
+
+    public String getStaffId() {
         return staffId;
     }
-public void setStaffId(String staffId) {
+
+    public void setStaffId(String staffId) {
         this.staffId = staffId;
     }
-public String getRoomId() {
+
+    public String getRoomId() {
         return roomId;
     }
-public void setRoomId(String roomId) {
+
+    public void setRoomId(String roomId) {
         this.roomId = roomId;
     }
-public String getRoomName() {
+
+    public String getRoomName() {
         return roomName;
     }
-public void setRoomName(String roomName) {
+
+    public void setRoomName(String roomName) {
         this.roomName = roomName;
     }
 
@@ -115,4 +139,12 @@ public void setRoomName(String roomName) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public int getEsYear() {
+        return esYear;
+    }
+
+    public void setEsYear(int esYear) {
+        this.esYear = esYear;
+    }
 }

+ 68 - 36
java110-bean/src/main/java/com/java110/po/examineStaffValue/ExamineStaffValuePo.java

@@ -17,6 +17,7 @@ package com.java110.po.examineStaffValue;
 
 import java.io.Serializable;
 import java.util.Date;
+
 /**
  * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
  * add by 吴学文 at 2023-03-07 16:34:48 mail: 928255095@qq.com
@@ -28,90 +29,121 @@ import java.util.Date;
 public class ExamineStaffValuePo implements Serializable {
 
     private String ownerName;
-private String esvId;
-private String esId;
-private String staffName;
-private String statusCd = "0";
-private String ownerId;
-private String communityId;
-private String projectId;
-private String examineValue;
-private String staffId;
-private String roomId;
-private String roomName;
-public String getOwnerName() {
+    private String esvId;
+    private String esId;
+    private String staffName;
+    private String statusCd = "0";
+    private String ownerId;
+    private String communityId;
+    private String projectId;
+    private String examineValue;
+    private String staffId;
+    private String roomId;
+    private String roomName;
+
+    private int esYear;
+
+    public String getOwnerName() {
         return ownerName;
     }
-public void setOwnerName(String ownerName) {
+
+    public void setOwnerName(String ownerName) {
         this.ownerName = ownerName;
     }
-public String getEsvId() {
+
+    public String getEsvId() {
         return esvId;
     }
-public void setEsvId(String esvId) {
+
+    public void setEsvId(String esvId) {
         this.esvId = esvId;
     }
-public String getEsId() {
+
+    public String getEsId() {
         return esId;
     }
-public void setEsId(String esId) {
+
+    public void setEsId(String esId) {
         this.esId = esId;
     }
-public String getStaffName() {
+
+    public String getStaffName() {
         return staffName;
     }
-public void setStaffName(String staffName) {
+
+    public void setStaffName(String staffName) {
         this.staffName = staffName;
     }
-public String getStatusCd() {
+
+    public String getStatusCd() {
         return statusCd;
     }
-public void setStatusCd(String statusCd) {
+
+    public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
-public String getOwnerId() {
+
+    public String getOwnerId() {
         return ownerId;
     }
-public void setOwnerId(String ownerId) {
+
+    public void setOwnerId(String ownerId) {
         this.ownerId = ownerId;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getProjectId() {
+
+    public String getProjectId() {
         return projectId;
     }
-public void setProjectId(String projectId) {
+
+    public void setProjectId(String projectId) {
         this.projectId = projectId;
     }
-public String getExamineValue() {
+
+    public String getExamineValue() {
         return examineValue;
     }
-public void setExamineValue(String examineValue) {
+
+    public void setExamineValue(String examineValue) {
         this.examineValue = examineValue;
     }
-public String getStaffId() {
+
+    public String getStaffId() {
         return staffId;
     }
-public void setStaffId(String staffId) {
+
+    public void setStaffId(String staffId) {
         this.staffId = staffId;
     }
-public String getRoomId() {
+
+    public String getRoomId() {
         return roomId;
     }
-public void setRoomId(String roomId) {
+
+    public void setRoomId(String roomId) {
         this.roomId = roomId;
     }
-public String getRoomName() {
+
+    public String getRoomName() {
         return roomName;
     }
-public void setRoomName(String roomName) {
+
+    public void setRoomName(String roomName) {
         this.roomName = roomName;
     }
 
+    public int getEsYear() {
+        return esYear;
+    }
 
-
+    public void setEsYear(int esYear) {
+        this.esYear = esYear;
+    }
 }

+ 139 - 131
java110-db/src/main/resources/mapper/user/ExamineStaffValueV1ServiceDaoImplMapper.xml

@@ -5,156 +5,164 @@
 <mapper namespace="examineStaffValueV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存考核评分信息 add by wuxw 2018-07-03 -->
     <insert id="saveExamineStaffValueInfo" parameterType="Map">
         insert into examine_staff_value(
-owner_name,esv_id,es_id,staff_name,owner_id,community_id,project_id,examine_value,staff_id,room_id,room_name
-) values (
-#{ownerName},#{esvId},#{esId},#{staffName},#{ownerId},#{communityId},#{projectId},#{examineValue},#{staffId},#{roomId},#{roomName}
-)
+        owner_name,esv_id,es_id,staff_name,owner_id,community_id,project_id,examine_value,staff_id,room_id,room_name
+        ) values (
+        #{ownerName},#{esvId},#{esId},#{staffName},#{ownerId},#{communityId},#{projectId},#{examineValue},#{staffId},#{roomId},#{roomName}
+        )
     </insert>
 
 
-
     <!-- 查询考核评分信息 add by wuxw 2018-07-03 -->
     <select id="getExamineStaffValueInfo" parameterType="Map" resultType="Map">
-        select  t.owner_name,t.owner_name ownerName,t.esv_id,t.esv_id esvId,t.es_id,t.es_id esId,t.staff_name,t.staff_name staffName,t.status_cd,t.status_cd statusCd,t.owner_id,t.owner_id ownerId,t.community_id,t.community_id communityId,t.project_id,t.project_id projectId,t.examine_value,t.examine_value examineValue,t.staff_id,t.staff_id staffId,t.room_id,t.room_id roomId,t.room_name,t.room_name roomName 
-from examine_staff_value t 
-where 1 =1 
-<if test="ownerName !=null and ownerName != ''">
-   and t.owner_name= #{ownerName}
-</if> 
-<if test="esvId !=null and esvId != ''">
-   and t.esv_id= #{esvId}
-</if> 
-<if test="esId !=null and esId != ''">
-   and t.es_id= #{esId}
-</if> 
-<if test="staffName !=null and staffName != ''">
-   and t.staff_name= #{staffName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="ownerId !=null and ownerId != ''">
-   and t.owner_id= #{ownerId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="projectId !=null and projectId != ''">
-   and t.project_id= #{projectId}
-</if> 
-<if test="examineValue !=null and examineValue != ''">
-   and t.examine_value= #{examineValue}
-</if> 
-<if test="staffId !=null and staffId != ''">
-   and t.staff_id= #{staffId}
-</if> 
-<if test="roomId !=null and roomId != ''">
-   and t.room_id= #{roomId}
-</if> 
-<if test="roomName !=null and roomName != ''">
-   and t.room_name= #{roomName}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.owner_name,t.owner_name ownerName,t.esv_id,t.esv_id esvId,t.es_id,t.es_id
+        esId,t.staff_name,t.staff_name staffName,t.status_cd,t.status_cd statusCd,t.owner_id,t.owner_id
+        ownerId,t.community_id,t.community_id communityId,t.project_id,t.project_id
+        projectId,t.examine_value,t.examine_value examineValue,t.staff_id,t.staff_id staffId,t.room_id,t.room_id
+        roomId,t.room_name,t.room_name roomName,t.es_year esYear
+        from examine_staff_value t
+        where 1 =1
+        <if test="ownerName !=null and ownerName != ''">
+            and t.owner_name= #{ownerName}
+        </if>
+        <if test="esvId !=null and esvId != ''">
+            and t.esv_id= #{esvId}
+        </if>
+        <if test="esId !=null and esId != ''">
+            and t.es_id= #{esId}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            and t.staff_name= #{staffName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="ownerId !=null and ownerId != ''">
+            and t.owner_id= #{ownerId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="projectId !=null and projectId != ''">
+            and t.project_id= #{projectId}
+        </if>
+        <if test="examineValue !=null and examineValue != ''">
+            and t.examine_value= #{examineValue}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+        <if test="roomName !=null and roomName != ''">
+            and t.room_name= #{roomName}
+        </if>
+        <if test="esYear !=null and esYear != ''">
+            and t.es_year= #{esYear}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改考核评分信息 add by wuxw 2018-07-03 -->
     <update id="updateExamineStaffValueInfo" parameterType="Map">
-        update  examine_staff_value t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="ownerName !=null and ownerName != ''">
-, t.owner_name= #{ownerName}
-</if> 
-<if test="esId !=null and esId != ''">
-, t.es_id= #{esId}
-</if> 
-<if test="staffName !=null and staffName != ''">
-, t.staff_name= #{staffName}
-</if> 
-<if test="ownerId !=null and ownerId != ''">
-, t.owner_id= #{ownerId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
-<if test="projectId !=null and projectId != ''">
-, t.project_id= #{projectId}
-</if> 
-<if test="examineValue !=null and examineValue != ''">
-, t.examine_value= #{examineValue}
-</if> 
-<if test="staffId !=null and staffId != ''">
-, t.staff_id= #{staffId}
-</if> 
-<if test="roomId !=null and roomId != ''">
-, t.room_id= #{roomId}
-</if> 
-<if test="roomName !=null and roomName != ''">
-, t.room_name= #{roomName}
-</if> 
- where 1=1 <if test="esvId !=null and esvId != ''">
-and t.esv_id= #{esvId}
-</if> 
+        update examine_staff_value t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="ownerName !=null and ownerName != ''">
+            , t.owner_name= #{ownerName}
+        </if>
+        <if test="esId !=null and esId != ''">
+            , t.es_id= #{esId}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            , t.staff_name= #{staffName}
+        </if>
+        <if test="ownerId !=null and ownerId != ''">
+            , t.owner_id= #{ownerId}
+        </if>
+        <if test="examineValue !=null and examineValue != ''">
+            , t.examine_value= #{examineValue}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            , t.room_id= #{roomId}
+        </if>
+        <if test="roomName !=null and roomName != ''">
+            , t.room_name= #{roomName}
+        </if>
+        where 1=1
+        <if test="esvId !=null and esvId != ''">
+            and t.esv_id= #{esvId}
+        </if>
+        <if test="projectId !=null and projectId != ''">
+            and t.project_id= #{projectId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="esYear !=null and esYear != ''">
+            and t.es_year= #{esYear}
+        </if>
 
     </update>
 
     <!-- 查询考核评分数量 add by wuxw 2018-07-03 -->
-     <select id="queryExamineStaffValuesCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from examine_staff_value t 
-where 1 =1 
-<if test="ownerName !=null and ownerName != ''">
-   and t.owner_name= #{ownerName}
-</if> 
-<if test="esvId !=null and esvId != ''">
-   and t.esv_id= #{esvId}
-</if> 
-<if test="esId !=null and esId != ''">
-   and t.es_id= #{esId}
-</if> 
-<if test="staffName !=null and staffName != ''">
-   and t.staff_name= #{staffName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="ownerId !=null and ownerId != ''">
-   and t.owner_id= #{ownerId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="projectId !=null and projectId != ''">
-   and t.project_id= #{projectId}
-</if> 
-<if test="examineValue !=null and examineValue != ''">
-   and t.examine_value= #{examineValue}
-</if> 
-<if test="staffId !=null and staffId != ''">
-   and t.staff_id= #{staffId}
-</if> 
-<if test="roomId !=null and roomId != ''">
-   and t.room_id= #{roomId}
-</if> 
-<if test="roomName !=null and roomName != ''">
-   and t.room_name= #{roomName}
-</if> 
+    <select id="queryExamineStaffValuesCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from examine_staff_value t
+        where 1 =1
+        <if test="ownerName !=null and ownerName != ''">
+            and t.owner_name= #{ownerName}
+        </if>
+        <if test="esvId !=null and esvId != ''">
+            and t.esv_id= #{esvId}
+        </if>
+        <if test="esId !=null and esId != ''">
+            and t.es_id= #{esId}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            and t.staff_name= #{staffName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="ownerId !=null and ownerId != ''">
+            and t.owner_id= #{ownerId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="projectId !=null and projectId != ''">
+            and t.project_id= #{projectId}
+        </if>
+        <if test="examineValue !=null and examineValue != ''">
+            and t.examine_value= #{examineValue}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+        <if test="roomName !=null and roomName != ''">
+            and t.room_name= #{roomName}
+        </if>
+        <if test="esYear !=null and esYear != ''">
+            and t.es_year= #{esYear}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 141 - 9
service-user/src/main/java/com/java110/user/cmd/examine/SaveExamineStaffValueCmd.java

@@ -15,6 +15,7 @@
  */
 package com.java110.user.cmd.examine;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.annotation.Java110Transactional;
@@ -22,16 +23,28 @@ import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.user.IExamineStaffValueV1InnerServiceSMO;
+import com.java110.dto.RoomDto;
+import com.java110.dto.examineStaff.ExamineStaffDto;
+import com.java110.dto.examineStaffValue.ExamineStaffValueDto;
+import com.java110.dto.owner.OwnerAppUserDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.dto.owner.OwnerRoomRelDto;
+import com.java110.dto.user.UserDto;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.intf.user.*;
 import com.java110.po.examineStaffValue.ExamineStaffValuePo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
+import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.List;
+
 /**
  * 类表述:保存
  * 服务编码:examineStaffValue.saveExamineStaffValue
@@ -52,25 +65,144 @@ public class SaveExamineStaffValueCmd extends Cmd {
     @Autowired
     private IExamineStaffValueV1InnerServiceSMO examineStaffValueV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IExamineStaffV1InnerServiceSMO examineStaffV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl;
+
+    @Autowired
+    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerV1InnerServiceSMO ownerV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerRoomRelV1InnerServiceSMO ownerRoomRelV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "esId", "请求报文中未包含esId");
-Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
-Assert.hasKeyAndValue(reqJson, "projectId", "请求报文中未包含projectId");
-Assert.hasKeyAndValue(reqJson, "examineValue", "请求报文中未包含examineValue");
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
+        if (!reqJson.containsKey("projects")) {
+            throw new CmdException("未包含考核项目");
+        }
+
+        JSONArray projects = reqJson.getJSONArray("projects");
+
+        if (projects == null || projects.size() < 1) {
+            throw new CmdException("未包含考核项目");
+        }
+        JSONObject param = null;
+        String value = "";
+        for (int proIndex = 0; proIndex < projects.size(); proIndex++) {
+            param = projects.getJSONObject(proIndex);
+            Assert.hasKeyAndValue(param, "value", "未包含评分");
+            value = param.getString("value");
+            if (!StringUtil.isNumber(value)) {
+                throw new CmdException("不是有效数字");
+            }
+        }
+
+        String userId = cmdDataFlowContext.getReqHeaders().get("user-id");
+
+        Assert.hasLength(userId, "用户未登陆");
 
+        OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
+        ownerAppUserDto.setUserId(userId);
+        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
+
+        if (ownerAppUserDtos == null || ownerAppUserDtos.size() < 1) {
+            throw new CmdException("未找到业主信息");
+        }
+
+        reqJson.put("ownerId", ownerAppUserDtos.get(0).getOwnerId());
     }
 
     @Override
     @Java110Transactional
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+        String userId = cmdDataFlowContext.getReqHeaders().get("user-id");
+        UserDto userDto = new UserDto();
+        userDto.setUserId(userId);
+        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
+        Assert.listOnlyOne(userDtos, "业主不存在");
+
+        ExamineStaffDto examineStaffDto = new ExamineStaffDto();
+        examineStaffDto.setEsId(reqJson.getString("esId"));
+        List<ExamineStaffDto> examineStaffDtos = examineStaffV1InnerServiceSMOImpl.queryExamineStaffs(examineStaffDto);
+        Assert.listOnlyOne(examineStaffDtos, "考核员工不存在");
+
+
+        OwnerDto ownerDto = new OwnerDto();
+        ownerDto.setMemberId(reqJson.getString("ownerId"));
+        ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER);
+        List<OwnerDto> ownerDtos = ownerV1InnerServiceSMOImpl.queryOwners(ownerDto);
+        String ownerName = "未知";
+        if (ownerDtos != null && ownerDtos.size() > 0) {
+            ownerName = ownerDtos.get(0).getName();
+        }
+
+        String roomId = "";
+        String roomName = "";
+
+        OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
+        ownerRoomRelDto.setOwnerId(reqJson.getString("ownerId"));
+        List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
+
+        if (ownerRoomRelDtos != null && ownerRoomRelDtos.size() > 0) {
+            RoomDto roomDto = new RoomDto();
+            roomDto.setRoomId(ownerRoomRelDtos.get(0).getRoomId());
+            List<RoomDto> roomDtos = roomV1InnerServiceSMOImpl.queryRooms(roomDto);
+            if (roomDtos != null && roomDtos.size() > 0) {
+                roomName = roomDtos.get(0).getFloorNum() + "-" + roomDtos.get(0).getUnitNum() + "-" + roomDtos.get(0).getRoomNum();
+            }
+        }
+
+
+        JSONArray projects = reqJson.getJSONArray("projects");
+        ExamineStaffValuePo examineStaffValuePo = null;
+        for (int proIndex = 0; proIndex < projects.size(); proIndex++) {
+
+            ExamineStaffValueDto examineStaffValueDto = new ExamineStaffValueDto();
+            examineStaffValueDto.setEsYear(DateUtil.getYear());
+            examineStaffValueDto.setOwnerId(reqJson.getString("ownerId"));
+            examineStaffValueDto.setStaffId(examineStaffDtos.get(0).getStaffId());
+            examineStaffValueDto.setProjectId(projects.getJSONObject(proIndex).getString("projectId"));
+            List<ExamineStaffValueDto> examineStaffValueDtos = examineStaffValueV1InnerServiceSMOImpl.queryExamineStaffValues(examineStaffValueDto);
+            if(examineStaffValueDtos == null || examineStaffValueDtos.size() < 1) {
+                examineStaffValuePo = new ExamineStaffValuePo();
+                examineStaffValuePo.setExamineValue(projects.getJSONObject(proIndex).getString("value"));
+                examineStaffValuePo.setStaffId(examineStaffDtos.get(0).getStaffId());
+                examineStaffValuePo.setStaffName(examineStaffDtos.get(0).getStaffName());
+                examineStaffValuePo.setEsvId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+                examineStaffValuePo.setEsId(reqJson.getString("esId"));
+                examineStaffValuePo.setCommunityId(examineStaffDtos.get(0).getCommunityId());
+                examineStaffValuePo.setOwnerId(reqJson.getString("ownerId"));
+                examineStaffValuePo.setOwnerName(ownerName);
+                examineStaffValuePo.setProjectId(projects.getJSONObject(proIndex).getString("projectId"));
+                examineStaffValuePo.setRoomId(roomId);
+                examineStaffValuePo.setRoomName(roomName);
+                examineStaffValuePo.setEsYear(DateUtil.getYear());
+                int flag = examineStaffValueV1InnerServiceSMOImpl.saveExamineStaffValue(examineStaffValuePo);
 
-       ExamineStaffValuePo examineStaffValuePo = BeanConvertUtil.covertBean(reqJson, ExamineStaffValuePo.class);
-        examineStaffValuePo.setEsvId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
-        int flag = examineStaffValueV1InnerServiceSMOImpl.saveExamineStaffValue(examineStaffValuePo);
+                if (flag < 1) {
+                    throw new CmdException("保存数据失败");
+                }
+            }else {
+                examineStaffValuePo = new ExamineStaffValuePo();
+                examineStaffValuePo.setExamineValue(projects.getJSONObject(proIndex).getString("value"));
+                examineStaffValuePo.setEsvId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+                examineStaffValuePo.setCommunityId(examineStaffDtos.get(0).getCommunityId());
+                int flag = examineStaffValueV1InnerServiceSMOImpl.updateExamineStaffValue(examineStaffValuePo);
 
-        if (flag < 1) {
-            throw new CmdException("保存数据失败");
+                if (flag < 1) {
+                    throw new CmdException("修改数据失败");
+                }
+            }
         }
 
         cmdDataFlowContext.setResponseEntity(ResultVo.success());