Просмотр исходного кода

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

Your Name лет назад: 3
Родитель
Сommit
0945b922dc

+ 93 - 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,87 +16,115 @@ 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 String projectName;
+    private String post;
+    private String weight;
+
+    private int esYear;
 
 
     private Date createTime;
 
+
+
     private String statusCd = "0";
 
 
     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 +144,37 @@ 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;
+    }
+
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getPost() {
+        return post;
+    }
+
+    public void setPost(String post) {
+        this.post = post;
+    }
+
+    public String getWeight() {
+        return weight;
+    }
+
+    public void setWeight(String weight) {
+        this.weight = weight;
+    }
 }

+ 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;
+    }
 }

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

@@ -5,156 +5,165 @@
 <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,es_year
+        ) values (
+        #{ownerName},#{esvId},#{esId},#{staffName},#{ownerId},#{communityId},#{projectId},#{examineValue},#{staffId},#{roomId},#{roomName},#{esYear}
+        )
     </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,t.create_time createTime,ep.`name` projectName,ep.post,ep.weight
+        from examine_staff_value t
+        left join examine_project ep on t.project_id = ep.project_id and ep.status_cd = '0'
+        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>

+ 2 - 2
service-common/src/main/java/com/java110/common/charge/factory/kehang/KeHangChargeMachineFactoryAdapt.java

@@ -30,7 +30,7 @@ public class KeHangChargeMachineFactoryAdapt implements IChargeFactoryAdapt {
         body.put("chargeId", orderId);
         String paramOut = null;
         try {
-            paramOut = DingdingChargeUtils.execute("net.equip.charge.slow.ru", body.toJSONString(), HttpMethod.GET);
+            paramOut = DingdingChargeUtils.execute("net.equip.charge.slow.run", body.toJSONString(), HttpMethod.GET);
         } catch (Exception e) {
             throw new IllegalArgumentException(e.getMessage());
         }
@@ -105,7 +105,7 @@ public class KeHangChargeMachineFactoryAdapt implements IChargeFactoryAdapt {
         body.put("equipCd", chargeMachineDto.getMachineCode());
         String paramOut = null;
         try {
-            paramOut = DingdingChargeUtils.execute("net.equip.online.que", body.toJSONString(), HttpMethod.GET);
+            paramOut = DingdingChargeUtils.execute("net.equip.online.query", body.toJSONString(), HttpMethod.GET);
         } catch (Exception e) {
             throw new IllegalArgumentException(e.getMessage());
         }

+ 138 - 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,141 @@ 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(examineStaffValueDtos.get(0).getEsvId());
+                examineStaffValuePo.setCommunityId(examineStaffDtos.get(0).getCommunityId());
+                examineStaffValueV1InnerServiceSMOImpl.updateExamineStaffValue(examineStaffValuePo);
 
-        if (flag < 1) {
-            throw new CmdException("保存数据失败");
+            }
         }
 
         cmdDataFlowContext.setResponseEntity(ResultVo.success());

+ 213 - 0
service-user/src/main/java/com/java110/user/cmd/owner/SyncThirdEnterpriseCmd.java

@@ -0,0 +1,213 @@
+package com.java110.user.cmd.owner;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.client.OutRestTemplate;
+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.doc.annotation.*;
+import com.java110.dto.owner.OwnerAttrDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.intf.user.IOwnerAttrInnerServiceSMO;
+import com.java110.intf.user.IOwnerV1InnerServiceSMO;
+import com.java110.po.owner.OwnerAttrPo;
+import com.java110.po.owner.OwnerPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+import java.text.ParseException;
+import java.util.List;
+
+
+@Java110CmdDoc(title = "招商平台企业信息同步",
+        description = "同步企业信息",
+        httpMethod = "post",
+        url = "http://{ip}:{port}/app/owner.syncThirdEnterprise",
+        resource = "userDoc",
+        author = "吴学文",
+        serviceCode = "owner.syncThirdEnterprise"
+)
+
+@Java110ParamsDoc(params = {
+        @Java110ParamDoc(name = "communityId", length = 30, remark = "物业系统小区ID"),
+        @Java110ParamDoc(name = "enterpriseArea", length = 64, remark = "办公面积"),
+        @Java110ParamDoc(name = "enterpriseAssets", length = 64, remark = "企业资产"),
+        @Java110ParamDoc(name = "enterpriseIncome", length = 64, remark = "企业收入"),
+        @Java110ParamDoc(name = "enterpriseMember", length = 64, remark = "办公人数"),
+        @Java110ParamDoc(name = "enterpriseOutput", length = 64, remark = "企业产值"),
+        @Java110ParamDoc(name = "enterpriseSize", length = 64, remark = "企业规模"),
+        @Java110ParamDoc(name = "enterpriseTax", length = 64, remark = "企业税收"),
+        @Java110ParamDoc(name = "enterpriseType", length = 64, remark = "企业类型(未定义,暂定1,五百强,2上市)"),
+        @Java110ParamDoc(name = "financingInfo", length = 64, remark = "融资信息"),
+        @Java110ParamDoc(name = "inTime", length = 64, remark = "入驻时间"),
+        @Java110ParamDoc(name = "industry", length = 64, remark = "所属行业"),
+        @Java110ParamDoc(name = "label", length = 64, remark = "企业标签"),
+        @Java110ParamDoc(name = "legalPerson", length = 64, remark = "法人"),
+        @Java110ParamDoc(name = "scienceEnterprise", length = 64, remark = "科技型企业:如民营科技企业"),
+        @Java110ParamDoc(name = "shopName", length = 64, remark = "店铺名称"),
+        @Java110ParamDoc(name = "superAdmin", length = 64, remark = "超级管理员号码"),
+        @Java110ParamDoc(name = "website", length = 64, remark = "官网地址"),
+        @Java110ParamDoc(name = "years", length = 64, remark = "成立年限:如1-3年"),
+        @Java110ParamDoc(name = "contactInfo", length = 64, remark = "联系方式"),
+        @Java110ParamDoc(name = "creditCode", length = 64, remark = "统一信用代码"),
+        @Java110ParamDoc(name = "enterpriseAddress", length = 64, remark = "企业地址"),
+        @Java110ParamDoc(name = "enterpriseName", length = 64, remark = "企业名称"),
+        @Java110ParamDoc(name = "introduction", length = 256, remark = "简介"),
+        @Java110ParamDoc(name = "licenseImg", length = 64, remark = "营业执照图片"),
+})
+
+@Java110ResponseDoc(
+        params = {
+                @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "返回编号,0 成功 其他失败"),
+                @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "成功", remark = "描述"),
+        }
+)
+
+@Java110ExampleDoc(
+        reqBody = "{'communityId':'123123','enterpriseArea':'11','enterpriseAssets':'11','enterpriseIncome':'11','enterpriseMember':'11','enterpriseOutput':'11','enterpriseSize':'11'," +
+                "'enterpriseTax':'11','enterpriseType':'11','financingInfo':'11','inTime':'2023-01-01','industry':'11','label':'11','label':'11'," +
+                "'legalPerson':'11','scienceEnterprise':'11','shopName':'11','superAdmin':'11','website':'11','contactInfo':'11','creditCode':'11'," +
+                "'enterpriseAddress':'11','enterpriseName':'11','introduction':'11','licenseImg':'11',}",
+        resBody = "{'code':0,'msg':'成功'}"
+)
+
+/***
+ * 提供招商平台
+ */
+@Java110Cmd(serviceCode = "owner.syncThirdEnterprise")
+public class SyncThirdEnterpriseCmd extends Cmd {
+
+    @Autowired
+    private IOwnerAttrInnerServiceSMO ownerAttrInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerV1InnerServiceSMO ownerV1InnerServiceSMOImpl;
+
+    public static final String DEFAULT_COMMUNITY_ID = "123"; //特殊化需求 这里写死
+
+    @Autowired
+    private OutRestTemplate outRestTemplate;
+
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "enterpriseArea", "未包含enterpriseArea");
+        Assert.hasKeyAndValue(reqJson, "enterpriseAssets", "未包含enterpriseAssets");
+        Assert.hasKeyAndValue(reqJson, "enterpriseIncome", "未包含enterpriseIncome");
+        Assert.hasKeyAndValue(reqJson, "enterpriseMember", "未包含enterpriseMember");
+        Assert.hasKeyAndValue(reqJson, "enterpriseOutput", "未包含enterpriseOutput");
+        Assert.hasKeyAndValue(reqJson, "enterpriseSize", "未包含enterpriseSize");
+        Assert.hasKeyAndValue(reqJson, "enterpriseTax", "未包含enterpriseTax");
+        Assert.hasKeyAndValue(reqJson, "enterpriseType", "未包含enterpriseType");
+        Assert.hasKeyAndValue(reqJson, "enterpriseOutput", "未包含enterpriseOutput");
+        Assert.hasKeyAndValue(reqJson, "financingInfo", "未包含financingInfo");
+        Assert.hasKeyAndValue(reqJson, "inTime", "未包含inTime");
+        Assert.hasKeyAndValue(reqJson, "industry", "未包含industry");
+        Assert.hasKeyAndValue(reqJson, "label", "未包含label");
+        Assert.hasKeyAndValue(reqJson, "legalPerson", "未包含legalPerson");
+        Assert.hasKeyAndValue(reqJson, "scienceEnterprise", "未包含scienceEnterprise");
+        Assert.hasKeyAndValue(reqJson, "shopName", "未包含shopName");
+        Assert.hasKeyAndValue(reqJson, "superAdmin", "未包含superAdmin");
+        Assert.hasKeyAndValue(reqJson, "website", "未包含website");
+        Assert.hasKeyAndValue(reqJson, "years", "未包含years");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+
+        OwnerAttrDto ownerAttrDto = new OwnerAttrDto();
+        ownerAttrDto.setSpecCd(OwnerAttrDto.SPEC_CD_EXT_OWNER_ID);
+        ownerAttrDto.setValue(reqJson.getString("userId"));
+        List<OwnerAttrDto> ownerAttrDtos = ownerAttrInnerServiceSMOImpl.queryOwnerAttrs(ownerAttrDto);
+
+        String ownerId = "";
+
+        if (ownerAttrDtos == null || ownerAttrDtos.size() < 1) {
+            ownerId = saveOwner(reqJson);
+        }
+
+        context.setResponseEntity(ResultVo.createResponseEntity(ownerId));
+    }
+
+    /**
+     * 添加业主
+     *
+     * @param reqJson
+     * @return
+     */
+    private String saveOwner(JSONObject reqJson) {
+
+        JSONObject data = reqJson;
+
+        OwnerPo ownerPo = new OwnerPo();
+        ownerPo.setOwnerId(GenerateCodeFactory.getGeneratorId("99"));
+        ownerPo.setMemberId(ownerPo.getOwnerId());
+        ownerPo.setAge("1");
+        ownerPo.setOwnerFlag(OwnerDto.OWNER_FLAG_TRUE);
+        ownerPo.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER);
+        ownerPo.setAddress(reqJson.getString("enterpriseAddress"));
+        ownerPo.setCommunityId(reqJson.getString("communityId"));
+        ownerPo.setIdCard(data.getString("creditCode"));
+        ownerPo.setLink(data.getString("contactInfo"));
+        ownerPo.setName(data.getString("enterpriseName"));
+        ownerPo.setRemark(data.getString("introduction"));
+        ownerPo.setSex(data.getString("sex") == null ? "1" : "0");
+        ownerPo.setState(OwnerDto.STATE_FINISH);
+        ownerPo.setUserId("-1");
+        int flag = ownerV1InnerServiceSMOImpl.saveOwner(ownerPo);
+        if (flag < 1) {
+            throw new CmdException("保存业主失败");
+        }
+
+        saveAttr(reqJson, ownerPo, OwnerAttrDto.SPEC_CD_EXT_OWNER_ID, reqJson.getString("createBy"));
+
+        saveAttr(reqJson, ownerPo, "enterpriseArea", reqJson.getString("enterpriseArea")); // 办公面积
+        saveAttr(reqJson, ownerPo, "enterpriseAssets", reqJson.getString("enterpriseAssets")); // 企业资产
+        saveAttr(reqJson, ownerPo, "enterpriseIncome", reqJson.getString("enterpriseIncome")); // 企业收入
+        saveAttr(reqJson, ownerPo, "enterpriseMember", reqJson.getString("enterpriseMember")); // 办公人数
+        saveAttr(reqJson, ownerPo, "enterpriseOutput", reqJson.getString("enterpriseOutput")); // 企业产值
+        saveAttr(reqJson, ownerPo, "enterpriseSize", reqJson.getString("enterpriseSize")); // 企业规模
+        saveAttr(reqJson, ownerPo, "enterpriseTax", reqJson.getString("enterpriseTax")); // 企业税收
+        saveAttr(reqJson, ownerPo, "enterpriseType", reqJson.getString("enterpriseType")); // 企业类型
+        saveAttr(reqJson, ownerPo, "financingInfo", reqJson.getString("financingInfo")); // 融资信息
+        saveAttr(reqJson, ownerPo, "inTime", reqJson.getString("inTime")); // 入驻时间
+        saveAttr(reqJson, ownerPo, "industry", reqJson.getString("industry")); // 所属行业
+        saveAttr(reqJson, ownerPo, "label", reqJson.getString("label")); // 企业标签
+        saveAttr(reqJson, ownerPo, "legalPerson", reqJson.getString("legalPerson")); // 法人
+        saveAttr(reqJson, ownerPo, "scienceEnterprise", reqJson.getString("scienceEnterprise")); // 科技型企业
+        saveAttr(reqJson, ownerPo, "shopName", reqJson.getString("shopName")); // 店铺名称
+        saveAttr(reqJson, ownerPo, "superAdmin", reqJson.getString("superAdmin")); // 超级管理员号码
+        saveAttr(reqJson, ownerPo, "website", reqJson.getString("website")); // 官网地址
+        saveAttr(reqJson, ownerPo, "years", reqJson.getString("years")); // 成立年限:如1-3年
+
+        return ownerPo.getOwnerId();
+    }
+
+    private void saveAttr(JSONObject reqJson, OwnerPo ownerPo, String specCd, String value) {
+
+        if (StringUtil.isEmpty(value)) {
+            return;
+        }
+        OwnerAttrPo ownerAttrPo = new OwnerAttrPo();
+        ownerAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId("11"));
+        ownerAttrPo.setCommunityId(reqJson.getString("communityId"));
+        ownerAttrPo.setValue(value);
+        ownerAttrPo.setMemberId(ownerPo.getMemberId());
+        ownerAttrPo.setSpecCd(specCd);
+        int flag = ownerAttrInnerServiceSMOImpl.saveOwnerAttr(ownerAttrPo);
+        if (flag < 1) {
+            throw new CmdException("保存业主失败");
+        }
+    }
+
+}