From 5700f42a37a2f9ecc27161e2b0559a820d320f6b Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期一, 17 三月 2025 15:11:40 +0800
Subject: [PATCH] 开发完成同一个手机号登录不同物业公司的支持
---
service-user/src/main/java/com/java110/user/cmd/user/UserStaffDeleteCmd.java | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 203 insertions(+), 11 deletions(-)
diff --git a/service-user/src/main/java/com/java110/user/cmd/user/UserStaffDeleteCmd.java b/service-user/src/main/java/com/java110/user/cmd/user/UserStaffDeleteCmd.java
index 0f155fd..7ec535d 100644
--- a/service-user/src/main/java/com/java110/user/cmd/user/UserStaffDeleteCmd.java
+++ b/service-user/src/main/java/com/java110/user/cmd/user/UserStaffDeleteCmd.java
@@ -5,24 +5,67 @@
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
-import com.java110.dto.privilegeUser.PrivilegeUserDto;
+import com.java110.doc.annotation.*;
+import com.java110.dto.attendance.AttendanceClassesStaffDto;
+import com.java110.dto.classes.ScheduleClassesStaffDto;
+import com.java110.dto.data.DataPrivilegeStaffDto;
+import com.java110.dto.inspection.InspectionPlanStaffDto;
+import com.java110.dto.maintainance.MaintainancePlanStaffDto;
+import com.java110.dto.privilege.PrivilegeUserDto;
import com.java110.dto.repair.RepairTypeUserDto;
+import com.java110.dto.user.StaffAppAuthDto;
+import com.java110.intf.community.IInspectionPlanStaffV1InnerServiceSMO;
+import com.java110.intf.community.IMaintainancePlanStaffV1InnerServiceSMO;
import com.java110.intf.community.IRepairTypeUserInnerServiceSMO;
import com.java110.intf.community.IRepairTypeUserV1InnerServiceSMO;
+import com.java110.intf.store.IScheduleClassesStaffV1InnerServiceSMO;
import com.java110.intf.store.IStoreUserV1InnerServiceSMO;
-import com.java110.intf.user.IPrivilegeUserV1InnerServiceSMO;
-import com.java110.intf.user.IUserV1InnerServiceSMO;
-import com.java110.po.privilegeUser.PrivilegeUserPo;
+import com.java110.intf.user.*;
+import com.java110.po.attendance.AttendanceClassesStaffPo;
+import com.java110.po.classes.ScheduleClassesStaffPo;
+import com.java110.po.inspection.InspectionPlanStaffPo;
+import com.java110.po.maintainance.MaintainancePlanStaffPo;
+import com.java110.po.privilege.DataPrivilegeStaffPo;
+import com.java110.po.privilege.PrivilegeUserPo;
import com.java110.po.repair.RepairTypeUserPo;
import com.java110.po.store.StoreUserPo;
+import com.java110.po.user.StaffAppAuthPo;
import com.java110.po.user.UserPo;
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 org.springframework.beans.factory.annotation.Autowired;
import java.text.ParseException;
import java.util.List;
+
+
+@Java110CmdDoc(title = "鍒犻櫎鍛樺伐",
+ description = "澶栭儴绯荤粺閫氳繃鍒犻櫎鍛樺伐鎺ュ彛 鍒犻櫎鍛樺伐 娉ㄦ剰闇�瑕佺墿涓氱鐞嗗憳璐﹀彿鐧诲綍锛屽洜涓轰笉闇�瑕佷紶storeId 鏄牴鎹鐞嗗憳鐧诲綍淇℃伅鑾峰彇鐨�",
+ httpMethod = "post",
+ url = "http://{ip}:{port}/app/user.staff.delete",
+ resource = "userDoc",
+ author = "鍚村鏂�",
+ serviceCode = "user.staff.delete",
+ seq = 5
+)
+
+@Java110ParamsDoc(params = {
+ @Java110ParamDoc(name = "userId", length = 30, remark = "鍛樺伐ID"),
+})
+
+@Java110ResponseDoc(
+ params = {
+ @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "杩斿洖缂栧彿锛�0 鎴愬姛 鍏朵粬澶辫触"),
+ @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "鎴愬姛", remark = "鎻忚堪"),
+ }
+)
+
+@Java110ExampleDoc(
+ reqBody = "{\"userId\":\"123123\"}",
+ resBody = "{'code':0,'msg':'鎴愬姛'"
+)
@Java110Cmd(serviceCode = "user.staff.delete")
public class UserStaffDeleteCmd extends Cmd {
@@ -43,35 +86,184 @@
@Autowired
private IRepairTypeUserV1InnerServiceSMO repairTypeUserV1InnerServiceSMOImpl;
+ @Autowired
+ private IScheduleClassesStaffV1InnerServiceSMO scheduleClassesStaffV1InnerServiceSMOImpl;
+
+ @Autowired
+ private IAttendanceClassesStaffV1InnerServiceSMO attendanceClassesStaffV1InnerServiceSMOImpl;
+
+ @Autowired
+ private IInspectionPlanStaffV1InnerServiceSMO inspectionPlanStaffV1InnerServiceSMOImpl;
+
+ @Autowired
+ private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMOImpl;
+
+ @Autowired
+ private IDataPrivilegeStaffV1InnerServiceSMO dataPrivilegeStaffV1InnerServiceSMOImpl;
+
+ @Autowired
+ private IMaintainancePlanStaffV1InnerServiceSMO maintainancePlanStaffV1InnerServiceSMOImpl;
+
@Override
public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
Assert.jsonObjectHaveKey(reqJson, "storeId", "璇锋眰鍙傛暟涓湭鍖呭惈storeId 鑺傜偣锛岃纭");
Assert.jsonObjectHaveKey(reqJson, "userId", "璇锋眰鍙傛暟涓湭鍖呭惈userId 鑺傜偣锛岃纭");
+
+
}
@Override
public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+ //todo 鍒犻櫎鍛樺伐淇℃伅
deleteStaff(reqJson);
- //鍒犻櫎鐢ㄦ埛
+ //todo 鍒犻櫎鐢ㄦ埛
deleteUser(reqJson);
- //鍒犻櫎鎶ヤ慨璁剧疆
+ //todo 鍒犻櫎鎶ヤ慨璁剧疆
RepairTypeUserDto repairTypeUserDto = new RepairTypeUserDto();
repairTypeUserDto.setStaffId(reqJson.getString("userId"));
repairTypeUserDto.setStatusCd("0");
List<RepairTypeUserDto> repairTypeUserDtoList = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsers(repairTypeUserDto);
- if (repairTypeUserDtoList != null && repairTypeUserDtoList.size() > 0) {
- for (RepairTypeUserDto repairTypeUserDto1 : repairTypeUserDtoList) {
- JSONObject typeUserJson1 = (JSONObject) JSONObject.toJSON(repairTypeUserDto1);
+ if (!ListUtil.isNull(repairTypeUserDtoList)) {
+ for (RepairTypeUserDto tmpRepairTypeUserDto : repairTypeUserDtoList) {
+ JSONObject typeUserJson1 = (JSONObject) JSONObject.toJSON(tmpRepairTypeUserDto);
deleteRepairTypeUser(typeUserJson1);
}
}
+ //todo 鍒犻櫎鍛樺伐鎺掔彮鏁版嵁
+ deleteScheduleClassesStaff(reqJson);
- //璧嬫潈
+ //todo 鍒犻櫎鍛樺伐鑰冨嫟缁�
+ deleteAttendanceClassesStaff(reqJson);
+
+ // todo 鍒犻櫎宸℃鍛樺伐
+ deleteInspectionPlanStaff(reqJson);
+
+ //todo 璧嬫潈
deleteUserPrivilege(reqJson);
+
+ // todo 鍒犻櫎鍛樺伐璁よ瘉
+ deleteStaffAppAuth(reqJson);
+
+ // todo 鍒犻櫎鏁版嵁鏉冮檺
+ deleteStaffDataPri(reqJson);
+
+ //todo 鍒犻櫎淇濆吇鍛樺伐
+ deleteMaintainanceStaff(reqJson);
+ }
+
+
+
+ /**
+ * 鍒犻櫎鏁版嵁鏉冮檺
+ * @param reqJson
+ */
+ private void deleteStaffDataPri(JSONObject reqJson) {
+
+ DataPrivilegeStaffDto dataPrivilegeStaffDto = new DataPrivilegeStaffDto();
+ dataPrivilegeStaffDto.setStaffId(reqJson.getString("userId"));
+ List<DataPrivilegeStaffDto> dataPrivilegeStaffDtos
+ = dataPrivilegeStaffV1InnerServiceSMOImpl.queryDataPrivilegeStaffs(dataPrivilegeStaffDto);
+ if(ListUtil.isNull(dataPrivilegeStaffDtos)){
+ return;
+ }
+ for(DataPrivilegeStaffDto tmpDataPrivilegeStaffDto:dataPrivilegeStaffDtos){
+
+ DataPrivilegeStaffPo dataPrivilegeStaffPo = new DataPrivilegeStaffPo();
+ dataPrivilegeStaffPo.setDpsId(tmpDataPrivilegeStaffDto.getDpsId());
+ dataPrivilegeStaffV1InnerServiceSMOImpl.deleteDataPrivilegeStaff(dataPrivilegeStaffPo);
+ }
+ }
+
+ private void deleteStaffAppAuth(JSONObject reqJson) {
+
+ StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
+ staffAppAuthDto.setStaffId(reqJson.getString("userId"));
+ List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuths(staffAppAuthDto);
+ if(ListUtil.isNull(staffAppAuthDtos)){
+ return;
+ }
+ for(StaffAppAuthDto tmpStaffAppAuthDto:staffAppAuthDtos){
+ StaffAppAuthPo staffAppAuthPo = new StaffAppAuthPo();
+ staffAppAuthPo.setAuId(tmpStaffAppAuthDto.getAuId());
+ staffAppAuthInnerServiceSMOImpl.deleteStaffAppAuth(staffAppAuthPo);
+ }
+ }
+
+ private void deleteInspectionPlanStaff(JSONObject reqJson) {
+
+ InspectionPlanStaffDto inspectionPlanStaffDto = new InspectionPlanStaffDto();
+ inspectionPlanStaffDto.setStaffId(reqJson.getString("userId"));
+ List<InspectionPlanStaffDto> inspectionPlanStaffDtos
+ = inspectionPlanStaffV1InnerServiceSMOImpl.queryInspectionPlanStaffs(inspectionPlanStaffDto);
+ if(ListUtil.isNull(inspectionPlanStaffDtos)){
+ return;
+ }
+
+ for(InspectionPlanStaffDto tmpInspectionPlanStaffDto:inspectionPlanStaffDtos){
+ InspectionPlanStaffPo inspectionPlanStaffPo = new InspectionPlanStaffPo();
+ inspectionPlanStaffPo.setIpStaffId(tmpInspectionPlanStaffDto.getIpStaffId());
+ inspectionPlanStaffV1InnerServiceSMOImpl.deleteInspectionPlanStaff(inspectionPlanStaffPo);
+ }
+ }
+
+ /**
+ * 鍒犻櫎淇濆吇鍛樺伐
+ * @param reqJson
+ */
+ private void deleteMaintainanceStaff(JSONObject reqJson) {
+ MaintainancePlanStaffDto maintainancePlanStaffDto = new MaintainancePlanStaffDto();
+ maintainancePlanStaffDto.setStaffId(reqJson.getString("userId"));
+ List<MaintainancePlanStaffDto> maintainancePlanStaffDtos
+ = maintainancePlanStaffV1InnerServiceSMOImpl.queryMaintainancePlanStaffs(maintainancePlanStaffDto);
+ if(ListUtil.isNull(maintainancePlanStaffDtos)){
+ return;
+ }
+
+ for(MaintainancePlanStaffDto tmpMaintainancePlanStaffDto:maintainancePlanStaffDtos){
+ MaintainancePlanStaffPo maintainancePlanStaffPo = new MaintainancePlanStaffPo();
+ maintainancePlanStaffPo.setMpsId(tmpMaintainancePlanStaffDto.getMpsId());
+ maintainancePlanStaffV1InnerServiceSMOImpl.deleteMaintainancePlanStaff(maintainancePlanStaffPo);
+ }
+ }
+
+ private void deleteAttendanceClassesStaff(JSONObject reqJson) {
+
+ AttendanceClassesStaffDto attendanceClassesStaffDto = new AttendanceClassesStaffDto();
+ attendanceClassesStaffDto.setStaffId(reqJson.getString("userId"));
+ List<AttendanceClassesStaffDto> attendanceClassesStaffDtos
+ = attendanceClassesStaffV1InnerServiceSMOImpl.queryAttendanceClassesStaffs(attendanceClassesStaffDto);
+ if(ListUtil.isNull(attendanceClassesStaffDtos)){
+ return;
+ }
+ for(AttendanceClassesStaffDto tmpAttendanceClassesStaffDto:attendanceClassesStaffDtos){
+ AttendanceClassesStaffPo attendanceClassesStaffPo = new AttendanceClassesStaffPo();
+ attendanceClassesStaffPo.setCsId(tmpAttendanceClassesStaffDto.getCsId());
+ attendanceClassesStaffV1InnerServiceSMOImpl.deleteAttendanceClassesStaff(attendanceClassesStaffPo);
+ }
+ }
+
+ /**
+ * 鍒犻櫎鑰冨嫟鍛樺伐
+ * @param reqJson
+ */
+ private void deleteScheduleClassesStaff(JSONObject reqJson) {
+ ScheduleClassesStaffDto scheduleClassesStaffDto = new ScheduleClassesStaffDto();
+ scheduleClassesStaffDto.setStaffId(reqJson.getString("userId"));
+ List<ScheduleClassesStaffDto> scheduleClassesStaffDtos
+ = scheduleClassesStaffV1InnerServiceSMOImpl.queryScheduleClassesStaffs(scheduleClassesStaffDto);
+ if(ListUtil.isNull(scheduleClassesStaffDtos)){
+ return;
+ }
+ for (ScheduleClassesStaffDto tmpScheduleClassesStaffDto : scheduleClassesStaffDtos) {
+ ScheduleClassesStaffPo scheduleClassesStaffPo = new ScheduleClassesStaffPo();
+ scheduleClassesStaffPo.setScsId(tmpScheduleClassesStaffDto.getScsId());
+ scheduleClassesStaffV1InnerServiceSMOImpl.deleteScheduleClassesStaff(scheduleClassesStaffPo);
+ }
+
}
/**
@@ -85,7 +277,7 @@
privilegeUserDto.setUserId(paramInJson.getString("userId"));
List<PrivilegeUserDto> privilegeUserDtos = privilegeUserV1InnerServiceSMOImpl.queryPrivilegeUsers(privilegeUserDto);
- if (privilegeUserDtos == null || privilegeUserDtos.size() < 1) {
+ if (ListUtil.isNull(privilegeUserDtos)) {
return;
}
--
Gitblit v1.8.0