1、优化报修通知信息2、优化缴费审核3、优化发布公告信息4、优化页面显示性问题
59个文件已修改
7个文件已添加
2752 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/RoomDto.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/machineAuth/MachineAuthDto.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/notice/NoticeDto.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/owner/OwnerCarDto.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/parkingSpaceApply/ParkingSpaceApplyDto.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/staffAppAuth/StaffAppAuthDto.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/machineAuth/MachineAuthPo.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/staffAppAuth/StaffAppAuthPo.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/machineAuth/ApiMachineAuthDataVo.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/machineAuth/ApiMachineAuthVo.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/center/PrivilegeDAOImplMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/CarInoutServiceDaoImplMapper.xml 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/MachineAuthServiceDaoImplMapper.xml 457 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/MachineV1ServiceDaoImplMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/NoticeServiceDaoImplMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/ParkingSpaceApplyV1ServiceDaoImplMapper.xml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/RepairServiceDaoImplMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/PayFeeAuditServiceDaoImplMapper.xml 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/TempCarFeeConfigServiceDaoImplMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/job/TaskServiceDaoImplMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/StaffAppAuthServiceDaoImplMapper.xml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/common/IMachineAuthInnerServiceSMO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/fee/IFeeConfigInnerServiceSMO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/order/IPrivilegeInnerServiceSMO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-acct/src/main/java/com/java110/acct/cmd/account/CancelAccountDetailCmd.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/machineAuth/DeleteMachineAuth.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/machineAuth/ListMachineAuths.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/machineAuth/SaveMachineAuth.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/machineAuth/UpdateMachineAuth.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/dao/IMachineAuthServiceDao.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/dao/impl/MachineAuthServiceDaoImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/smo/impl/MachineAuthInnerServiceSMOImpl.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/GrabbingRepairCmd.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/ListStaffRepairsCmd.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairForceFinishCmd.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/AuditParkingSpaceApplyCmd.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/DeleteParkingSpaceApplyCmd.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/visit/SaveVisitCmd.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/visit/UpdateVisitCmd.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/cmd/task/ListTasksCmd.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/bmo/fee/impl/FeeBMOImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/bmo/payFeeAudit/impl/GetPayFeeAuditBMOImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/fee/DeleteTempCarFeeConfigCmd.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/fee/SaveTempCarFeeConfigCmd.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/fee/UpdateTempCarFeeConfigCmd.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/returnPayFee/UpdateReturnPayFeeCmd.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/dao/IFeeConfigServiceDao.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/dao/impl/FeeConfigServiceDaoImpl.java 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/smo/impl/FeeConfigInnerServiceSMOImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/Repair/MachineAddOwnerRepairAdapt.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/Repair/MachineDistributeLeaflets.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/Repair/MachineReturnRepairAdapt.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/hcGov/visit/AddVisitAdapt.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/hcGov/visit/ExamineVisitAdapt.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/notice/MachineNoticeAdapt.java 280 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/task/wechat/WeChatPushMessageTemplate.java 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-order/src/main/java/com/java110/order/smo/impl/OrderInnerServiceSMOImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/bmo/customReport/InspectionData.java 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/cmd/reportCustomComponent/ListReportCustomComponentDataCmd.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/smo/impl/QueryPayFeeDetailInnerServiceSMOImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/api/StaffApi.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/UpdateStaffAppAuthBMOImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/RoomDto.java
@@ -19,17 +19,18 @@
    public static final String STATE_SELL = "2001"; // 已入住
    public static final String STATE_FREE = "2002"; //未销售
    public static final String STATE_DELIVERY = "2003";//已交房
    public static final String STATE_NO_HOME = "2004";//未入住
    public static final String STATE_RENOVATION = "2005";//已装修
    public static final String STATE_SHOP_FIRE = "2006";//已经租
    public static final String STATE_SHOP_FIRE = "2006";//已出租
    public static final String STATE_SHOP_SELL = "2007";//已售
    public static final String STATE_SHOP_FREE = "2008";//空闲
    public static final String STATE_SHOP_REPAIR = "2009";//装修中
    public static final String ROOM_TYPE_ROOM = "1010301";//普通房屋
    public static final String ROOM_TYPE_SHOPS = "2020602";//商铺
    public static final String ROOM_SUB_TYPE_PERSON = "110";
    public static final String ROOM_SUB_TYPE_WORK = "119";
    public static final String ROOM_SUB_TYPE_HOUSE = "120";
    private String feeCoefficient;
    private String section;
@@ -80,7 +81,6 @@
    private Date endTime;
    private String roomName;
    private String statusCd = "0";
@@ -164,7 +164,6 @@
        this.apartment = apartment;
    }
    public Date getCreateTime() {
        return createTime;
    }
@@ -188,7 +187,6 @@
    public void setRoomAttrDto(List<RoomAttrDto> roomAttrDto) {
        this.roomAttrDto = roomAttrDto;
    }
    public String getCommunityId() {
        return communityId;
java110-bean/src/main/java/com/java110/dto/machineAuth/MachineAuthDto.java
@@ -1,6 +1,7 @@
package com.java110.dto.machineAuth;
import com.java110.dto.PageDto;
import java.io.Serializable;
import java.util.Date;
@@ -15,76 +16,91 @@
public class MachineAuthDto extends PageDto implements Serializable {
    private String personName;
private String machineId;
private String personId;
private String startTime;
private String state;
private String endTime;
private String communityId;
private String personType;
private String authId;
    private String machineId;
    private String machineName;
    private String personId;
    private String startTime;
    private String state;
    private String endTime;
    private String communityId;
    private String personType;
    private String authId;
    private Date createTime;
    private String statusCd = "0";
    public String getPersonName() {
        return personName;
    }
public void setPersonName(String personName) {
    public void setPersonName(String personName) {
        this.personName = personName;
    }
public String getMachineId() {
    public String getMachineId() {
        return machineId;
    }
public void setMachineId(String machineId) {
    public void setMachineId(String machineId) {
        this.machineId = machineId;
    }
public String getPersonId() {
    public String getPersonId() {
        return personId;
    }
public void setPersonId(String personId) {
    public void setPersonId(String personId) {
        this.personId = personId;
    }
public String getStartTime() {
    public String getStartTime() {
        return startTime;
    }
public void setStartTime(String startTime) {
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
public String getState() {
    public String getState() {
        return state;
    }
public void setState(String state) {
    public void setState(String state) {
        this.state = state;
    }
public String getEndTime() {
    public String getEndTime() {
        return endTime;
    }
public void setEndTime(String endTime) {
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
public String getCommunityId() {
    public String getCommunityId() {
        return communityId;
    }
public void setCommunityId(String communityId) {
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
public String getPersonType() {
    public String getPersonType() {
        return personType;
    }
public void setPersonType(String personType) {
    public void setPersonType(String personType) {
        this.personType = personType;
    }
public String getAuthId() {
    public String getAuthId() {
        return authId;
    }
public void setAuthId(String authId) {
    public void setAuthId(String authId) {
        this.authId = authId;
    }
    public Date getCreateTime() {
        return createTime;
@@ -101,4 +117,12 @@
    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }
    public String getMachineName() {
        return machineName;
    }
    public void setMachineName(String machineName) {
        this.machineName = machineName;
    }
}
java110-bean/src/main/java/com/java110/dto/notice/NoticeDto.java
@@ -15,15 +15,15 @@
 **/
public class NoticeDto extends PageDto implements Serializable {
    public static final String STATE_WAIT = "1000";// 等待房屋
    public static final String STATE_DOING = "2000";//处理中
    public static final String STATE_FINISH = "3000";//处理完成
    public static final String STATE_WAIT = "1000";// 待通知
    public static final String STATE_DOING = "2000";//通知中
    public static final String STATE_FINISH = "3000";//通知完成
    public static final String OBJ_TYPE_COMMUNITY = "001";//小区
    public static final String OBJ_TYPE_FLOOR = "002";//楼栋
    public static final String OBJ_TYPE_UNIT = "003";//单元
    public static final String OBJ_TYPE_ROOM = "004";//单元
    public static final String OBJ_TYPE_ALL = "005";//单元
    public static final String OBJ_TYPE_ROOM = "004";//房屋
    public static final String OBJ_TYPE_ALL = "005";//全部发送
    public static final String NOTICE_TYPE_OWNER_WECHAT = "1003";//发送给业主微信
java110-bean/src/main/java/com/java110/dto/owner/OwnerCarDto.java
@@ -21,7 +21,6 @@
    public static final String STATE_OWE = "2002";
    public static final String STATE_FINISH = "3003";
    public static final String CAR_TYPE_PRIMARY = "1001"; //主车辆
    public static final String CAR_TYPE_MEMBER = "1002"; //车辆成员
    public static final String CAR_TYPE_TEMP = "1003"; //临时车
@@ -95,7 +94,6 @@
    private String leaseTypeName;
    private List<OwnerCarAttrDto> ownerCarAttrDto;
    public String getCarColor() {
        return carColor;
@@ -456,6 +454,7 @@
    public void setPaIds(String[] paIds) {
        this.paIds = paIds;
    }
    public String getCarTypeCdName() {
        return carTypeCdName;
    }
java110-bean/src/main/java/com/java110/dto/parkingSpaceApply/ParkingSpaceApplyDto.java
@@ -33,7 +33,10 @@
    private String state;
    private String communityId;
    private String feeId;
    //停车位编号
    private String num;
    //停车场编号
    private String areaNum;
    private String paId;
    private String parkingTypeName;
    private String stateName;
@@ -41,7 +44,6 @@
    private Date createTime;
    private String statusCd = "0";
    public String getCarBrand() {
        return carBrand;
@@ -163,7 +165,6 @@
        this.communityId = communityId;
    }
    public Date getCreateTime() {
        return createTime;
    }
@@ -227,4 +228,12 @@
    public void setCarId(String carId) {
        this.carId = carId;
    }
    public String getAreaNum() {
        return areaNum;
    }
    public void setAreaNum(String areaNum) {
        this.areaNum = areaNum;
    }
}
java110-bean/src/main/java/com/java110/dto/staffAppAuth/StaffAppAuthDto.java
@@ -25,11 +25,9 @@
    private String staffId;
    private String staffName;
    private Date createTime;
    private String statusCd = "0";
    public String getAuId() {
        return auId;
java110-bean/src/main/java/com/java110/po/machineAuth/MachineAuthPo.java
@@ -6,69 +6,102 @@
public class MachineAuthPo implements Serializable {
    private String personName;
private String machineId;
private String personId;
private String startTime;
private String state;
private String endTime;
private String communityId;
private String personType;
private String authId;
public String getPersonName() {
    private String machineId;
    private String personId;
    private String startTime;
    private String state;
    private String endTime;
    private String communityId;
    private String personType;
    private String authId;
    private String statusCd = "0";
    private String bId;
    public String getPersonName() {
        return personName;
    }
public void setPersonName(String personName) {
    public void setPersonName(String personName) {
        this.personName = personName;
    }
public String getMachineId() {
    public String getMachineId() {
        return machineId;
    }
public void setMachineId(String machineId) {
    public void setMachineId(String machineId) {
        this.machineId = machineId;
    }
public String getPersonId() {
    public String getPersonId() {
        return personId;
    }
public void setPersonId(String personId) {
    public void setPersonId(String personId) {
        this.personId = personId;
    }
public String getStartTime() {
    public String getStartTime() {
        return startTime;
    }
public void setStartTime(String startTime) {
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
public String getState() {
    public String getState() {
        return state;
    }
public void setState(String state) {
    public void setState(String state) {
        this.state = state;
    }
public String getEndTime() {
    public String getEndTime() {
        return endTime;
    }
public void setEndTime(String endTime) {
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
public String getCommunityId() {
    public String getCommunityId() {
        return communityId;
    }
public void setCommunityId(String communityId) {
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
public String getPersonType() {
    public String getPersonType() {
        return personType;
    }
public void setPersonType(String personType) {
    public void setPersonType(String personType) {
        this.personType = personType;
    }
public String getAuthId() {
    public String getAuthId() {
        return authId;
    }
public void setAuthId(String authId) {
    public void setAuthId(String authId) {
        this.authId = authId;
    }
    public String getStatusCd() {
        return statusCd;
    }
    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }
    public String getbId() {
        return bId;
    }
    public void setbId(String bId) {
        this.bId = bId;
    }
}
java110-bean/src/main/java/com/java110/po/staffAppAuth/StaffAppAuthPo.java
@@ -12,6 +12,7 @@
    private String storeId;
    private String openName;
    private String staffId;
    private String createTime;
    public String getAuId() {
        return auId;
@@ -77,5 +78,11 @@
        this.staffId = staffId;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
java110-bean/src/main/java/com/java110/vo/api/machineAuth/ApiMachineAuthDataVo.java
New file
@@ -0,0 +1,108 @@
package com.java110.vo.api.machineAuth;
import java.io.Serializable;
import java.util.Date;
public class ApiMachineAuthDataVo implements Serializable {
    private String personName;
    private String machineId;
    private String machineName;
    private String personId;
    private String startTime;
    private String state;
    private String endTime;
    private String communityId;
    private String personType;
    private String authId;
    private Date createTime;
    public String getPersonName() {
        return personName;
    }
    public void setPersonName(String personName) {
        this.personName = personName;
    }
    public String getMachineId() {
        return machineId;
    }
    public void setMachineId(String machineId) {
        this.machineId = machineId;
    }
    public String getPersonId() {
        return personId;
    }
    public void setPersonId(String personId) {
        this.personId = personId;
    }
    public String getStartTime() {
        return startTime;
    }
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getEndTime() {
        return endTime;
    }
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
    public String getCommunityId() {
        return communityId;
    }
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    public String getPersonType() {
        return personType;
    }
    public void setPersonType(String personType) {
        this.personType = personType;
    }
    public String getAuthId() {
        return authId;
    }
    public void setAuthId(String authId) {
        this.authId = authId;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getMachineName() {
        return machineName;
    }
    public void setMachineName(String machineName) {
        this.machineName = machineName;
    }
}
java110-bean/src/main/java/com/java110/vo/api/machineAuth/ApiMachineAuthVo.java
New file
@@ -0,0 +1,21 @@
package com.java110.vo.api.machineAuth;
import com.java110.vo.MorePageVo;
import java.io.Serializable;
import java.util.List;
public class ApiMachineAuthVo extends MorePageVo implements Serializable {
    List<ApiMachineAuthDataVo> machineAuths;
    public List<ApiMachineAuthDataVo> getMachineAuths() {
        return machineAuths;
    }
    public void setMachineAuths(List<ApiMachineAuthDataVo> machineAuths) {
        this.machineAuths = machineAuths;
    }
}
java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdListener.java
@@ -21,7 +21,7 @@
     * @param event              事件对象
     * @param context 请求报文数据
     */
    void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException;
    void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException;
    /**
java110-db/src/main/resources/mapper/center/PrivilegeDAOImplMapper.xml
@@ -198,9 +198,6 @@
        <if test="storeId != null and storeId != ''">
            and t.store_id = #{storeId}
        </if>
        <if test="communityId != null and communityId != ''">
            and t.community_id = #{communityId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/common/CarInoutServiceDaoImplMapper.xml
@@ -1,18 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="carInoutServiceDaoImpl">
    <!-- 保存进出场信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessCarInoutInfo" parameterType="Map">
        insert into business_car_inout(
        in_time,inout_id,operate,car_num,state,community_id,b_id,out_time
        ) values (
        #{inTime},#{inoutId},#{operate},#{carNum},#{state},#{communityId},#{bId},#{outTime}
        )
        insert into business_car_inout(in_time, inout_id, operate, car_num, state, community_id, b_id, out_time)
        values (#{inTime}, #{inoutId}, #{operate}, #{carNum}, #{state}, #{communityId}, #{bId}, #{outTime})
    </insert>
    <!-- 查询进出场信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessCarInoutInfo" parameterType="Map" resultType="Map">
@@ -44,9 +39,7 @@
        <if test="outTime !=null ">
            and t.out_time= #{outTime}
        </if>
    </select>
    <!-- 保存进出场信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveCarInoutInfoInstance" parameterType="Map">
@@ -76,9 +69,7 @@
        <if test="outTime !=null ">
            and t.out_time= #{outTime}
        </if>
    </insert>
    <!-- 查询进出场信息 add by wuxw 2018-07-03 -->
    <select id="getCarInoutInfo" parameterType="Map" resultType="Map">
@@ -120,13 +111,17 @@
        <if test="outTime !=null ">
            and t.out_time= #{outTime}
        </if>
        <if test="startTime != null and startTime != ''">
            and t.in_time &gt; #{startTime}
        </if>
        <if test="endTime != null and endTime != ''">
            and t.out_time &lt; #{endTime}
        </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="updateCarInoutInfoInstance" parameterType="Map">
@@ -156,7 +151,6 @@
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
    </update>
    <!-- 查询进出场数量 add by wuxw 2018-07-03 -->
@@ -197,8 +191,11 @@
        <if test="outTime !=null ">
            and t.out_time= #{outTime}
        </if>
        <if test="startTime != null and startTime != ''">
            and t.in_time &gt; #{startTime}
        </if>
        <if test="endTime != null and endTime != ''">
            and t.out_time &lt; #{endTime}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/common/MachineAuthServiceDaoImplMapper.xml
@@ -1,232 +1,271 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="machineAuthServiceDaoImpl">
    <insert id="saveMachineAuth" parameterType="Map">
        insert into machine_auth(person_name, machine_id, person_id, start_time, status_cd, state, end_time,
                                 community_id, b_id, person_type, auth_id)
        values (#{personName}, #{machineId}, #{personId}, #{startTime}, #{statusCd}, #{state}, #{endTime},
                #{communityId}, #{bId}, #{personType}, #{authId})
    </insert>
    <!-- 保存设备权限信息 add by wuxw 2018-07-03 -->
       <insert id="saveBusinessMachineAuthInfo" parameterType="Map">
           insert into business_machine_auth(
person_name,machine_id,operate,person_id,start_time,state,end_time,community_id,b_id,person_type,auth_id
) values (
#{personName},#{machineId},#{operate},#{personId},#{startTime},#{state},#{endTime},#{communityId},#{bId},#{personType},#{authId}
)
       </insert>
    <insert id="saveBusinessMachineAuthInfo" parameterType="Map">
        insert into business_machine_auth(person_name, machine_id, operate, person_id, start_time, state, end_time,
                                          community_id, b_id, person_type, auth_id)
        values (#{personName}, #{machineId}, #{operate}, #{personId}, #{startTime}, #{state}, #{endTime},
                #{communityId}, #{bId}, #{personType}, #{authId})
    </insert>
       <!-- 查询设备权限信息(Business) add by wuxw 2018-07-03 -->
       <select id="getBusinessMachineAuthInfo" parameterType="Map" resultType="Map">
           select  t.person_name,t.person_name personName,t.machine_id,t.machine_id machineId,t.operate,t.person_id,t.person_id personId,t.start_time,t.start_time startTime,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.person_type,t.person_type personType,t.auth_id,t.auth_id authId
from business_machine_auth t
where 1 =1
<if test="personName !=null and personName != ''">
   and t.person_name= #{personName}
</if>
<if test="machineId !=null and machineId != ''">
   and t.machine_id= #{machineId}
</if>
<if test="operate !=null and operate != ''">
   and t.operate= #{operate}
</if>
<if test="personId !=null and personId != ''">
   and t.person_id= #{personId}
</if>
<if test="startTime !=null and startTime != ''">
   and t.start_time= #{startTime}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="endTime !=null and endTime != ''">
   and t.end_time= #{endTime}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="personType !=null and personType != ''">
   and t.person_type= #{personType}
</if>
<if test="authId !=null and authId != ''">
   and t.auth_id= #{authId}
</if>
       </select>
    <!-- 查询设备权限信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessMachineAuthInfo" parameterType="Map" resultType="Map">
        select t.person_name,t.person_name personName,t.machine_id,t.machine_id
        machineId,t.operate,t.person_id,t.person_id personId,t.start_time,t.start_time
        startTime,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id
        bId,t.person_type,t.person_type personType,t.auth_id,t.auth_id authId
        from business_machine_auth t
        where 1 =1
        <if test="personName !=null and personName != ''">
            and t.person_name= #{personName}
        </if>
        <if test="machineId !=null and machineId != ''">
            and t.machine_id= #{machineId}
        </if>
        <if test="operate !=null and operate != ''">
            and t.operate= #{operate}
        </if>
        <if test="personId !=null and personId != ''">
            and t.person_id= #{personId}
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.start_time &lt;= #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.end_time &gt;= #{endTime}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="personType !=null and personType != ''">
            and t.person_type= #{personType}
        </if>
        <if test="authId !=null and authId != ''">
            and t.auth_id= #{authId}
        </if>
    </select>
    <!-- 保存设备权限信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveMachineAuthInfoInstance" parameterType="Map">
        insert into machine_auth(
person_name,machine_id,person_id,start_time,status_cd,state,end_time,community_id,b_id,person_type,auth_id
) select t.person_name,t.machine_id,t.person_id,t.start_time,'0',t.state,t.end_time,t.community_id,t.b_id,t.person_type,t.auth_id from business_machine_auth t where 1=1
<if test="personName !=null and personName != ''">
   and t.person_name= #{personName}
</if>
<if test="machineId !=null and machineId != ''">
   and t.machine_id= #{machineId}
</if>
   and t.operate= 'ADD'
<if test="personId !=null and personId != ''">
   and t.person_id= #{personId}
</if>
<if test="startTime !=null and startTime != ''">
   and t.start_time= #{startTime}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="endTime !=null and endTime != ''">
   and t.end_time= #{endTime}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="personType !=null and personType != ''">
   and t.person_type= #{personType}
</if>
<if test="authId !=null and authId != ''">
   and t.auth_id= #{authId}
</if>
        person_name,machine_id,person_id,start_time,status_cd,state,end_time,community_id,b_id,person_type,auth_id
        ) select
        t.person_name,t.machine_id,t.person_id,t.start_time,'0',t.state,t.end_time,t.community_id,t.b_id,t.person_type,t.auth_id
        from business_machine_auth t where 1=1
        <if test="personName !=null and personName != ''">
            and t.person_name= #{personName}
        </if>
        <if test="machineId !=null and machineId != ''">
            and t.machine_id= #{machineId}
        </if>
        and t.operate= 'ADD'
        <if test="personId !=null and personId != ''">
            and t.person_id= #{personId}
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.start_time= #{startTime}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.end_time= #{endTime}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="personType !=null and personType != ''">
            and t.person_type= #{personType}
        </if>
        <if test="authId !=null and authId != ''">
            and t.auth_id= #{authId}
        </if>
    </insert>
    <!-- 查询设备权限信息 add by wuxw 2018-07-03 -->
    <select id="getMachineAuthInfo" parameterType="Map" resultType="Map">
        select  t.person_name,t.person_name personName,t.machine_id,t.machine_id machineId,t.person_id,t.person_id personId,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.person_type,t.person_type personType,t.auth_id,t.auth_id authId
from machine_auth t
where 1 =1
<if test="personName !=null and personName != ''">
   and t.person_name= #{personName}
</if>
<if test="machineId !=null and machineId != ''">
   and t.machine_id= #{machineId}
</if>
<if test="personId !=null and personId != ''">
   and t.person_id= #{personId}
</if>
<if test="startTime !=null and startTime != ''">
   and t.start_time= #{startTime}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="endTime !=null and endTime != ''">
   and t.end_time= #{endTime}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="personType !=null and personType != ''">
   and t.person_type= #{personType}
</if>
<if test="authId !=null and authId != ''">
   and t.auth_id= #{authId}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
   limit #{page}, #{row}
</if>
        select t.person_name,t.person_name personName,t.machine_id,t.machine_id machineId,t.person_id,t.person_id
        personId,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.state,t.end_time,t.end_time
        endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.person_type,t.person_type
        personType,t.auth_id,t.auth_id authId,u.name personName,m.machine_name machineName
        from machine_auth t
        left join u_user u on t.person_id = u.user_id and u.status_cd = '0'
        left join machine m on t.machine_id = m.machine_id and m.status_cd = '0'
        where 1 = 1
        <if test="personName !=null and personName != ''">
            and t.person_name= #{personName}
        </if>
        <if test="machineId !=null and machineId != ''">
            and t.machine_id= #{machineId}
        </if>
        <if test="personId !=null and personId != ''">
            and t.person_id= #{personId}
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.start_time &lt;= #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.end_time &gt;= #{endTime}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="personType !=null and personType != ''">
            and t.person_type= #{personType}
        </if>
        <if test="authId !=null and authId != ''">
            and t.auth_id= #{authId}
        </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="updateMachineAuthInfoInstance" parameterType="Map">
        update  machine_auth t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="personName !=null and personName != ''">
, t.person_name= #{personName}
</if>
<if test="machineId !=null and machineId != ''">
, t.machine_id= #{machineId}
</if>
<if test="personId !=null and personId != ''">
, t.person_id= #{personId}
</if>
<if test="startTime !=null and startTime != ''">
, t.start_time= #{startTime}
</if>
<if test="state !=null and state != ''">
, t.state= #{state}
</if>
<if test="endTime !=null and endTime != ''">
, t.end_time= #{endTime}
</if>
<if test="communityId !=null and communityId != ''">
, t.community_id= #{communityId}
</if>
<if test="personType !=null and personType != ''">
, t.person_type= #{personType}
</if>
 where 1=1 <if test="bId !=null and bId != ''">
and t.b_id= #{bId}
</if>
<if test="authId !=null and authId != ''">
and t.auth_id= #{authId}
</if>
        update machine_auth t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="personName !=null and personName != ''">
            , t.person_name= #{personName}
        </if>
        <if test="machineId !=null and machineId != ''">
            , t.machine_id= #{machineId}
        </if>
        <if test="personId !=null and personId != ''">
            , t.person_id= #{personId}
        </if>
        <if test="startTime !=null and startTime != ''">
            , t.start_time= #{startTime}
        </if>
        <if test="state !=null and state != ''">
            , t.state= #{state}
        </if>
        <if test="endTime !=null and endTime != ''">
            , t.end_time= #{endTime}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        <if test="personType !=null and personType != ''">
            , t.person_type= #{personType}
        </if>
        where 1=1
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="authId !=null and authId != ''">
            and t.auth_id= #{authId}
        </if>
    </update>
    <!-- 查询设备权限数量 add by wuxw 2018-07-03 -->
     <select id="queryMachineAuthsCount" parameterType="Map" resultType="Map">
        select  count(1) count
from machine_auth t
where 1 =1
<if test="personName !=null and personName != ''">
   and t.person_name= #{personName}
</if>
<if test="machineId !=null and machineId != ''">
   and t.machine_id= #{machineId}
</if>
<if test="personId !=null and personId != ''">
   and t.person_id= #{personId}
</if>
<if test="startTime !=null and startTime != ''">
   and t.start_time= #{startTime}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="endTime !=null and endTime != ''">
   and t.end_time= #{endTime}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="personType !=null and personType != ''">
   and t.person_type= #{personType}
</if>
<if test="authId !=null and authId != ''">
   and t.auth_id= #{authId}
</if>
    <select id="queryMachineAuthsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from machine_auth t
        left join u_user u on t.person_id = u.user_id and u.status_cd = '0'
        left join machine m on t.machine_id = m.machine_id and m.status_cd = '0'
        where 1 = 1
        <if test="personName !=null and personName != ''">
            and t.person_name= #{personName}
        </if>
        <if test="machineId !=null and machineId != ''">
            and t.machine_id= #{machineId}
        </if>
        <if test="personId !=null and personId != ''">
            and t.person_id= #{personId}
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.start_time &lt;= #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.end_time &gt;= #{endTime}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="personType !=null and personType != ''">
            and t.person_type= #{personType}
        </if>
        <if test="authId !=null and authId != ''">
            and t.auth_id= #{authId}
        </if>
    </select>
     </select>
    <update id="deleteMachineAuth" parameterType="Map">
        update machine_auth t set t.status_cd = '1'
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="personName !=null and personName != ''">
            , t.person_name= #{personName}
        </if>
        <if test="machineId !=null and machineId != ''">
            , t.machine_id= #{machineId}
        </if>
        <if test="personId !=null and personId != ''">
            , t.person_id= #{personId}
        </if>
        <if test="startTime !=null and startTime != ''">
            , t.start_time= #{startTime}
        </if>
        <if test="state !=null and state != ''">
            , t.state= #{state}
        </if>
        <if test="endTime !=null and endTime != ''">
            , t.end_time= #{endTime}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        <if test="personType !=null and personType != ''">
            , t.person_type= #{personType}
        </if>
        where 1=1
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="authId !=null and authId != ''">
            and t.auth_id= #{authId}
        </if>
    </update>
</mapper>
java110-db/src/main/resources/mapper/common/MachineV1ServiceDaoImplMapper.xml
@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="machineV1ServiceDaoImpl">
    <!-- 保存设备信息信息 add by wuxw 2018-07-03 -->
    <insert id="saveMachineInfo" parameterType="Map">
        insert into machine(
heartbeat_time,machine_code,auth_code,location_type_cd,machine_version,machine_name,machine_mac,
machine_id,type_id,state,community_id,location_obj_id,machine_type_cd,machine_ip,direction,b_id
) values (
#{heartbeatTime},#{machineCode},#{authCode},#{locationTypeCd},#{machineVersion},#{machineName},#{machineMac},
#{machineId},#{typeId},#{state},#{communityId},#{locationObjId},#{machineTypeCd},#{machineIp},#{direction},#{bId}
)
        insert into machine(heartbeat_time, machine_code, auth_code, location_type_cd, machine_version, machine_name,
                            machine_mac,
                            machine_id, type_id, state, community_id, location_obj_id, machine_type_cd, machine_ip,
                            direction, b_id)
        values (#{heartbeatTime}, #{machineCode}, #{authCode}, #{locationTypeCd}, #{machineVersion}, #{machineName},
                #{machineMac},
                #{machineId}, #{typeId}, #{state}, #{communityId}, #{locationObjId}, #{machineTypeCd}, #{machineIp},
                #{direction}, #{bId})
    </insert>
    <!-- 查询设备信息信息 add by wuxw 2018-07-03 -->
    <select id="getMachineInfo" parameterType="Map" resultType="Map">
@@ -80,9 +78,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改设备信息信息 add by wuxw 2018-07-03 -->
    <update id="updateMachineInfo" parameterType="Map">
@@ -136,7 +132,6 @@
        <if test="machineId !=null and machineId != ''">
            and t.machine_id= #{machineId}
        </if>
    </update>
    <!-- 查询设备信息数量 add by wuxw 2018-07-03 -->
@@ -192,8 +187,5 @@
        <if test="direction !=null and direction != ''">
            and t.direction= #{direction}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/community/NoticeServiceDaoImplMapper.xml
@@ -217,6 +217,9 @@
        <if test="noticeId !=null and noticeId != ''">
            and t.notice_id= #{noticeId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/community/ParkingSpaceApplyV1ServiceDaoImplMapper.xml
@@ -25,13 +25,14 @@
        startTime,t.apply_person_id,t.apply_person_id applyPersonId,t.end_time,t.end_time
        endTime,t.state,t.community_id,t.community_id communityId,
        t1.num ,t1.pa_id paId,t3.name parkingTypeName,t4.name stateName,
        t2.car_id carId
        t2.car_id carId,par.num areaNum
        from parking_space_apply t
        left join parking_space t1 on t.ps_id = t1.ps_id  and t1.status_cd =0
        left join owner_car t2 on t.apply_person_id = t2.owner_id and t.community_id =t2.community_id  and t.car_num = t2.car_num and t2.status_cd =0
        left join t_dict t3 on t1.parking_type  = t3.status_cd and t3.table_name ='parking_space' and t3.table_columns ='parking_type'
        left join t_dict t4 on t1.state  = t4.status_cd and t4.table_name ='parking_space' and t4.table_columns ='state'
        where 1 =1
        left join parking_space t1 on t.ps_id = t1.ps_id and t1.status_cd = '0'
        left join parking_area par on t1.pa_id = par.pa_id and par.status_cd = '0'
        left join owner_car t2 on t.apply_person_id = t2.owner_id and t.community_id =t2.community_id and t.car_num = t2.car_num and t2.status_cd =0
        left join t_dict t3 on t1.parking_type = t3.status_cd and t3.table_name ='parking_space' and t3.table_columns ='parking_type'
        left join t_dict t4 on t1.state = t4.status_cd and t4.table_name ='parking_space' and t4.table_columns ='state'
        where 1 = 1
        <if test="carBrand !=null and carBrand != ''">
            and t.car_brand= #{carBrand}
        </if>
java110-db/src/main/resources/mapper/community/RepairServiceDaoImplMapper.xml
@@ -6,13 +6,14 @@
    <!-- 保存报修信息信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessRepairInfo" parameterType="Map">
        insert into business_repair_pool(
        operate,repair_name,appointment_time,repair_type,context,repair_id,tel,state,community_id,b_id,repair_obj_type,repair_obj_id,
        repair_obj_name, maintenance_type,repair_channel,repair_materials,repair_fee,pay_type
        ) values (
        #{operate},#{repairName},#{appointmentTime},#{repairType},#{context},#{repairId},#{tel},#{state},#{communityId},#{bId},
        #{repairObjType},#{repairObjId},#{repairObjName},#{maintenanceType},#{repairChannel},#{repairMaterials},#{repairFee},#{payType}
        )
        insert into business_repair_pool(operate, repair_name, appointment_time, repair_type, context, repair_id, tel,
                                         state, community_id, b_id, repair_obj_type, repair_obj_id,
                                         repair_obj_name, maintenance_type, repair_channel, repair_materials,
                                         repair_fee, pay_type)
        values (#{operate}, #{repairName}, #{appointmentTime}, #{repairType}, #{context}, #{repairId}, #{tel}, #{state},
                #{communityId}, #{bId},
                #{repairObjType}, #{repairObjId}, #{repairObjName}, #{maintenanceType}, #{repairChannel},
                #{repairMaterials}, #{repairFee}, #{payType})
    </insert>
    <!-- 查询报修信息信息(Business) add by wuxw 2018-07-03 -->
@@ -146,8 +147,10 @@
        from r_repair_pool t
        left join t_dict d on t.state = d.status_cd and d.table_name = 'r_repair_pool' and d.table_columns = 'state'
        left join r_repair_setting rs on rs.repair_type = t.repair_type and rs.status_cd = '0'
        left join t_dict d1 on rs.repair_setting_type = d1.status_cd and d1.table_name = 'r_repair_setting' and d1.table_columns = 'repair_setting_type'
        left join r_repair_return_visit rrv on t.repair_id = rrv.repair_id and rrv.community_id = t.community_id and rrv.status_cd = '0'
        left join t_dict d1 on rs.repair_setting_type = d1.status_cd and d1.table_name = 'r_repair_setting' and
        d1.table_columns = 'repair_setting_type'
        left join r_repair_return_visit rrv on t.repair_id = rrv.repair_id and rrv.community_id = t.community_id and
        rrv.status_cd = '0'
        left join appraise a on a.obj_id = t.repair_id and a.status_cd = '0'
        <if test="staffId != null and staffId != ''">
            ,r_repair_user rru
@@ -531,7 +534,7 @@
        left join t_dict td on rs.return_visit_flag = td.status_cd and td.table_name='r_repair_setting' and
        td.table_columns='return_visit_flag'
        where 1 =1
        and ru.state in ('10002','10003','10004','10005','10009','11000','12000')
        and ru.state in ('10002','10005','10009','11000','12000')
        <if test="staffId !=null and staffId != ''">
            and ru.staff_id = #{staffId}
        </if>
@@ -596,7 +599,7 @@
        left join t_dict td on rs.return_visit_flag = td.status_cd and td.table_name='r_repair_setting' and
        td.table_columns='return_visit_flag'
        where 1 =1
        and ru.state in ('10002','10003','10004','10005','10009','11000','12000')
        and ru.state in ('10002','10005','10009','11000','12000')
        <if test="staffId != null and staffId != ''">
            and ru.staff_id = #{staffId}
        </if>
java110-db/src/main/resources/mapper/fee/PayFeeAuditServiceDaoImplMapper.xml
@@ -1,33 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="payFeeAuditServiceDaoImpl">
    <!-- 保存缴费审核信息 add by wuxw 2018-07-03 -->
    <insert id="savePayFeeAuditInfo" parameterType="Map">
        insert into pay_fee_audit(
        audit_user_id,audit_user_name,fee_detail_id,state,message,community_id,fee_id,audit_id
        ) values (
        #{auditUserId},#{auditUserName},#{feeDetailId},#{state},#{message},#{communityId},#{feeId},#{auditId}
        )
        insert into pay_fee_audit(audit_user_id, audit_user_name, fee_detail_id, state, message, community_id, fee_id,
                                  audit_id)
        values (#{auditUserId}, #{auditUserName}, #{feeDetailId}, #{state}, #{message}, #{communityId}, #{feeId},
                #{auditId})
    </insert>
    <!-- 查询缴费审核信息 add by wuxw 2018-07-03 -->
    <select id="getPayFeeAuditInfo" parameterType="Map" resultType="Map">
        select pf.payer_obj_id payerObjId,pf.payer_obj_type payerObjType,pfc.fee_name feeName,
        pfd.cycles,pfd.start_time startTime,pfd.end_time endTime,pfd.receivable_amount receivableAmount,
        pfd.received_amount receivedAmount,pfd.create_time createTime,pfa.state,pfa.message,pfd.remark,
        pfa.audit_user_name auditUserName,pfd.b_id bId,pf.fee_id feeId,pf.community_id communityId,pfd.detail_id detailId
        pfa.audit_user_name auditUserName,pfd.b_id bId,pf.fee_id feeId,pf.community_id communityId,pfd.detail_id
        detailId
        from pay_fee_detail pfd
        INNER JOIN pay_fee pf on pf.fee_id = pfd.fee_id and pf.community_id = pfd.community_id and pf.status_cd = '0'
        inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and pfc.status_cd = '0'
        left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd = '0'
        inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and
        pfc.status_cd = '0'
        left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd =
        '0'
        where 1=1
        and pfd.community_id = #{communityId}
        and  pfd.status_cd = '0'
        and pfd.status_cd = '0'
        and pfd.state = '1400'
        <if test="roomId !=null and roomId != ''">
            and pf.payer_obj_id = #{roomId}
@@ -43,19 +42,17 @@
        <if test="payerObjType !=null and payerObjType != ''">
            and pf.payer_obj_type = #{payerObjType}
        </if>
        <if test="state !=null and state != '1010'">
            and  pfa.state = #{state}
        <if test="state != null and state != '' and state != '1010'">
            and pfa.state = #{state}
        </if>
        <if test="state !=null and state == '1010'">
        <if test="state != null and state != '' and state == '1010'">
            and pfa.state is null
        </if>
        ORDER BY pfd.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改缴费审核信息 add by wuxw 2018-07-03 -->
    <update id="updatePayFeeAuditInfo" parameterType="Map">
@@ -95,11 +92,13 @@
        select count(1) count
        from pay_fee_detail pfd
        INNER JOIN pay_fee pf on pf.fee_id = pfd.fee_id and pf.community_id = pfd.community_id and pf.status_cd = '0'
        inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and pfc.status_cd = '0'
        left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd = '0'
        inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and
        pfc.status_cd = '0'
        left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd =
        '0'
        where 1=1
        and pfd.community_id = #{communityId}
        and  pfd.status_cd = '0'
        and pfd.status_cd = '0'
        and pfd.state = '1400'
        <if test="roomId !=null and roomId != ''">
            and pf.payer_obj_id = #{roomId}
@@ -115,14 +114,11 @@
        <if test="payerObjType !=null and payerObjType != ''">
            and pf.payer_obj_type = #{payerObjType}
        </if>
        <if test="state !=null and state != '1010'">
            and  pfa.state = #{state}
        <if test="state != null and state != '' and state != '1010'">
            and pfa.state = #{state}
        </if>
        <if test="state !=null and state == '1010'">
        <if test="state != null and state != '' and state == '1010'">
            and pfa.state is null
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/fee/TempCarFeeConfigServiceDaoImplMapper.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="tempCarFeeConfigServiceDaoImpl">
@@ -12,7 +11,6 @@
        #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId},#{feeConfigId}
        )
    </insert>
    <!-- 查询临时车收费标准信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessTempCarFeeConfigInfo" parameterType="Map" resultType="Map">
@@ -55,9 +53,7 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </select>
    <!-- 保存临时车收费标准信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveTempCarFeeConfigInfoInstance" parameterType="Map">
@@ -97,9 +93,7 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </insert>
    <!-- 查询临时车收费标准信息 add by wuxw 2018-07-03 -->
    <select id="getTempCarFeeConfigInfo" parameterType="Map" resultType="Map">
@@ -109,8 +103,9 @@
        ruleId,t.community_id,t.community_id communityId,tcfr.rule_name ruleName,td.name carTypeName,t.fee_config_id,t.fee_config_id feeConfigId
        from temp_car_fee_config t
        left join temp_car_fee_rule tcfr on t.rule_id = tcfr.rule_id and tcfr.status_cd = '0'
        inner join pay_fee_config pfc on t.fee_config_id = pfc.config_id and pfc.status_cd = '0'
        left join t_dict td on t.car_type = td.status_cd and td.table_name = 'temp_car_fee_config' and td.table_columns = 'car_type'
        where 1 =1
        where 1 = 1
        <if test="carType !=null and carType != ''">
            and t.car_type= #{carType}
        </if>
@@ -151,9 +146,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改临时车收费标准信息 add by wuxw 2018-07-03 -->
    <update id="updateTempCarFeeConfigInfoInstance" parameterType="Map">
@@ -192,14 +185,16 @@
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
    </update>
    <!-- 查询临时车收费标准数量 add by wuxw 2018-07-03 -->
    <select id="queryTempCarFeeConfigsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from temp_car_fee_config t
        where 1 =1
        left join temp_car_fee_rule tcfr on t.rule_id = tcfr.rule_id and tcfr.status_cd = '0'
        inner join pay_fee_config pfc on t.fee_config_id = pfc.config_id and pfc.status_cd = '0'
        left join t_dict td on t.car_type = td.status_cd and td.table_name = 'temp_car_fee_config' and td.table_columns = 'car_type'
        where 1 = 1
        <if test="carType !=null and carType != ''">
            and t.car_type= #{carType}
        </if>
@@ -237,6 +232,7 @@
            and t.fee_config_id= #{feeConfigId}
        </if>
    </select>
    <!-- 查询临时车 收费规则 -->
    <select id="queryTempCarFeeRules" parameterType="Map" resultType="Map">
        select
@@ -252,8 +248,7 @@
    <!-- 查询临时车 收费规则 -->
    <select id="queryTempCarFeeRuleSpecs" parameterType="Map" resultType="Map">
        select t.rule_id ruleId,t.spec_id specId,t.spec_name specName,t.seq,t.remark
        from
        temp_car_fee_rule_spec t
        from temp_car_fee_rule_spec t
        where t.status_cd = '0'
        <if test="ruleId !=null and ruleId != ''">
            and t.rule_id= #{ruleId}
@@ -269,5 +264,4 @@
        </if>
        order by t.seq
    </select>
</mapper>
java110-db/src/main/resources/mapper/job/TaskServiceDaoImplMapper.xml
@@ -86,7 +86,7 @@
            and t.create_time= #{createTime}
        </if>
        <if test="taskName !=null and taskName != ''">
            and t.task_name= #{taskName}
            and t.task_name like '%${taskName}%'
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
@@ -101,7 +101,7 @@
            and t.template_id= #{templateId}
        </if>
        <if test="templateName != null and templateName != ''">
            and tt.template_name = #{templateName}
            and tt.template_name like '%${templateName}%'
        </if>
        <if test="taskId !=null and taskId != ''">
            and t.task_id= #{taskId}
@@ -152,7 +152,7 @@
            and t.create_time= #{createTime}
        </if>
        <if test="taskName !=null and taskName != ''">
            and t.task_name= #{taskName}
            and t.task_name like '%${taskName}%'
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
@@ -167,7 +167,7 @@
            and t.template_id= #{templateId}
        </if>
        <if test="templateName != null and templateName != ''">
            and tt.template_name = #{templateName}
            and tt.template_name like '%${templateName}%'
        </if>
        <if test="taskId !=null and taskId != ''">
            and t.task_id= #{taskId}
@@ -261,5 +261,4 @@
            and t.status_cd= #{statusCd}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml
@@ -206,6 +206,9 @@
        <if test="ownerName !=null and ownerName != ''">
            and bow.name like '%${ownerName}%'
        </if>
        <if test="link !=null and link != ''">
            and bow.link = #{link}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
@@ -369,6 +372,9 @@
        <if test="ownerName !=null and ownerName != ''">
            and bow.name like '%${ownerName}%'
        </if>
        <if test="link !=null and link != ''">
            and bow.link = #{link}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
java110-db/src/main/resources/mapper/user/StaffAppAuthServiceDaoImplMapper.xml
@@ -1,19 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="staffAppAuthServiceDaoImpl">
    <!-- 保存员工微信认证信息 add by wuxw 2018-07-03 -->
    <insert id="saveStaffAppAuthInfo" parameterType="Map">
        insert into staff_app_auth(
        au_id,app_type,open_id,state,store_id,open_name,staff_id
        ) values (
        #{auId},#{appType},#{openId},#{state},#{storeId},#{openName},#{staffId}
        )
        insert into staff_app_auth(au_id, app_type, open_id, state, store_id, open_name, staff_id)
        values (#{auId}, #{appType}, #{openId}, #{state}, #{storeId}, #{openName}, #{staffId})
    </insert>
    <!-- 查询员工微信认证信息 add by wuxw 2018-07-03 -->
    <select id="getStaffAppAuthInfo" parameterType="Map" resultType="Map">
@@ -50,14 +44,11 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改员工微信认证信息 add by wuxw 2018-07-03 -->
    <update id="updateStaffAppAuthInfo" parameterType="Map">
        update staff_app_auth t set t.status_cd = #{statusCd}
        <if test="openId !=null and openId != ''">
            , t.open_id= #{openId}
        </if>
@@ -66,6 +57,9 @@
        </if>
        <if test="openName !=null and openName != ''">
            , t.open_name= #{openName}
        </if>
        <if test="createTime !=null and createTime != ''">
            , t.create_time= #{createTime}
        </if>
        where 1=1
        <if test="auId !=null and auId != ''">
@@ -112,8 +106,5 @@
        <if test="staffId !=null and staffId != ''">
            and t.staff_id= #{staffId}
        </if>
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/common/IMachineAuthInnerServiceSMO.java
@@ -2,6 +2,7 @@
import com.java110.config.feign.FeignConfiguration;
import com.java110.dto.machineAuth.MachineAuthDto;
import com.java110.po.machineAuth.MachineAuthPo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -24,7 +25,6 @@
    /**
     * <p>查询小区楼信息</p>
     *
     *
     * @param machineAuthDto 数据对象分享
     * @return MachineAuthDto 对象数据
     */
@@ -39,4 +39,19 @@
     */
    @RequestMapping(value = "/queryMachineAuthsCount", method = RequestMethod.POST)
    int queryMachineAuthsCount(@RequestBody MachineAuthDto machineAuthDto);
    /**
     * 添加员工门禁授权
     *
     * @param machineAuthPo
     * @return
     */
    @RequestMapping(value = "/saveMachineAuth", method = RequestMethod.POST)
    int saveMachineAuth(@RequestBody MachineAuthPo machineAuthPo);
    @RequestMapping(value = "/updateMachineAuth", method = RequestMethod.POST)
    int updateMachineAuth(@RequestBody MachineAuthPo machineAuthPo);
    @RequestMapping(value = "/deleteMachineAuth", method = RequestMethod.POST)
    int deleteMachineAuth(@RequestBody MachineAuthPo machineAuthPo);
}
java110-interface/src/main/java/com/java110/intf/fee/IFeeConfigInnerServiceSMO.java
@@ -25,7 +25,6 @@
    /**
     * <p>查询小区楼信息</p>
     *
     *
     * @param feeConfigDto 数据对象分享
     * @return FeeConfigDto 对象数据
     */
@@ -43,9 +42,19 @@
    /**
     * 保存费用配置
     *
     * @param payFeeConfigPo 费用配置对象
     * @return
     */
    @RequestMapping(value = "/saveFeeConfig", method = RequestMethod.POST)
    int saveFeeConfig(@RequestBody PayFeeConfigPo payFeeConfigPo);
    /**
     * 删除费用项
     *
     * @param payFeeConfigPo
     * @return
     */
    @RequestMapping(value = "/deleteFeeConfig", method = RequestMethod.POST)
    int deleteFeeConfig(@RequestBody PayFeeConfigPo payFeeConfigPo);
}
java110-interface/src/main/java/com/java110/intf/order/IPrivilegeInnerServiceSMO.java
@@ -49,7 +49,4 @@
    @RequestMapping(value = "/queryPrivilegeUsers", method = RequestMethod.POST)
    List<UserDto> queryPrivilegeUsers(@RequestBody BasePrivilegeDto privilegeDto);
}
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
@@ -792,15 +792,16 @@
     * 11开头  3保存
     */
    public static final String BUSINESS_TYPE_SAVE_REPAIR_USER="130200030001";
    /**
     *  报修派单变更 11开头  4修改
     */
    public static final String BUSINESS_TYPE_UPDATE_REPAIR_USER="130200040001";
    /**
     *  作废报修派单信息  11开头  5修改
     */
    public static final String BUSINESS_TYPE_DELETE_REPAIR_USER ="130200050001";
    /**
     *  保存组织
service-acct/src/main/java/com/java110/acct/cmd/account/CancelAccountDetailCmd.java
@@ -23,7 +23,6 @@
    @Autowired
    private IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl;
    @Autowired
    private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
@@ -42,15 +41,15 @@
        accountDetailDto.setDetailType(AccountDetailDto.DETAIL_TYPE_IN);
        List<AccountDetailDto> accountDetailDtos = accountDetailInnerServiceSMOImpl.queryAccountDetails(accountDetailDto);
        Assert.listOnlyOne(accountDetailDtos,"入账明细不存在");
        Assert.listOnlyOne(accountDetailDtos, "入账明细不存在");
        AccountDetailPo accountDetailPo = new AccountDetailPo();
        accountDetailPo.setAcctId(accountDetailDtos.get(0).getAcctId());
        accountDetailPo.setObjId(accountDetailDtos.get(0).getObjId());
        accountDetailPo.setAmount(accountDetailDtos.get(0).getAmount());
        accountDetailPo.setRemark("明细:"+reqJson.getString("detailId")+"撤销,原因:"+reqJson.getString("remark"));
        accountDetailPo.setRemark("明细:" + reqJson.getString("detailId") + "撤销,原因:" + reqJson.getString("remark"));
        int flag = accountInnerServiceSMOImpl.withholdAccount(accountDetailPo);
        if(flag < 1){
        if (flag < 1) {
            throw new CmdException("撤销失败");
        }
@@ -58,7 +57,7 @@
        accountDetailPo1.setDetailId(accountDetailDtos.get(0).getDetailId());
        accountDetailPo1.setDetailType(AccountDetailDto.DETAIL_TYPE_IN_CANCEL);
        flag = accountDetailInnerServiceSMOImpl.updateAccountDetails(accountDetailPo1);
        if(flag < 1){
        if (flag < 1) {
            throw new CmdException("撤销失败");
        }
    }
service-common/src/main/java/com/java110/common/cmd/machineAuth/DeleteMachineAuth.java
New file
@@ -0,0 +1,46 @@
package com.java110.common.cmd.machineAuth;
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.dto.machineAuth.MachineAuthDto;
import com.java110.intf.common.IMachineAuthInnerServiceSMO;
import com.java110.po.machineAuth.MachineAuthPo;
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 java.text.ParseException;
import java.util.List;
@Java110Cmd(serviceCode = "machineAuth.deleteMachineAuth")
public class DeleteMachineAuth extends Cmd {
    @Autowired
    private IMachineAuthInnerServiceSMO machineAuthInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        Assert.jsonObjectHaveKey(reqJson, "authId", "请求报文中未包含授权ID");
        MachineAuthDto machineAuthDto = new MachineAuthDto();
        machineAuthDto.setAuthId(reqJson.getString("authId"));
        List<MachineAuthDto> machineAuthDtos = machineAuthInnerServiceSMOImpl.queryMachineAuths(machineAuthDto);
        Assert.listOnlyOne(machineAuthDtos, "查询员工门禁授权错误!");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        MachineAuthPo machineAuthPo = BeanConvertUtil.covertBean(reqJson, MachineAuthPo.class);
        int flag = machineAuthInnerServiceSMOImpl.deleteMachineAuth(machineAuthPo);
        if (flag < 1) {
            throw new CmdException("删除员工门禁授权失败");
        }
        context.setResponseEntity(ResultVo.success());
    }
}
service-common/src/main/java/com/java110/common/cmd/machineAuth/ListMachineAuths.java
New file
@@ -0,0 +1,54 @@
package com.java110.common.cmd.machineAuth;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.machineAuth.MachineAuthDto;
import com.java110.intf.common.IMachineAuthInnerServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.api.machineAuth.ApiMachineAuthDataVo;
import com.java110.vo.api.machineAuth.ApiMachineAuthVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
@Java110Cmd(serviceCode = "machineAuth.listMachineAuths")
public class ListMachineAuths extends Cmd {
    @Autowired
    private IMachineAuthInnerServiceSMO machineAuthInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        super.validatePageInfo(reqJson);
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含小区信息");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        MachineAuthDto machineAuthDto = BeanConvertUtil.covertBean(reqJson, MachineAuthDto.class);
        int count = machineAuthInnerServiceSMOImpl.queryMachineAuthsCount(machineAuthDto);
        List<ApiMachineAuthDataVo> machineAuths = null;
        if (count > 0) {
            machineAuths = BeanConvertUtil.covertBeanList(machineAuthInnerServiceSMOImpl.queryMachineAuths(machineAuthDto), ApiMachineAuthDataVo.class);
        } else {
            machineAuths = new ArrayList<>();
        }
        ApiMachineAuthVo apiMachineAuthVo = new ApiMachineAuthVo();
        apiMachineAuthVo.setTotal(count);
        apiMachineAuthVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
        apiMachineAuthVo.setMachineAuths(machineAuths);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiMachineAuthVo), HttpStatus.OK);
        context.setResponseEntity(responseEntity);
    }
}
service-common/src/main/java/com/java110/common/cmd/machineAuth/SaveMachineAuth.java
New file
@@ -0,0 +1,95 @@
package com.java110.common.cmd.machineAuth;
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.core.log.LoggerFactory;
import com.java110.dto.machineAuth.MachineAuthDto;
import com.java110.dto.user.UserDto;
import com.java110.intf.common.IMachineAuthInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.po.machineAuth.MachineAuthPo;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
 * 添加员工门禁授权
 *
 * @author fqz
 * @date 2022-10-29
 */
@Java110Cmd(serviceCode = "machineAuth.saveMachineAuth")
public class SaveMachineAuth extends Cmd {
    @Autowired
    private IMachineAuthInnerServiceSMO machineAuthInnerServiceSMOImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    private static Logger logger = LoggerFactory.getLogger(SaveMachineAuth.class);
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含小区信息");
        Assert.jsonObjectHaveKey(reqJson, "startTime", "请求报文中未包含开始时间");
        Assert.jsonObjectHaveKey(reqJson, "endTime", "请求报文中未包含结束时间");
        Assert.jsonObjectHaveKey(reqJson, "personId", "请求报文中未包含员工ID");
        Assert.jsonObjectHaveKey(reqJson, "machineId", "请求报文中未包含设备ID");
        MachineAuthDto machineAuthDto = new MachineAuthDto();
        machineAuthDto.setMachineId(reqJson.getString("machineId"));
        machineAuthDto.setPersonId(reqJson.getString("personId"));
        List<MachineAuthDto> machineAuthDtos = machineAuthInnerServiceSMOImpl.queryMachineAuths(machineAuthDto);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (machineAuthDtos != null && machineAuthDtos.size() > 0) {
            for (MachineAuthDto machineAuth : machineAuthDtos) {
                //获取结束时间
                Date endTime = simpleDateFormat.parse(machineAuth.getEndTime());
                //开始时间
                Date newStartTime = simpleDateFormat.parse(reqJson.getString("startTime"));
                int i = newStartTime.compareTo(endTime);
                if (i < 0) { //上次结束时间大于本次开始时间
                    throw new IllegalArgumentException("该时间段内该员工已经授权过该设备,无法再次进行授权!");
                }
            }
        }
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        MachineAuthPo machineAuthPo = BeanConvertUtil.covertBean(reqJson, MachineAuthPo.class);
        if (!StringUtil.isEmpty(reqJson.getString("personId"))) {
            UserDto userDto = new UserDto();
            userDto.setUserId(reqJson.getString("personId"));
            List<UserDto> users = userInnerServiceSMOImpl.getUsers(userDto);
            Assert.listOnlyOne(users, "查询用户错误!");
            machineAuthPo.setPersonName(users.get(0).getName());
        } else {
            machineAuthPo.setPersonName("-1");
        }
        machineAuthPo.setAuthId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_authId));
        machineAuthPo.setPersonType("1001"); //员工
        machineAuthPo.setState("10301"); //待审核 10301  审核通过 10302  审核不通过 10303
        machineAuthPo.setbId("-1");
        int flag = machineAuthInnerServiceSMOImpl.saveMachineAuth(machineAuthPo);
        if (flag < 1) {
            throw new CmdException("添加员工门禁授权失败");
        }
        context.setResponseEntity(ResultVo.success());
    }
}
service-common/src/main/java/com/java110/common/cmd/machineAuth/UpdateMachineAuth.java
New file
@@ -0,0 +1,90 @@
package com.java110.common.cmd.machineAuth;
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.log.LoggerFactory;
import com.java110.dto.machineAuth.MachineAuthDto;
import com.java110.dto.user.UserDto;
import com.java110.intf.common.IMachineAuthInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.po.machineAuth.MachineAuthPo;
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.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
 * 修改员工门禁授权
 *
 * @author fqz
 * @date 2022-10-29
 */
@Java110Cmd(serviceCode = "machineAuth.updateMachineAuth")
public class UpdateMachineAuth extends Cmd {
    @Autowired
    private IMachineAuthInnerServiceSMO machineAuthInnerServiceSMOImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    private static Logger logger = LoggerFactory.getLogger(UpdateMachineAuth.class);
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        Assert.jsonObjectHaveKey(reqJson, "authId", "请求报文中未包含授权ID");
        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含小区信息");
        Assert.jsonObjectHaveKey(reqJson, "startTime", "请求报文中未包含开始时间");
        Assert.jsonObjectHaveKey(reqJson, "endTime", "请求报文中未包含结束时间");
        Assert.jsonObjectHaveKey(reqJson, "personId", "请求报文中未包含员工ID");
        Assert.jsonObjectHaveKey(reqJson, "machineId", "请求报文中未包含设备ID");
        MachineAuthDto machineAuthDto = new MachineAuthDto();
        machineAuthDto.setMachineId(reqJson.getString("machineId"));
        machineAuthDto.setPersonId(reqJson.getString("personId"));
        List<MachineAuthDto> machineAuthDtos = machineAuthInnerServiceSMOImpl.queryMachineAuths(machineAuthDto);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (machineAuthDtos != null && machineAuthDtos.size() > 0) {
            for (MachineAuthDto machineAuth : machineAuthDtos) {
                if (machineAuth.getAuthId().equals(reqJson.getString("authId"))) {
                    continue;
                } else {
                    //获取结束时间
                    Date endTime = simpleDateFormat.parse(machineAuth.getEndTime());
                    //开始时间
                    Date newStartTime = simpleDateFormat.parse(reqJson.getString("startTime"));
                    int i = newStartTime.compareTo(endTime);
                    if (i < 0) { //上次结束时间大于本次开始时间
                        throw new IllegalArgumentException("该时间段内该员工已经授权过该设备,无法再次进行授权!");
                    }
                }
            }
        }
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        MachineAuthPo machineAuthPo = BeanConvertUtil.covertBean(reqJson, MachineAuthPo.class);
        UserDto userDto = new UserDto();
        userDto.setUserId(reqJson.getString("personId"));
        List<UserDto> users = userInnerServiceSMOImpl.getUsers(userDto);
        Assert.listOnlyOne(users, "查询员工错误!");
        machineAuthPo.setPersonName(users.get(0).getName());
        int flag = machineAuthInnerServiceSMOImpl.updateMachineAuth(machineAuthPo);
        if (flag < 1) {
            throw new CmdException("修改员工门禁授权失败");
        }
        context.setResponseEntity(ResultVo.success());
    }
}
service-common/src/main/java/com/java110/common/dao/IMachineAuthServiceDao.java
@@ -1,12 +1,6 @@
package com.java110.common.dao;
import com.java110.utils.exception.DAOException;
import com.java110.entity.merchant.BoMerchant;
import com.java110.entity.merchant.BoMerchantAttr;
import com.java110.entity.merchant.Merchant;
import com.java110.entity.merchant.MerchantAttr;
import java.util.List;
import java.util.Map;
@@ -15,60 +9,54 @@
 * 设备权限组件内部之间使用,没有给外围系统提供服务能力
 * 设备权限服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 *
 * <p>
 * Created by wuxw on 2016/12/27.
 */
public interface IMachineAuthServiceDao {
    /**
     * 保存 设备权限信息
     *
     * @param businessMachineAuthInfo 设备权限信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveBusinessMachineAuthInfo(Map businessMachineAuthInfo) throws DAOException;
    /**
     * 查询设备权限信息(business过程)
     * 根据bId 查询设备权限信息
     *
     * @param info bId 信息
     * @return 设备权限信息
     * @throws DAOException DAO异常
     */
    List<Map> getBusinessMachineAuthInfo(Map info) throws DAOException;
    /**
     * 保存 设备权限信息 Business数据到 Instance中
     *
     * @param info
     * @throws DAOException DAO异常
     */
    void saveMachineAuthInfoInstance(Map info) throws DAOException;
    int saveMachineAuthInfoInstance(Map info) throws DAOException;
    /**
     * 查询设备权限信息(instance过程)
     * 根据bId 查询设备权限信息
     *
     * @param info bId 信息
     * @return 设备权限信息
     * @throws DAOException DAO异常
     */
    List<Map> getMachineAuthInfo(Map info) throws DAOException;
    /**
     * 修改设备权限信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    void updateMachineAuthInfoInstance(Map info) throws DAOException;
    int updateMachineAuthInfoInstance(Map info) throws DAOException;
    /**
     * 查询设备权限总数
@@ -78,4 +66,20 @@
     */
    int queryMachineAuthsCount(Map info);
    /**
     * 添加员工门禁授权
     *
     * @param info
     * @return
     */
    int saveMachineAuth(Map info);
    /**
     * 删除员工门禁授权
     *
     * @param info
     * @return
     */
    int deleteMachineAuth(Map info);
}
service-common/src/main/java/com/java110/common/dao/impl/MachineAuthServiceDaoImpl.java
@@ -9,7 +9,6 @@
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@@ -26,6 +25,7 @@
    /**
     * 设备权限信息封装
     *
     * @param businessMachineAuthInfo 设备权限信息 封装
     * @throws DAOException DAO异常
     */
@@ -33,17 +33,18 @@
    public void saveBusinessMachineAuthInfo(Map businessMachineAuthInfo) throws DAOException {
        businessMachineAuthInfo.put("month", DateUtil.getCurrentMonth());
        // 查询business_user 数据是否已经存在
        logger.debug("保存设备权限信息 入参 businessMachineAuthInfo : {}",businessMachineAuthInfo);
        int saveFlag = sqlSessionTemplate.insert("machineAuthServiceDaoImpl.saveBusinessMachineAuthInfo",businessMachineAuthInfo);
        logger.debug("保存设备权限信息 入参 businessMachineAuthInfo : {}", businessMachineAuthInfo);
        int saveFlag = sqlSessionTemplate.insert("machineAuthServiceDaoImpl.saveBusinessMachineAuthInfo", businessMachineAuthInfo);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存设备权限数据失败:"+ JSONObject.toJSONString(businessMachineAuthInfo));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存设备权限数据失败:" + JSONObject.toJSONString(businessMachineAuthInfo));
        }
    }
    /**
     * 查询设备权限信息
     *
     * @param info bId 信息
     * @return 设备权限信息
     * @throws DAOException DAO异常
@@ -51,43 +52,45 @@
    @Override
    public List<Map> getBusinessMachineAuthInfo(Map info) throws DAOException {
        logger.debug("查询设备权限信息 入参 info : {}",info);
        logger.debug("查询设备权限信息 入参 info : {}", info);
        List<Map> businessMachineAuthInfos = sqlSessionTemplate.selectList("machineAuthServiceDaoImpl.getBusinessMachineAuthInfo",info);
        List<Map> businessMachineAuthInfos = sqlSessionTemplate.selectList("machineAuthServiceDaoImpl.getBusinessMachineAuthInfo", info);
        return businessMachineAuthInfos;
    }
    /**
     * 保存设备权限信息 到 instance
     * @param info   bId 信息
     *
     * @param info bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public void saveMachineAuthInfoInstance(Map info) throws DAOException {
        logger.debug("保存设备权限信息Instance 入参 info : {}",info);
    public int saveMachineAuthInfoInstance(Map info) throws DAOException {
        logger.debug("保存设备权限信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.insert("machineAuthServiceDaoImpl.saveMachineAuthInfoInstance",info);
        int saveFlag = sqlSessionTemplate.insert("machineAuthServiceDaoImpl.saveMachineAuthInfoInstance", info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存设备权限信息Instance数据失败:"+ JSONObject.toJSONString(info));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存设备权限信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
        return saveFlag;
    }
    /**
     * 查询设备权限信息(instance)
     *
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getMachineAuthInfo(Map info) throws DAOException {
        logger.debug("查询设备权限信息 入参 info : {}",info);
        logger.debug("查询设备权限信息 入参 info : {}", info);
        List<Map> businessMachineAuthInfos = sqlSessionTemplate.selectList("machineAuthServiceDaoImpl.getMachineAuthInfo",info);
        List<Map> businessMachineAuthInfos = sqlSessionTemplate.selectList("machineAuthServiceDaoImpl.getMachineAuthInfo", info);
        return businessMachineAuthInfos;
    }
@@ -95,28 +98,31 @@
    /**
     * 修改设备权限信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public void updateMachineAuthInfoInstance(Map info) throws DAOException {
        logger.debug("修改设备权限信息Instance 入参 info : {}",info);
    public int updateMachineAuthInfoInstance(Map info) throws DAOException {
        logger.debug("修改设备权限信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.update("machineAuthServiceDaoImpl.updateMachineAuthInfoInstance",info);
        int saveFlag = sqlSessionTemplate.update("machineAuthServiceDaoImpl.updateMachineAuthInfoInstance", info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改设备权限信息Instance数据失败:"+ JSONObject.toJSONString(info));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改设备权限信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
        return saveFlag;
    }
     /**
    /**
     * 查询设备权限数量
     *
     * @param info 设备权限信息
     * @return 设备权限数量
     */
    @Override
    public int queryMachineAuthsCount(Map info) {
        logger.debug("查询设备权限数据 入参 info : {}",info);
        logger.debug("查询设备权限数据 入参 info : {}", info);
        List<Map> businessMachineAuthInfos = sqlSessionTemplate.selectList("machineAuthServiceDaoImpl.queryMachineAuthsCount", info);
        if (businessMachineAuthInfos.size() < 1) {
@@ -126,5 +132,25 @@
        return Integer.parseInt(businessMachineAuthInfos.get(0).get("count").toString());
    }
    @Override
    public int saveMachineAuth(Map info) {
        logger.debug("保存员工门禁授权信息 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.insert("machineAuthServiceDaoImpl.saveMachineAuth", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存员工门禁授权数据失败:" + JSONObject.toJSONString(info));
        }
        return saveFlag;
    }
    @Override
    public int deleteMachineAuth(Map info) {
        logger.debug("保存员工门禁授权信息 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.delete("machineAuthServiceDaoImpl.deleteMachineAuth", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "删除员工门禁授权数据失败:" + JSONObject.toJSONString(info));
        }
        return saveFlag;
    }
}
service-common/src/main/java/com/java110/common/smo/impl/MachineAuthInnerServiceSMOImpl.java
@@ -1,10 +1,10 @@
package com.java110.common.smo.impl;
import com.java110.common.dao.IMachineAuthServiceDao;
import com.java110.dto.machineAuth.MachineAuthDto;
import com.java110.intf.common.IMachineAuthInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.po.machineAuth.MachineAuthPo;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.dto.user.UserDto;
@@ -34,7 +34,7 @@
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    @Override
    public List<MachineAuthDto> queryMachineAuths(@RequestBody  MachineAuthDto machineAuthDto) {
    public List<MachineAuthDto> queryMachineAuths(@RequestBody MachineAuthDto machineAuthDto) {
        //校验是否传了 分页信息
@@ -64,7 +64,7 @@
     * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
     *
     * @param machineAuth 小区设备权限信息
     * @param users 用户列表
     * @param users       用户列表
     */
    private void refreshMachineAuth(MachineAuthDto machineAuth, List<UserDto> users) {
        for (UserDto user : users) {
@@ -80,7 +80,7 @@
     * @param machineAuths 小区楼信息
     * @return 批量userIds 信息
     */
     private String[] getUserIds(List<MachineAuthDto> machineAuths) {
    private String[] getUserIds(List<MachineAuthDto> machineAuths) {
        List<String> userIds = new ArrayList<String>();
        for (MachineAuthDto machineAuth : machineAuths) {
            userIds.add(machineAuth.getAuthId());
@@ -91,7 +91,23 @@
    @Override
    public int queryMachineAuthsCount(@RequestBody MachineAuthDto machineAuthDto) {
        return machineAuthServiceDaoImpl.queryMachineAuthsCount(BeanConvertUtil.beanCovertMap(machineAuthDto));    }
        return machineAuthServiceDaoImpl.queryMachineAuthsCount(BeanConvertUtil.beanCovertMap(machineAuthDto));
    }
    @Override
    public int saveMachineAuth(@RequestBody MachineAuthPo machineAuthPo) {
        return machineAuthServiceDaoImpl.saveMachineAuth(BeanConvertUtil.beanCovertMap(machineAuthPo));
    }
    @Override
    public int updateMachineAuth(@RequestBody MachineAuthPo machineAuthPo) {
        return machineAuthServiceDaoImpl.updateMachineAuthInfoInstance(BeanConvertUtil.beanCovertMap(machineAuthPo));
    }
    @Override
    public int deleteMachineAuth(@RequestBody MachineAuthPo machineAuthPo) {
        return machineAuthServiceDaoImpl.deleteMachineAuth(BeanConvertUtil.beanCovertMap(machineAuthPo));
    }
    public IMachineAuthServiceDao getMachineAuthServiceDaoImpl() {
        return machineAuthServiceDaoImpl;
service-community/src/main/java/com/java110/community/cmd/ownerRepair/GrabbingRepairCmd.java
@@ -2,6 +2,7 @@
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;
@@ -68,6 +69,7 @@
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        String userId = context.getReqHeaders().get("user-id");
        Assert.hasLength(userId, "员工不存在");
service-community/src/main/java/com/java110/community/cmd/ownerRepair/ListStaffRepairsCmd.java
@@ -27,7 +27,6 @@
@Java110Cmd(serviceCode = "ownerRepair.listStaffRepairs")
public class ListStaffRepairsCmd extends Cmd {
    @Autowired
    private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
@@ -48,9 +47,10 @@
    /**
     * 报修待办
     * @param event              事件对象
     *
     * @param event   事件对象
     * @param context 数据上文对象
     * @param reqJson            请求报文
     * @param reqJson 请求报文
     * @throws CmdException
     * @throws ParseException
     */
@@ -61,10 +61,10 @@
        String userId = reqJson.getString("userId");
        String viewListStaffRepairs = CommunitySettingFactory.getValue(reqJson.getString("communityId"), VIEW_LIST_STAFF_REPAIRS);
        if (StringUtil.isEmpty(viewListStaffRepairs)) {
            viewListStaffRepairs = MappingCache.getValue(DOMAIN_COMMON,VIEW_LIST_STAFF_REPAIRS);
            viewListStaffRepairs = MappingCache.getValue(DOMAIN_COMMON, VIEW_LIST_STAFF_REPAIRS);
        }
        List<Map> privileges = null;
        if("ON".equals(viewListStaffRepairs)) {//是否让管理员看到所有工单
        if ("ON".equals(viewListStaffRepairs)) {//是否让管理员看到所有工单
            //报修待办查看所有记录权限
            BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
            basePrivilegeDto.setResource("/viewListStaffRepairs");
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java
@@ -89,19 +89,16 @@
        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
        Assert.hasKeyAndValue(reqJson, "action", "未包含处理动作");
        if(!reqJson.containsKey("userId")){
            reqJson.put("userId",context.getReqHeaders().get("user-id"));
        if (!reqJson.containsKey("userId")) {
            reqJson.put("userId", context.getReqHeaders().get("user-id"));
        }
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        RepairUserPo repairUserPo = BeanConvertUtil.covertBean(reqJson, RepairUserPo.class);
//        RepairUserPo repairUserPo = BeanConvertUtil.covertBean(reqJson, RepairUserPo.class);
        String action = reqJson.getString("action");
        switch (action) {
            case ACTION_DISPATCH:
                dispacthRepair(context, reqJson);
@@ -123,7 +120,6 @@
        List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
        Assert.listOnlyOne(repairDtos, "当前用户没有需要处理订单或存在多条");
        int flag = 0;
        //待评价
        if (RepairDto.STATE_APPRAISE.equals(repairDtos.get(0).getState())) {
            FeeAttrDto feeAttrDto = new FeeAttrDto();
@@ -142,7 +138,6 @@
                    context.setResponseEntity(responseEntity);
                    return;
                }
                PayFeePo payFeePo = new PayFeePo();
                payFeePo.setCommunityId(feeDtos.get(0).getCommunityId());
                payFeePo.setFeeId(feeDtos.get(0).getFeeId());
@@ -160,60 +155,49 @@
//                if (flag < 1) {
//                    throw new CmdException("删除费用失败");
//                }
            }
            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK);
            context.setResponseEntity(responseEntity);
        }
        String userId = reqJson.getString("userId");
        String userName = reqJson.getString("userName");
        RepairUserDto repairUserDto = new RepairUserDto();
        repairUserDto.setRepairId(reqJson.getString("repairId"));
        repairUserDto.setCommunityId(reqJson.getString("communityId"));
        repairUserDto.setState(RepairUserDto.STATE_DOING);
        repairUserDto.setStaffId(userId);
        repairUserDto.setStaffId(reqJson.getString("userId"));
        List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto);
        if (repairUserDtos != null && repairUserDtos.size() != 1) {
            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "当前用户没有需要处理订单!");
            context.setResponseEntity(responseEntity);
            return;
        }
        String ruId = repairUserDtos.get(0).getRuId();
        RepairUserPo repairUserPo = new RepairUserPo();
        repairUserPo.setRuId(repairUserDtos.get(0).getRuId());
        repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        repairUserPo.setState(RepairUserDto.STATE_BACK);
        repairUserPo.setContext(reqJson.getString("context"));
        repairUserPo.setCommunityId(reqJson.getString("communityId"));
//        String ruId = repairUserDtos.get(0).getRuId();
//        RepairUserPo repairUserPo = new RepairUserPo();
//        repairUserPo.setRuId(repairUserDtos.get(0).getRuId());
//        repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
//        repairUserPo.setState(RepairUserDto.STATE_BACK);
//        repairUserPo.setContext(reqJson.getString("context"));
//        repairUserInnerServiceSMOImpl.updateRepairUser(repairUserPo);
        //处理人信息
        repairUserPo = new RepairUserPo();
        repairUserPo.setRuId("-1");
        repairUserPo.setState(RepairUserDto.STATE_DOING);
        repairUserPo.setRepairId(reqJson.getString("repairId"));
        repairUserPo.setStaffId(reqJson.getString("staffId"));
        repairUserPo.setStaffName(reqJson.getString("staffName"));
        repairUserPo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        repairUserDto = new RepairUserDto();
        repairUserDto.setRepairId(reqJson.getString("repairId"));
        repairUserDto.setStaffId(reqJson.getString("staffId"));
        repairUserDto.setCommunityId(reqJson.getString("communityId"));
        repairUserDto.setRuId(repairUserDtos.get(0).getPreRuId());
        repairUserDto.setStates(new String[]{RepairUserDto.STATE_TRANSFER, RepairUserDto.STATE_CLOSE, RepairUserDto.STATE_STOP});
        repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto);
        if (repairUserDtos == null || repairUserDtos.size() < 1) {
//        repairUserPo = new RepairUserPo();
//        repairUserPo.setRuId("-1");
//        repairUserPo.setState(RepairUserDto.STATE_DOING);
//        repairUserPo.setRepairId(reqJson.getString("repairId"));
//        repairUserPo.setStaffId(reqJson.getString("staffId"));
//        repairUserPo.setStaffName(reqJson.getString("staffName"));
        RepairUserDto repair = new RepairUserDto();
        repair.setRepairId(reqJson.getString("repairId"));
        repair.setStaffId(reqJson.getString("staffId"));
        repair.setCommunityId(reqJson.getString("communityId"));
//        repair.setRuId(repairUserDtos.get(0).getPreRuId());
        repair.setStates(new String[]{RepairUserDto.STATE_TRANSFER, RepairUserDto.STATE_CLOSE, RepairUserDto.STATE_STOP});
        List<RepairUserDto> repairUsers = repairUserInnerServiceSMOImpl.queryRepairUsers(repair);
        if (repairUsers == null || repairUsers.size() < 1) { //指派的不能退单
            if (RepairDto.REPAIR_WAY_GRABBING.equals(repairDtos.get(0).getRepairWay())
                    || RepairDto.REPAIR_WAY_TRAINING.equals(repairDtos.get(0).getRepairWay())
            ) {
                    || RepairDto.REPAIR_WAY_TRAINING.equals(repairDtos.get(0).getRepairWay())) {
                modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_WAIT);//维修单变成未派单
                //把自己改成退单
                RepairUserPo repairUser = new RepairUserPo();
                repairUser.setRuId(ruId);
                repairUser.setRuId(repairUserDtos.get(0).getRuId());
                repairUser.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
                repairUser.setState(RepairUserDto.STATE_BACK);
                repairUser.setContext(reqJson.getString("context"));
@@ -229,24 +213,32 @@
                return;
            }
        }
        //把自己改成退单
        RepairUserPo repairUser = new RepairUserPo();
        repairUser.setRuId(ruId);
        repairUser.setRuId(repairUserDtos.get(0).getRuId());
        repairUser.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        repairUser.setState(RepairUserDto.STATE_BACK);
        repairUser.setContext(reqJson.getString("context"));
        repairUser.setCommunityId(reqJson.getString("communityId"));
        flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
        flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUser);
        if (flag < 1) {
            throw new CmdException("修改用户失败");
        }
        repairUserPo.setPreStaffId(repairUserDtos.get(0).getPreStaffId());
        repairUserPo.setPreStaffName(repairUserDtos.get(0).getPreStaffName());
        repairUserPo.setPreRuId(repairUserDtos.get(0).getPreRuId());
        repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_AUDIT_USER);
        repairUserPo.setContext("");
        RepairUserPo repairUserPo = new RepairUserPo();
        repairUserPo.setRuId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ruId));
        repairUserPo.setRepairId(reqJson.getString("repairId"));
        repairUserPo.setbId("-1");
        repairUserPo.setCommunityId(reqJson.getString("communityId"));
        repairUserPo.setCreateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        repairUserPo.setState(RepairUserDto.STATE_DOING);
        repairUserPo.setContext("");
        repairUserPo.setStaffId(repairUserDtos.get(0).getPreStaffId());
        repairUserPo.setStaffName(repairUserDtos.get(0).getPreStaffName());
        repairUserPo.setPreStaffId(repairUserDtos.get(0).getStaffId());
        repairUserPo.setPreStaffName(repairUserDtos.get(0).getStaffName());
        repairUserPo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_AUDIT_USER);
        repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId());
        flag = repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
        if (flag < 1) {
            throw new CmdException("修改用户失败");
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairForceFinishCmd.java
@@ -3,27 +3,24 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.annotation.Java110Transactional;
import com.java110.core.context.DataFlowContext;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.repair.RepairDto;
import com.java110.dto.repair.RepairUserDto;
import com.java110.intf.common.IFileInnerServiceSMO;
import com.java110.dto.user.UserDto;
import com.java110.intf.community.IRepairInnerServiceSMO;
import com.java110.intf.community.IRepairPoolV1InnerServiceSMO;
import com.java110.intf.community.IRepairUserInnerServiceSMO;
import com.java110.intf.community.IRepairUserV1InnerServiceSMO;
import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
import com.java110.intf.user.IOwnerInnerServiceSMO;
import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.po.owner.RepairPoolPo;
import com.java110.po.owner.RepairUserPo;
import com.java110.utils.constant.BusinessTypeConstant;
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.springframework.http.ResponseEntity;
@@ -41,22 +38,13 @@
    private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
    @Autowired
    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
    @Autowired
    private IFileInnerServiceSMO fileInnerServiceSMOImpl;
    @Autowired
    private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMO;
    @Autowired
    private IOwnerInnerServiceSMO ownerInnerServiceSMO;
    @Autowired
    private IRepairPoolV1InnerServiceSMO repairPoolV1InnerServiceSMOImpl;
    @Autowired
    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
@@ -69,7 +57,16 @@
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        String userId = context.getReqHeaders().get("user-id");
        String userName = context.getReqHeaders().get("user-name");
        String userName = "";
        if (!StringUtil.isEmpty(context.getReqHeaders().get("user-name"))) {
            userName = context.getReqHeaders().get("user-name");
        } else {
            UserDto userDto = new UserDto();
            userDto.setUserId(userId);
            List<UserDto> users = userInnerServiceSMOImpl.getUsers(userDto);
            Assert.listOnlyOne(users, "查询用户错误!");
            userName = users.get(0).getName();
        }
        int flag = 0;
@@ -100,7 +97,7 @@
            repairUserPo.setContext(userName + " 强制回单");
            repairUserPo.setCommunityId(reqJson.getString("communityId"));
            flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
            if(flag < 1){
            if (flag < 1) {
                throw new CmdException("修改工单失败");
            }
@@ -119,7 +116,7 @@
            repairUserPo.setContext(reqJson.getString("context"));
            repairUserPo.setCommunityId(reqJson.getString("communityId"));
            flag = repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
            if(flag < 1){
            if (flag < 1) {
                throw new CmdException("修改工单失败");
            }
        }
@@ -143,7 +140,7 @@
        //计算 应收金额
        RepairPoolPo repairPoolPo = BeanConvertUtil.covertBean(businessOwnerRepair, RepairPoolPo.class);
        int flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
        if(flag < 1){
        if (flag < 1) {
            throw new CmdException("修改工单失败");
        }
    }
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/AuditParkingSpaceApplyCmd.java
@@ -49,7 +49,6 @@
import java.util.List;
/**
 * 类表述:更新
 * 服务编码:parkingSpaceApply.updateParkingSpaceApply
@@ -66,14 +65,19 @@
    private static Logger logger = LoggerFactory.getLogger(AuditParkingSpaceApplyCmd.class);
    public static final String CODE_PREFIX_ID = "10";
    @Autowired
    private IParkingSpaceApplyV1InnerServiceSMO parkingSpaceApplyV1InnerServiceSMOImpl;
    @Autowired
    private IOwnerCarV1InnerServiceSMO ownerCarV1InnerServiceSMOImpl;
    @Autowired
    private IPayFeeV1InnerServiceSMO payFeeNewV1InnerServiceSMOImpl;
    @Autowired
    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
    @Autowired
    private ICommunityMemberV1InnerServiceSMO communityMemberV1InnerServiceSMOImpl;
@@ -83,7 +87,6 @@
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
    }
    @Override
@@ -91,7 +94,6 @@
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        String userId = cmdDataFlowContext.getReqHeaders().get(CommonConstant.USER_ID);
        ParkingSpaceApplyPo parkingSpaceApplyPo = BeanConvertUtil.covertBean(reqJson, ParkingSpaceApplyPo.class);
        //审核失败
        if (ParkingSpaceApplyDto.STATE_FAIL.equals(parkingSpaceApplyPo.getState())) {
            parkingSpaceApplyPo.setPsId("");
@@ -102,26 +104,20 @@
            }
            return;
        }
        PayFeePo payFeePo = new PayFeePo();
        payFeePo.setFeeId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
        parkingSpaceApplyPo.setFeeId(payFeePo.getFeeId());
        int flag = parkingSpaceApplyV1InnerServiceSMOImpl.updateParkingSpaceApply(parkingSpaceApplyPo);
        if (flag < 1) {
            throw new CmdException("更新数据失败");
        }
        ParkingSpaceApplyDto parkingSpaceApplyDto = new ParkingSpaceApplyDto();
        parkingSpaceApplyDto.setApplyId(parkingSpaceApplyPo.getApplyId());
        List<ParkingSpaceApplyDto> parkingSpaceApplyDtos = parkingSpaceApplyV1InnerServiceSMOImpl.queryParkingSpaceApplys(parkingSpaceApplyDto);
        if (parkingSpaceApplyDtos == null || parkingSpaceApplyDtos.size() < 1) {
            throw new CmdException("未查询到申请单,请联系管理员");
        }
        ParkingSpaceApplyDto parkingSpaceApply = parkingSpaceApplyDtos.get(0);
        //2、审核的时,判断车辆是否在owner_car中有,有就跳过。  没有的话写入owner_car,--都要写入pay_fee。
        OwnerCarDto ownerCarDto = new OwnerCarDto();
        ownerCarDto.setCarNum(parkingSpaceApplyPo.getCarNum());
@@ -156,7 +152,6 @@
        } else {
            catId = ownerCarDtos.get(0).getCarId();
        }
        // 将车位状态 修改为已出租状态
        ParkingSpacePo parkingSpacePo = new ParkingSpacePo();
        parkingSpacePo.setPsId(parkingSpaceApply.getPsId());
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/DeleteParkingSpaceApplyCmd.java
@@ -21,15 +21,22 @@
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.parking.ParkingSpaceDto;
import com.java110.intf.community.IParkingSpaceApplyV1InnerServiceSMO;
import com.java110.intf.community.IParkingSpaceV1InnerServiceSMO;
import com.java110.po.parking.ParkingSpacePo;
import com.java110.po.parkingSpaceApply.ParkingSpaceApplyPo;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import java.util.List;
/**
 * 类表述:删除
 * 服务编码:parkingSpaceApply.deleteParkingSpaceApply
@@ -42,29 +49,44 @@
 */
@Java110Cmd(serviceCode = "parkingSpaceApply.deleteParkingSpaceApply")
public class DeleteParkingSpaceApplyCmd extends Cmd {
  private static Logger logger = LoggerFactory.getLogger(DeleteParkingSpaceApplyCmd.class);
    private static Logger logger = LoggerFactory.getLogger(DeleteParkingSpaceApplyCmd.class);
    @Autowired
    private IParkingSpaceApplyV1InnerServiceSMO parkingSpaceApplyV1InnerServiceSMOImpl;
    @Autowired
    private IParkingSpaceV1InnerServiceSMO parkingSpaceV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
       ParkingSpaceApplyPo parkingSpaceApplyPo = BeanConvertUtil.covertBean(reqJson, ParkingSpaceApplyPo.class);
        ParkingSpaceApplyPo parkingSpaceApplyPo = BeanConvertUtil.covertBean(reqJson, ParkingSpaceApplyPo.class);
        int flag = parkingSpaceApplyV1InnerServiceSMOImpl.deleteParkingSpaceApply(parkingSpaceApplyPo);
        if (flag < 1) {
            throw new CmdException("删除数据失败");
        }
        if (!StringUtil.isEmpty(reqJson.getString("state")) && (reqJson.getString("state").equals("2002")
                || reqJson.getString("state").equals("3003"))) { //审核通过待缴费状态或完成状态
            if (!StringUtil.isEmpty(reqJson.getString("psId"))) {
                ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
                parkingSpaceDto.setPsId(reqJson.getString("psId"));
                List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceV1InnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto);
                Assert.listOnlyOne(parkingSpaceDtos, "查询车位失败");
                ParkingSpacePo parkingSpacePo = new ParkingSpacePo();
                parkingSpacePo.setPsId(parkingSpaceDtos.get(0).getPsId());
                parkingSpacePo.setState("F"); //出售 S,出租 H ,空闲 F
                int i = parkingSpaceV1InnerServiceSMOImpl.updateParkingSpace(parkingSpacePo);
                if (i < 1) {
                    throw new CmdException("更新数据失败");
                }
            }
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-community/src/main/java/com/java110/community/cmd/visit/SaveVisitCmd.java
@@ -2,6 +2,7 @@
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;
@@ -87,6 +88,7 @@
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        String userId = context.getReqHeaders().get("user-id");
        reqJson.put("vId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_vId));
service-community/src/main/java/com/java110/community/cmd/visit/UpdateVisitCmd.java
@@ -2,6 +2,7 @@
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;
@@ -66,6 +67,7 @@
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        String userId = context.getReqHeaders().get("user-id");
        //是否有空闲车位
service-dev/src/main/java/com/java110/dev/cmd/task/ListTasksCmd.java
@@ -21,7 +21,6 @@
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.taskAttr.TaskAttrDto;
import com.java110.intf.dev.ITaskV1InnerServiceSMO;
import com.java110.intf.job.ITaskAttrInnerServiceSMO;
import com.java110.intf.job.ITaskInnerServiceSMO;
import com.java110.utils.exception.CmdException;
@@ -29,13 +28,14 @@
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import com.java110.dto.task.TaskDto;
import java.util.List;
import java.util.ArrayList;
import org.springframework.http.ResponseEntity;
import org.springframework.http.HttpStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:查询
@@ -50,7 +50,7 @@
@Java110Cmd(serviceCode = "task.listTasks")
public class ListTasksCmd extends Cmd {
  private static Logger logger = LoggerFactory.getLogger(ListTasksCmd.class);
    private static Logger logger = LoggerFactory.getLogger(ListTasksCmd.class);
    @Autowired
    private ITaskInnerServiceSMO taskInnerServiceSMOImpl;
@@ -65,25 +65,17 @@
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        TaskDto taskDto = BeanConvertUtil.covertBean(reqJson, TaskDto.class);
        int count = taskInnerServiceSMOImpl.queryTasksCount(taskDto);
        List<TaskDto> taskDtos = null;
        if (count > 0) {
            taskDtos = taskInnerServiceSMOImpl.queryTasks(taskDto);
            freshTaskAttr(taskDtos);
        } else {
            taskDtos = new ArrayList<>();
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, taskDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        cmdDataFlowContext.setResponseEntity(responseEntity);
    }
@@ -93,14 +85,11 @@
     * @param taskDtos
     */
    private void freshTaskAttr(List<TaskDto> taskDtos) {
        for (TaskDto taskDto : taskDtos) {
            TaskAttrDto taskAttrDto = new TaskAttrDto();
            taskAttrDto.setTaskId(taskDto.getTaskId());
            List<TaskAttrDto> taskAttrDtos = taskAttrInnerServiceSMOImpl.queryTaskAttrs(taskAttrDto);
            taskDto.setTaskAttr(taskAttrDtos);
        }
    }
}
service-fee/src/main/java/com/java110/fee/bmo/fee/impl/FeeBMOImpl.java
@@ -347,7 +347,7 @@
        if (!FeeDto.FEE_FLAG_CYCLE.equals(feeInfo.getFeeFlag())) {
            maxEndTime = feeInfo.getDeadlineTime();
        }
        if(maxEndTime != null) { //这里数据问题的情况下
        if (maxEndTime != null) { //这里数据问题的情况下
            Date endTime = DateUtil.getDateFromStringA(paramInJson.getString("endTime"));
            if (endTime.getTime() >= maxEndTime.getTime()) {
                feeMap.put("state", FeeDto.STATE_FINISH);
@@ -414,11 +414,13 @@
        PayFeeDetailPo payFeeDetail = BeanConvertUtil.covertBean(businessFeeDetail, PayFeeDetailPo.class);
        payFeeDetail.setbId("-1");
        if (StringUtil.isEmpty(payFeeDetail.getPayableAmount())) {
            payFeeDetail.setPayableAmount("0.0");
        }
        int flag = payFeeDetailNewV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetail);
        if (flag < 1) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "保存费用明细失败");
        }
        return businessFeeDetail;
    }
service-fee/src/main/java/com/java110/fee/bmo/payFeeAudit/impl/GetPayFeeAuditBMOImpl.java
@@ -46,33 +46,24 @@
     * @return 订单服务能够接受的报文
     */
    public ResponseEntity<String> get(PayFeeAuditDto payFeeAuditDto) {
        if (!refreshRoomPayObjId(payFeeAuditDto)) {
            ResponseEntity<String> responseEntity = new ResponseEntity<String>("[]", HttpStatus.OK);
            return responseEntity;
        }
        if (!refreshCarPayObjId(payFeeAuditDto)) {
            ResponseEntity<String> responseEntity = new ResponseEntity<String>("[]", HttpStatus.OK);
            return responseEntity;
        }
        int count = payFeeAuditInnerServiceSMOImpl.queryPayFeeAuditsCount(payFeeAuditDto);
        List<PayFeeAuditDto> payFeeAuditDtos = null;
        if (count > 0) {
            payFeeAuditDtos = payFeeAuditInnerServiceSMOImpl.queryPayFeeAudits(payFeeAuditDto);
            frashRoomAndStaff(payFeeAuditDtos);
        } else {
            payFeeAuditDtos = new ArrayList<>();
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) payFeeAuditDto.getRow()), count, payFeeAuditDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        return responseEntity;
    }
@@ -162,7 +153,7 @@
        for (PayFeeAuditDto payFeeAuditDto : payFeeAuditDtos) {
            for (OrderDto orderDto : orderDtos) {
                if(StringUtil.isEmpty(payFeeAuditDto.getbId())){
                if (StringUtil.isEmpty(payFeeAuditDto.getbId())) {
                    continue;
                }
                if (payFeeAuditDto.getbId().equals(orderDto.getbId())) {
@@ -171,8 +162,6 @@
                }
            }
        }
    }
}
service-fee/src/main/java/com/java110/fee/cmd/fee/DeleteTempCarFeeConfigCmd.java
@@ -7,8 +7,10 @@
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
import com.java110.intf.fee.ITempCarFeeConfigAttrV1InnerServiceSMO;
import com.java110.intf.fee.ITempCarFeeConfigV1InnerServiceSMO;
import com.java110.po.fee.PayFeeConfigPo;
import com.java110.po.tempCarFeeConfig.TempCarFeeConfigPo;
import com.java110.po.tempCarFeeConfigAttr.TempCarFeeConfigAttrPo;
import com.java110.utils.exception.CmdException;
@@ -26,6 +28,9 @@
    @Autowired
    private ITempCarFeeConfigAttrV1InnerServiceSMO tempCarFeeConfigAttrV1InnerServiceSMOImpl;
    @Autowired
    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        Assert.hasKeyAndValue(reqJson, "configId", "configId不能为空");
@@ -37,29 +42,32 @@
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        TempCarFeeConfigPo tempCarFeeConfigPo = BeanConvertUtil.covertBean(reqJson, TempCarFeeConfigPo.class);
        int flag = tempCarFeeConfigV1InnerServiceSMOImpl.deleteTempCarFeeConfig(tempCarFeeConfigPo);
        if (flag < 1) {
            throw new CmdException("删除临时车费失败");
        }
        JSONArray attrs = reqJson.getJSONArray("tempCarFeeConfigAttrs");
        if (attrs == null || attrs.size() < 1) {
            return;
        if (attrs != null && attrs.size() > 0) {
            JSONObject attr = null;
            for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) {
                attr = attrs.getJSONObject(attrIndex);
                attr.put("ruleId", reqJson.getString("ruleId"));
                attr.put("communityId", reqJson.getString("communityId"));
                if (!attr.containsKey("attrId") || attr.getString("attrId").startsWith("-") || StringUtil.isEmpty(attr.getString("attrId"))) {
                    continue;
                }
                TempCarFeeConfigAttrPo tempCarFeeConfigAttrPo = BeanConvertUtil.covertBean(attr, TempCarFeeConfigAttrPo.class);
                flag = tempCarFeeConfigAttrV1InnerServiceSMOImpl.deleteTempCarFeeConfigAttr(tempCarFeeConfigAttrPo);
                if (flag < 1) {
                    throw new CmdException("删除临时车费失败");
                }
            }
        }
        JSONObject attr = null;
        for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) {
            attr = attrs.getJSONObject(attrIndex);
            attr.put("ruleId", reqJson.getString("ruleId"));
            attr.put("communityId", reqJson.getString("communityId"));
            if (!attr.containsKey("attrId") || attr.getString("attrId").startsWith("-") || StringUtil.isEmpty(attr.getString("attrId"))) {
                continue;
            }
            TempCarFeeConfigAttrPo tempCarFeeConfigAttrPo = BeanConvertUtil.covertBean(attr, TempCarFeeConfigAttrPo.class);
            flag = tempCarFeeConfigAttrV1InnerServiceSMOImpl.deleteTempCarFeeConfigAttr(tempCarFeeConfigAttrPo);
            if (flag < 1) {
                throw new CmdException("删除临时车费失败");
            }
        PayFeeConfigPo payFeeConfigPo = new PayFeeConfigPo();
        payFeeConfigPo.setConfigId(reqJson.getString("feeConfigId"));
        payFeeConfigPo.setStatusCd("1");
        int i = feeConfigInnerServiceSMOImpl.deleteFeeConfig(payFeeConfigPo);
        if (i < 1) {
            throw new CmdException("删除费用项失败");
        }
    }
}
service-fee/src/main/java/com/java110/fee/cmd/fee/SaveTempCarFeeConfigCmd.java
@@ -64,16 +64,12 @@
        reqJson.put("feeConfigId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId));
        reqJson.put("configId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId));
        TempCarFeeConfigPo tempCarFeeConfigPo = BeanConvertUtil.covertBean(reqJson, TempCarFeeConfigPo.class);
        //处理房屋属性
        dealAttr(reqJson, context);
        int flag = tempCarFeeConfigV1InnerServiceSMOImpl.saveTempCarFeeConfig(tempCarFeeConfigPo);
        if (flag < 1) {
            throw new CmdException("保存临时收费失败");
        }
        //补费用项数据
        PayFeeConfigPo payFeeConfigPo = new PayFeeConfigPo();
        payFeeConfigPo.setAdditionalAmount("0");
@@ -96,21 +92,16 @@
        if (flag < 1) {
            throw new CmdException("保存临时收费失败");
        }
    }
    private void dealAttr(JSONObject reqJson, ICmdDataFlowContext context) {
        if (!reqJson.containsKey("attrs")) {
            return;
        }
        JSONArray attrs = reqJson.getJSONArray("attrs");
        if (attrs == null || attrs.size() < 1) {
            return;
        }
        JSONObject attr = null;
        int flag = 0;
        for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) {
@@ -124,6 +115,5 @@
                throw new CmdException("保存临时收费失败");
            }
        }
    }
}
service-fee/src/main/java/com/java110/fee/cmd/fee/UpdateTempCarFeeConfigCmd.java
@@ -55,22 +55,21 @@
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        FeeConfigDto feeConfigDto = new FeeConfigDto();
        feeConfigDto.setConfigId(reqJson.getString("feeConfigId"));
        List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
        Assert.listOnlyOne(feeConfigDtos, "查询费用项错误!");
        TempCarFeeConfigDto tempCarFeeConfigDto = new TempCarFeeConfigDto();
        tempCarFeeConfigDto.setConfigId(reqJson.getString("configId"));
        tempCarFeeConfigDto.setCommunityId(reqJson.getString("communityId"));
        List<TempCarFeeConfigDto> tempCarFeeConfigDtos = tempCarFeeConfigInnerServiceSMOImpl.queryTempCarFeeConfigs(tempCarFeeConfigDto);
        Assert.listOnlyOne(tempCarFeeConfigDtos, "临时车收费标准不存在");
        TempCarFeeConfigPo tempCarFeeConfigPo = BeanConvertUtil.covertBean(reqJson, TempCarFeeConfigPo.class);
        updateAttr(reqJson);
        int flag = tempCarFeeConfigV1InnerServiceSMOImpl.updateTempCarFeeConfig(tempCarFeeConfigPo);
        if (flag < 1) {
            throw new CmdException("修改临时车费用配置失败");
        }
        //补费用项数据
        PayFeeConfigPo payFeeConfigPo = new PayFeeConfigPo();
        payFeeConfigPo.setCommunityId(reqJson.getString("communityId"));
@@ -79,18 +78,14 @@
        payFeeConfigPo.setStartTime(reqJson.getString("startTime"));
        payFeeConfigPo.setFeeName(reqJson.getString("feeName"));
        updateFeeConfig(BeanConvertUtil.beanCovertJson(payFeeConfigPo), context);
    }
    private void updateAttr(JSONObject reqJson) {
        int flag;JSONArray attrs = reqJson.getJSONArray("attrs");
        int flag;
        JSONArray attrs = reqJson.getJSONArray("attrs");
        if (attrs == null || attrs.size() < 1) {
            return;
        }
        JSONObject attr = null;
        for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) {
            attr = attrs.getJSONObject(attrIndex);
service-fee/src/main/java/com/java110/fee/cmd/returnPayFee/UpdateReturnPayFeeCmd.java
@@ -15,6 +15,7 @@
 */
package com.java110.fee.cmd.returnPayFee;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.annotation.Java110Transactional;
@@ -22,15 +23,26 @@
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.RoomDto;
import com.java110.dto.account.AccountDto;
import com.java110.dto.fee.FeeDetailDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.feeDiscount.FeeDiscountDto;
import com.java110.dto.feeDiscount.FeeDiscountRuleDto;
import com.java110.dto.feeDiscount.FeeDiscountSpecDto;
import com.java110.dto.owner.OwnerCarDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.dto.payFeeConfigDiscount.PayFeeConfigDiscountDto;
import com.java110.dto.payFeeDetailDiscount.PayFeeDetailDiscountDto;
import com.java110.dto.returnPayFee.ReturnPayFeeDto;
import com.java110.intf.acct.IAccountDetailInnerServiceSMO;
import com.java110.intf.acct.IAccountInnerServiceSMO;
import com.java110.intf.community.IRoomInnerServiceSMO;
import com.java110.intf.fee.*;
import com.java110.intf.user.IOwnerCarInnerServiceSMO;
import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
import com.java110.po.account.AccountPo;
import com.java110.po.accountDetail.AccountDetailPo;
import com.java110.po.fee.PayFeeDetailPo;
import com.java110.po.fee.PayFeePo;
import com.java110.po.payFeeDetailDiscount.PayFeeDetailDiscountPo;
@@ -100,6 +112,18 @@
    @Autowired
    private IPayFeeDetailDiscountNewV1InnerServiceSMO payFeeDetailDiscountNewV1InnerServiceSMOImpl;
    @Autowired
    private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl;
    @Autowired
    private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
    @Autowired
    private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
    @Autowired
    private IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl;
    private static final String SPEC_RATE = "89002020980015"; //赠送月份
@@ -256,6 +280,61 @@
                }
            }
            //检查是否现金账户抵扣
            String feeAccountDetailDtoList = reqJson.getString("feeAccountDetailDtoList");
            JSONArray feeAccountDetails = JSONArray.parseArray(feeAccountDetailDtoList);
            if (feeAccountDetails != null && feeAccountDetails.size() > 0) {
                String ownerId = "";
                if (!StringUtil.isEmpty(reqJson.getString("payerObjType")) && reqJson.getString("payerObjType").equals("3333")) { //房屋
                    OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
                    ownerRoomRelDto.setRoomId(reqJson.getString("payerObjId"));
                    List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
                    Assert.listOnlyOne(ownerRoomRelDtos, "查询业主房屋关系表错误!");
                    ownerId = ownerRoomRelDtos.get(0).getOwnerId();
                } else if (!StringUtil.isEmpty(reqJson.getString("payerObjType")) && reqJson.getString("payerObjType").equals("6666")) { //车辆
                    OwnerCarDto ownerCarDto = new OwnerCarDto();
                    ownerCarDto.setCarId(reqJson.getString("payerObjId"));
                    List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
                    Assert.listOnlyOne(ownerCarDtos, "查询业主车辆错误!");
                    ownerId = ownerCarDtos.get(0).getOwnerId();
                }
                for (int index = 0; index < feeAccountDetails.size(); index++) {
                    JSONObject param = feeAccountDetails.getJSONObject(index);
                    String state = param.getString("state");
                    if (!StringUtil.isEmpty(param.getString("state")) && param.getString("state").equals("1002")) { //1001 无抵扣 1002 现金账户抵扣 1003 积分账户抵扣 1004 优惠券抵扣
                        AccountDto accountDto = new AccountDto();
                        accountDto.setObjId(ownerId);
                        accountDto.setAcctType(AccountDto.ACCT_TYPE_CASH); //2003  现金账户
                        List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto);
                        Assert.listOnlyOne(accountDtos, "查询业主现金账户错误!");
                        BigDecimal amount = new BigDecimal(accountDtos.get(0).getAmount());
                        BigDecimal money = new BigDecimal(param.getString("amount"));
                        BigDecimal newAmount = amount.add(money);
                        AccountPo accountPo = new AccountPo();
                        accountPo.setAcctId(accountDtos.get(0).getAcctId());
                        accountPo.setAmount(String.valueOf(newAmount));
                        int flag = accountInnerServiceSMOImpl.updateAccount(accountPo);
                        if (flag < 1) {
                            throw new IllegalArgumentException("更新业主现金账户失败!");
                        }
                        AccountDetailPo accountDetailPo = new AccountDetailPo();
                        accountDetailPo.setDetailId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId));
                        accountDetailPo.setAcctId(accountDtos.get(0).getAcctId());
                        accountDetailPo.setDetailType("1001"); //1001 转入 2002 转出
                        accountDetailPo.setRelAcctId("-1");
                        accountDetailPo.setAmount(param.getString("amount"));
                        accountDetailPo.setObjType("6006"); //6006 个人 7007 商户
                        accountDetailPo.setObjId(ownerId);
                        accountDetailPo.setOrderId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
                        accountDetailPo.setbId("-1");
                        accountDetailPo.setRemark("现金账户退费");
                        accountDetailPo.setCreateTime(new Date());
                        int i = accountDetailInnerServiceSMOImpl.saveAccountDetails(accountDetailPo);
                        if (i < 1) {
                            throw new IllegalArgumentException("保存业主现金账户明细失败!");
                        }
                    }
                }
            }
        }
        //不通过
        if ("1200".equals(reqJson.getString("state"))) {
service-fee/src/main/java/com/java110/fee/dao/IFeeConfigServiceDao.java
@@ -1,8 +1,6 @@
package com.java110.fee.dao;
import com.java110.utils.exception.DAOException;
import java.util.List;
import java.util.Map;
@@ -11,23 +9,24 @@
 * 费用配置组件内部之间使用,没有给外围系统提供服务能力
 * 费用配置服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 *
 * <p>
 * Created by wuxw on 2016/12/27.
 */
public interface IFeeConfigServiceDao {
    /**
     * 保存 费用配置信息
     *
     * @param businessFeeConfigInfo 费用配置信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveBusinessFeeConfigInfo(Map businessFeeConfigInfo) throws DAOException;
    /**
     * 查询费用配置信息(business过程)
     * 根据bId 查询费用配置信息
     *
     * @param info bId 信息
     * @return 费用配置信息
     * @throws DAOException DAO异常
@@ -35,21 +34,19 @@
    List<Map> getBusinessFeeConfigInfo(Map info) throws DAOException;
    /**
     * 保存 费用配置信息 Business数据到 Instance中
     *
     * @param info
     * @throws DAOException DAO异常
     */
    void saveFeeConfigInfoInstance(Map info) throws DAOException;
    /**
     * 查询费用配置信息(instance过程)
     * 根据bId 查询费用配置信息
     *
     * @param info bId 信息
     * @return 费用配置信息
     * @throws DAOException DAO异常
@@ -57,9 +54,9 @@
    List<Map> getFeeConfigInfo(Map info) throws DAOException;
    /**
     * 修改费用配置信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
@@ -77,9 +74,18 @@
    /**
     * 保存费用配置
     *
     * @param info
     * @return
     */
    int saveFeeConfig(Map info);
    /**
     * 删除费用配置
     *
     * @param info
     * @return
     */
    int deleteFeeConfig(Map info);
}
service-fee/src/main/java/com/java110/fee/dao/impl/FeeConfigServiceDaoImpl.java
@@ -25,6 +25,7 @@
    /**
     * 费用配置信息封装
     *
     * @param businessFeeConfigInfo 费用配置信息 封装
     * @throws DAOException DAO异常
     */
@@ -32,106 +33,105 @@
    public void saveBusinessFeeConfigInfo(Map businessFeeConfigInfo) throws DAOException {
        businessFeeConfigInfo.put("month", DateUtil.getCurrentMonth());
        // 查询business_user 数据是否已经存在
        logger.debug("保存费用配置信息 入参 businessFeeConfigInfo : {}",businessFeeConfigInfo);
        int saveFlag = sqlSessionTemplate.insert("feeConfigServiceDaoImpl.saveBusinessFeeConfigInfo",businessFeeConfigInfo);
        logger.debug("保存费用配置信息 入参 businessFeeConfigInfo : {}", businessFeeConfigInfo);
        int saveFlag = sqlSessionTemplate.insert("feeConfigServiceDaoImpl.saveBusinessFeeConfigInfo", businessFeeConfigInfo);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存费用配置数据失败:"+ JSONObject.toJSONString(businessFeeConfigInfo));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存费用配置数据失败:" + JSONObject.toJSONString(businessFeeConfigInfo));
        }
    }
    /**
     * 查询费用配置信息
     *
     * @param info bId 信息
     * @return 费用配置信息
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getBusinessFeeConfigInfo(Map info) throws DAOException {
        logger.debug("查询费用配置信息 入参 info : {}",info);
        List<Map> businessFeeConfigInfos = sqlSessionTemplate.selectList("feeConfigServiceDaoImpl.getBusinessFeeConfigInfo",info);
        logger.debug("查询费用配置信息 入参 info : {}", info);
        List<Map> businessFeeConfigInfos = sqlSessionTemplate.selectList("feeConfigServiceDaoImpl.getBusinessFeeConfigInfo", info);
        return businessFeeConfigInfos;
    }
    /**
     * 保存费用配置信息 到 instance
     * @param info   bId 信息
     *
     * @param info bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public void saveFeeConfigInfoInstance(Map info) throws DAOException {
        logger.debug("保存费用配置信息Instance 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.insert("feeConfigServiceDaoImpl.saveFeeConfigInfoInstance",info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存费用配置信息Instance数据失败:"+ JSONObject.toJSONString(info));
        logger.debug("保存费用配置信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.insert("feeConfigServiceDaoImpl.saveFeeConfigInfoInstance", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存费用配置信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询费用配置信息(instance)
     *
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getFeeConfigInfo(Map info) throws DAOException {
        logger.debug("查询费用配置信息 入参 info : {}",info);
        List<Map> businessFeeConfigInfos = sqlSessionTemplate.selectList("feeConfigServiceDaoImpl.getFeeConfigInfo",info);
        logger.debug("查询费用配置信息 入参 info : {}", info);
        List<Map> businessFeeConfigInfos = sqlSessionTemplate.selectList("feeConfigServiceDaoImpl.getFeeConfigInfo", info);
        return businessFeeConfigInfos;
    }
    /**
     * 修改费用配置信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public void updateFeeConfigInfoInstance(Map info) throws DAOException {
        logger.debug("修改费用配置信息Instance 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.update("feeConfigServiceDaoImpl.updateFeeConfigInfoInstance",info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改费用配置信息Instance数据失败:"+ JSONObject.toJSONString(info));
        logger.debug("修改费用配置信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.update("feeConfigServiceDaoImpl.updateFeeConfigInfoInstance", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改费用配置信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
    }
     /**
    /**
     * 查询费用配置数量
     *
     * @param info 费用配置信息
     * @return 费用配置数量
     */
    @Override
    public int queryFeeConfigsCount(Map info) {
        logger.debug("查询费用配置数据 入参 info : {}",info);
        logger.debug("查询费用配置数据 入参 info : {}", info);
        List<Map> businessFeeConfigInfos = sqlSessionTemplate.selectList("feeConfigServiceDaoImpl.queryFeeConfigsCount", info);
        if (businessFeeConfigInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessFeeConfigInfos.get(0).get("count").toString());
    }
    @Override
    public int saveFeeConfig(Map info) {
        logger.debug("保存费用配置saveFeeConfig : {}",info);
        int saveFlag = sqlSessionTemplate.update("feeConfigServiceDaoImpl.saveFeeConfig",info);
        logger.debug("保存费用配置saveFeeConfig : {}", info);
        int saveFlag = sqlSessionTemplate.update("feeConfigServiceDaoImpl.saveFeeConfig", info);
        return saveFlag;
    }
    @Override
    public int deleteFeeConfig(Map info) {
        logger.debug("删除费用配置deleteFeeConfig : {}", info);
        int deleteFlag = sqlSessionTemplate.update("feeConfigServiceDaoImpl.updateFeeConfigInfoInstance", info);
        if (deleteFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "删除费用配置信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
        return deleteFlag;
    }
}
service-fee/src/main/java/com/java110/fee/smo/impl/FeeConfigInnerServiceSMOImpl.java
@@ -1,6 +1,5 @@
package com.java110.fee.smo.impl;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.dto.PageDto;
import com.java110.dto.fee.FeeConfigDto;
@@ -34,21 +33,14 @@
    @Override
    public List<FeeConfigDto> queryFeeConfigs(@RequestBody FeeConfigDto feeConfigDto) {
        //校验是否传了 分页信息
        int page = feeConfigDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            feeConfigDto.setPage((page - 1) * feeConfigDto.getRow());
        }
        List<FeeConfigDto> feeConfigs = BeanConvertUtil.covertBeanList(feeConfigServiceDaoImpl.getFeeConfigInfo(BeanConvertUtil.beanCovertMap(feeConfigDto)), FeeConfigDto.class);
        return feeConfigs;
    }
    @Override
    public int queryFeeConfigsCount(@RequestBody FeeConfigDto feeConfigDto) {
@@ -60,6 +52,11 @@
        return feeConfigServiceDaoImpl.saveFeeConfig(BeanConvertUtil.beanCovertMap(payFeeConfigPo));
    }
    @Override
    public int deleteFeeConfig(@RequestBody PayFeeConfigPo payFeeConfigPo) {
        return feeConfigServiceDaoImpl.deleteFeeConfig(BeanConvertUtil.beanCovertMap(payFeeConfigPo));
    }
    public IFeeConfigServiceDao getFeeConfigServiceDaoImpl() {
        return feeConfigServiceDaoImpl;
    }
service-job/src/main/java/com/java110/job/adapt/Repair/MachineAddOwnerRepairAdapt.java
@@ -23,7 +23,6 @@
import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
import com.java110.job.adapt.DatabusAdaptImpl;
import com.java110.po.car.OwnerCarPo;
import com.java110.po.owner.RepairPoolPo;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.util.Assert;
@@ -35,6 +34,7 @@
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
/**
@@ -74,13 +74,11 @@
    @Override
    public void execute(Business business, List<Business> businesses) {
        JSONObject data = business.getData();
        JSONArray businessOwnerRepairs = new JSONArray();
        System.out.println("收到日志:>>>>>>>>>>>>>"+data.toJSONString());
        System.out.println("收到日志:>>>>>>>>>>>>>" + data.toJSONString());
        if (data.containsKey(RepairPoolPo.class.getSimpleName())) {
            Object bObj = data.get(RepairPoolPo.class.getSimpleName());
            if (bObj instanceof JSONObject) {
                businessOwnerRepairs.add(bObj);
            } else if (bObj instanceof List) {
@@ -88,27 +86,22 @@
            } else {
                businessOwnerRepairs = (JSONArray) bObj;
            }
        } else {
            if (data instanceof JSONObject) {
                businessOwnerRepairs.add(data);
            }
        }
        //JSONObject businessOwnerCar = data.getJSONObject("businessOwnerCar");
        for (int bOwnerRepairIndex = 0; bOwnerRepairIndex < businessOwnerRepairs.size(); bOwnerRepairIndex++) {
            JSONObject businessOwnerRepair = businessOwnerRepairs.getJSONObject(bOwnerRepairIndex);
            doDealOwnerRepair(business, businessOwnerRepair);
        }
    }
    private void doDealOwnerRepair(Business business, JSONObject businessOwnerRepair) {
        RepairDto repairDto = new RepairDto();
        repairDto.setRepairId(businessOwnerRepair.getString("repairId"));
        repairDto.setStatusCd("0");
//        repairDto.setStatusCd("0");
        List<RepairDto> repairDtos = repairInnerServiceSMO.queryRepairs(repairDto);
        //获取报修类型
        String repairTypeName = repairDtos.get(0).getRepairTypeName();
@@ -180,7 +173,12 @@
        basePrivilegeDto.setCommunityId(communityMemberDtos.get(0).getCommunityId());
        List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto);
        String url = sendMsgUrl + accessToken;
        List<String> userIds = new ArrayList<>();
        for (UserDto userDto : userDtos) {
            if (userIds.contains(userDto.getUserId())) {
                continue;
            }
            userIds.add(userDto.getUserId());
            //根据 userId 查询到openId
            StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
            staffAppAuthDto.setStaffId(userDto.getUserId());
service-job/src/main/java/com/java110/job/adapt/Repair/MachineDistributeLeaflets.java
@@ -29,7 +29,6 @@
import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.job.adapt.DatabusAdaptImpl;
import com.java110.po.owner.RepairPoolPo;
import com.java110.po.owner.RepairUserPo;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.util.ImageUtils;
@@ -90,13 +89,11 @@
    @Override
    public void execute(Business business, List<Business> businesses) {
        JSONObject data = business.getData();
        JSONArray businessRepairUsers = new JSONArray();
        System.out.println("收到日志:>>>>>>>>>>>>>"+data.toJSONString());
        System.out.println("收到日志:>>>>>>>>>>>>>" + data.toJSONString());
        if (data.containsKey(RepairUserPo.class.getSimpleName())) {
            Object bObj = data.get(RepairUserPo.class.getSimpleName());
            if (bObj instanceof JSONObject) {
                businessRepairUsers.add(bObj);
            } else if (bObj instanceof List) {
@@ -104,36 +101,28 @@
            } else {
                businessRepairUsers = (JSONArray) bObj;
            }
        } else {
            if (data instanceof JSONObject) {
                businessRepairUsers.add(data);
            }
        }
        //JSONObject businessOwnerCar = data.getJSONObject("businessOwnerCar");
        for (int bOwnerRepairIndex = 0; bOwnerRepairIndex < businessRepairUsers.size(); bOwnerRepairIndex++) {
            JSONObject businessRepairUser = businessRepairUsers.getJSONObject(bOwnerRepairIndex);
            doDealOwnerRepair(business, businessRepairUser);
            doDealOwnerRepair(businesses, businessRepairUser);
        }
    }
    private void doDealOwnerRepair(Business business, JSONObject businessRepairUser) {
    private void doDealOwnerRepair(List<Business> businesses, JSONObject businessRepairUser) {
        RepairUserDto repairUserDto = new RepairUserDto();
        repairUserDto.setRuId(businessRepairUser.getString("ruId"));
        repairUserDto.setStatusCd("0");
        List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMO.queryRepairUsers(repairUserDto);
        //获取员工处理状态(10001 处理中;10002 结单;10003 退单;10004 转单;10005 提交)
        //获取员工处理状态(10001 处理中;10002 结单;10003 退单;10004 转单;10005 提交;10006 已派单;10007 已评价;10008 已回访;10009 待支付;11000 待评价;12000 已支付;12001 暂停)
        String state = repairUserDtos.get(0).getState();
        if (!state.equals("10005")) {
            //获取报修id
            String repairId = repairUserDtos.get(0).getRepairId();
            RepairDto repairDto = new RepairDto();
            repairDto.setRepairId(repairId);
            repairDto.setStatusCd("0");
            List<RepairDto> repairDtos = repairInnerServiceSMO.queryRepairs(repairDto);
            //查询报修状态(1000 未派单;1100 接单;1200 退单;1300 转单;1400 申请支付;1500 支付失败;1700 待评价;1800 电话回访;1900 办理完成;2000 未办理结单)
            String repairState = repairDtos.get(0).getState();
@@ -156,23 +145,28 @@
            CommunityDto communityDto = new CommunityDto();
            communityDto.setCommunityId(communityId);
            List<CommunityDto> communityDtos = communityInnerServiceSMO.queryCommunitys(communityDto);
            //派单方式(100表示抢单;200表示指派;300表示轮训)
            String repairWay = repairDtos.get(0).getRepairWay();
            if (repairState.equals("1100") && repairWay.equals("200")) {
                //获取维修员工的id
                String staffId = repairUserDtos.get(1).getStaffId();
                //获取用户id
                String preStaffId = repairUserDtos.get(0).getPreStaffId();
            if (repairState.equals("1100") && businessRepairUser.getString("state").equals("10006")) { //派单
                JSONObject paramIn = new JSONObject();
                for (Business business : businesses) {
                    String businessTypeCd = business.getBusinessTypeCd();
                    if (!StringUtil.isEmpty(businessTypeCd) && businessTypeCd.equals("130200030001")) {
                        JSONObject data = business.getData();
                        if (!StringUtil.isEmpty(data.getString("state")) && data.getString("state").equals("10001")) {
                            paramIn.put("staffId", data.getString("staffId"));
                            paramIn.put("staffName", data.getString("staffName"));
                        } else if (data.getString("state").equals("10006")) {
                            paramIn.put("preStaffId", data.getString("preStaffId"));
                            paramIn.put("preStaffName", data.getString("preStaffName"));
                        }
                    }
                }
                paramIn.put("repairName", repairName);
                paramIn.put("repairObjName", repairObjName);
                paramIn.put("tel", tel);
                paramIn.put("communityId", communityId);
                paramIn.put("context", context);
                paramIn.put("time", time);
                paramIn.put("staffId", staffId);
                paramIn.put("repairObjId", repairObjId);
                paramIn.put("preStaffId", preStaffId);
                paramIn.put("repairId", repairId);
                //给维修师傅推送信息
                sendMsg(paramIn, communityDtos.get(0));
@@ -180,47 +174,29 @@
                publishMsg(paramIn, communityDtos.get(0));
                //为企业微信群发消息
                sendMsgToWechatGroup(paramIn, communityDtos.get(0));
            } else if (repairState.equals("1100") && (repairWay.equals("100") || repairWay.equals("300"))) {
                String staffId = "";
                if (repairUserDtos.size() > 1) {
                    staffId = repairUserDtos.get(1).getStaffId();
                } else {
                    //获取维修员工的id
                    staffId = repairUserDtos.get(0).getStaffId();
                }
                //获取用户id
                String preStaffId = repairUserDtos.get(0).getPreStaffId();
            } else if (repairState.equals("1100") && !businessRepairUser.getString("state").equals("10006")) {
                JSONObject paramIn = new JSONObject();
                paramIn.put("staffId", staffId);
                paramIn.put("staffId", businessRepairUser.getString("staffId"));
                paramIn.put("context", context);
                paramIn.put("time", time);
                paramIn.put("repairObjId", repairObjId);
                paramIn.put("preStaffId", preStaffId);
                paramIn.put("preStaffId", businessRepairUser.getString("preStaffId"));
                paramIn.put("repairName", repairName);
                paramIn.put("tel", tel);
                paramIn.put("repairObjName", repairObjName);
                //抢单成功给维修师傅推送信息
                publishMessage(paramIn, communityDtos.get(0));
                //抢单成功给业主推送信息
                publishMsg(paramIn, communityDtos.get(0));
                if (repairUserDtos.size() > 1) {
                    //给维修师傅推送信息
                    sendMsg(paramIn, communityDtos.get(0));
                } else {
                    //抢单成功给维修师傅推送信息
                    publishMessage(paramIn, communityDtos.get(0));
                }
            } else if (repairState.equals("1300")) {   //转单
                //获取维修员工id
                String staffId = repairUserDtos.get(0).getStaffId();
                //获取上级用户姓名
                String preStaffName = repairUserDtos.get(0).getPreStaffName();
                JSONObject paramIn = new JSONObject();
                paramIn.put("repairName", repairName);
                paramIn.put("repairObjName", repairObjName);
                paramIn.put("tel", tel);
                paramIn.put("context", context);
                paramIn.put("time", time);
                paramIn.put("staffId", staffId);
                paramIn.put("preStaffName", preStaffName);
                paramIn.put("staffId", businessRepairUser.getString("staffId"));
                paramIn.put("preStaffName", businessRepairUser.getString("preStaffName"));
                //给维修师傅推送信息
                sendMessage(paramIn, communityDtos.get(0));
            }
@@ -332,6 +308,7 @@
        //根据 userId 查询到openId
        StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
        staffAppAuthDto.setStaffId(paramIn.getString("staffId"));
        staffAppAuthDto.setStaffName(paramIn.getString("staffName"));
        staffAppAuthDto.setAppType("WECHAT");
        List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMO.queryStaffAppAuths(staffAppAuthDto);
        if (staffAppAuthDtos.size() > 0) {
@@ -434,7 +411,7 @@
            image.put("base64", ImageUtils.getBase64ByImgUrl(imageUrl));
            image.put("md5", ImageUtils.getMd5ByImgUrl(imageUrl));
            responseEntity = outRestTemplate.postForEntity(url, rebootParam.toJSONString(), String.class);
            logger.debug("返回信息:"+responseEntity);
            logger.debug("返回信息:" + responseEntity);
        }
    }
@@ -507,9 +484,9 @@
                templateMessage.setData(data);
                //获取业主公众号地址
                String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
                if(!StringUtil.isEmpty(wechatUrl) && wechatUrl.contains("?")){
                if (!StringUtil.isEmpty(wechatUrl) && wechatUrl.contains("?")) {
                    wechatUrl += ("&wAppId=" + weChatDto.getAppId());
                }else{
                } else {
                    wechatUrl += ("?wAppId=" + weChatDto.getAppId());
                }
service-job/src/main/java/com/java110/job/adapt/Repair/MachineReturnRepairAdapt.java
@@ -88,7 +88,6 @@
    @Override
    public void execute(Business business, List<Business> businesses) throws Exception {
        JSONObject data = business.getData();
        JSONArray businessRepairUsers = new JSONArray();
        System.out.println("收到日志:>>>>>>>>>>>>>"+data.toJSONString());
@@ -102,25 +101,19 @@
            } else {
                businessRepairUsers = (JSONArray) bObj;
            }
        } else {
            if (data instanceof JSONObject) {
                businessRepairUsers.add(data);
            }
        }
        //JSONObject businessOwnerCar = data.getJSONObject("businessOwnerCar");
        for (int bOwnerRepairIndex = 0; bOwnerRepairIndex < businessRepairUsers.size(); bOwnerRepairIndex++) {
            JSONObject businessRepairUser = businessRepairUsers.getJSONObject(bOwnerRepairIndex);
            doDealOwnerRepair(business, businessRepairUser);
        }
    }
    private void doDealOwnerRepair(Business business, JSONObject businessRepairUser) {
        RepairUserDto repairUserDto = new RepairUserDto();
        repairUserDto.setRuId(businessRepairUser.getString("ruId"));
        repairUserDto.setStatusCd("0");
@@ -187,7 +180,6 @@
            //获取价格
            String price = "";
            //这里建议查询 报修所在费用的 固定费
//            for (Business bus : businesses) {
//                if (bus.getBusinessTypeCd().equals("600100030001")) {  //保存费用信息
//                    JSONObject data = bus.getData();
service-job/src/main/java/com/java110/job/adapt/hcGov/visit/AddVisitAdapt.java
@@ -278,9 +278,9 @@
                body.put("extCarId", ownerCarDtos.get(0).getCarId());
                body.put("attrs", parkingAreaAttrDtos);
                body.put("extCommunityId", visits.get(0).getCommunityId());
                body.put("leaseType", ownerCarDtos.get(0).getLeaseType());
                hcOwnerVisitAsynImpl.addVisit(body);
            }
        }
    }
}
service-job/src/main/java/com/java110/job/adapt/hcGov/visit/ExamineVisitAdapt.java
@@ -119,11 +119,11 @@
        }
        for (int bVisitIndex = 0; bVisitIndex < businessVisits.size(); bVisitIndex++) {
            JSONObject businessVisit = businessVisits.getJSONObject(bVisitIndex);
            if (!StringUtil.isEmpty(businessVisit.getString("flag")) && businessVisit.getString("flag").equals("1")) {
            if (!StringUtil.isEmpty(businessVisit.getString("carNum"))) {
                sendMessage(business, businessVisit);
            }
            if (!StringUtil.isEmpty(businessVisit.getString("flag")) && businessVisit.getString("flag").equals("1")
                    && !StringUtil.isEmpty(businessVisit.getString("state")) && businessVisit.getString("state").equals("1")) { //审核通过时走适配器
            if (!StringUtil.isEmpty(businessVisit.getString("carNum")) &&
                    !StringUtil.isEmpty(businessVisit.getString("state")) && businessVisit.getString("state").equals("1")) { //审核通过时走适配器
                doAddVisit(business, businessVisit);
            }
        }
@@ -293,7 +293,7 @@
        body.put("psId", parkingSpaceDtos.get(0).getPsId());
        body.put("extCarId", ownerCarDtos.get(0).getCarId());
        body.put("attrs", parkingAreaAttrDtos);
        body.put("leaseType", ownerCarDtos.get(0).getLeaseType());
        hcOwnerVisitAsynImpl.addVisit(body);
    }
}
service-job/src/main/java/com/java110/job/adapt/notice/MachineNoticeAdapt.java
New file
@@ -0,0 +1,280 @@
package com.java110.job.adapt.notice;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.factory.WechatFactory;
import com.java110.core.log.LoggerFactory;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.notice.NoticeDto;
import com.java110.dto.owner.OwnerAppUserDto;
import com.java110.dto.owner.OwnerDto;
import com.java110.dto.smallWeChat.SmallWeChatDto;
import com.java110.dto.smallWechatAttr.SmallWechatAttrDto;
import com.java110.dto.staffAppAuth.StaffAppAuthDto;
import com.java110.dto.user.UserDto;
import com.java110.entity.order.Business;
import com.java110.entity.wechat.Content;
import com.java110.entity.wechat.Data;
import com.java110.entity.wechat.PropertyFeeTemplateMessage;
import com.java110.intf.community.ICommunityInnerServiceSMO;
import com.java110.intf.community.INoticeInnerServiceSMO;
import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
import com.java110.intf.user.IOwnerInnerServiceSMO;
import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.job.adapt.DatabusAdaptImpl;
import com.java110.po.notice.NoticePo;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.util.Assert;
import com.java110.utils.util.StringUtil;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.List;
/**
 * 发布公告推送通知
 *
 * @author fqz
 * @date 2022-10-15
 */
@Component(value = "machineNoticeAdapt")
public class MachineNoticeAdapt extends DatabusAdaptImpl {
    private static Logger logger = LoggerFactory.getLogger(MachineNoticeAdapt.class);
    @Autowired
    private INoticeInnerServiceSMO noticeInnerServiceSMOImpl;
    @Autowired
    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
    @Autowired
    private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl;
    @Autowired
    private ISmallWechatAttrInnerServiceSMO smallWechatAttrInnerServiceSMOImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    @Autowired
    private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMOImpl;
    @Autowired
    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
    @Autowired
    private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl;
    @Autowired
    private RestTemplate outRestTemplate;
    //模板信息推送地址
    private static String sendMsgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
    @Override
    public void execute(Business business, List<Business> businesses) {
        JSONObject data = business.getData();
        JSONArray businessNotices = new JSONArray();
        System.out.println("收到日志:>>>>>>>>>>>>>" + data.toJSONString());
        if (data.containsKey(NoticePo.class.getSimpleName())) {
            Object bObj = data.get(NoticePo.class.getSimpleName());
            if (bObj instanceof JSONObject) {
                businessNotices.add(bObj);
            } else if (bObj instanceof List) {
                businessNotices = JSONArray.parseArray(JSONObject.toJSONString(bObj));
            } else {
                businessNotices = (JSONArray) bObj;
            }
        } else {
            if (data instanceof JSONObject) {
                businessNotices.add(data);
            }
        }
        for (int noticeIndex = 0; noticeIndex < businessNotices.size(); noticeIndex++) {
            JSONObject businessNotice = businessNotices.getJSONObject(noticeIndex);
            doDealNotice(businesses, businessNotice);
        }
    }
    private void doDealNotice(List<Business> businesses, JSONObject businessNotice) {
        NoticeDto noticeDto = new NoticeDto();
        noticeDto.setNoticeId(businessNotice.getString("noticeId"));
        List<NoticeDto> noticeDtos = noticeInnerServiceSMOImpl.queryNotices(noticeDto);
        Assert.listOnlyOne(noticeDtos, "查询公告错误!");
        //获取标题
        String title = businessNotice.getString("title");
        //获取开始时间
        String startTime = businessNotice.getString("startTime");
        //获取备注内容
        String context = businessNotice.getString("context");
        //查询小区信息
        CommunityDto communityDto = new CommunityDto();
        communityDto.setCommunityId(businessNotice.getString("communityId"));
        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
        Assert.listOnlyOne(communityDtos, "查询小区错误!");
        if (!StringUtil.isEmpty(businessNotice.getString("noticeTypeCd")) && businessNotice.getString("noticeTypeCd").equals("1001")) { //员工通知
            JSONObject paramIn = new JSONObject();
            paramIn.put("title", title);
            paramIn.put("startTime", startTime);
            paramIn.put("context", context);
            //给员工推送通知
            sendMsg(paramIn, communityDtos.get(0));
        } else if (!StringUtil.isEmpty(businessNotice.getString("noticeTypeCd")) && businessNotice.getString("noticeTypeCd").equals("1000")) { //业主通知
            JSONObject paramIn = new JSONObject();
            paramIn.put("title", title);
            paramIn.put("startTime", startTime);
            paramIn.put("context", context);
            //给业主推送通知
            publishMsg(paramIn, communityDtos.get(0));
        } else if (!StringUtil.isEmpty(businessNotice.getString("noticeTypeCd")) && businessNotice.getString("noticeTypeCd").equals("1002")) { //小区通知
            JSONObject paramIn = new JSONObject();
            paramIn.put("title", title);
            paramIn.put("startTime", startTime);
            paramIn.put("context", context);
            //给业主推送通知
            publishMsg(paramIn, communityDtos.get(0));
        }
    }
    /**
     * 给员工推送通知
     *
     * @param paramIn
     * @param communityDto
     */
    private void sendMsg(JSONObject paramIn, CommunityDto communityDto) {
        //查询公众号配置
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setWeChatType("1100");
        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
        smallWeChatDto.setObjId(communityDto.getCommunityId());
        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
            logger.info("未配置微信公众号信息,定时任务执行结束");
            return;
        }
        SmallWeChatDto weChatDto = smallWeChatDtos.get(0);
        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
        smallWechatAttrDto.setCommunityId(communityDto.getCommunityId());
        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
        smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_TEMPLATE);
        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
            logger.info("未配置微信公众号消息模板");
            return;
        }
        String templateId = smallWechatAttrDtos.get(0).getValue();
        String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret());
        if (StringUtil.isEmpty(accessToken)) {
            logger.info("推送微信模板,获取accessToken失败:{}", accessToken);
            return;
        }
        UserDto userDto = new UserDto();
        List<UserDto> users = userInnerServiceSMOImpl.getUsers(userDto);
        for (UserDto user : users) {
            StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
            staffAppAuthDto.setStaffId(user.getUserId());
            staffAppAuthDto.setAppType("WECHAT");
            List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuths(staffAppAuthDto);
            if (staffAppAuthDtos != null && staffAppAuthDtos.size() > 0) {
                String openId = staffAppAuthDtos.get(0).getOpenId();
                String url = sendMsgUrl + accessToken;
                Data data = new Data();
                PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
                templateMessage.setTemplate_id(templateId);
                templateMessage.setTouser(openId);
                data.setFirst(new Content(paramIn.getString("title")));
                data.setKeyword1(new Content(paramIn.getString("title")));
                data.setKeyword2(new Content(paramIn.getString("startTime")));
                data.setKeyword3(new Content(StringUtil.delHtmlTag(paramIn.getString("context"))));
                data.setRemark(new Content("如有疑问请联系相关物业人员"));
                templateMessage.setData(data);
                //获取员工公众号地址
                String wechatUrl = MappingCache.getValue("STAFF_WECHAT_URL");
                templateMessage.setUrl(wechatUrl);
                logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
                ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class);
                logger.info("微信模板返回内容:{}", responseEntity);
            }
        }
    }
    /**
     * 给业主推送通知
     *
     * @param paramIn
     * @param communityDto
     */
    private void publishMsg(JSONObject paramIn, CommunityDto communityDto) {
        //查询公众号配置
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setWeChatType("1100");
        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
        smallWeChatDto.setObjId(communityDto.getCommunityId());
        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
            logger.info("未配置微信公众号信息,定时任务执行结束");
            return;
        }
        SmallWeChatDto weChatDto = smallWeChatDtos.get(0);
        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
        smallWechatAttrDto.setCommunityId(communityDto.getCommunityId());
        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
        smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_TEMPLATE);
        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
            logger.info("未配置微信公众号消息模板");
            return;
        }
        String templateId = smallWechatAttrDtos.get(0).getValue();
        String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret());
        if (StringUtil.isEmpty(accessToken)) {
            logger.info("推送微信模板,获取accessToken失败:{}", accessToken);
            return;
        }
        OwnerDto ownerDto = new OwnerDto();
        ownerDto.setCommunityId(communityDto.getCommunityId());
        List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
        for (OwnerDto owner : ownerDtos) {
            OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
            ownerAppUserDto.setMemberId(owner.getMemberId());
            ownerAppUserDto.setAppType("WECHAT");
            //查询绑定业主
            List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
            if (ownerAppUserDtos.size() > 0) {
                //获取openId
                String openId = ownerAppUserDtos.get(0).getOpenId();
                String url = sendMsgUrl + accessToken;
                Data data = new Data();
                PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
                templateMessage.setTemplate_id(templateId);
                templateMessage.setTouser(openId);
                data.setFirst(new Content(paramIn.getString("title")));
                data.setKeyword1(new Content(paramIn.getString("title")));
                data.setKeyword2(new Content(paramIn.getString("startTime")));
                data.setKeyword3(new Content(StringUtil.delHtmlTag(paramIn.getString("context"))));
                data.setRemark(new Content("如有疑问请联系相关物业人员"));
                templateMessage.setData(data);
                //获取业主公众号地址
                String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
                if (!StringUtil.isEmpty(wechatUrl) && wechatUrl.contains("?")) {
                    wechatUrl += ("&wAppId=" + weChatDto.getAppId());
                } else {
                    wechatUrl += ("?wAppId=" + weChatDto.getAppId());
                }
                templateMessage.setUrl(wechatUrl);
                logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
                ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class);
                logger.info("微信模板返回内容:{}", responseEntity);
            }
        }
    }
}
service-job/src/main/java/com/java110/job/task/wechat/WeChatPushMessageTemplate.java
@@ -15,6 +15,7 @@
import com.java110.dto.logSystemError.LogSystemErrorDto;
import com.java110.dto.notice.NoticeDto;
import com.java110.dto.owner.OwnerAppUserDto;
import com.java110.dto.owner.OwnerDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.dto.smallWeChat.SmallWeChatDto;
import com.java110.dto.smallWechatAttr.SmallWechatAttrDto;
@@ -29,6 +30,7 @@
import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
import com.java110.intf.user.IOwnerInnerServiceSMO;
import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
import com.java110.intf.user.IWechatSubscribeV1InnerServiceSMO;
import com.java110.job.quartz.TaskSystemQuartz;
@@ -64,6 +66,7 @@
    private static Logger logger = LoggerFactory.getLogger(WeChatPushMessageTemplate.class);
    public static final int DEFAULT_THREAD_NUM = 20;
    public static final int DEFAULT_SUBSCRIBE_PERSON = 100;
    public static final int DEFAULT_QUERY_APP_OWNER_COUNT = 50;
@@ -85,6 +88,7 @@
    @Autowired
    private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl;
    @Autowired
    private ISaveTransactionLogSMO saveTransactionLogSMOImpl;
@@ -97,23 +101,26 @@
    @Autowired
    private IWechatSubscribeV1InnerServiceSMO wechatSubscribeV1InnerServiceSMOImpl;
    @Autowired
    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
    @Autowired
    private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMO;
    //模板信息推送地址
    private static String sendMsgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
    private static String getUser = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN";
    private Java110ThreadPoolFactory<PublicWeChatPushMessageTemplate> publicWeChatPushMessageTemplateJava110ThreadPoolFactory = null;
    @Override
    protected void process(TaskDto taskDto) {
        logger.debug("开始执行微信模板信息推送" + taskDto.toString());
        //创建连接池
        publicWeChatPushMessageTemplateJava110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(DEFAULT_THREAD_NUM);
        // 获取小区
        List<CommunityDto> communityDtos = getAllCommunity();
        for (CommunityDto communityDto : communityDtos) {
            try {
                publishMsg(taskDto, communityDto);
@@ -126,53 +133,41 @@
                logger.error("推送消息失败", e);
            }
        }
        publicWeChatPushMessageTemplateJava110ThreadPoolFactory.stop();
    }
    private void publishMsg(TaskDto taskDto, CommunityDto communityDto) throws Exception {
        //查询公众号配置
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setWeChatType("1100");
        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
        smallWeChatDto.setObjId(communityDto.getCommunityId());
        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
            logger.info("未配置微信公众号信息,定时任务执行结束");
            return;
        }
        SmallWeChatDto weChatDto = smallWeChatDtos.get(0);
        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
        smallWechatAttrDto.setCommunityId(communityDto.getCommunityId());
        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
        smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_TEMPLATE);
        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
            logger.info("未配置微信公众号消息模板");
            return;
        }
        String templateId = smallWechatAttrDtos.get(0).getValue();
        String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret());
        if (accessToken == null || accessToken == "") {
            logger.info("推送微信模板,获取accessToken失败:{}", accessToken);
            return;
        }
        //
        //处理通知
        List<NoticeDto> noticeDtos = getNotices(communityDto.getCommunityId());
        if (noticeDtos == null || noticeDtos.size() < 1) {
            return;
        }
        for (NoticeDto tmpNotice : noticeDtos) {
            try {
                doSentWechat(tmpNotice, templateId, accessToken, weChatDto);
@@ -185,7 +180,6 @@
                logger.error("通知异常", e);
            }
        }
    }
    @Java110Synchronized(value = "communityId")
@@ -197,7 +191,6 @@
        noticeDto.setState(NoticeDto.STATE_WAIT);
        noticeDto.setNoticeTypeCd(NoticeDto.NOTICE_TYPE_OWNER_WECHAT);
        List<NoticeDto> noticeDtos = noticeInnerServiceSMOImpl.queryNotices(noticeDto);
        //更新为发送中
        for (NoticeDto noticeDto1 : noticeDtos) {
            noticeDto = new NoticeDto();
@@ -206,72 +199,71 @@
            noticeDto.setCommunityId(communityId);
            noticeInnerServiceSMOImpl.updateNotice(noticeDto);
        }
        return noticeDtos;
    }
    private void doSentWechat(NoticeDto noticeDto, String templateId, String accessToken, SmallWeChatDto weChatDto) throws Exception {
//        Date startTime = DateUtil.getDateFromString(noticeDto.getStartTime(), DateUtil.DATE_FORMATE_STRING_A);
//        Date nowTime = DateUtil.getCurrentDate();
//        if (startTime.getTime() > nowTime.getTime()) { //还没有到时间
//            return;
//        }
        String objType = noticeDto.getObjType();
        switch (objType) {
            case NoticeDto.OBJ_TYPE_ALL:
                sendAllOwner(noticeDto, templateId, accessToken, weChatDto);
            case NoticeDto.OBJ_TYPE_ALL: //全部推送
                sendAllOwners(noticeDto, templateId, accessToken, weChatDto);
                break;
            case NoticeDto.OBJ_TYPE_FLOOR:
            case NoticeDto.OBJ_TYPE_FLOOR: //楼栋
                sendFloorOwner(noticeDto, templateId, accessToken, weChatDto);
                break;
            case NoticeDto.OBJ_TYPE_UNIT:
            case NoticeDto.OBJ_TYPE_UNIT: //单元
                sendUnitOwner(noticeDto, templateId, accessToken, weChatDto);
                break;
            case NoticeDto.OBJ_TYPE_ROOM:
            case NoticeDto.OBJ_TYPE_ROOM: //房屋
                sendRoomOwner(noticeDto, templateId, accessToken, weChatDto);
                break;
            case NoticeDto.OBJ_TYPE_COMMUNITY:
            case NoticeDto.OBJ_TYPE_COMMUNITY: //小区
                sendCommunityOwner(noticeDto, templateId, accessToken, weChatDto);
                break;
        }
        NoticeDto tmpNoticeDto = new NoticeDto();
        tmpNoticeDto.setNoticeId(noticeDto.getNoticeId());
        tmpNoticeDto.setState(NoticeDto.STATE_FINISH);
        noticeInnerServiceSMOImpl.updateNotice(tmpNoticeDto);
    }
    /**
     * 小区推送
     *
     * @param noticeDto
     * @param templateId
     * @param accessToken
     * @param weChatDto
     */
    private void sendCommunityOwner(NoticeDto noticeDto, String templateId, String accessToken, SmallWeChatDto weChatDto) {
        OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
        ownerAppUserDto.setAppType(OwnerAppUserDto.APP_TYPE_WECHAT);
        ownerAppUserDto.setCommunityId(noticeDto.getCommunityId());
        int count = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsersCount(ownerAppUserDto);
        double maxPage = Math.ceil(count/DEFAULT_QUERY_APP_OWNER_COUNT)+1;
        for(int page = 0; page < maxPage; page++){
            ownerAppUserDto.setPage(page+1);
        double maxPage = Math.ceil(count / DEFAULT_QUERY_APP_OWNER_COUNT) + 1;
        for (int page = 0; page < maxPage; page++) {
            ownerAppUserDto.setPage(page + 1);
            ownerAppUserDto.setRow(DEFAULT_QUERY_APP_OWNER_COUNT);
            List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
            doSend(ownerAppUserDtos, noticeDto, templateId, accessToken, weChatDto);
        }
//
//        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
//        doSend(ownerAppUserDtos, noticeDto, templateId, accessToken, weChatDto);
    }
    /**
     * 楼栋推送
     *
     * @param noticeDto
     * @param templateId
     * @param accessToken
     * @param weChatDto
     */
    private void sendFloorOwner(NoticeDto noticeDto, String templateId, String accessToken, SmallWeChatDto weChatDto) {
        RoomDto roomDto = new RoomDto();
        roomDto.setCommunityId(noticeDto.getCommunityId());
        roomDto.setFloorId(noticeDto.getObjId());
        List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
        for (RoomDto tmpRoomDto : roomDtos) {
            if (!RoomDto.STATE_SELL.equals(tmpRoomDto.getState())) {
                continue;
@@ -279,7 +271,6 @@
            OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
            ownerRoomRelDto.setRoomId(tmpRoomDto.getRoomId());
            List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
            if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
                continue;
            }
@@ -291,13 +282,19 @@
        }
    }
    /**
     * 单元推送
     *
     * @param noticeDto
     * @param templateId
     * @param accessToken
     * @param weChatDto
     */
    private void sendUnitOwner(NoticeDto noticeDto, String templateId, String accessToken, SmallWeChatDto weChatDto) {
        RoomDto roomDto = new RoomDto();
        roomDto.setCommunityId(noticeDto.getCommunityId());
        roomDto.setUnitId(noticeDto.getObjId());
        List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
        for (RoomDto tmpRoomDto : roomDtos) {
            if (!RoomDto.STATE_SELL.equals(tmpRoomDto.getState())) {
                continue;
@@ -305,7 +302,6 @@
            OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
            ownerRoomRelDto.setRoomId(tmpRoomDto.getRoomId());
            List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
            if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
                continue;
            }
@@ -317,21 +313,26 @@
        }
    }
    /**
     * 房屋推送
     *
     * @param noticeDto
     * @param templateId
     * @param accessToken
     * @param weChatDto
     */
    private void sendRoomOwner(NoticeDto noticeDto, String templateId, String accessToken, SmallWeChatDto weChatDto) {
        RoomDto roomDto = new RoomDto();
        roomDto.setCommunityId(noticeDto.getCommunityId());
        roomDto.setRoomId(noticeDto.getObjId());
        List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
        for (RoomDto tmpRoomDto : roomDtos) {
            if (!RoomDto.STATE_SELL.equals(tmpRoomDto.getState())) {
            if (RoomDto.STATE_FREE.equals(tmpRoomDto.getState())) { //不给未销售状态的房屋推送(未入住的推送,业主未入住可能绑定了房屋)
                continue;
            }
            OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
            ownerRoomRelDto.setRoomId(tmpRoomDto.getRoomId());
            List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
            if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
                continue;
            }
@@ -348,9 +349,7 @@
        WechatSubscribeDto wechatSubscribeDto = new WechatSubscribeDto();
        wechatSubscribeDto.setAppId(weChatDto.getAppId());
        wechatSubscribeDto.setOpenType(WechatSubscribeDto.OPEN_TYPE_WECHAT);
        int count = wechatSubscribeV1InnerServiceSMOImpl.queryWechatSubscribesCount(wechatSubscribeDto);
        //可能公众号 已经 使用了好久 但是 程序可能刚开始用
        if (count < DEFAULT_SUBSCRIBE_PERSON) {
            //doSendToOpenId(noticeDto, templateId, accessToken, "", weChatDto);
@@ -359,22 +358,18 @@
            wechatSubscribeV1InnerServiceSMOImpl.deleteWechatSubscribe(tmpWechatSubscribePo);
            getAllOpenId(accessToken, "", weChatDto);
        }
        List<WechatSubscribeDto> wechatSubscribeDtos = wechatSubscribeV1InnerServiceSMOImpl.queryDistinctWechatSubscribes(wechatSubscribeDto);
        if (wechatSubscribeDtos == null || wechatSubscribeDtos.size() < 1) {
            return;
        }
        String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
        Miniprogram miniprogram = null;
        if (wechatUrl.startsWith("https://") || wechatUrl.startsWith("http://")) {
            miniprogram = new Miniprogram();
        } else {
            miniprogram = new Miniprogram();
            miniprogram.setAppid(wechatUrl);
        }
        String sendTemplate = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.SEND_TEMPLATE_URL);
        if (StringUtil.isEmpty(sendTemplate)) {
            sendTemplate = sendMsgUrl;
@@ -404,7 +399,7 @@
                //并发处理
                PushWechatTemplateMessageThread pushWechatTemplateMessageThread = new PushWechatTemplateMessageThread(outRestTemplate, sendTemplate + accessToken, JSON.toJSONString(templateMessage));
                publicWeChatPushMessageTemplateJava110ThreadPoolFactory.submit(pushWechatTemplateMessageThread);
                //responseEntity = outRestTemplate.postForEntity(sendTemplate + accessToken, JSON.toJSONString(templateMessage), String.class);
                responseEntity = outRestTemplate.postForEntity(sendTemplate + accessToken, JSON.toJSONString(templateMessage), String.class);
            } catch (Exception e) {
                LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo();
                logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId));
@@ -414,6 +409,95 @@
                logger.error("发送失败", e);
            } finally {
                doSaveLog(startTime, DateUtil.getCurrentDate(), "/pages/notice/detail/detail", JSON.toJSONString(templateMessage), responseEntity, wechatSubscribeDto1.getOpenId());
            }
        }
    }
    /**
     * 给关注用户推送
     *
     * @param noticeDto
     * @param templateId
     * @param accessToken
     * @param weChatDto
     */
    private void sendAllOwners(NoticeDto noticeDto, String templateId, String accessToken, SmallWeChatDto weChatDto) {
        //查询公众号配置
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setWeChatType("1100");
        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
        smallWeChatDto.setObjId(noticeDto.getObjId());
        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
            logger.info("未配置微信公众号信息,定时任务执行结束");
            return;
        }
        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
        smallWechatAttrDto.setCommunityId(noticeDto.getObjId());
        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
        smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_WORK_ORDER_REMIND_TEMPLATE);
        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
            logger.info("未配置微信公众号消息模板");
            return;
        }
        if (StringUtil.isEmpty(accessToken)) {
            logger.info("推送微信模板,获取accessToken失败:{}", accessToken);
            return;
        }
        OwnerDto ownerDto = new OwnerDto();
        ownerDto.setCommunityId(noticeDto.getObjId());
        List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
        String sendTemplate = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.SEND_TEMPLATE_URL);
        if (StringUtil.isEmpty(sendTemplate)) {
            sendTemplate = sendMsgUrl;
        }
        ResponseEntity<String> responseEntity = null;
        if (ownerDtos != null && ownerDtos.size() > 0) {
            for (OwnerDto owner : ownerDtos) {
                OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
                ownerAppUserDto.setMemberId(owner.getMemberId());
                ownerAppUserDto.setAppType("WECHAT");
                //查询绑定业主
                List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMO.queryOwnerAppUsers(ownerAppUserDto);
                if (ownerAppUserDtos.size() > 0) {
                    //获取openId
                    String openId = ownerAppUserDtos.get(0).getOpenId();
                    Date startTime = DateUtil.getCurrentDate();
                    Data data = new Data();
                    PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
                    try {
                        templateMessage.setTemplate_id(templateId);
                        templateMessage.setTouser(openId);
                        data.setFirst(new Content(noticeDto.getTitle()));
                        data.setKeyword1(new Content(noticeDto.getTitle()));
                        data.setKeyword2(new Content(noticeDto.getStartTime()));
                        data.setKeyword3(new Content(StringUtil.delHtmlTag(noticeDto.getContext())));
                        data.setRemark(new Content("如有疑问请联系相关物业人员"));
                        templateMessage.setData(data);
                        //获取业主公众号地址
                        String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL");
                        if (!StringUtil.isEmpty(wechatUrl) && wechatUrl.contains("?")) {
                            wechatUrl += ("&wAppId=" + weChatDto.getAppId());
                        } else {
                            wechatUrl += ("?wAppId=" + weChatDto.getAppId());
                        }
                        templateMessage.setUrl(wechatUrl);
                        //并发处理
                        PushWechatTemplateMessageThread pushWechatTemplateMessageThread = new PushWechatTemplateMessageThread(outRestTemplate, sendTemplate + accessToken, JSON.toJSONString(templateMessage));
                        publicWeChatPushMessageTemplateJava110ThreadPoolFactory.submit(pushWechatTemplateMessageThread);
                        responseEntity = outRestTemplate.postForEntity(sendTemplate + accessToken, JSON.toJSONString(templateMessage), String.class);
                    } catch (Exception e) {
                        LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo();
                        logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId));
                        logSystemErrorPo.setErrType(LogSystemErrorDto.ERR_TYPE_NOTICE);
                        logSystemErrorPo.setMsg(ExceptionUtil.getStackTrace(e));
                        saveSystemErrorSMOImpl.saveLog(logSystemErrorPo);
                        logger.error("发送失败", e);
                    } finally {
                        doSaveLog(startTime, DateUtil.getCurrentDate(), "/pages/notice/detail/detail", JSON.toJSONString(templateMessage), responseEntity, openId);
                    }
                }
            }
        }
    }
@@ -428,18 +512,14 @@
            url += ("&next_openid=" + nextOpenid);
        }
        ResponseEntity<String> paramOut = outRestTemplate.getForEntity(url, String.class);
        logger.info("获取用户返回:{}", paramOut);
        if (paramOut.getStatusCode() != HttpStatus.OK) {
            throw new IllegalArgumentException(paramOut.getBody());
        }
        JSONObject paramOutObj = JSONObject.parseObject(paramOut.getBody());
        if (paramOutObj.containsKey("errcode")) {
            throw new IllegalArgumentException(paramOut.getBody());
        }
        if (!paramOutObj.containsKey("data")) {
            return;
        }
@@ -456,11 +536,9 @@
            wechatSubscribePo.setOpenType(WechatSubscribeDto.OPEN_TYPE_WECHAT);
            wechatSubscribePos.add(wechatSubscribePo);
        }
        if (wechatSubscribePos.size() > 0) {
            wechatSubscribeV1InnerServiceSMOImpl.saveWechatSubscribes(wechatSubscribePos);
        }
        //(关注者列表已返回完时,返回next_openid为空)
        if (!StringUtil.isEmpty(nextOpenid)) {
            getAllOpenId(accessToken, nextOpenid, weChatDto);
@@ -474,6 +552,7 @@
        if (StringUtil.isEmpty(sendTemplate)) {
            sendTemplate = sendMsgUrl;
        }
        List<String> ownerAppUserList = new ArrayList<>();
        for (OwnerAppUserDto appUserDto : ownerAppUserDtos) {
            Date startTime = DateUtil.getCurrentDate();
            PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
@@ -489,9 +568,9 @@
                templateMessage.setData(data);
                templateMessage.setUrl(wechatUrl + noticeDto.getNoticeId() + "&wAppId=" + weChatDto.getAppId() + "&communityId=" + noticeDto.getCommunityId());
                logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
                //responseEntity = outRestTemplate.postForEntity(sendTemplate + accessToken, JSON.toJSONString(templateMessage), String.class);
                PushWechatTemplateMessageThread pushWechatTemplateMessageThread = new PushWechatTemplateMessageThread(outRestTemplate, sendTemplate + accessToken, JSON.toJSONString(templateMessage));
                publicWeChatPushMessageTemplateJava110ThreadPoolFactory.submit(pushWechatTemplateMessageThread);
                responseEntity = outRestTemplate.postForEntity(sendTemplate + accessToken, JSON.toJSONString(templateMessage), String.class);
//                PushWechatTemplateMessageThread pushWechatTemplateMessageThread = new PushWechatTemplateMessageThread(outRestTemplate, sendTemplate + accessToken, JSON.toJSONString(templateMessage));
//                publicWeChatPushMessageTemplateJava110ThreadPoolFactory.submit(pushWechatTemplateMessageThread);
                logger.info("微信模板返回内容:{}", responseEntity);
            } catch (Exception e) {
                LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo();
@@ -503,6 +582,12 @@
            } finally {
                doSaveLog(startTime, DateUtil.getCurrentDate(), "/pages/notice/detail/detail", JSON.toJSONString(templateMessage), responseEntity, appUserDto.getOpenId());
            }
            if (!StringUtil.isEmpty(noticeDto.getObjType()) && noticeDto.getObjType().equals("004")) { //房屋
                if (ownerAppUserList.contains(appUserDto.getAppUserName())) {
                    continue;
                }
            }
            ownerAppUserList.add(appUserDto.getAppUserName());
        }
    }
@@ -527,5 +612,4 @@
            logger.error("存日志失败", e);
        }
    }
}
service-order/src/main/java/com/java110/order/smo/impl/OrderInnerServiceSMOImpl.java
@@ -76,14 +76,15 @@
            return orderDtos;
        }
        String[] userIds = getUserIds(orderDtos);
        //根据 userId 查询用户信息
        List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds);
        for (OrderDto orderDto : orderDtos) {
            for (UserDto userDto : users) {
                if (orderDto.getUserId().equals(userDto.getUserId())) {
                    orderDto.setUserName(userDto.getUserName());
                    break;
        if(userIds != null && userIds.length > 0) {
            //根据 userId 查询用户信息
            List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds);
            for (OrderDto orderDto : orderDtos) {
                for (UserDto userDto : users) {
                    if (orderDto.getUserId().equals(userDto.getUserId())) {
                        orderDto.setUserName(userDto.getUserName());
                        break;
                    }
                }
            }
        }
service-report/src/main/java/com/java110/report/bmo/customReport/InspectionData.java
@@ -11,42 +11,42 @@
/**
 * select t.inspection_name '巡检点',t.point_obj_name '位置',ips.staff_name '员工',
 (select count(1) from inspection_task it
 INNER JOIN inspection_task_detail itd on it.task_id = itd.task_id and itd.status_cd = '0'
 where it.inspection_plan_id = ip.inspection_plan_id
 and itd.inspection_id = t.inspection_id and it.plan_user_id = ips.staff_id
 and itd.act_user_id is not null
 ) '已巡检',
 (select count(1) from inspection_task it
 INNER JOIN inspection_task_detail itd on it.task_id = itd.task_id and itd.status_cd = '0'
 where it.inspection_plan_id = ip.inspection_plan_id
 and itd.inspection_id = t.inspection_id and it.plan_user_id = ips.staff_id
 and itd.act_user_id is null
 ) '未巡检',
 (select itd.description from inspection_task it
 INNER JOIN inspection_task_detail itd on it.task_id = itd.task_id and itd.status_cd = '0'
 where it.inspection_plan_id = ip.inspection_plan_id
 and itd.inspection_id = t.inspection_id and it.plan_user_id = ips.staff_id
 and itd.act_user_id is not null
 limit 1
 ) '状态'
 from inspection_point t
 left join inspection_route_point_rel irpr on t.inspection_id = irpr.inspection_id and irpr.status_cd = '0'
 left join inspection_plan ip on ip.inspection_route_id = irpr.inspection_route_id and ip.status_cd = '0'
 left join inspection_plan_staff ips on ip.inspection_plan_id = ips.inspection_plan_id and ips.status_cd = '0'
 where ips.staff_name is not null
 and t.community_id = #communityId#
 and t.status_cd = '0'
 <if test="startTime != null and startTime != ''">
 and ip.create_time &gt; #startTime#
 </if>
 <if test="endTime != null and endTime != ''">
 and ip.create_time &lt; #endTime#
 </if>
 group by t.inspection_name,t.point_obj_name,ips.staff_name
 order by t.inspection_name
 * (select count(1) from inspection_task it
 * INNER JOIN inspection_task_detail itd on it.task_id = itd.task_id and itd.status_cd = '0'
 * where it.inspection_plan_id = ip.inspection_plan_id
 * and itd.inspection_id = t.inspection_id and it.plan_user_id = ips.staff_id
 * and itd.act_user_id is not null
 * ) '已巡检',
 * (select count(1) from inspection_task it
 * INNER JOIN inspection_task_detail itd on it.task_id = itd.task_id and itd.status_cd = '0'
 * where it.inspection_plan_id = ip.inspection_plan_id
 * and itd.inspection_id = t.inspection_id and it.plan_user_id = ips.staff_id
 * and itd.act_user_id is null
 * ) '未巡检',
 * (select itd.description from inspection_task it
 * INNER JOIN inspection_task_detail itd on it.task_id = itd.task_id and itd.status_cd = '0'
 * where it.inspection_plan_id = ip.inspection_plan_id
 * and itd.inspection_id = t.inspection_id and it.plan_user_id = ips.staff_id
 * and itd.act_user_id is not null
 * limit 1
 * ) '状态'
 * from inspection_point t
 * left join inspection_route_point_rel irpr on t.inspection_id = irpr.inspection_id and irpr.status_cd = '0'
 * left join inspection_plan ip on ip.inspection_route_id = irpr.inspection_route_id and ip.status_cd = '0'
 * left join inspection_plan_staff ips on ip.inspection_plan_id = ips.inspection_plan_id and ips.status_cd = '0'
 * <p>
 * where ips.staff_name is not null
 * and t.community_id = #communityId#
 * and t.status_cd = '0'
 * <if test="startTime != null and startTime != ''">
 * and ip.create_time &gt; #startTime#
 * </if>
 * <if test="endTime != null and endTime != ''">
 * and ip.create_time &lt; #endTime#
 * </if>
 * <p>
 * group by t.inspection_name,t.point_obj_name,ips.staff_name
 * order by t.inspection_name
 */
public class InspectionData implements ReportExecute {
@@ -104,7 +104,7 @@
                "left join inspection_plan_staff ips on ip.inspection_plan_id = ips.inspection_plan_id and ips.status_cd = '0'\n" +
                "\n" +
                "where ips.staff_name is not null\n" +
                "and t.status_cd = '0'\n" ;
                "and t.status_cd = '0'\n";
        if (params.containsKey("startTime") && !StringUtils.isEmpty(params.getString("startTime"))) {
            sqlParams.add(params.get("startTime"));
            sqlParams.add(params.get("endTime"));
@@ -134,11 +134,11 @@
        List datas = queryServiceDAOImpl.executeSql(sql, sqlParams.toArray());
        System.out.println("datas="+datas);
        System.out.println("datas=" + datas);
        if (datas == null || datas.size() < 1) {
            paramOut.put("toatl",1);
            paramOut.put("data",new JSONArray());
            paramOut.put("toatl", 1);
            paramOut.put("data", new JSONArray());
            return paramOut.toJSONString();
        }
@@ -155,11 +155,11 @@
            }
            td.put(dataObj.get("员工").toString(), dataObj.get("已巡检") + "/" + dataObj.get("未巡检"));
            td.put(dataObj.get("员工").toString()+"巡检状态", dataObj.get("状态"));
            td.put(dataObj.get("员工").toString() + "巡检状态", dataObj.get("状态"));
        }
        paramOut.put("total",params.get("row"));
        paramOut.put("data",tds);
        paramOut.put("total", params.get("row"));
        paramOut.put("data", tds);
        return paramOut.toJSONString();
    }
service-report/src/main/java/com/java110/report/cmd/reportCustomComponent/ListReportCustomComponentDataCmd.java
@@ -15,6 +15,7 @@
 */
package com.java110.report.cmd.reportCustomComponent;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.context.ICmdDataFlowContext;
@@ -27,6 +28,7 @@
import com.java110.service.smo.IQueryServiceSMO;
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.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@@ -50,6 +52,7 @@
public class ListReportCustomComponentDataCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(ListReportCustomComponentDataCmd.class);
    @Autowired
    private IReportCustomComponentV1InnerServiceSMO reportCustomComponentV1InnerServiceSMOImpl;
@@ -122,9 +125,15 @@
            reqJson.put("page", (page - 1) * reqJson.getIntValue("row"));
        }
        JSONObject data = queryServiceSMOImpl.execQuerySql(reqJson, sql);
        if (!sql.trim().contains("test=\"count")) {
            total = JSONArray.parseArray(data.getString("td")).size();
        }
        if (!StringUtil.isEmpty(sql) && !sql.contains("limit #page#,#row#")) {
            sql = sql + " limit #page#,#row#";
            data = queryServiceSMOImpl.execQuerySql(reqJson, sql);
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) total / (double) reqJson.getInteger("row")), total, data);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        cmdDataFlowContext.setResponseEntity(responseEntity);
    }
}
service-report/src/main/java/com/java110/report/smo/impl/QueryPayFeeDetailInnerServiceSMOImpl.java
@@ -29,10 +29,9 @@
/**
 * 查询缴费明细
 *
 */
@RestController
public class QueryPayFeeDetailInnerServiceSMOImpl implements IQueryPayFeeDetailInnerServiceSMO{
public class QueryPayFeeDetailInnerServiceSMOImpl implements IQueryPayFeeDetailInnerServiceSMO {
    private int MAX_ROWS = 500;  // 最大行数
@@ -107,27 +106,39 @@
                String discountPrice = reportFeeMonthStatistics.getDiscountPrice();
                //优惠金额(大计)
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("1")) {
                    allPreferentialAmount = Double.valueOf(discountPrice);
//                    allPreferentialAmount = Double.valueOf(discountPrice);
                    Double aDouble = Double.valueOf(discountPrice);
                    allPreferentialAmount = allPreferentialAmount + aDouble;
                }
                //减免金额(大计)
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("2")) {
                    allDeductionAmount = Double.valueOf(discountPrice);
                    //allDeductionAmount = Double.valueOf(discountPrice);
                    Double aDouble = Double.valueOf(discountPrice);
                    allDeductionAmount = allDeductionAmount + aDouble;
                }
                //滞纳金(大计)
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("3")) {
                    allLateFee = Double.valueOf(discountPrice);
//                    allLateFee = Double.valueOf(discountPrice);
                    Double aDouble = Double.valueOf(discountPrice);
                    allLateFee = allLateFee + aDouble;
                }
                //空置房打折金额(大计)
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("4")) {
                    allVacantHousingDiscount = Double.valueOf(discountPrice);
//                    allVacantHousingDiscount = Double.valueOf(discountPrice);
                    Double aDouble = Double.valueOf(discountPrice);
                    allVacantHousingDiscount = allVacantHousingDiscount + aDouble;
                }
                //空置房减免金额(大计)
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("5")) {
                    allVacantHousingReduction = Double.valueOf(discountPrice);
//                    allVacantHousingReduction = Double.valueOf(discountPrice);
                    Double aDouble = Double.valueOf(discountPrice);
                    allVacantHousingReduction = allVacantHousingReduction + aDouble;
                }
                //赠送金额(大计)
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("6")) {
                    allGiftAmount = Double.valueOf(discountPrice);
//                    allGiftAmount = Double.valueOf(discountPrice);
                    Double aDouble = Double.valueOf(discountPrice);
                    allGiftAmount = allGiftAmount + aDouble;
                }
            }
            //应收总金额(小计)
service-user/src/main/java/com/java110/user/api/StaffApi.java
@@ -136,7 +136,6 @@
    public ResponseEntity<String> generatorQrCode(@RequestHeader(value = "store-id") String storeId,
                                                  @RequestHeader(value = "user-id") String userId,
                                                  @RequestParam(value = "communityId") String communityId) {
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setObjId(communityId);
        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/UpdateStaffAppAuthBMOImpl.java
@@ -6,10 +6,15 @@
import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
import com.java110.po.staffAppAuth.StaffAppAuthPo;
import com.java110.user.bmo.staffAppAuth.IUpdateStaffAppAuthBMO;
import com.java110.utils.util.Assert;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Service("updateStaffAppAuthBMOImpl")
public class UpdateStaffAppAuthBMOImpl implements IUpdateStaffAppAuthBMO {
@@ -23,7 +28,7 @@
     */
    @Java110Transactional
    public ResponseEntity<String> update(StaffAppAuthPo staffAppAuthPo) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
        staffAppAuthDto.setAppType(staffAppAuthPo.getAppType());
        staffAppAuthDto.setStaffId(staffAppAuthPo.getStaffId());
@@ -32,6 +37,10 @@
        int count = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuthsCount(staffAppAuthDto);
        int flag = 0;
        if (count > 0) {
            List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuths(staffAppAuthDto);
            Assert.listOnlyOne(staffAppAuthDtos, "查询到多个员工认证信息");
            staffAppAuthPo.setAuId(staffAppAuthDtos.get(0).getAuId());
            staffAppAuthPo.setCreateTime(format.format(new Date()));
            flag = staffAppAuthInnerServiceSMOImpl.updateStaffAppAuth(staffAppAuthPo);
        } else {
            staffAppAuthPo.setAuId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_auId));