wuxw 2 anni fa
parent
commit
c7ec9c2822

+ 40 - 16
java110-bean/src/main/java/com/java110/dto/complaintType/ComplaintTypeDto.java

@@ -1,8 +1,11 @@
 package com.java110.dto.complaintType;
 
 import com.java110.dto.PageDto;
+import com.java110.dto.complaintTypeUser.ComplaintTypeUserDto;
+
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @ClassName FloorDto
@@ -15,11 +18,13 @@ import java.util.Date;
 public class ComplaintTypeDto extends PageDto implements Serializable {
 
     private String typeCd;
-private String typeName;
-private String notifyWay;
-private String remark;
-private String communityId;
-private String appraiseReply;
+    private String typeName;
+    private String notifyWay;
+    private String remark;
+    private String communityId;
+    private String appraiseReply;
+
+    private List<ComplaintTypeUserDto> staffs;
 
 
     private Date createTime;
@@ -30,37 +35,48 @@ private String appraiseReply;
     public String getTypeCd() {
         return typeCd;
     }
-public void setTypeCd(String typeCd) {
+
+    public void setTypeCd(String typeCd) {
         this.typeCd = typeCd;
     }
-public String getTypeName() {
+
+    public String getTypeName() {
         return typeName;
     }
-public void setTypeName(String typeName) {
+
+    public void setTypeName(String typeName) {
         this.typeName = typeName;
     }
-public String getNotifyWay() {
+
+    public String getNotifyWay() {
         return notifyWay;
     }
-public void setNotifyWay(String notifyWay) {
+
+    public void setNotifyWay(String notifyWay) {
         this.notifyWay = notifyWay;
     }
-public String getRemark() {
+
+    public String getRemark() {
         return remark;
     }
-public void setRemark(String remark) {
+
+    public void setRemark(String remark) {
         this.remark = remark;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getAppraiseReply() {
+
+    public String getAppraiseReply() {
         return appraiseReply;
     }
-public void setAppraiseReply(String appraiseReply) {
+
+    public void setAppraiseReply(String appraiseReply) {
         this.appraiseReply = appraiseReply;
     }
 
@@ -80,4 +96,12 @@ public void setAppraiseReply(String appraiseReply) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public List<ComplaintTypeUserDto> getStaffs() {
+        return staffs;
+    }
+
+    public void setStaffs(List<ComplaintTypeUserDto> staffs) {
+        this.staffs = staffs;
+    }
 }

+ 32 - 13
java110-bean/src/main/java/com/java110/dto/complaintTypeUser/ComplaintTypeUserDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.complaintTypeUser;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,10 +16,11 @@ import java.util.Date;
 public class ComplaintTypeUserDto extends PageDto implements Serializable {
 
     private String typeCd;
-private String typeUserId;
-private String staffName;
-private String communityId;
-private String staffId;
+    private String[] typeCds;
+    private String typeUserId;
+    private String staffName;
+    private String communityId;
+    private String staffId;
 
 
     private Date createTime;
@@ -29,31 +31,40 @@ private String staffId;
     public String getTypeCd() {
         return typeCd;
     }
-public void setTypeCd(String typeCd) {
+
+    public void setTypeCd(String typeCd) {
         this.typeCd = typeCd;
     }
-public String getTypeUserId() {
+
+    public String getTypeUserId() {
         return typeUserId;
     }
-public void setTypeUserId(String typeUserId) {
+
+    public void setTypeUserId(String typeUserId) {
         this.typeUserId = typeUserId;
     }
-public String getStaffName() {
+
+    public String getStaffName() {
         return staffName;
     }
-public void setStaffName(String staffName) {
+
+    public void setStaffName(String staffName) {
         this.staffName = staffName;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getStaffId() {
+
+    public String getStaffId() {
         return staffId;
     }
-public void setStaffId(String staffId) {
+
+    public void setStaffId(String staffId) {
         this.staffId = staffId;
     }
 
@@ -73,4 +84,12 @@ public void setStaffId(String staffId) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String[] getTypeCds() {
+        return typeCds;
+    }
+
+    public void setTypeCds(String[] typeCds) {
+        this.typeCds = typeCds;
+    }
 }

+ 88 - 77
java110-db/src/main/resources/mapper/store/ComplaintTypeUserV1ServiceDaoImplMapper.xml

@@ -5,102 +5,113 @@
 <mapper namespace="complaintTypeUserV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存投诉类型员工信息 add by wuxw 2018-07-03 -->
     <insert id="saveComplaintTypeUserInfo" parameterType="Map">
         insert into complaint_type_user(
-type_cd,type_user_id,staff_name,community_id,staff_id
-) values (
-#{typeCd},#{typeUserId},#{staffName},#{communityId},#{staffId}
-)
+        type_cd,type_user_id,staff_name,community_id,staff_id
+        ) values (
+        #{typeCd},#{typeUserId},#{staffName},#{communityId},#{staffId}
+        )
     </insert>
 
 
-
     <!-- 查询投诉类型员工信息 add by wuxw 2018-07-03 -->
     <select id="getComplaintTypeUserInfo" parameterType="Map" resultType="Map">
-        select  t.type_cd,t.type_cd typeCd,t.type_user_id,t.type_user_id typeUserId,t.staff_name,t.staff_name staffName,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId 
-from complaint_type_user t 
-where 1 =1 
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="typeUserId !=null and typeUserId != ''">
-   and t.type_user_id= #{typeUserId}
-</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="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="staffId !=null and staffId != ''">
-   and t.staff_id= #{staffId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.type_cd,t.type_cd typeCd,t.type_user_id,t.type_user_id typeUserId,t.staff_name,t.staff_name
+        staffName,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.staff_id,t.staff_id
+        staffId
+        from complaint_type_user t
+        where 1 =1
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="typeCds !=null ">
+            and t.type_cd in
+            <foreach collection="typeCds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="typeUserId !=null and typeUserId != ''">
+            and t.type_user_id= #{typeUserId}
+        </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="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </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="updateComplaintTypeUserInfo" parameterType="Map">
-        update  complaint_type_user t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="typeCd !=null and typeCd != ''">
-, t.type_cd= #{typeCd}
-</if> 
-<if test="staffName !=null and staffName != ''">
-, t.staff_name= #{staffName}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
-<if test="staffId !=null and staffId != ''">
-, t.staff_id= #{staffId}
-</if> 
- where 1=1 <if test="typeUserId !=null and typeUserId != ''">
-and t.type_user_id= #{typeUserId}
-</if> 
+        update complaint_type_user t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+
+        <if test="staffName !=null and staffName != ''">
+            , t.staff_name= #{staffName}
+        </if>
+
+        <if test="staffId !=null and staffId != ''">
+            , t.staff_id= #{staffId}
+        </if>
+        where 1=1
+        <if test="typeUserId !=null and typeUserId != ''">
+            and t.type_user_id= #{typeUserId}
+        </if>
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
     </update>
 
     <!-- 查询投诉类型员工数量 add by wuxw 2018-07-03 -->
-     <select id="queryComplaintTypeUsersCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from complaint_type_user t 
-where 1 =1 
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="typeUserId !=null and typeUserId != ''">
-   and t.type_user_id= #{typeUserId}
-</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="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="staffId !=null and staffId != ''">
-   and t.staff_id= #{staffId}
-</if> 
+    <select id="queryComplaintTypeUsersCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from complaint_type_user t
+        where 1 =1
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="typeCds !=null ">
+            and t.type_cd in
+            <foreach collection="typeCds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="typeUserId !=null and typeUserId != ''">
+            and t.type_user_id= #{typeUserId}
+        </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="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 5 - 4
java110-db/src/main/resources/mapper/store/ComplaintTypeV1ServiceDaoImplMapper.xml

@@ -19,7 +19,7 @@
     <select id="getComplaintTypeInfo" parameterType="Map" resultType="Map">
         select t.type_cd,t.type_cd typeCd,t.type_name,t.type_name typeName,t.notify_way,t.notify_way
         notifyWay,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id
-        communityId,t.appraise_reply,t.appraise_reply appraiseReply
+        communityId,t.appraise_reply,t.appraise_reply appraiseReply,t.create_time createTime
         from complaint_type t
         where 1 =1
         <if test="typeCd !=null and typeCd != ''">
@@ -66,9 +66,7 @@
         <if test="remark !=null and remark != ''">
             , t.remark= #{remark}
         </if>
-        <if test="communityId !=null and communityId != ''">
-            , t.community_id= #{communityId}
-        </if>
+
         <if test="appraiseReply !=null and appraiseReply != ''">
             , t.appraise_reply= #{appraiseReply}
         </if>
@@ -76,6 +74,9 @@
         <if test="typeCd !=null and typeCd != ''">
             and t.type_cd= #{typeCd}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
     </update>
 

+ 10 - 0
service-store/src/main/java/com/java110/store/cmd/complaintType/DeleteComplaintTypeCmd.java

@@ -21,8 +21,10 @@ import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.store.IComplaintTypeUserV1InnerServiceSMO;
 import com.java110.intf.store.IComplaintTypeV1InnerServiceSMO;
 import com.java110.po.complaintType.ComplaintTypePo;
+import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -48,6 +50,9 @@ public class DeleteComplaintTypeCmd extends Cmd {
     @Autowired
     private IComplaintTypeV1InnerServiceSMO complaintTypeV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "typeCd", "typeCd不能为空");
@@ -66,6 +71,11 @@ public class DeleteComplaintTypeCmd extends Cmd {
             throw new CmdException("删除数据失败");
         }
 
+        ComplaintTypeUserPo complaintTypeUserPo = new ComplaintTypeUserPo();
+        complaintTypeUserPo.setTypeCd(complaintTypePo.getTypeCd());
+        complaintTypeUserV1InnerServiceSMOImpl.deleteComplaintTypeUser(complaintTypeUserPo);
+
+
         cmdDataFlowContext.setResponseEntity(ResultVo.success());
     }
 }

+ 57 - 12
service-store/src/main/java/com/java110/store/cmd/complaintType/ListComplaintTypeCmd.java

@@ -22,16 +22,22 @@ 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.dto.complaintTypeUser.ComplaintTypeUserDto;
+import com.java110.intf.store.IComplaintTypeUserV1InnerServiceSMO;
 import com.java110.intf.store.IComplaintTypeV1InnerServiceSMO;
 import com.java110.po.complaintType.ComplaintTypePo;
+import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.ListUtil;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import com.java110.dto.complaintType.ComplaintTypeDto;
+
 import java.util.List;
 import java.util.ArrayList;
+
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.HttpStatus;
 import org.slf4j.Logger;
@@ -51,10 +57,14 @@ import org.slf4j.LoggerFactory;
 @Java110Cmd(serviceCode = "complaintType.listComplaintType")
 public class ListComplaintTypeCmd extends Cmd {
 
-  private static Logger logger = LoggerFactory.getLogger(ListComplaintTypeCmd.class);
+    private static Logger logger = LoggerFactory.getLogger(ListComplaintTypeCmd.class);
     @Autowired
     private IComplaintTypeV1InnerServiceSMO complaintTypeV1InnerServiceSMOImpl;
 
+
+    @Autowired
+    private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
@@ -65,22 +75,57 @@ public class ListComplaintTypeCmd extends Cmd {
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
 
-           ComplaintTypeDto complaintTypeDto = BeanConvertUtil.covertBean(reqJson, ComplaintTypeDto.class);
+        ComplaintTypeDto complaintTypeDto = BeanConvertUtil.covertBean(reqJson, ComplaintTypeDto.class);
+
+        int count = complaintTypeV1InnerServiceSMOImpl.queryComplaintTypesCount(complaintTypeDto);
+
+        List<ComplaintTypeDto> complaintTypeDtos = null;
+
+        if (count > 0) {
+            complaintTypeDtos = complaintTypeV1InnerServiceSMOImpl.queryComplaintTypes(complaintTypeDto);
+        } else {
+            complaintTypeDtos = new ArrayList<>();
+        }
+
+        //todo 查询类型员工
+        toQueryStaff(complaintTypeDtos);
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, complaintTypeDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+
+    private void toQueryStaff(List<ComplaintTypeDto> complaintTypeDtos) {
 
-           int count = complaintTypeV1InnerServiceSMOImpl.queryComplaintTypesCount(complaintTypeDto);
+        if (ListUtil.isNull(complaintTypeDtos)) {
+            return;
+        }
 
-           List<ComplaintTypeDto> complaintTypeDtos = null;
+        List<String> typeCds = new ArrayList<>();
+        for (ComplaintTypeDto complaintTypeDto : complaintTypeDtos) {
+            typeCds.add(complaintTypeDto.getTypeCd());
+        }
 
-           if (count > 0) {
-               complaintTypeDtos = complaintTypeV1InnerServiceSMOImpl.queryComplaintTypes(complaintTypeDto);
-           } else {
-               complaintTypeDtos = new ArrayList<>();
-           }
+        ComplaintTypeUserDto complaintTypeUserDto = new ComplaintTypeUserDto();
+        complaintTypeUserDto.setTypeCds(typeCds.toArray(new String[typeCds.size()]));
 
-           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, complaintTypeDtos);
+        List<ComplaintTypeUserDto> complaintTypeUserDtos = complaintTypeUserV1InnerServiceSMOImpl.queryComplaintTypeUsers(complaintTypeUserDto);
 
-           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+        if (ListUtil.isNull(complaintTypeUserDtos)) {
+            return;
+        }
+        List<ComplaintTypeUserDto> staffs = null;
+        for (ComplaintTypeDto complaintTypeDto : complaintTypeDtos) {
+            staffs = new ArrayList<>();
+            for(ComplaintTypeUserDto complaintTypeUserDto1 : complaintTypeUserDtos){
+                if(complaintTypeDto.getTypeCd().equals(complaintTypeUserDto1.getTypeCds())){
+                    staffs.add(complaintTypeUserDto1);
+                }
+            }
+            complaintTypeDto.setStaffs(staffs);
+        }
 
-           cmdDataFlowContext.setResponseEntity(responseEntity);
     }
 }

+ 2 - 5
service-store/src/main/java/com/java110/store/cmd/complaintTypeUser/ListComplaintTypeUserCmd.java

@@ -13,17 +13,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.java110.store.cmd.complaintTypeUser;
+package com.java110.store.cmd.complaintType;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Cmd;
-import com.java110.core.annotation.Java110Transactional;
 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.store.IComplaintTypeUserV1InnerServiceSMO;
-import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -48,7 +45,7 @@ import org.slf4j.LoggerFactory;
  * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
  * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
  */
-@Java110Cmd(serviceCode = "complaintTypeUser.listComplaintTypeUser")
+@Java110Cmd(serviceCode = "complaintType.listComplaintTypeUser")
 public class ListComplaintTypeUserCmd extends Cmd {
 
   private static Logger logger = LoggerFactory.getLogger(ListComplaintTypeUserCmd.class);

+ 46 - 0
service-store/src/main/java/com/java110/store/cmd/complaintType/SaveComplaintTypeCmd.java

@@ -15,6 +15,7 @@
  */
 package com.java110.store.cmd.complaintType;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.annotation.Java110Transactional;
@@ -22,11 +23,14 @@ 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.store.IComplaintTypeUserV1InnerServiceSMO;
 import com.java110.intf.store.IComplaintTypeV1InnerServiceSMO;
 import com.java110.po.complaintType.ComplaintTypePo;
+import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.ListUtil;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.slf4j.Logger;
@@ -52,6 +56,20 @@ public class SaveComplaintTypeCmd extends Cmd {
     @Autowired
     private IComplaintTypeV1InnerServiceSMO complaintTypeV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
+
+    /**
+     * {"typeCd":"","typeName":"123","notifyWay":"WECHAT","appraiseReply":"Y","remark":"123",
+     * "staffs":[{"address":"无","age":0,"email":"","initials":"B","levelCd":"01","name":"bbbb","orgId":"842024012258220036","orgLevel":"1",
+     * "orgName":"物联网同步物业 / 物联网同步物业","parentOrgId":"-1","parentTwoOrgId":"-1","relCd":"1000","relCdName":"普通员工",
+     * "relId":"842024020671010069","sex":"0","storeId":"102024012228150026","tel":"14545456666","userId":"302024020663670065","userName":"bbbb"}],
+     * "communityId":"2024012252790005"}
+     *
+     * @param event              事件对象
+     * @param cmdDataFlowContext 请求报文数据
+     * @param reqJson
+     */
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "typeName", "请求报文中未包含typeName");
@@ -59,6 +77,20 @@ public class SaveComplaintTypeCmd extends Cmd {
         Assert.hasKeyAndValue(reqJson, "notifyWay", "请求报文中未包含notifyWay");
         Assert.hasKeyAndValue(reqJson, "appraiseReply", "请求报文中未包含appraiseReply");
 
+
+        JSONArray staffs = reqJson.getJSONArray("staffs");
+        if (ListUtil.isNull(staffs)) {
+            throw new CmdException("未包含人员");
+        }
+
+        JSONObject staff = null;
+        for(int staffIndex = 0;staffIndex < staffs.size(); staffIndex++){
+            staff = staffs.getJSONObject(staffIndex);
+            Assert.hasKeyAndValue(staff, "userId", "请求报文中未包含userId");
+            Assert.hasKeyAndValue(staff, "name", "请求报文中未包含userName");
+
+        }
+
     }
 
     @Override
@@ -73,6 +105,20 @@ public class SaveComplaintTypeCmd extends Cmd {
             throw new CmdException("保存数据失败");
         }
 
+        JSONArray staffs = reqJson.getJSONArray("staffs");
+        JSONObject staff = null;
+        for(int staffIndex = 0;staffIndex < staffs.size(); staffIndex++){
+            staff = staffs.getJSONObject(staffIndex);
+            ComplaintTypeUserPo complaintTypeUserPo = new ComplaintTypeUserPo();
+            complaintTypeUserPo.setTypeCd(complaintTypePo.getTypeCd());
+            complaintTypeUserPo.setTypeUserId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+            complaintTypeUserPo.setStaffName(staff.getString("name"));
+            complaintTypeUserPo.setCommunityId(complaintTypePo.getCommunityId());
+            complaintTypeUserPo.setStaffId(staff.getString("userId"));
+            complaintTypeUserV1InnerServiceSMOImpl.saveComplaintTypeUser(complaintTypeUserPo);
+        }
+
+
         cmdDataFlowContext.setResponseEntity(ResultVo.success());
     }
 }

+ 38 - 0
service-store/src/main/java/com/java110/store/cmd/complaintType/UpdateComplaintTypeCmd.java

@@ -15,6 +15,7 @@
  */
 package com.java110.store.cmd.complaintType;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.annotation.Java110Transactional;
@@ -22,11 +23,14 @@ 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.store.IComplaintTypeUserV1InnerServiceSMO;
 import com.java110.intf.store.IComplaintTypeV1InnerServiceSMO;
 import com.java110.po.complaintType.ComplaintTypePo;
+import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.ListUtil;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.slf4j.Logger;
@@ -52,11 +56,27 @@ public class UpdateComplaintTypeCmd extends Cmd {
     @Autowired
     private IComplaintTypeV1InnerServiceSMO complaintTypeV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "typeCd", "typeCd不能为空");
         Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
 
+
+        JSONArray staffs = reqJson.getJSONArray("staffs");
+        if (ListUtil.isNull(staffs)) {
+            throw new CmdException("未包含人员");
+        }
+
+        JSONObject staff = null;
+        for(int staffIndex = 0;staffIndex < staffs.size(); staffIndex++){
+            staff = staffs.getJSONObject(staffIndex);
+            Assert.hasKeyAndValue(staff, "userId", "请求报文中未包含userId");
+            Assert.hasKeyAndValue(staff, "name", "请求报文中未包含userName");
+
+        }
     }
 
     @Override
@@ -70,6 +90,24 @@ public class UpdateComplaintTypeCmd extends Cmd {
             throw new CmdException("更新数据失败");
         }
 
+        ComplaintTypeUserPo complaintTypeUserPo = new ComplaintTypeUserPo();
+        complaintTypeUserPo.setTypeCd(complaintTypePo.getTypeCd());
+        complaintTypeUserV1InnerServiceSMOImpl.deleteComplaintTypeUser(complaintTypeUserPo);
+
+
+        JSONArray staffs = reqJson.getJSONArray("staffs");
+        JSONObject staff = null;
+        for(int staffIndex = 0;staffIndex < staffs.size(); staffIndex++){
+            staff = staffs.getJSONObject(staffIndex);
+             complaintTypeUserPo = new ComplaintTypeUserPo();
+            complaintTypeUserPo.setTypeCd(complaintTypePo.getTypeCd());
+            complaintTypeUserPo.setTypeUserId(GenerateCodeFactory.getGeneratorId("11"));
+            complaintTypeUserPo.setStaffName(staff.getString("name"));
+            complaintTypeUserPo.setCommunityId(complaintTypePo.getCommunityId());
+            complaintTypeUserPo.setStaffId(staff.getString("userId"));
+            complaintTypeUserV1InnerServiceSMOImpl.saveComplaintTypeUser(complaintTypeUserPo);
+        }
+
         cmdDataFlowContext.setResponseEntity(ResultVo.success());
     }
 }

+ 0 - 72
service-store/src/main/java/com/java110/store/cmd/complaintTypeUser/DeleteComplaintTypeUserCmd.java

@@ -1,72 +0,0 @@
-/*
- * Copyright 2017-2020 吴学文 and java110 team.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.java110.store.cmd.complaintTypeUser;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.core.annotation.Java110Cmd;
-import com.java110.core.annotation.Java110Transactional;
-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.store.IComplaintTypeUserV1InnerServiceSMO;
-import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
-import com.java110.utils.exception.CmdException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.vo.ResultVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 类表述:删除
- * 服务编码:complaintTypeUser.deleteComplaintTypeUser
- * 请求路劲:/app/complaintTypeUser.DeleteComplaintTypeUser
- * add by 吴学文 at 2024-02-21 12:58:40 mail: 928255095@qq.com
- * open source address: https://gitee.com/wuxw7/MicroCommunity
- * 官网:http://www.homecommunity.cn
- * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
- * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
- */
-@Java110Cmd(serviceCode = "complaintTypeUser.deleteComplaintTypeUser")
-public class DeleteComplaintTypeUserCmd extends Cmd {
-    private static Logger logger = LoggerFactory.getLogger(DeleteComplaintTypeUserCmd.class);
-
-    @Autowired
-    private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
-
-    @Override
-    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "typeUserId", "typeUserId不能为空");
-        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
-        ComplaintTypeUserPo complaintTypeUserPo = BeanConvertUtil.covertBean(reqJson, ComplaintTypeUserPo.class);
-        int flag = complaintTypeUserV1InnerServiceSMOImpl.deleteComplaintTypeUser(complaintTypeUserPo);
-
-        if (flag < 1) {
-            throw new CmdException("删除数据失败");
-        }
-
-        cmdDataFlowContext.setResponseEntity(ResultVo.success());
-    }
-}

+ 0 - 78
service-store/src/main/java/com/java110/store/cmd/complaintTypeUser/SaveComplaintTypeUserCmd.java

@@ -1,78 +0,0 @@
-/*
- * Copyright 2017-2020 吴学文 and java110 team.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.java110.store.cmd.complaintTypeUser;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.core.annotation.Java110Cmd;
-import com.java110.core.annotation.Java110Transactional;
-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.store.IComplaintTypeUserV1InnerServiceSMO;
-import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
-import com.java110.utils.exception.CmdException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.vo.ResultVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 类表述:保存
- * 服务编码:complaintTypeUser.saveComplaintTypeUser
- * 请求路劲:/app/complaintTypeUser.SaveComplaintTypeUser
- * add by 吴学文 at 2024-02-21 12:58:40 mail: 928255095@qq.com
- * open source address: https://gitee.com/wuxw7/MicroCommunity
- * 官网:http://www.homecommunity.cn
- * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
- * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
- */
-@Java110Cmd(serviceCode = "complaintTypeUser.saveComplaintTypeUser")
-public class SaveComplaintTypeUserCmd extends Cmd {
-
-    private static Logger logger = LoggerFactory.getLogger(SaveComplaintTypeUserCmd.class);
-
-    public static final String CODE_PREFIX_ID = "10";
-
-    @Autowired
-    private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
-
-    @Override
-    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "typeCd", "请求报文中未包含typeCd");
-        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
-        Assert.hasKeyAndValue(reqJson, "staffName", "请求报文中未包含staffName");
-        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
-        ComplaintTypeUserPo complaintTypeUserPo = BeanConvertUtil.covertBean(reqJson, ComplaintTypeUserPo.class);
-        complaintTypeUserPo.setTypeUserId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
-        int flag = complaintTypeUserV1InnerServiceSMOImpl.saveComplaintTypeUser(complaintTypeUserPo);
-
-        if (flag < 1) {
-            throw new CmdException("保存数据失败");
-        }
-
-        cmdDataFlowContext.setResponseEntity(ResultVo.success());
-    }
-}

+ 0 - 75
service-store/src/main/java/com/java110/store/cmd/complaintTypeUser/UpdateComplaintTypeUserCmd.java

@@ -1,75 +0,0 @@
-/*
- * Copyright 2017-2020 吴学文 and java110 team.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.java110.store.cmd.complaintTypeUser;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.core.annotation.Java110Cmd;
-import com.java110.core.annotation.Java110Transactional;
-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.store.IComplaintTypeUserV1InnerServiceSMO;
-import com.java110.po.complaintTypeUser.ComplaintTypeUserPo;
-import com.java110.utils.exception.CmdException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.vo.ResultVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * 类表述:更新
- * 服务编码:complaintTypeUser.updateComplaintTypeUser
- * 请求路劲:/app/complaintTypeUser.UpdateComplaintTypeUser
- * add by 吴学文 at 2024-02-21 12:58:40 mail: 928255095@qq.com
- * open source address: https://gitee.com/wuxw7/MicroCommunity
- * 官网:http://www.homecommunity.cn
- * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
- * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
- */
-@Java110Cmd(serviceCode = "complaintTypeUser.updateComplaintTypeUser")
-public class UpdateComplaintTypeUserCmd extends Cmd {
-
-    private static Logger logger = LoggerFactory.getLogger(UpdateComplaintTypeUserCmd.class);
-
-
-    @Autowired
-    private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
-
-    @Override
-    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "typeUserId", "typeUserId不能为空");
-        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
-        ComplaintTypeUserPo complaintTypeUserPo = BeanConvertUtil.covertBean(reqJson, ComplaintTypeUserPo.class);
-        int flag = complaintTypeUserV1InnerServiceSMOImpl.updateComplaintTypeUser(complaintTypeUserPo);
-
-        if (flag < 1) {
-            throw new CmdException("更新数据失败");
-        }
-
-        cmdDataFlowContext.setResponseEntity(ResultVo.success());
-    }
-}