wuxw
2023-11-06 4f3b666cd625381e4acb07d8ae4d68ae9554b1b8
Merge branch 'xinghong-dev' of http://git.homecommunity.cn/supervip/MicroCommunity
89个文件已修改
3297 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/contract/ContractChangePlanDto.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/fee/TempCarFeeConfigDto.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/owner/OwnerCarDto.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/questionAnswer/QuestionAnswerDto.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/repair/RepairUserDto.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/resource/ResourceStoreDto.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/room/RoomDto.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyDetailPo.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/questionAnswer/QuestionAnswerPo.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/auditAppUserBindingOwner/ApiAuditAppUserBindingOwnerDataVo.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/resourceStore/ApiResourceStoreDataVo.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/acct/AccountServiceDaoImplMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/ItemReleaseTypeV1ServiceDaoImplMapper.xml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/ItemReleaseV1ServiceDaoImplMapper.xml 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/MachinePrinterV1ServiceDaoImplMapper.xml 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/MeterMachineFactoryV1ServiceDaoImplMapper.xml 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/CommunitySpaceV1ServiceDaoImplMapper.xml 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/FloorServiceDaoImplMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/PropertyRightRegistrationV1ServiceDaoImplMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/RepairServiceDaoImplMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/ApplyRoomDiscountTypeServiceDaoImplMapper.xml 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/FeeComboV1ServiceDaoImplMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/PayFeeQrcodeV1ServiceDaoImplMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/TempCarFeeConfigServiceDaoImplMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml 511 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/report/ReportOweFeeServiceDaoImplMapper.xml 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/AllocationStorehouseServiceDaoImplMapper.xml 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/AllocationUserStorehouseServiceDaoImplMapper.xml 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ContractChangePlanServiceDaoImplMapper.xml 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ContractPartyaServiceDaoImplMapper.xml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ContractServiceDaoImplMapper.xml 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ContractTypeServiceDaoImplMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ContractTypeSpecServiceDaoImplMapper.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseApplyDetailServiceDaoImplMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseApplyDetailV1ServiceDaoImplMapper.xml 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseApplyServiceDaoImplMapper.xml 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ResourceStoreUseRecordServiceDaoImplMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/ResourceSupplierServiceDaoImplMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/UserStorehouseServiceDaoImplMapper.xml 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/OwnerAppUserServiceDaoImplMapper.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/OwnerCommitteeV1ServiceDaoImplMapper.xml 325 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/OwnerRoomRelV1ServiceDaoImplMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/QuestionAnswerV1ServiceDaoImplMapper.xml 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/QuestionTitleV1ServiceDaoImplMapper.xml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/report/IReportFeeMonthStatisticsInnerServiceSMO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/report/IReportOweFeeInnerServiceSMO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/itemRelease/SaveItemReleaseCmd.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/api/RepairApi.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/api/RoomRenovationApi.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/GrabbingRepairCmd.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairForceFinishCmd.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairStartCmd.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/room/QueryRoomsByOwnerCmd.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/api/ApplyRoomDiscountApi.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/export/adapt/DataMonthReceivedStatisticsAdapt.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/export/adapt/ExportOwnerCarAdapt.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/bmo/reportFeeYearCollection/impl/GetReportFeeYearCollectionBMOImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/cmd/room/QueryHisRoomCmd.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/api/ContractApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/assetInventory/SaveAssetInventoryCmd.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/collection/GoodsCollectionCmd.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/purchase/PurchaseApplyCmd.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/purchase/UrgentPurchaseApplyCmd.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/purchaseApply/ListPurchaseApplysCmd.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/purchaseApply/UpdatePurchaseApplyCmd.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/resourceStore/ListResourceStoreUseRecordCmd.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/SaveResourceSupplierCmd.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/UpdateResourceSupplierCmd.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/smo/impl/ResourceStoreTimesV1InnerServiceSMOImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/owner/QueryOwnerMembersCmd.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/question/ListQuestionAnswerCmd.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/question/ListQuestionTitleCmd.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/question/SaveOwnerVoteCmd.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/question/SaveQuestionAnswerCmd.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/question/UpdateQuestionAnswerCmd.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/contract/ContractChangePlanDto.java
@@ -36,13 +36,18 @@
    private String storeId;
    private String nextUserId;
    private Date createTime;
    private String statusCd = "0";
    private String staffNameLike;
    private String contractName;
    private String contractCode;
    private String contractType;
    private String logStartTime;
    private String logEndTime;
    public String getPlanType() {
        return planType;
@@ -100,7 +105,6 @@
        this.storeId = storeId;
    }
    public Date getCreateTime() {
        return createTime;
    }
@@ -150,4 +154,58 @@
    public void setNextUserId(String nextUserId) {
        this.nextUserId = nextUserId;
    }
    public String getStaffNameLike() {
        return staffNameLike;
    }
    public void setStaffNameLike(String staffNameLike) {
        this.staffNameLike = staffNameLike;
    }
    @Override
    public String getContractName() {
        return contractName;
    }
    @Override
    public void setContractName(String contractName) {
        this.contractName = contractName;
    }
    @Override
    public String getContractCode() {
        return contractCode;
    }
    @Override
    public void setContractCode(String contractCode) {
        this.contractCode = contractCode;
    }
    @Override
    public String getContractType() {
        return contractType;
    }
    @Override
    public void setContractType(String contractType) {
        this.contractType = contractType;
    }
    public String getLogStartTime() {
        return logStartTime;
    }
    public void setLogStartTime(String logStartTime) {
        this.logStartTime = logStartTime;
    }
    public String getLogEndTime() {
        return logEndTime;
    }
    public void setLogEndTime(String logEndTime) {
        this.logEndTime = logEndTime;
    }
}
java110-bean/src/main/java/com/java110/dto/fee/TempCarFeeConfigDto.java
@@ -22,6 +22,7 @@
    private String feeName;
    private String paId;
    private String areaNum;
    private String areaNumLike;
    private String startTime;
    private String endTime;
    private String ruleId;
@@ -31,11 +32,9 @@
    private List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs;
    private Date createTime;
    private String statusCd = "0";
    public String getCarType() {
        return carType;
@@ -109,7 +108,6 @@
        this.communityId = communityId;
    }
    public Date getCreateTime() {
        return createTime;
    }
@@ -157,4 +155,12 @@
    public void setFeeConfigId(String feeConfigId) {
        this.feeConfigId = feeConfigId;
    }
    public String getAreaNumLike() {
        return areaNumLike;
    }
    public void setAreaNumLike(String areaNumLike) {
        this.areaNumLike = areaNumLike;
    }
}
java110-bean/src/main/java/com/java110/dto/owner/OwnerCarDto.java
@@ -106,6 +106,9 @@
    private String staffNameLike;
    private String logStartTime;
    private String logEndTime;
    private List<OwnerCarAttrDto> ownerCarAttrDto;
    public String getCarColor() {
@@ -547,4 +550,20 @@
    public void setStaffNameLike(String staffNameLike) {
        this.staffNameLike = staffNameLike;
    }
    public String getLogStartTime() {
        return logStartTime;
    }
    public void setLogStartTime(String logStartTime) {
        this.logStartTime = logStartTime;
    }
    public String getLogEndTime() {
        return logEndTime;
    }
    public void setLogEndTime(String logEndTime) {
        this.logEndTime = logEndTime;
    }
}
java110-bean/src/main/java/com/java110/dto/questionAnswer/QuestionAnswerDto.java
@@ -26,12 +26,15 @@
    private String qaName;
    private String qaType;
    private String qaTypeName;
    private String startTime;
    private String remark;
    private String endTime;
    private String communityId;
    private String content;
    private String qaId;
    private String objType;
    private String objId;
    private String titleType;
@@ -122,7 +125,6 @@
    public void setQaId(String qaId) {
        this.qaId = qaId;
    }
    public Date getCreateTime() {
        return createTime;
@@ -227,4 +229,28 @@
    public void setScore(long score) {
        this.score = score;
    }
    public String getObjType() {
        return objType;
    }
    public void setObjType(String objType) {
        this.objType = objType;
    }
    public String getObjId() {
        return objId;
    }
    public void setObjId(String objId) {
        this.objId = objId;
    }
    public String getQaTypeName() {
        return qaTypeName;
    }
    public void setQaTypeName(String qaTypeName) {
        this.qaTypeName = qaTypeName;
    }
}
java110-bean/src/main/java/com/java110/dto/repair/RepairUserDto.java
@@ -36,6 +36,7 @@
    public static final String STATE_EVALUATE = "11000";//待评价
    public static final String STATE_FINISH_PAY_FEE = "12000";//已支付
    public static final String STATE_STOP = "12001";//暂停
    public static final String STATE_START = "12002";//启动
    private String context;
    private String repairId;
java110-bean/src/main/java/com/java110/dto/resource/ResourceStoreDto.java
@@ -75,6 +75,7 @@
    //是否是固定物品
    private String isFixed;
    private String isFixedName;
    private String timesId;
    private String communityId;
@@ -232,8 +233,6 @@
        this.shName = shName;
    }
    public String getWarningStock() {
        return warningStock;
    }
@@ -386,8 +385,6 @@
        this.isFixedName = isFixedName;
    }
    public List<ResourceStoreTimesDto> getTimes() {
        return times;
    }
@@ -419,4 +416,12 @@
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    public String getTimesId() {
        return timesId;
    }
    public void setTimesId(String timesId) {
        this.timesId = timesId;
    }
}
java110-bean/src/main/java/com/java110/dto/room/RoomDto.java
@@ -105,8 +105,10 @@
    private String operate;
    private String staffNameLike;
    private String logStartTime;
    private String logEndTime;
    public String getFeeCoefficient() {
        return feeCoefficient;
@@ -563,4 +565,28 @@
    public void setOperate(String operate) {
        this.operate = operate;
    }
    public String getStaffNameLike() {
        return staffNameLike;
    }
    public void setStaffNameLike(String staffNameLike) {
        this.staffNameLike = staffNameLike;
    }
    public String getLogStartTime() {
        return logStartTime;
    }
    public void setLogStartTime(String logStartTime) {
        this.logStartTime = logStartTime;
    }
    public String getLogEndTime() {
        return logEndTime;
    }
    public void setLogEndTime(String logEndTime) {
        this.logEndTime = logEndTime;
    }
}
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyDetailPo.java
@@ -34,6 +34,8 @@
    private String consultPrice;
    private String shId;
    private String bId;
    public String getApplyOrderId() {
        return applyOrderId;
    }
@@ -153,4 +155,12 @@
    public void setShId(String shId) {
        this.shId = shId;
    }
    public String getbId() {
        return bId;
    }
    public void setbId(String bId) {
        this.bId = bId;
    }
}
java110-bean/src/main/java/com/java110/po/questionAnswer/QuestionAnswerPo.java
@@ -37,6 +37,8 @@
    private String communityId;
    private String content;
    private String qaId;
    private String objType;
    private String objId;
    private String state;
@@ -119,4 +121,20 @@
    public void setState(String state) {
        this.state = state;
    }
    public String getObjType() {
        return objType;
    }
    public void setObjType(String objType) {
        this.objType = objType;
    }
    public String getObjId() {
        return objId;
    }
    public void setObjId(String objId) {
        this.objId = objId;
    }
}
java110-bean/src/main/java/com/java110/vo/api/auditAppUserBindingOwner/ApiAuditAppUserBindingOwnerDataVo.java
@@ -1,7 +1,6 @@
package com.java110.vo.api.auditAppUserBindingOwner;
import java.io.Serializable;
import java.util.Date;
public class ApiAuditAppUserBindingOwnerDataVo implements Serializable {
@@ -24,6 +23,8 @@
    private String parentAreaName;
    private String userId;
    private String ownerId;
    private String ownerName;
    public String getAppUserId() {
        return appUserId;
@@ -160,4 +161,20 @@
    public void setAppTypeName(String appTypeName) {
        this.appTypeName = appTypeName;
    }
    public String getOwnerId() {
        return ownerId;
    }
    public void setOwnerId(String ownerId) {
        this.ownerId = ownerId;
    }
    public String getOwnerName() {
        return ownerName;
    }
    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }
}
java110-bean/src/main/java/com/java110/vo/api/resourceStore/ApiResourceStoreDataVo.java
@@ -61,6 +61,8 @@
    private String totalPrice;
    private String timesId;
    private List<ResourceStoreTimesDto> times;
    public String getResId() {
        return resId;
@@ -349,4 +351,12 @@
    public void setTotalPrice(String totalPrice) {
        this.totalPrice = totalPrice;
    }
    public String getTimesId() {
        return timesId;
    }
    public void setTimesId(String timesId) {
        this.timesId = timesId;
    }
}
java110-db/src/main/resources/mapper/acct/AccountServiceDaoImplMapper.xml
@@ -91,9 +91,15 @@
        select t.amount,t.acct_type,t.acct_type acctType,t.obj_id,t.obj_id objId,t.acct_id,t.acct_id
        acctId,t.status_cd,t.status_cd statusCd,t.acct_name,t.acct_name acctName,t.b_id,t.b_id bId,t.obj_type,t.obj_type
        objType,t.create_time createTime,td.`name` acctTypeName,t.part_id,t.part_id partId,t.link
        <if test="objType !=null and objType == 6006">
            ,bo.id_card idCard
        </if>
        from account t
        LEFT JOIN t_dict td on t.acct_type = td.status_cd and td.table_name = 'account' and td.table_columns =
        'acct_type'
        <if test="objType !=null and objType == 6006">
            left join building_owner bo on t.obj_id = bo.owner_id and bo.status_cd = '0'
        </if>
        where 1 =1
        <if test="amount !=null and amount != ''">
            and t.amount= #{amount}
@@ -186,6 +192,11 @@
    <select id="queryAccountsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from account t
        LEFT JOIN t_dict td on t.acct_type = td.status_cd and td.table_name = 'account' and td.table_columns =
        'acct_type'
        <if test="objType !=null and objType == 6006">
            left join building_owner bo on t.obj_id = bo.owner_id and bo.status_cd = '0'
        </if>
        where 1 =1
        <if test="amount !=null and amount != ''">
            and t.amount= #{amount}
java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml
@@ -1,19 +1,15 @@
<?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="communityPublicityV1ServiceDaoImpl">
    <!-- 保存小区公示信息 add by wuxw 2018-07-03 -->
    <insert id="saveCommunityPublicityInfo" parameterType="Map">
        insert into community_publicity(
        create_user_id,pub_id,context,collect_count,pub_type,like_count,create_user_name,title,community_id,read_count,header_img
        ) values (
        #{createUserId},#{pubId},#{context},#{collectCount},#{pubType},#{likeCount},#{createUserName},#{title},#{communityId},#{readCount},#{headerImg}
        )
        insert into community_publicity(create_user_id, pub_id, context, collect_count, pub_type, like_count,
                                        create_user_name, title, community_id, read_count, header_img)
        values (#{createUserId}, #{pubId}, #{context}, #{collectCount}, #{pubType}, #{likeCount}, #{createUserName},
                #{title}, #{communityId}, #{readCount}, #{headerImg})
    </insert>
    <!-- 查询小区公示信息 add by wuxw 2018-07-03 -->
    <select id="getCommunityPublicityInfo" parameterType="Map" resultType="Map">
@@ -24,7 +20,8 @@
        communityId,t.read_count,t.read_count readCount,t.header_img,t.header_img headerImg,
        t.create_time createTime,td.`name` pubTypeName
        from community_publicity t
        left join t_dict td on t.pub_type = td.status_cd and td.table_name = 'community_publicity' and td.table_columns = 'pub_type'
        left join t_dict td on t.pub_type = td.status_cd and td.table_name = 'community_publicity' and td.table_columns
        = 'pub_type'
        where 1 =1
        <if test="createUserId !=null and createUserId != ''">
            and t.create_user_id= #{createUserId}
@@ -51,7 +48,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="title !=null and title != ''">
            and t.title= #{title}
            and t.title like concat('%',#{title},'%')
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
@@ -66,9 +63,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改小区公示信息 add by wuxw 2018-07-03 -->
    <update id="updateCommunityPublicityInfo" parameterType="Map">
@@ -110,7 +105,6 @@
        <if test="pubId !=null and pubId != ''">
            and t.pub_id= #{pubId}
        </if>
    </update>
    <!-- 查询小区公示数量 add by wuxw 2018-07-03 -->
@@ -143,7 +137,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="title !=null and title != ''">
            and t.title= #{title}
            and t.title like concat('%',#{title},'%')
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
@@ -154,8 +148,5 @@
        <if test="headerImg !=null and headerImg != ''">
            and t.header_img= #{headerImg}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/common/ItemReleaseTypeV1ServiceDaoImplMapper.xml
@@ -1,16 +1,12 @@
<?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="itemReleaseTypeV1ServiceDaoImpl">
    <!-- 保存放行类型信息 add by wuxw 2018-07-03 -->
    <insert id="saveItemReleaseTypeInfo" parameterType="Map">
        insert into item_release_type(
        type_name,type_id,remark,community_id,flow_id,flow_name
        ) values (
        #{typeName},#{typeId},#{remark},#{communityId},#{flowId},#{flowName}
        )
        insert into item_release_type(type_name, type_id, remark, community_id, flow_id, flow_name)
        values (#{typeName}, #{typeId}, #{remark}, #{communityId}, #{flowId}, #{flowName})
    </insert>
    <!-- 查询放行类型信息 add by wuxw 2018-07-03 -->
@@ -21,7 +17,7 @@
        from item_release_type t
        where 1 =1
        <if test="typeName !=null and typeName != ''">
            and t.type_name= #{typeName}
            and t.type_name like concat('%',#{typeName},'%')
        </if>
        <if test="typeId !=null and typeId != ''">
            and t.type_id= #{typeId}
@@ -45,9 +41,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改放行类型信息 add by wuxw 2018-07-03 -->
    <update id="updateItemReleaseTypeInfo" parameterType="Map">
@@ -74,7 +68,6 @@
        <if test="typeId !=null and typeId != ''">
            and t.type_id= #{typeId}
        </if>
    </update>
    <!-- 查询放行类型数量 add by wuxw 2018-07-03 -->
@@ -83,7 +76,7 @@
        from item_release_type t
        where 1 =1
        <if test="typeName !=null and typeName != ''">
            and t.type_name= #{typeName}
            and t.type_name like concat('%',#{typeName},'%')
        </if>
        <if test="typeId !=null and typeId != ''">
            and t.type_id= #{typeId}
@@ -103,8 +96,5 @@
        <if test="flowName !=null and flowName != ''">
            and t.flow_name= #{flowName}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/common/ItemReleaseV1ServiceDaoImplMapper.xml
@@ -1,16 +1,14 @@
<?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="itemReleaseV1ServiceDaoImpl">
    <!-- 保存放行管理信息 add by wuxw 2018-07-03 -->
    <insert id="saveItemReleaseInfo" parameterType="Map">
        insert into item_release(
        apply_company,id_card,pass_time,car_num,remark,apply_person,ir_id,apply_tel,type_id,state,community_id,create_user_id
        ) values (
        #{applyCompany},#{idCard},#{passTime},#{carNum},#{remark},#{applyPerson},#{irId},#{applyTel},#{typeId},#{state},#{communityId},#{createUserId}
        )
        insert into item_release(apply_company, id_card, pass_time, car_num, remark, apply_person, ir_id, apply_tel,
                                 type_id, state, community_id, create_user_id)
        values (#{applyCompany}, #{idCard}, #{passTime}, #{carNum}, #{remark}, #{applyPerson}, #{irId}, #{applyTel},
                #{typeId}, #{state}, #{communityId}, #{createUserId})
    </insert>
    <!-- 查询放行管理信息 add by wuxw 2018-07-03 -->
@@ -18,12 +16,15 @@
        select t.apply_company,t.apply_company applyCompany,t.id_card,t.id_card idCard,t.pass_time,t.pass_time
        passTime,t.car_num,t.car_num carNum,t.remark,t.status_cd,t.status_cd statusCd,t.apply_person,t.apply_person
        applyPerson,t.ir_id,t.ir_id irId,t.apply_tel,t.apply_tel applyTel,t.type_id,t.type_id
        typeId,t.state,t.community_id,t.community_id communityId,irt.type_name typeName,irt.flow_id flowId,irt.flow_name flowName,
        typeId,t.state,t.community_id,t.community_id communityId,irt.type_name typeName,irt.flow_id flowId,irt.flow_name
        flowName,
        td.name stateName,t.create_time createTime,SUM(irr.amount) amount,t.create_user_id createUserId
        from item_release t
        LEFT JOIN item_release_type irt on t.type_id = irt.type_id and irt.status_cd = '0' and irt.community_id = t.community_id
        LEFT JOIN item_release_type irt on t.type_id = irt.type_id and irt.status_cd = '0' and irt.community_id =
        t.community_id
        left join t_dict td on t.state = td.status_cd and td.table_name = 'item_release' and td.table_columns = 'state'
        left join item_release_res irr on t.ir_id = irr.ir_id and t.community_id = irr.community_id and irr.status_cd = '0'
        left join item_release_res irr on t.ir_id = irr.ir_id and t.community_id = irr.community_id and irr.status_cd =
        '0'
        where 1 =1
        <if test="applyCompany !=null and applyCompany != ''">
            and t.apply_company= #{applyCompany}
@@ -44,7 +45,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="applyPerson !=null and applyPerson != ''">
            and t.apply_person= #{applyPerson}
            and t.apply_person like concat('%',#{applyPerson},'%')
        </if>
        <if test="irId !=null and irId != ''">
            and t.ir_id= #{irId}
@@ -70,15 +71,14 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        group by t.create_time,t.apply_company,t.id_card,t.pass_time,t.car_num,t.remark,t.status_cd,t.apply_person,t.ir_id,t.apply_tel,t.type_id,t.state,t.community_id,irt.type_name,irt.flow_id ,irt.flow_name,
        td.name
        group by
        t.create_time,t.apply_company,t.id_card,t.pass_time,t.car_num,t.remark,t.status_cd,t.apply_person,t.ir_id,
        t.apply_tel,t.type_id,t.state,t.community_id,irt.type_name,irt.flow_id,irt.flow_name,td.name
        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="updateItemReleaseInfo" parameterType="Map">
@@ -113,7 +113,6 @@
        <if test="state !=null and state != ''">
            , t.state= #{state}
        </if>
        where 1=1
        <if test="irId !=null and irId != ''">
            and t.ir_id= #{irId}
@@ -147,7 +146,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="applyPerson !=null and applyPerson != ''">
            and t.apply_person= #{applyPerson}
            and t.apply_person like concat('%',#{applyPerson},'%')
        </if>
        <if test="irId !=null and irId != ''">
            and t.ir_id= #{irId}
@@ -175,5 +174,4 @@
            and t.community_id= #{communityId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/common/MachinePrinterV1ServiceDaoImplMapper.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="machinePrinterV1ServiceDaoImpl">
    <!-- 保存云打印机信息 add by wuxw 2018-07-03 -->
    <insert id="saveMachinePrinterInfo" parameterType="Map">
        insert into machine_printer(
        impl_bean,machine_id,machine_code,community_id,machine_name
        ) values (
        #{implBean},#{machineId},#{machineCode},#{communityId},#{machineName}
        )
        insert into machine_printer(impl_bean, machine_id, machine_code, community_id, machine_name)
        values (#{implBean}, #{machineId}, #{machineCode}, #{communityId}, #{machineName})
    </insert>
    <!-- 查询云打印机信息 add by wuxw 2018-07-03 -->
    <select id="getMachinePrinterInfo" parameterType="Map" resultType="Map">
@@ -21,7 +15,8 @@
        machineCode,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id
        communityId,t.machine_name,t.machine_name machineName,td.`name` implBeanName
        from machine_printer t
        left join t_dict td on t.impl_bean = td.status_cd and td.table_name = 'machine_printer' and td.table_columns = 'impl_bean'
        left join t_dict td on t.impl_bean = td.status_cd and td.table_name = 'machine_printer' and td.table_columns =
        'impl_bean'
        where 1 =1
        <if test="implBean !=null and implBean != ''">
            and t.impl_bean= #{implBean}
@@ -39,15 +34,13 @@
            and t.community_id= #{communityId}
        </if>
        <if test="machineName !=null and machineName != ''">
            and t.machine_name= #{machineName}
            and t.machine_name like '%${machineName}%'
        </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="updateMachinePrinterInfo" parameterType="Map">
@@ -71,7 +64,6 @@
        <if test="machineId !=null and machineId != ''">
            and t.machine_id= #{machineId}
        </if>
    </update>
    <!-- 查询云打印机数量 add by wuxw 2018-07-03 -->
@@ -95,10 +87,7 @@
            and t.community_id= #{communityId}
        </if>
        <if test="machineName !=null and machineName != ''">
            and t.machine_name= #{machineName}
            and t.machine_name like '%${machineName}%'
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/common/MeterMachineFactoryV1ServiceDaoImplMapper.xml
@@ -1,97 +1,81 @@
<?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="meterMachineFactoryV1ServiceDaoImpl">
    <!-- 保存电表厂家信息 add by wuxw 2018-07-03 -->
    <insert id="saveMeterMachineFactoryInfo" parameterType="Map">
        insert into meter_machine_factory(
factory_id,factory_name,remark,bean_impl
) values (
#{factoryId},#{factoryName},#{remark},#{beanImpl}
)
        insert into meter_machine_factory(factory_id, factory_name, remark, bean_impl)
        values (#{factoryId}, #{factoryName}, #{remark}, #{beanImpl})
    </insert>
    <!-- 查询电表厂家信息 add by wuxw 2018-07-03 -->
    <select id="getMeterMachineFactoryInfo" parameterType="Map" resultType="Map">
        select  t.factory_id,t.factory_id factoryId,t.factory_name,t.factory_name factoryName,t.remark,t.status_cd,t.status_cd statusCd,t.bean_impl,t.bean_impl beanImpl
from meter_machine_factory t
where 1 =1
<if test="factoryId !=null and factoryId != ''">
   and t.factory_id= #{factoryId}
</if>
<if test="factoryName !=null and factoryName != ''">
   and t.factory_name= #{factoryName}
</if>
<if test="remark !=null and remark != ''">
   and t.remark= #{remark}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="beanImpl !=null and beanImpl != ''">
   and t.bean_impl= #{beanImpl}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
   limit #{page}, #{row}
</if>
        select t.factory_id,t.factory_id factoryId,t.factory_name,t.factory_name
        factoryName,t.remark,t.status_cd,t.status_cd statusCd,t.bean_impl,t.bean_impl beanImpl
        from meter_machine_factory t
        where 1 =1
        <if test="factoryId !=null and factoryId != ''">
            and t.factory_id= #{factoryId}
        </if>
        <if test="factoryName !=null and factoryName != ''">
            and t.factory_name= #{factoryName}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="beanImpl !=null and beanImpl != ''">
            and t.bean_impl= #{beanImpl}
        </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="updateMeterMachineFactoryInfo" parameterType="Map">
        update  meter_machine_factory t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="factoryName !=null and factoryName != ''">
, t.factory_name= #{factoryName}
</if>
<if test="remark !=null and remark != ''">
, t.remark= #{remark}
</if>
<if test="beanImpl !=null and beanImpl != ''">
, t.bean_impl= #{beanImpl}
</if>
 where 1=1 <if test="factoryId !=null and factoryId != ''">
and t.factory_id= #{factoryId}
</if>
        update meter_machine_factory t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="factoryName !=null and factoryName != ''">
            , t.factory_name= #{factoryName}
        </if>
        <if test="remark !=null and remark != ''">
            , t.remark= #{remark}
        </if>
        <if test="beanImpl !=null and beanImpl != ''">
            , t.bean_impl= #{beanImpl}
        </if>
        where 1=1
        <if test="factoryId !=null and factoryId != ''">
            and t.factory_id= #{factoryId}
        </if>
    </update>
    <!-- 查询电表厂家数量 add by wuxw 2018-07-03 -->
     <select id="queryMeterMachineFactorysCount" parameterType="Map" resultType="Map">
        select  count(1) count
from meter_machine_factory t
where 1 =1
<if test="factoryId !=null and factoryId != ''">
   and t.factory_id= #{factoryId}
</if>
<if test="factoryName !=null and factoryName != ''">
   and t.factory_name= #{factoryName}
</if>
<if test="remark !=null and remark != ''">
   and t.remark= #{remark}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="beanImpl !=null and beanImpl != ''">
   and t.bean_impl= #{beanImpl}
</if>
     </select>
    <select id="queryMeterMachineFactorysCount" parameterType="Map" resultType="Map">
        select count(1) count
        from meter_machine_factory t
        where 1 =1
        <if test="factoryId !=null and factoryId != ''">
            and t.factory_id= #{factoryId}
        </if>
        <if test="factoryName !=null and factoryName != ''">
            and t.factory_name= #{factoryName}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="beanImpl !=null and beanImpl != ''">
            and t.bean_impl= #{beanImpl}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/community/CommunitySpaceV1ServiceDaoImplMapper.xml
@@ -1,19 +1,15 @@
<?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="communitySpaceV1ServiceDaoImpl">
    <!-- 保存小区场地信息 add by wuxw 2018-07-03 -->
    <insert id="saveCommunitySpaceInfo" parameterType="Map">
        insert into community_space(
        admin_name,space_id,name,start_time,tel,end_time,state,community_id,fee_money,venue_id
        ) values (
        #{adminName},#{spaceId},#{name},#{startTime},#{tel},#{endTime},#{state},#{communityId},#{feeMoney},#{venueId}
        )
        insert into community_space(admin_name, space_id, name, start_time, tel, end_time, state, community_id,
                                    fee_money, venue_id)
        values (#{adminName}, #{spaceId}, #{name}, #{startTime}, #{tel}, #{endTime}, #{state}, #{communityId},
                #{feeMoney}, #{venueId})
    </insert>
    <!-- 查询小区场地信息 add by wuxw 2018-07-03 -->
    <select id="getCommunitySpaceInfo" parameterType="Map" resultType="Map">
@@ -31,9 +27,8 @@
        <if test="venueId !=null and venueId != ''">
            and t.venue_id= #{venueId}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.start_time= #{startTime}
@@ -60,9 +55,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改小区场地信息 add by wuxw 2018-07-03 -->
    <update id="updateCommunitySpaceInfo" parameterType="Map">
@@ -101,7 +94,6 @@
        <if test="venueId !=null and venueId != ''">
            and t.venue_id= #{venueId}
        </if>
    </update>
    <!-- 查询小区场地数量 add by wuxw 2018-07-03 -->
@@ -119,7 +111,7 @@
            and t.venue_id= #{venueId}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.start_time= #{startTime}
@@ -142,8 +134,5 @@
        <if test="feeMoney !=null and feeMoney != ''">
            and t.fee_money= #{feeMoney}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/community/FloorServiceDaoImplMapper.xml
@@ -1,18 +1,14 @@
<?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="floorServiceDaoImpl">
    <!-- 保存小区楼信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessFloorInfo" parameterType="Map">
        insert into business_floor(
        floor_id,operate,name,remark,b_id,user_id,floor_num,community_id,floor_area
        ) values (
        #{floorId},#{operate},#{name},#{remark},#{bId},#{userId},#{floorNum},#{communityId},#{floorArea}
        )
        insert into business_floor(floor_id, operate, name, remark, b_id, user_id, floor_num, community_id, floor_area)
        values (#{floorId}, #{operate}, #{name}, #{remark}, #{bId}, #{userId}, #{floorNum}, #{communityId},
                #{floorArea})
    </insert>
    <!-- 查询小区楼信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessFloorInfo" parameterType="Map" resultType="Map">
@@ -45,7 +41,6 @@
        </if>
    </select>
    <!-- 保存小区楼信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveFloorInfoInstance" parameterType="Map">
        insert into f_floor(
@@ -76,11 +71,11 @@
        </if>
    </insert>
    <!-- 查询小区楼信息 add by wuxw 2018-07-03 -->
    <select id="getFloorInfo" parameterType="Map" resultType="Map">
        select t.floor_id,t.floor_id floorId,t.name,t.status_cd, t.status_cd statusCd,t.remark,t.b_id,
        t.b_id bId,t.user_id, t.user_id userId,t.floor_num ,t.floor_num floorNum,t.community_id communityId,t.community_id,
        t.b_id bId,t.user_id, t.user_id userId,t.floor_num ,t.floor_num floorNum,t.community_id
        communityId,t.community_id,
        t.floor_area,t.floor_area floorArea,t.seq
        from f_floor t
        where 1 =1
@@ -114,7 +109,6 @@
        </if>
    </select>
    <!-- 修改小区楼信息 add by wuxw 2018-07-03 -->
    <update id="updateFloorInfoInstance" parameterType="Map">
        update f_floor t set t.status_cd = #{statusCd}
@@ -146,7 +140,6 @@
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
    </update>
    <select id="queryFloorsCount" parameterType="Map" resultType="Map">
@@ -182,13 +175,11 @@
        <if test="bId !=null and bId != ''">
            and f.b_id= #{bId}
        </if>
        <if test="floorNum !=null and floorNum != ''">
            and f.floor_num= #{floorNum}
        </if>
        AND f.`status_cd` = '0'
    </select>
    <!-- 查询小区 内的楼 -->
    <select id="queryFloors" parameterType="Map" resultType="Map">
@@ -243,8 +234,10 @@
    <!-- 查询小区单元信息 add by wuxw 2018-07-03 -->
    <select id="queryFloorAndUnits" parameterType="Map" resultType="Map">
        select t.floor_id,t.floor_id floorId,t.`name` floorName,bu.layer_count,bu.layer_count layerCount,bu.unit_id,bu.unit_id
        unitId,bu.unit_num,bu.unit_num unitNum,bu.lift,bu.remark,bu.unit_area,bu.unit_area unitArea,t.floor_num floorNum,t.seq
        select t.floor_id,t.floor_id floorId,t.`name` floorName,bu.layer_count,bu.layer_count
        layerCount,bu.unit_id,bu.unit_id
        unitId,bu.unit_num,bu.unit_num unitNum,bu.lift,bu.remark,bu.unit_area,bu.unit_area unitArea,t.floor_num
        floorNum,t.seq
        from f_floor t
        left join building_unit bu on t.`floor_id` = bu.`floor_id` and bu.status_cd = '0'
        where 1 =1
@@ -273,7 +266,7 @@
        <if test="lift !=null and lift != ''">
            and bu.lift= #{lift}
        </if>
        order by t.floor_num  * 1,bu.unit_num * 1 asc
        order by t.floor_num * 1,bu.unit_num * 1 asc
        <!-- <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>limit 10;-->
java110-db/src/main/resources/mapper/community/PropertyRightRegistrationV1ServiceDaoImplMapper.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="propertyRightRegistrationV1ServiceDaoImpl">
    <!-- 保存房屋产权信息 add by wuxw 2018-07-03 -->
@@ -25,7 +24,7 @@
        table_columns = 'state'
        where 1 = 1
        <if test="address !=null and address != ''">
            and t.address= #{address}
            and t.address like concat('%',#{address},'%')
        </if>
        <if test="prrId !=null and prrId != ''">
            and t.prr_id= #{prrId}
@@ -34,7 +33,7 @@
            and t.id_card= #{idCard}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="link !=null and link != ''">
            and t.link= #{link}
@@ -77,7 +76,6 @@
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改房屋产权信息 add by wuxw 2018-07-03 -->
    <update id="updatePropertyRightRegistrationInfo" parameterType="Map">
@@ -127,7 +125,7 @@
        left join f_floor fl on bu.floor_id = fl.floor_id and fl.status_cd = '0'
        where 1 = 1
        <if test="address !=null and address != ''">
            and t.address= #{address}
            and t.address like concat('%',#{address},'%')
        </if>
        <if test="prrId !=null and prrId != ''">
            and t.prr_id= #{prrId}
@@ -136,7 +134,7 @@
            and t.id_card= #{idCard}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="link !=null and link != ''">
            and t.link= #{link}
@@ -175,5 +173,4 @@
            and t.community_id= #{communityId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/community/RepairServiceDaoImplMapper.xml
@@ -523,7 +523,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
            and ru.state= #{state}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
java110-db/src/main/resources/mapper/fee/ApplyRoomDiscountTypeServiceDaoImplMapper.xml
@@ -1,97 +1,81 @@
<?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="applyRoomDiscountTypeServiceDaoImpl">
    <!-- 保存优惠申请类型信息 add by wuxw 2018-07-03 -->
    <insert id="saveApplyRoomDiscountTypeInfo" parameterType="Map">
        insert into apply_room_discount_type(
apply_type,type_desc,type_name,community_id
) values (
#{applyType},#{typeDesc},#{typeName},#{communityId}
)
        insert into apply_room_discount_type(apply_type, type_desc, type_name, community_id)
        values (#{applyType}, #{typeDesc}, #{typeName}, #{communityId})
    </insert>
    <!-- 查询优惠申请类型信息 add by wuxw 2018-07-03 -->
    <select id="getApplyRoomDiscountTypeInfo" parameterType="Map" resultType="Map">
        select  t.apply_type,t.apply_type applyType,t.type_desc,t.type_desc typeDesc,t.type_name,t.type_name typeName,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId
from apply_room_discount_type t
where 1 =1
<if test="applyType !=null and applyType != ''">
   and t.apply_type= #{applyType}
</if>
<if test="typeDesc !=null and typeDesc != ''">
   and t.type_desc= #{typeDesc}
</if>
<if test="typeName !=null and typeName != ''">
   and t.type_name= #{typeName}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
   limit #{page}, #{row}
</if>
        select t.apply_type,t.apply_type applyType,t.type_desc,t.type_desc typeDesc,t.type_name,t.type_name
        typeName,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId
        from apply_room_discount_type t
        where 1 =1
        <if test="applyType !=null and applyType != ''">
            and t.apply_type= #{applyType}
        </if>
        <if test="typeDesc !=null and typeDesc != ''">
            and t.type_desc= #{typeDesc}
        </if>
        <if test="typeName !=null and typeName != ''">
            and t.type_name like '%${typeName}%'
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        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="updateApplyRoomDiscountTypeInfo" parameterType="Map">
        update  apply_room_discount_type t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="typeDesc !=null and typeDesc != ''">
, t.type_desc= #{typeDesc}
</if>
<if test="typeName !=null and typeName != ''">
, t.type_name= #{typeName}
</if>
<if test="communityId !=null and communityId != ''">
, t.community_id= #{communityId}
</if>
 where 1=1 <if test="applyType !=null and applyType != ''">
and t.apply_type= #{applyType}
</if>
        update apply_room_discount_type t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="typeDesc !=null and typeDesc != ''">
            , t.type_desc= #{typeDesc}
        </if>
        <if test="typeName !=null and typeName != ''">
            , t.type_name= #{typeName}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        where 1=1
        <if test="applyType !=null and applyType != ''">
            and t.apply_type= #{applyType}
        </if>
    </update>
    <!-- 查询优惠申请类型数量 add by wuxw 2018-07-03 -->
     <select id="queryApplyRoomDiscountTypesCount" parameterType="Map" resultType="Map">
        select  count(1) count
from apply_room_discount_type t
where 1 =1
<if test="applyType !=null and applyType != ''">
   and t.apply_type= #{applyType}
</if>
<if test="typeDesc !=null and typeDesc != ''">
   and t.type_desc= #{typeDesc}
</if>
<if test="typeName !=null and typeName != ''">
   and t.type_name= #{typeName}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
     </select>
    <select id="queryApplyRoomDiscountTypesCount" parameterType="Map" resultType="Map">
        select count(1) count
        from apply_room_discount_type t
        where 1 =1
        <if test="applyType !=null and applyType != ''">
            and t.apply_type= #{applyType}
        </if>
        <if test="typeDesc !=null and typeDesc != ''">
            and t.type_desc= #{typeDesc}
        </if>
        <if test="typeName !=null and typeName != ''">
            and t.type_name like '%${typeName}%'
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/fee/FeeComboV1ServiceDaoImplMapper.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="feeComboV1ServiceDaoImpl">
    <!-- 保存费用套餐信息 add by wuxw 2018-07-03 -->
    <insert id="saveFeeComboInfo" parameterType="Map">
        insert into fee_combo(
        combo_name,combo_id,community_id,remark
        ) values (
        #{comboName},#{comboId},#{communityId},#{remark}
        )
        insert into fee_combo(combo_name, combo_id, community_id, remark)
        values (#{comboName}, #{comboId}, #{communityId}, #{remark})
    </insert>
    <!-- 查询费用套餐信息 add by wuxw 2018-07-03 -->
    <select id="getFeeComboInfo" parameterType="Map" resultType="Map">
@@ -22,7 +16,7 @@
        from fee_combo t
        where 1 =1
        <if test="comboName !=null and comboName != ''">
            and t.combo_name= #{comboName}
            and t.combo_name like '%${comboName}%'
        </if>
        <if test="comboId !=null and comboId != ''">
            and t.combo_id= #{comboId}
@@ -37,9 +31,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改费用套餐信息 add by wuxw 2018-07-03 -->
    <update id="updateFeeComboInfo" parameterType="Map">
@@ -60,7 +52,6 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </update>
    <!-- 查询费用套餐数量 add by wuxw 2018-07-03 -->
@@ -69,7 +60,7 @@
        from fee_combo t
        where 1 =1
        <if test="comboName !=null and comboName != ''">
            and t.combo_name= #{comboName}
            and t.combo_name like '%${comboName}%'
        </if>
        <if test="comboId !=null and comboId != ''">
            and t.combo_id= #{comboId}
@@ -80,8 +71,5 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/fee/PayFeeQrcodeV1ServiceDaoImplMapper.xml
@@ -1,9 +1,7 @@
<?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="payFeeQrcodeV1ServiceDaoImpl">
    <!-- 保存支付二维码信息 add by wuxw 2018-07-03 -->
    <insert id="savePayFeeQrcodeInfo" parameterType="Map">
@@ -13,7 +11,6 @@
        #{createStaffName},#{queryWay},#{createStaffId},#{preFee},#{customFee},#{pfqId},#{qrcodeName},#{communityId},#{smsValidate},#{content},#{state},#{feeType}
        )
    </insert>
    <!-- 查询支付二维码信息 add by wuxw 2018-07-03 -->
    <select id="getPayFeeQrcodeInfo" parameterType="Map" resultType="Map">
@@ -46,7 +43,7 @@
            and t.pfq_id= #{pfqId}
        </if>
        <if test="qrcodeName !=null and qrcodeName != ''">
            and t.qrcode_name= #{qrcodeName}
            and t.qrcode_name like concat('%',#{qrcodeName},'%')
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
@@ -67,9 +64,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改支付二维码信息 add by wuxw 2018-07-03 -->
    <update id="updatePayFeeQrcodeInfo" parameterType="Map">
@@ -115,7 +110,6 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </update>
    <!-- 查询支付二维码数量 add by wuxw 2018-07-03 -->
@@ -145,7 +139,7 @@
            and t.pfq_id= #{pfqId}
        </if>
        <if test="qrcodeName !=null and qrcodeName != ''">
            and t.qrcode_name= #{qrcodeName}
            and t.qrcode_name like concat('%',#{qrcodeName},'%')
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
@@ -162,7 +156,5 @@
        <if test="feeType !=null and feeType != ''">
            and t.fee_type= #{feeType}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/fee/TempCarFeeConfigServiceDaoImplMapper.xml
@@ -5,11 +5,10 @@
    <!-- 保存临时车收费标准信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessTempCarFeeConfigInfo" parameterType="Map">
        insert into business_temp_car_fee_config(
        car_type,operate,config_id,fee_name,pa_id,area_num,start_time,end_time,b_id,rule_id,community_id,fee_config_id
        ) values (
        #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId},#{feeConfigId}
        )
        insert into business_temp_car_fee_config(car_type, operate, config_id, fee_name, pa_id, area_num, start_time,
                                                 end_time, b_id, rule_id, community_id, fee_config_id)
        values (#{carType}, #{operate}, #{configId}, #{feeName}, #{paId}, #{areaNum}, #{startTime}, #{endTime}, #{bId},
                #{ruleId}, #{communityId}, #{feeConfigId})
    </insert>
    <!-- 查询临时车收费标准信息(Business) add by wuxw 2018-07-03 -->
@@ -100,11 +99,13 @@
        select t.car_type,t.car_type carType,t.config_id,t.config_id configId,t.fee_name,t.fee_name
        feeName,t.pa_id,t.pa_id paId,t.area_num,t.area_num areaNum,t.status_cd,t.status_cd
        statusCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.b_id,t.b_id bId,t.rule_id,t.rule_id
        ruleId,t.community_id,t.community_id communityId,tcfr.rule_name ruleName,td.name carTypeName,t.fee_config_id,t.fee_config_id feeConfigId
        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'
        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}
@@ -113,13 +114,16 @@
            and t.config_id= #{configId}
        </if>
        <if test="feeName !=null and feeName != ''">
            and t.fee_name= #{feeName}
            and t.fee_name like '%${feeName}%'
        </if>
        <if test="paId !=null and paId != ''">
            and t.pa_id= #{paId}
        </if>
        <if test="areaNum !=null and areaNum != ''">
            and t.area_num= #{areaNum}
        </if>
        <if test="areaNumLike !=null and areaNumLike != ''">
            and t.area_num like '%${areaNumLike}%'
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
@@ -193,7 +197,8 @@
        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'
        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}
@@ -202,7 +207,7 @@
            and t.config_id= #{configId}
        </if>
        <if test="feeName !=null and feeName != ''">
            and t.fee_name= #{feeName}
            and t.fee_name like '%${feeName}%'
        </if>
        <if test="paId !=null and paId != ''">
            and t.pa_id= #{paId}
@@ -210,6 +215,9 @@
        <if test="areaNum !=null and areaNum != ''">
            and t.area_num= #{areaNum}
        </if>
        <if test="areaNumLike !=null and areaNumLike != ''">
            and t.area_num like '%${areaNumLike}%'
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml
@@ -1,20 +1,16 @@
<?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="baseDataStatisticsServiceDaoImpl">
    <!-- 查询房屋数 -->
    <select id="getRoomCount" parameterType="Map" resultType="Map">
        select count(1) count
        from building_room t
        inner join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
        <if test="ownerId != null and ownerId != ''">
            inner join building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
            left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
        </if>
        inner join building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
        left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
        where 1=1
        and t.status_cd = '0'
        <if test="floorId != null and floorId != ''">
@@ -105,9 +101,7 @@
        </if>
    </select>
    <select id="getReceivedRoomCount" parameterType="Map" resultType="Map">
        select count(1) count
        from
        (select t.room_id
@@ -227,7 +221,6 @@
    </select>
    <select id="getOweRoomCount" parameterType="Map" resultType="Map">
        select count(1) count
        from
        (select t.room_id
@@ -648,7 +641,6 @@
            limit #{page},#{row}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml
@@ -249,21 +249,33 @@
    <!-- 查询无效费用 add by wuxw 2018-07-03 -->
    <select id="queryRoomsTree" parameterType="Map" resultType="Map">
        SELECT t.room_id,t.room_id roomId,t.layer,t.room_num,
        t.room_num roomNum,t.unit_id,u.`unit_num` unitNum,
        u.unit_id unitId,f.floor_id floorId,f.floor_num floorNum,t.`community_id` communityId,bo.owner_id ownerId
        ,bo.`name` ownerName ,bo.link link
        SELECT t.room_id,
               t.room_id        roomId,
               t.layer,
               t.room_num,
               t.room_num       roomNum,
               t.unit_id,
               u.`unit_num`     unitNum,
               u.unit_id        unitId,
               f.floor_id       floorId,
               f.floor_num      floorNum,
               t.`community_id` communityId,
               bo.owner_id      ownerId
                ,
               bo.`name`        ownerName,
               bo.link          link
        FROM building_room t
        inner join building_unit u on t.`unit_id` = u.`unit_id` and u.`status_cd` = '0'
        inner JOIN f_floor f on u.`floor_id` = f.`floor_id` AND f.`community_id` = t.`community_id` AND f.`status_cd` =
        '0'
        left join building_owner_room_rel borr on t.room_id =  borr.room_id and borr.status_cd = '0'
        left join building_owner bo on borr.owner_id =  bo.member_id and bo.status_cd = '0'
        WHERE 1 =1
        and t.status_cd = '0'
        and u.unit_id = #{unitId}
        and t.community_id= #{communityId}
        order by CONVERT(t.layer,SIGNED),CONVERT(t.room_num,SIGNED)
                 inner join building_unit u on t.`unit_id` = u.`unit_id` and u.`status_cd` = '0'
                 inner JOIN f_floor f
                            on u.`floor_id` = f.`floor_id` AND f.`community_id` = t.`community_id` AND f.`status_cd` =
                                                                                                       '0'
                 left join building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
                 left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
        WHERE 1 = 1
          and t.status_cd = '0'
          and u.unit_id = #{unitId}
          and t.community_id = #{communityId}
        order by CONVERT(t.layer, SIGNED), CONVERT(t.room_num, SIGNED)
    </select>
    <select id="queryHisOwnerCarCount" parameterType="Map" resultType="Map">
@@ -274,8 +286,10 @@
        left join u_user uu on co.user_id = uu.user_id
        left join t_dict t1 on t.car_type=t1.status_cd and t1.table_name='owner_car' and t1.table_columns = 'car_type'
        left join t_dict t2 on t.state=t2.status_cd and t2.table_name='owner_car' and t2.table_columns = 'state'
        left join t_dict t3 on t.lease_type = t3.status_cd and t3.table_name = 'owner_car' and t3.table_columns = 'lease_type'
        left join t_dict t4 on t.car_type_cd=t4.status_cd and t4.table_name='owner_car' and t4.table_columns = 'car_type_cd'
        left join t_dict t3 on t.lease_type = t3.status_cd and t3.table_name = 'owner_car' and t3.table_columns =
        'lease_type'
        left join t_dict t4 on t.car_type_cd=t4.status_cd and t4.table_name='owner_car' and t4.table_columns =
        'car_type_cd'
        left join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
        where 1=1
        <if test="carNum != null and carNum != ''">
@@ -288,8 +302,10 @@
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and t.start_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.end_time &lt;= #{logEndTime}
        </if>
        and t.community_id= #{communityId}
    </select>
@@ -309,8 +325,10 @@
        left join u_user uu on co.user_id = uu.user_id
        left join t_dict t1 on t.car_type=t1.status_cd and t1.table_name='owner_car' and t1.table_columns = 'car_type'
        left join t_dict t2 on t.state=t2.status_cd and t2.table_name='owner_car' and t2.table_columns = 'state'
        left join t_dict t3 on t.lease_type = t3.status_cd and t3.table_name = 'owner_car' and t3.table_columns = 'lease_type'
        left join t_dict t4 on t.car_type_cd=t4.status_cd and t4.table_name='owner_car' and t4.table_columns = 'car_type_cd'
        left join t_dict t3 on t.lease_type = t3.status_cd and t3.table_name = 'owner_car' and t3.table_columns =
        'lease_type'
        left join t_dict t4 on t.car_type_cd=t4.status_cd and t4.table_name='owner_car' and t4.table_columns =
        'car_type_cd'
        left join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
        where 1=1
        <if test="carNum != null and carNum != ''">
@@ -323,8 +341,10 @@
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and t.start_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.end_time &lt;= #{logEndTime}
        </if>
        and t.community_id= #{communityId}
        order by t.create_time desc,t.operate
@@ -350,8 +370,10 @@
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and co.create_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and co.create_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
    </select>
@@ -376,8 +398,10 @@
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and co.create_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and co.create_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
        order by t.create_time desc,t.operate
@@ -389,16 +413,19 @@
    <select id="queryHisFeeCount" parameterType="Map" resultType="Map">
        select count(1) count
        from business_pay_fee t
        left join  pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
        left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
        left join c_business cb on t.b_id = cb.b_id
        left join c_orders co on cb.o_id = co.o_id
        left join u_user uu on co.user_id = uu.user_id
        <if test="payerObjName != null and payerObjName != ''">
            left join pay_fee_attrs pfa on pfa.fee_id = t.fee_id and pfa.spec_cd = '390012'
        </if>
        <if test="deleteFlag != null and deleteFlag != ''">
            inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '1' and pf.b_id = t.b_id
        </if>
        where 1=1
        <if test="feeId != null and feeId != ''">
        and t.fee_id = #{feeId}
            and t.fee_id = #{feeId}
        </if>
        <if test="deleteFlag != null and deleteFlag != ''">
            and t.operate = 'DEL'
@@ -406,12 +433,17 @@
        <if test="staffNameLike != null and staffNameLike != ''">
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="feeNameLike != null and staffNameLike != ''">
        <if test="feeNameLike != null and feeNameLike != ''">
            and pfc.fee_name like concat('%',#{feeNameLike},'%')
        </if>
        <if test="payerObjName != null and payerObjName != ''">
            and pfa.value = #{payerObjName}
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and t.start_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.end_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
    </select>
@@ -421,7 +453,7 @@
        t.amount,
        uu.`name` userName,pfa.`value` payerObjName,pfa1.value ownerName,t.b_id bId,co.create_time createTime
        from business_pay_fee t
        left join  pay_fee_config pfc on t.config_id = pfc.config_id
        left join pay_fee_config pfc on t.config_id = pfc.config_id
        left join c_business cb on t.b_id = cb.b_id
        left join c_orders co on cb.o_id = co.o_id
        left join u_user uu on co.user_id = uu.user_id
@@ -438,17 +470,19 @@
            and t.operate = 'DEL'
        </if>
        <if test="payerObjName != null and payerObjName != ''">
            pfa.`value` = #{payerObjName}
            and pfa.value = #{payerObjName}
        </if>
        <if test="staffNameLike != null and staffNameLike != ''">
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="feeNameLike != null and staffNameLike != ''">
        <if test="feeNameLike != null and feeNameLike != ''">
            and pfc.fee_name like concat('%',#{feeNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and t.start_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.end_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
        order by t.create_time desc,t.operate
@@ -476,12 +510,14 @@
        <if test="staffNameLike != null and staffNameLike != ''">
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="feeNameLike != null and staffNameLike != ''">
        <if test="feeNameLike != null and feeNameLike != ''">
            and t.fee_name like concat('%',#{feeNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and t.start_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.end_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
    </select>
@@ -489,7 +525,8 @@
    <select id="queryHisFeeConfigs" parameterType="Map" resultType="Map">
        select t.operate,t.fee_type_cd feeTypeCd,t.computing_formula
        computingFormula,t.additional_amount additionalAmount,t.bill_type
        billType,t.computing_formula_text computingFormulaText,t.square_price squarePrice,t.payment_cd paymentCd,t.is_default
        billType,t.computing_formula_text computingFormulaText,t.square_price squarePrice,t.payment_cd
        paymentCd,t.is_default
        isDefault,t.config_id configId,t.fee_flag feeFlag,t.fee_name
        feeName,t.payment_cycle paymentCycle,t.start_time startTime,t.end_time
        endTime,t.community_id communityId,t.deduct_from deductFrom,
@@ -513,7 +550,7 @@
        </if>
        where 1=1
        <if test="configId != null and configId != ''">
        and t.config_id = #{configId}
            and t.config_id = #{configId}
        </if>
        <if test="deleteFlag != null and deleteFlag != ''">
            and t.operate = 'DEL'
@@ -525,8 +562,10 @@
            and t.fee_name like concat('%',#{feeNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and t.start_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.end_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
        order by t.create_time desc,t.operate
@@ -561,8 +600,10 @@
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and co.create_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and co.create_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
    </select>
@@ -572,7 +613,8 @@
        roomSubType,td1.name roomSubTypeName, t.room_area roomArea,t.room_id
        roomId,t.layer,t.fee_coefficient feeCoefficient,t.built_up_area
        builtUpArea,t.room_num roomNum,t.unit_id unitId,t.state,td.name stateName,t.community_id
        communityId,t.apartment,t.room_type roomType,t.room_rent roomRent,f.floor_num floorNum,bu.unit_num unitNum,t.b_id bId
        communityId,t.apartment,t.room_type roomType,t.room_rent roomRent,f.floor_num floorNum,bu.unit_num
        unitNum,t.b_id bId
        from business_building_room t
        left join building_unit bu on t.unit_id = bu.unit_id
        left join f_floor f on f.floor_id = bu.floor_id
@@ -599,8 +641,10 @@
            and uu.name like concat('%',#{staffNameLike},'%')
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and co.create_time &gt; #{logStartTime}
            and co.create_time &lt; #{logEndTime}
            and co.create_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and co.create_time &lt;= #{logEndTime}
        </if>
        and t.community_id = #{communityId}
        order by t.create_time desc,t.operate
@@ -608,5 +652,4 @@
            limit #{page}, #{row}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -1,23 +1,22 @@
<?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="reportFeeMonthStatisticsServiceDaoImpl">
    <!-- 保存费用月统计信息 add by wuxw 2018-07-03 -->
    <insert id="saveReportFeeMonthStatisticsInfo" parameterType="Map">
        insert into report_fee_month_statistics(receivable_amount, statistics_id, update_time, remark, obj_name,
        received_amount, fee_year, fee_month, fee_id, config_id,
        obj_id, fee_name, owe_amount, community_id, fee_create_time, obj_type,
        deadline_time, cur_max_time,
        his_owe_amount, cur_receivable_amount, cur_received_amount,
        his_owe_received_amount, pre_received_amount, obj_name_num)
                                                received_amount, fee_year, fee_month, fee_id, config_id,
                                                obj_id, fee_name, owe_amount, community_id, fee_create_time, obj_type,
                                                deadline_time, cur_max_time,
                                                his_owe_amount, cur_receivable_amount, cur_received_amount,
                                                his_owe_received_amount, pre_received_amount, obj_name_num)
        values (#{receivableAmount}, #{statisticsId}, #{updateTime}, #{remark}, #{objName}, #{receivedAmount},
        #{feeYear}, #{feeMonth},
        #{feeId}, #{configId}, #{objId}, #{feeName}, #{oweAmount}, #{communityId}, #{feeCreateTime}, #{objType},
        #{deadlineTime}, #{curMaxTime},
        #{hisOweAmount}, #{curReceivableAmount}, #{curReceivedAmount}, #{hisOweReceivedAmount},
        #{preReceivedAmount}, #{objNameNum})
                #{feeYear}, #{feeMonth},
                #{feeId}, #{configId}, #{objId}, #{feeName}, #{oweAmount}, #{communityId}, #{feeCreateTime}, #{objType},
                #{deadlineTime}, #{curMaxTime},
                #{hisOweAmount}, #{curReceivableAmount}, #{curReceivedAmount}, #{hisOweReceivedAmount},
                #{preReceivedAmount}, #{objNameNum})
    </insert>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
@@ -110,7 +109,6 @@
            and t.fee_id= #{feeId}
        </if>
    </update>
    <!-- 修改费用月统计信息 add by wuxw 2018-07-03 -->
    <update id="updateReportFeeMonthStatisticsInfo" parameterType="Map">
@@ -205,7 +203,6 @@
            and t.config_id= #{configId}
        </if>
    </update>
    <!-- 查询费用月统计数量 add by wuxw 2018-07-03 -->
    <select id="queryReportFeeMonthStatisticssCount" parameterType="Map" resultType="Map">
@@ -952,9 +949,7 @@
        </if>
    </select>
    <!--
    and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
    -->
    <!-- and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0 -->
    <select id="queryFeeBreakdownCount" parameterType="Map" resultType="Map">
        select count(1) count
        from (
@@ -1022,8 +1017,7 @@
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03
     and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
     -->
     and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0-->
    <select id="queryFeeBreakdown" parameterType="Map" resultType="Map">
        select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,t.config_id configId,SUM(t.his_owe_amount)
        hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
@@ -1158,8 +1152,7 @@
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03
     and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
     -->
     and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0-->
    <select id="queryFeeBreakdownDetail" parameterType="Map" resultType="Map">
        select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime
        ,t.config_id configId,t.his_owe_amount hisOweAmount,t.obj_name_num objNameNum,t.cur_receivable_amount
@@ -1600,6 +1593,7 @@
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryOweFeeDetailMajor" parameterType="Map" resultType="Map">
        select SUM(t.amount_owed) oweAmount
@@ -1744,7 +1738,8 @@
        pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,
        t.receivable_amount receivableAmount,t.received_amount receivedAmount,pfa.`value`
        importFeeName,t.prime_rate,d.name primeRate,fdr.discount_small_type discountSmallType,fdr.rule_name
        ruleName,pfdd.discount_price discountPrice,co.contract_code contractCode,pfo.`value` ownerName,t.pay_order_id oId,
        ruleName,pfdd.discount_price discountPrice,co.contract_code contractCode,pfo.`value` ownerName,t.pay_order_id
        oId,
        d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName,t.fee_id feeId,pft.`value` repairId,
        t.detail_id,t.detail_id detailId,pf.payer_obj_id,pfb.value ownerId,concat(pa.num,'停车场',ps.num,'车位') psName,
        fad.amount withholdAmount,t.cashier_id cashierId,t.cashier_name cashierName,t.payable_amount payableAmount,pfc.fee_flag feeFlag,t.remark
@@ -2018,7 +2013,6 @@
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryDeadlineFee" parameterType="Map" resultType="Map">
        select
        t.obj_name objName,
        pf.payer_obj_type objType,
@@ -2131,12 +2125,12 @@
    <select id="queryPrePaymentCount" parameterType="Map" resultType="Map">
        select pfc.fee_name feeName, count(t.payer_obj_id) objCount
        from pay_fee t
        inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
                 inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
        where t.state = '2008001'
        and t.status_cd = '0'
        and t.end_time &gt; #{startTime}
        and t.end_time &lt; #{endTime}
        and t.community_id = #{communityId}
          and t.status_cd = '0'
          and t.end_time &gt; #{startTime}
          and t.end_time &lt; #{endTime}
          and t.community_id = #{communityId}
        group by pfc.fee_name, pfc.config_id
        order by objCount
    </select>
@@ -2144,13 +2138,13 @@
    <select id="queryDeadlinePaymentCount" parameterType="Map" resultType="Map">
        SELECT t.fee_name feeName, count(t.obj_id) objCount
        FROM report_fee_month_statistics t
        inner join pay_fee pf on t.fee_id = pf.fee_id
        and pf.community_id = t.community_id and pf.status_cd = '0'
                 inner join pay_fee pf on t.fee_id = pf.fee_id
            and pf.community_id = t.community_id and pf.status_cd = '0'
        WHERE 1 = 1
        AND t.status_cd = '0'
        and t.community_id = #{communityId}
        AND t.deadline_time &gt; #{startTime}
        AND t.deadline_time &lt; #{endTime}
          AND t.status_cd = '0'
          and t.community_id = #{communityId}
          AND t.deadline_time &gt; #{startTime}
          AND t.deadline_time &lt; #{endTime}
        group by t.config_id, t.fee_name
        order by objCount desc
    </select>
@@ -2158,10 +2152,10 @@
    <select id="queryOwePaymentCount" parameterType="Map" resultType="Map">
        select t.fee_name feeName, count(distinct t.obj_id) objCount
        from report_fee_month_statistics t
        inner join pay_fee pf
        on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
                 inner join pay_fee pf
                            on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
        where t.community_id = #{communityId}
        and t.owe_amount > 0
          and t.owe_amount > 0
        group by t.config_id, t.fee_name
        order by objCount desc
    </select>
@@ -2169,26 +2163,26 @@
    <select id="queryAllPaymentCount" parameterType="Map" resultType="Map">
        select t.fee_name feeName, count(distinct t.obj_id) objCount
        from report_fee_month_statistics t
        inner join pay_fee pf
        on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
                 inner join pay_fee pf
                            on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
        where t.community_id = #{communityId}
        group by t.config_id, t.fee_name
        order by objCount desc
    </select>
    <select id="queryFinishOweFee" parameterType="Map" resultType="Map">
        select t.config_id configId,
        t.fee_id feeId,
        t.statistics_id statisticsId,
        t.fee_year feeYear,
        fee_month feeMonth
        select t.config_id     configId,
               t.fee_id        feeId,
               t.statistics_id statisticsId,
               t.fee_year      feeYear,
               fee_month       feeMonth
        from report_fee_month_statistics t
        inner join pay_fee pf
        on t.fee_id = pf.fee_id and pf.state = '2009001' and pf.community_id = #{communityId} and
        pf.status_cd = '0'
                 inner join pay_fee pf
                            on t.fee_id = pf.fee_id and pf.state = '2009001' and pf.community_id = #{communityId} and
                               pf.status_cd = '0'
        where t.owe_amount > 0
        and t.status_cd = '0'
        and t.community_id = #{communityId} limit 100
          and t.status_cd = '0'
          and t.community_id = #{communityId} limit 100
    </select>
    <!-- 查询费用配置信息 add by wuxw 2018-07-03 -->
@@ -2385,8 +2379,9 @@
    </select>
    <select id="queryRepairForStaff" parameterType="Map" resultType="Map">
        SELECT r.staff_id staffId,u.name staffName FROM r_repair_user r
        SELECT r.staff_id staffId,u.name staffName,r.state,td.name stateName FROM r_repair_user r
        inner join u_user u on u.user_id = r.staff_id and u.status_cd = '0'
        left join t_dict td on r.state = td.status_cd and td.table_name = 'r_repair_user' and td.table_columns = 'state'
        WHERE r.state!='10005' AND r.state!='10009' AND r.state!='11000' AND
        r.state!='12000' AND r.state != '10007' AND r.status_cd = '0' AND
        r.repair_event != 'payUser' AND r.repair_event != 'startUser' AND r.staff_id != '-1'
@@ -2395,6 +2390,21 @@
        </if>
        <if test="staffId != null and staffId != ''">
            and r.staff_id = #{staffId}
        </if>
        <if test="state != null and state != ''">
            and r.state = #{state}
        </if>
        <if test="beginStartTime != null and beginStartTime !=''">
            and r.start_time &gt;= #{beginStartTime}
        </if>
        <if test="beginEndTime != null and beginEndTime !=''">
            and r.start_time &lt;= #{beginEndTime}
        </if>
        <if test="finishStartTime != null and finishStartTime !=''">
            and r.end_time &gt;= #{finishStartTime}
        </if>
        <if test="finishEndTime != null and finishEndTime !=''">
            and r.end_time &lt;= #{finishEndTime}
        </if>
        group by r.staff_id
        <if test="page != -1 and page != null ">
@@ -2484,16 +2494,16 @@
    <select id="queryNoFeeRoomsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from building_room t
        inner join building_unit bu
            inner join building_unit bu
        on t.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
            inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
        where t.status_cd = '0'
        and not exists (
        select 1 from pay_fee pf where t.room_id = pf.payer_obj_id
        and pf.status_cd = '0'
        and pf.state = '2008001'
        )
        and t.community_id = #{communityId}
          and not exists (
            select 1 from pay_fee pf where t.room_id = pf.payer_obj_id
          and pf.status_cd = '0'
          and pf.state = '2008001'
            )
          and t.community_id = #{communityId}
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
@@ -2772,14 +2782,12 @@
        group by pfd.state
    </select>
    <select id="queryHuaningOweFeeCount" parameterType="Map" resultType="Map">
        select count(1) count
        from f_floor f
        where 1=1
        and f.community_id = #{communityId}
        and f.status_cd = '0'
          and f.community_id = #{communityId}
          and f.status_cd = '0'
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
@@ -2792,8 +2800,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        <if test="feeTypeCd != null and feeTypeCd != ''">
@@ -2808,8 +2815,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        <if test="feeTypeCd != null and feeTypeCd != ''">
@@ -2825,8 +2831,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        <if test="feeTypeCd != null and feeTypeCd != ''">
@@ -2838,24 +2843,17 @@
        from f_floor f
        where 1=1
        and f.community_id = #{communityId}
        <if test="floorNum != null and floorNum != ''">
            and f.floor_num = #{floorNum}
        </if>
        and f.status_cd = '0'
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <select id="queryHuaningPayFeeCount" parameterType="Map" resultType="Map">
        select count(1) count
        from (
        select t.floor_num
        from f_floor t
        where 1=1
        and t.community_id= #{communityId}
        GROUP BY t.floor_num
        ) tt
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryHuaningPayFee" parameterType="Map" resultType="Map">
    <select id="queryHuaningOweFeeCounts" parameterType="Map" resultType="Map">
        select count(1) count from (
        select
        f.floor_num floorNum,
        (
@@ -2864,8 +2862,78 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and t.detail_id = '-1'
        and t.cur_month_time &lt;= #{endTime}
        ) oweAmount,
        (
        select ifnull(SUM(t.receivable_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and t.detail_id = '-1'
        and t.cur_month_time &lt;= #{endTime}
        and t.cur_month_time &gt;= #{startTime}
        ) curOweAmount,
        (
        select ifnull(SUM(t.receivable_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and t.detail_id = '-1'
        and t.cur_month_time &lt; #{startTime}
        ) preOweAmount
        from f_floor f
        where 1=1
        and f.community_id = #{communityId}
        <if test="floorNum != null and floorNum != ''">
            and f.floor_num = #{floorNum}
        </if>
        and f.status_cd = '0'
        ) st
    </select>
    <select id="queryHuaningPayFeeCount" parameterType="Map" resultType="Map">
        select count(1) count
        from (
            select t.floor_num
            from f_floor t
            where 1=1
            and t.community_id= #{communityId}
            GROUP BY t.floor_num
            ) tt
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryHuaningPayFee" parameterType="Map" resultType="Map">
        select
        f.floor_num floorNum,
        (
        select ifnull(SUM(t.receivable_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
@@ -2879,8 +2947,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
@@ -2896,8 +2963,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
@@ -2915,8 +2981,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
@@ -2933,8 +2998,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
@@ -2951,8 +3015,7 @@
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where
        1=1
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
@@ -2966,67 +3029,188 @@
        from f_floor f
        where 1=1
        and f.community_id = #{communityId}
        <if test="floorNum != null and floorNum != ''">
            and f.floor_num = #{floorNum}
        </if>
        and f.status_cd = '0'
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <select id="queryHuaningPayFeeCounts" parameterType="Map" resultType="Map">
        select count(1) count
        from (
        select
        f.floor_num floorNum,
        (
        select ifnull(SUM(t.receivable_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        and t.cur_month_time = #{endTime}
        ) receivableAmount,
        (
        select ifnull(SUM(t.received_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        and t.pay_fee_time &gt;= #{endTime}
        and t.pay_fee_time &lt; #{nextMonthTime}
        and t.detail_id != '-1'
        ) receivedAmount,
        (
        select ifnull(SUM(t.received_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        and t.pay_fee_time &gt;= #{endTime}
        and t.pay_fee_time &lt; #{nextMonthTime}
        and t.cur_month_time &lt; #{endTime}
        and t.cur_month_time &gt;= #{startTime}
        and t.detail_id != '-1'
        ) receivedAmount1,
        (
        select ifnull(SUM(t.received_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        and t.pay_fee_time &gt;= #{endTime}
        and t.pay_fee_time &lt; #{nextMonthTime}
        and t.cur_month_time = #{endTime}
        and t.detail_id != '-1'
        ) receivedAmount2,
        (
        select ifnull(SUM(t.received_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        and t.pay_fee_time &gt;= #{endTime}
        and t.pay_fee_time &lt; #{nextMonthTime}
        and t.cur_month_time &gt;= #{nextMonthTime}
        and t.detail_id != '-1'
        ) receivedAmount3,
        (
        select ifnull(SUM(t.received_amount),0)
        from pay_fee_detail_month t
        inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
        where 1=1
        <if test="feeTypeCd != null and feeTypeCd != ''">
            and pf.fee_type_cd = #{feeTypeCd}
        </if>
        and bu.floor_id = f.floor_id
        and t.community_id = f.community_id
        and t.pay_fee_time &gt;= #{endTime}
        and t.pay_fee_time &lt; #{nextMonthTime}
        and t.cur_month_time &lt; #{startTime}
        and t.detail_id != '-1'
        ) receivedAmount4
        from f_floor f
        where 1=1
        and f.community_id = #{communityId}
        <if test="floorNum != null and floorNum != ''">
            and f.floor_num = #{floorNum}
        </if>
        and f.status_cd = '0'
        ) st
    </select>
    <select id="queryHuaningPayFeeTwoCount" parameterType="Map" resultType="Map">
        select count(1) count
        from (
        select a.floorNum, d.receivableAmount,
        a.receivedAmount, b.receivedAmount1,
        c.receivedAmount2
        from
        (select t.floor_num floorNum, sum (pfd.received_amount) receivedAmount
        from f_floor t
        inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
        inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
        inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
        inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
        where 1=1
        and t.status_cd = '0'
        and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
        and t.community_id= #{communityId}
        GROUP BY floor_num
        ) a,
        (select t.floor_num floorNum, SUM (pfdm1.discount_amount) receivedAmount1
        from f_floor t
        inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
        inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
        inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
        inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
        LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and
        pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month &lt; #{month}
        where 1=1
        and t.status_cd = '0'
        and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
        and t.community_id= #{communityId}
        GROUP BY floor_num
        ) b,
        (select t.floor_num floorNum, SUM (pfdm2.received_amount) receivedAmount2
        from f_floor t
        inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
        inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
        inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
        inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
        LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and
        pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month &gt; #{month}
        where 1=1
        and t.status_cd = '0'
        and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
        and t.community_id= #{communityId}
        GROUP BY floor_num
        ) c,
        (select t.floor_num floorNum, SUM (rfms.owe_amount) receivableAmount
        from f_floor t
        inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
        inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
        inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
        where t.community_id= #{communityId}
        group by t.floor_num
        ) d
        where a.floorNum = b.floorNum
        and b.floorNum = c.floorNum
        and c.floorNum = d.floorNum
        ) tt
            select a.floorNum, d.receivableAmount,
            a.receivedAmount, b.receivedAmount1,
            c.receivedAmount2
            from
            (select t.floor_num floorNum, sum (pfd.received_amount) receivedAmount
            from f_floor t
            inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
            inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
            inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
            inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
            where 1=1
            and t.status_cd = '0'
            and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
            and t.community_id= #{communityId}
            GROUP BY floor_num
            ) a,
            (select t.floor_num floorNum, SUM (pfdm1.discount_amount) receivedAmount1
            from f_floor t
            inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
            inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
            inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
            inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
            LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and
            pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month &lt; #{month}
            where 1=1
            and t.status_cd = '0'
            and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
            and t.community_id= #{communityId}
            GROUP BY floor_num
            ) b,
            (select t.floor_num floorNum, SUM (pfdm2.received_amount) receivedAmount2
            from f_floor t
            inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
            inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
            inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
            inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
            LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and
            pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month &gt; #{month}
            where 1=1
            and t.status_cd = '0'
            and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
            and t.community_id= #{communityId}
            GROUP BY floor_num
            ) c,
            (select t.floor_num floorNum, SUM (rfms.owe_amount) receivableAmount
            from f_floor t
            inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
            inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
            inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
            where t.community_id= #{communityId}
            group by t.floor_num
            ) d
            where a.floorNum = b.floorNum
            and b.floorNum = c.floorNum
            and c.floorNum = d.floorNum
            ) tt
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
@@ -3090,6 +3274,7 @@
            limit #{page}, #{row}
        </if>
    </select>
    <select id="queryHuaningOweFeeDetailCount" parameterType="Map" resultType="Map">
        select
        count(1) count
@@ -3108,12 +3293,15 @@
        <if test="floorId != null and floorId != ''">
            and f.floor_id = #{floorId}
        </if>
        <if test="floorNum != null and floorNum != ''">
            and f.floor_num = #{floorNum}
        </if>
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryHuaningOweFeeDetail" parameterType="Map" resultType="Map">
        select
        f.floor_num floorNum,
        concat(f.floor_num,'-',bu.unit_num,'-',br.room_num) roomName,
        br.built_up_area builtUpArea,
        rof.fee_name feeName,
@@ -3122,8 +3310,7 @@
        (
        select ifnull(SUM(t.receivable_amount),0)
        from pay_fee_detail_month t
        where
        1=1
        where 1=1
        and t.fee_id = rof.fee_id
        and t.community_id = f.community_id
        and t.detail_id = '-1'
@@ -3132,8 +3319,7 @@
        (
        select ifnull(SUM(t.receivable_amount),0)
        from pay_fee_detail_month t
        where
        1=1
        where 1=1
        and t.fee_id = rof.fee_id
        and t.community_id = f.community_id
        and t.detail_id = '-1'
@@ -3143,8 +3329,7 @@
        (
        select ifnull(SUM(t.receivable_amount),0)
        from pay_fee_detail_month t
        where
        1=1
        where 1=1
        and t.fee_id = rof.fee_id
        and t.community_id = f.community_id
        and t.detail_id = '-1'
@@ -3165,10 +3350,14 @@
        <if test="floorId != null and floorId != ''">
            and f.floor_id = #{floorId}
        </if>
        <if test="floorNum != null and floorNum != ''">
            and f.floor_num = #{floorNum}
        </if>
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="getReceivedAmountByMonth" parameterType="Map" resultType="Map">
        select ifnull(sum(t.received_amount),0) total
@@ -3210,10 +3399,10 @@
    <select id="queryInvalidFeeMonthStatistics" parameterType="Map" resultType="Map">
        select t.fee_id feeId
        from pay_fee t
        inner join pay_fee_config pfc on t.config_id = pfc.config_id
        inner join report_fee_month_statistics rfms on t.fee_id = rfms.fee_id and rfms.status_cd = '0'
                 inner join pay_fee_config pfc on t.config_id = pfc.config_id
                 inner join report_fee_month_statistics rfms on t.fee_id = rfms.fee_id and rfms.status_cd = '0'
        where (t.status_cd = '1' or pfc.status_cd = '1')
        and t.community_id = #{communityId}
          and t.community_id = #{communityId}
    </select>
    <!--清理报表 无效数据-->
java110-db/src/main/resources/mapper/report/ReportOweFeeServiceDaoImplMapper.xml
@@ -5,13 +5,13 @@
    <!-- 保存欠费统计信息 add by wuxw 2018-07-03 -->
    <insert id="saveReportOweFeeInfo" parameterType="Map">
        insert into report_owe_fee(
        config_name,deadline_time,owner_tel,update_time,owe_id,owner_id,fee_id,amount_owed,payer_obj_name,owner_name,config_id,fee_name,end_time,community_id,payer_obj_type,payer_obj_id
        ) values (
        #{configName},#{deadlineTime},#{ownerTel},#{updateTime},#{oweId},#{ownerId},#{feeId},#{amountOwed},#{payerObjName},#{ownerName},#{configId},#{feeName},#{endTime},#{communityId},#{payerObjType},#{payerObjId}
        )
        insert into report_owe_fee(config_name, deadline_time, owner_tel, update_time, owe_id, owner_id, fee_id,
                                   amount_owed, payer_obj_name, owner_name, config_id, fee_name, end_time, community_id,
                                   payer_obj_type, payer_obj_id)
        values (#{configName}, #{deadlineTime}, #{ownerTel}, #{updateTime}, #{oweId}, #{ownerId}, #{feeId},
                #{amountOwed}, #{payerObjName}, #{ownerName}, #{configId}, #{feeName}, #{endTime}, #{communityId},
                #{payerObjType}, #{payerObjId})
    </insert>
    <!-- 查询欠费统计信息 add by wuxw 2018-07-03 -->
    <select id="getReportOweFeeInfo" parameterType="Map" resultType="Map">
@@ -65,7 +65,7 @@
            and t.payer_obj_name= #{payerObjName}
        </if>
        <if test="ownerName !=null and ownerName != ''">
            and t.owner_name= #{ownerName}
            and t.owner_name like '%${ownerName}%'
        </if>
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
@@ -96,7 +96,6 @@
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改欠费统计信息 add by wuxw 2018-07-03 -->
    <update id="updateReportOweFeeInfo" parameterType="Map">
@@ -155,7 +154,6 @@
        </if>
    </update>
    <!-- 修改欠费统计信息 add by wuxw 2018-07-03 -->
    <delete id="deleteReportOweFeeInfo" parameterType="Map">
        delete from report_owe_fee
@@ -170,7 +168,6 @@
            and community_id= #{communityId}
        </if>
    </delete>
    <!-- 查询欠费统计数量 add by wuxw 2018-07-03 -->
    <select id="queryReportOweFeesCount" parameterType="Map" resultType="Map">
@@ -224,7 +221,7 @@
            and t.payer_obj_name= #{payerObjName}
        </if>
        <if test="ownerName !=null and ownerName != ''">
            and t.owner_name= #{ownerName}
            and t.owner_name like '%${ownerName}%'
        </if>
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
@@ -291,7 +288,6 @@
        <if test="updateTime !=null and updateTime != ''">
            and t.update_time= #{updateTime}
        </if>
        <if test="oweId !=null and oweId != ''">
            and t.owe_id= #{oweId}
        </if>
@@ -656,7 +652,7 @@
            and t.payer_obj_name= #{payerObjName}
        </if>
        <if test="ownerName !=null and ownerName != ''">
            and t.owner_name= #{ownerName}
            and t.owner_name like '%${ownerName}%'
        </if>
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
@@ -683,6 +679,7 @@
            and t.payer_obj_id= #{payerObjId}
        </if>
    </select>
    <select id="computeReportOweFeeItemAmount" parameterType="Map" resultType="Map">
        select t.config_name configName,sum(t.amount_owed) totalOweAmount
        from report_owe_fee t
@@ -734,7 +731,7 @@
            and t.payer_obj_name= #{payerObjName}
        </if>
        <if test="ownerName !=null and ownerName != ''">
            and t.owner_name= #{ownerName}
            and t.owner_name like '%${ownerName}%'
        </if>
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
@@ -763,16 +760,15 @@
        GROUP BY t.config_id,t.config_name
    </select>
    <!-- 查询无效费用 add by wuxw 2018-07-03 -->
    <select id="queryInvalidOweFee" parameterType="Map" resultType="Map">
        select t.fee_id feeId from pay_fee t
        inner join pay_fee_config pfc on t.config_id = pfc.config_id
        inner join report_owe_fee rof on t.fee_id = rof.fee_id
        select t.fee_id feeId
        from pay_fee t
                 inner join pay_fee_config pfc on t.config_id = pfc.config_id
                 inner join report_owe_fee rof on t.fee_id = rof.fee_id
        where (t.status_cd = '1' or pfc.status_cd = '1')
        and t.community_id= #{communityId}
          and t.community_id = #{communityId}
    </select>
    <update id="deleteInvalidFee" parameterType="Map">
        delete from report_owe_fee where fee_id in
@@ -782,9 +778,8 @@
        and community_id = #{communityId}
    </update>
    <select id="queryOweFeesByOwnerIds" parameterType="Map" resultType="Map">
        select  t.owner_id ownerId,SUM(t.amount_owed) oweFee
        select t.owner_id ownerId,SUM(t.amount_owed) oweFee
        from report_owe_fee t
        where t.community_id = #{communityId}
        and t.owner_id in
@@ -793,10 +788,11 @@
        </foreach>
        group by t.owner_id
    </select>
    <select id="queryOweFeesByRoomIds" parameterType="Map" resultType="Map">
        select  t.payer_obj_id roomId,SUM(t.amount_owed) oweFee
        select t.payer_obj_id roomId,SUM(t.amount_owed) oweFee
        from report_owe_fee t
        where t.community_id =  #{communityId}
        where t.community_id = #{communityId}
        and t.payer_obj_type = '3333'
        and t.payer_obj_id in
        <foreach collection="roomIds" item="item" open="(" close=")" separator=",">
@@ -804,5 +800,4 @@
        </foreach>
        group by t.payer_obj_id
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/AllocationStorehouseServiceDaoImplMapper.xml
@@ -1,32 +1,31 @@
<?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="allocationStorehouseServiceDaoImpl">
    <!-- 保存仓库调拨信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessAllocationStorehouseInfo" parameterType="Map">
        insert into business_allocation_storehouse(
        as_id,store_id,res_id,sh_id_z,res_name,start_user_id,operate,sh_id_a,start_user_name,b_id,stock,original_stock,remark,apply_id
        ) values (
        #{asId},#{storeId},#{resId},#{shIdz},#{resName},#{startUserId},#{operate},#{shIda},#{startUserName},#{bId},#{stock},#{originalStock},#{remark},#{applyId}
        )
        insert into business_allocation_storehouse(as_id, store_id, res_id, sh_id_z, res_name, start_user_id, operate,
                                                   sh_id_a, start_user_name, b_id, stock, original_stock, remark,
                                                   apply_id)
        values (#{asId}, #{storeId}, #{resId}, #{shIdz}, #{resName}, #{startUserId}, #{operate}, #{shIda},
                #{startUserName}, #{bId}, #{stock}, #{originalStock}, #{remark}, #{applyId})
    </insert>
    <!-- 保存仓库调拨信息 add by wuxw 2018-07-03 -->
    <insert id="saveAllocationStorehouseInfo" parameterType="Map">
        insert into allocation_storehouse(
        as_id,b_id,sh_id_a,sh_id_z,res_id,res_name,store_id,stock,start_user_id,start_user_name,create_time,remark,apply_id,original_stock
        ) values (
        #{asId},#{bId},#{shIda},#{shIdz},#{resId},#{resName},#{storeId},#{stock},#{startUserId},#{startUserName},#{createTime},#{remark},#{applyId},#{originalStock}
        )
        insert into allocation_storehouse(as_id, b_id, sh_id_a, sh_id_z, res_id, res_name, store_id, stock,
                                          start_user_id, start_user_name, create_time, remark, apply_id, original_stock)
        values (#{asId}, #{bId}, #{shIda}, #{shIdz}, #{resId}, #{resName}, #{storeId}, #{stock}, #{startUserId},
                #{startUserName}, #{createTime}, #{remark}, #{applyId}, #{originalStock})
    </insert>
    <!-- 查询仓库调拨信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessAllocationStorehouseInfo" parameterType="Map" resultType="Map">
        select t.as_id,t.as_id asId,t.store_id,t.store_id storeId,t.res_id,t.res_id resId,t.sh_id_z,t.sh_id_z
        shIdz,t.res_name,t.res_name resName,t.start_user_id,t.start_user_id startUserId,t.operate,t.sh_id_a,t.sh_id_a
        shIda,t.start_user_name,t.start_user_name startUserName,t.b_id,t.b_id bId,t.stock,t.original_stock,t.original_stock originalStock,t.remark,t.apply_id,t.apply_id applyId
        shIda,t.start_user_name,t.start_user_name startUserName,t.b_id,t.b_id
        bId,t.stock,t.original_stock,t.original_stock originalStock,t.remark,t.apply_id,t.apply_id applyId
        from business_allocation_storehouse t
        where 1 =1
        <if test="asId !=null and asId != ''">
@@ -115,20 +114,28 @@
        select t.as_id,t.as_id asId,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.res_id,t.res_id
        resId,t.sh_id_z,t.sh_id_z shIdz,t.res_name,t.res_name resName,t.start_user_id,t.start_user_id
        startUserId,t.sh_id_a,t.sh_id_a shIda,t.start_user_name,t.start_user_name startUserName,asa.state,t.b_id,t.b_id
        bId,t.stock,t.original_stock,t.original_stock originalStock,t.remark,t.create_time createTime,td.name stateName,a.sh_name shaName,z.sh_name shzName,
        rs.res_code,rs.res_code resCode,t.apply_id,t.apply_id applyId,rst.name rstName,rst1.name parentRstName,rss.spec_name specName,asa.apply_type,
        asa.apply_type applyType,td1.name applyTypeName,td2.name unitCodeName,td3.name miniUnitCodeName,rs.is_fixed isFixed,td4.name isFixedName,
        bId,t.stock,t.original_stock,t.original_stock originalStock,t.remark,t.create_time createTime,td.name
        stateName,a.sh_name shaName,z.sh_name shzName,
        rs.res_code,rs.res_code resCode,t.apply_id,t.apply_id applyId,rst.name rstName,rst1.name
        parentRstName,rss.spec_name specName,asa.apply_type,
        asa.apply_type applyType,td1.name applyTypeName,td2.name unitCodeName,td3.name miniUnitCodeName,rs.is_fixed
        isFixed,td4.name isFixedName,
        t.times_id,t.times_id timesId
        from allocation_storehouse t
        left join allocation_storehouse_apply asa on asa.apply_id = t.apply_id and asa.status_cd = '0'
        left join t_dict td on asa.state = td.status_cd and td.table_name = 'allocation_storehouse_apply' and td.table_columns = 'state'
        left join t_dict td1 on asa.apply_type = td1.status_cd and td.table_name = 'allocation_storehouse_apply' and td1.table_columns = 'apply_type'
        left join t_dict td on asa.state = td.status_cd and td.table_name = 'allocation_storehouse_apply' and
        td.table_columns = 'state'
        left join t_dict td1 on asa.apply_type = td1.status_cd and td.table_name = 'allocation_storehouse_apply' and
        td1.table_columns = 'apply_type'
        left join storehouse a on t.sh_id_a = a.sh_id and a.store_id = t.store_id and a.status_cd = '0'
        left join storehouse z on t.sh_id_z = z.sh_id and z.store_id = t.store_id and z.status_cd = '0'
        left join resource_store rs on t.res_id = rs.res_id and rs.status_cd = '0'
        left join t_dict td2 on rs.unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code'
        left join t_dict td3 on rs.mini_unit_code = td3.status_cd and td3.table_name = 'resource_store' and td3.table_columns = 'unit_code'
        left join t_dict td4 on rs.is_fixed = td4.status_cd and td4.table_name = 'resource_store' and td4.table_columns = 'is_fixed'
        left join t_dict td2 on rs.unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns
        = 'unit_code'
        left join t_dict td3 on rs.mini_unit_code = td3.status_cd and td3.table_name = 'resource_store' and
        td3.table_columns = 'unit_code'
        left join t_dict td4 on rs.is_fixed = td4.status_cd and td4.table_name = 'resource_store' and td4.table_columns
        = 'is_fixed'
        left join resource_store_type rst on rs.rst_id = rst.rst_id and rst.status_cd = '0'
        left join resource_store_type rst1 on rs.parent_rst_id = rst1.rst_id and rst1.status_cd = '0'
        left join resource_store_specification rss on rs.rss_id = rss.rss_id and rss.status_cd = '0'
@@ -146,7 +153,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="applyId !=null and applyId != ''">
            and t.apply_id= #{applyId}
            and t.apply_id like '%${applyId}%'
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
@@ -155,7 +162,7 @@
            and asa.community_id= #{communityId}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
            and t.res_id like '%${resId}%'
        </if>
        <if test="shIdz !=null and shIdz != ''">
            and t.sh_id_z= #{shIdz}
@@ -252,8 +259,10 @@
        select count(1) count
        from allocation_storehouse t
        left join allocation_storehouse_apply asa on asa.apply_id = t.apply_id and asa.status_cd = '0'
        left join t_dict td on asa.state = td.status_cd and td.table_name = 'allocation_storehouse_apply' and td.table_columns ='state'
        left join t_dict td1 on asa.apply_type = td1.status_cd and td.table_name = 'allocation_storehouse_apply' and td.table_columns = 'apply_type'
        left join t_dict td on asa.state = td.status_cd and td.table_name = 'allocation_storehouse_apply' and
        td.table_columns ='state'
        left join t_dict td1 on asa.apply_type = td1.status_cd and td.table_name = 'allocation_storehouse_apply' and
        td.table_columns = 'apply_type'
        left join storehouse a on t.sh_id_a = a.sh_id and a.store_id = t.store_id and a.status_cd = '0'
        left join storehouse z on t.sh_id_z = z.sh_id and z.store_id = t.store_id and z.status_cd = '0'
        left join resource_store rs on t.res_id = rs.res_id and rs.status_cd = '0'
@@ -274,7 +283,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="applyId !=null and applyId != ''">
            and t.apply_id= #{applyId}
            and t.apply_id like '%${applyId}%'
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
@@ -282,9 +291,8 @@
        <if test="communityId !=null and communityId != ''">
            and asa.community_id= #{communityId}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
            and t.res_id like '%${resId}%'
        </if>
        <if test="shIdz !=null and shIdz != ''">
            and t.sh_id_z= #{shIdz}
java110-db/src/main/resources/mapper/store/AllocationUserStorehouseServiceDaoImplMapper.xml
@@ -1,19 +1,17 @@
<?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="allocationUserStorehouseServiceDaoImpl">
    <!-- 保存物品供应商信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessAllocationUserStorehouseInfo" parameterType="Map">
           insert into business_allocation_user_storehouse(
            accept_user_id,accept_user_name,remark,store_id,res_id,res_name,start_user_id,operate,start_user_name,aus_id,b_id,stock,give_quantity
            ) values (
            #{acceptUserId},#{acceptUserName},#{remark},#{storeId},#{resId},#{resName},#{startUserId},#{operate},#{startUserName},#{ausId},#{bId},
            #{stock},#{giveQuantity}
            )
        insert into business_allocation_user_storehouse(accept_user_id, accept_user_name, remark, store_id, res_id,
                                                        res_name, start_user_id, operate, start_user_name, aus_id, b_id,
                                                        stock, give_quantity)
        values (#{acceptUserId}, #{acceptUserName}, #{remark}, #{storeId}, #{resId}, #{resName}, #{startUserId},
                #{operate}, #{startUserName}, #{ausId}, #{bId},
                #{stock}, #{giveQuantity})
    </insert>
    <!-- 查询物品供应商信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessAllocationUserStorehouseInfo" parameterType="Map" resultType="Map">
@@ -63,7 +61,6 @@
            and t.give_quantity= #{giveQuantity}
        </if>
    </select>
    <!-- 保存物品供应商信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveAllocationUserStorehouseInfoInstance" parameterType="Map">
@@ -119,18 +116,22 @@
        resId,t.res_name,t.res_name resName,t.start_user_id,t.start_user_id startUserId,t.start_user_name,
        t.start_user_name startUserName,t.aus_id,t.aus_id ausId,t.b_id,t.b_id
        bId,t.stock,t.give_quantity,t.give_quantity giveQuantity,t.create_time createTime,rst.name rstName,rss.spec_name
        specName,td1.name unitCodeName,td2.name miniUnitCodeName,rst1.name parentRstName,rs.is_fixed isFixed,rs.res_code resCode,td3.name isFixedName
        specName,td1.name unitCodeName,td2.name miniUnitCodeName,rst1.name parentRstName,rs.is_fixed isFixed,rs.res_code
        resCode,td3.name isFixedName
        from allocation_user_storehouse t
        left join resource_store rs on t.res_id = rs.res_id and rs.status_cd = '0'
        left join resource_store_type rst on rs.rst_id = rst.rst_id and rst.status_cd = '0'
        left join resource_store_type rst1 on rs.parent_rst_id = rst1.rst_id and rst1.status_cd = '0'
        left join resource_store_specification rss on rs.rss_id=rss.rss_id and rss.status_cd = '0'
        left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code'
        left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code'
        left join t_dict td3 on rs.is_fixed = td3.status_cd and td3.table_name = 'resource_store' and td3.table_columns = 'is_fixed'
        left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns
        = 'unit_code'
        left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and
        td2.table_columns = 'unit_code'
        left join t_dict td3 on rs.is_fixed = td3.status_cd and td3.table_name = 'resource_store' and td3.table_columns
        = 'is_fixed'
        where 1 = 1
        <if test="acceptUserId !=null and acceptUserId != ''">
            and t.accept_user_id= #{acceptUserId}
            and t.accept_user_id like '%${acceptUserId}%'
        </if>
        <if test="acceptUserName !=null and acceptUserName != ''">
            and t.accept_user_name like '%${acceptUserName}%'
@@ -145,19 +146,19 @@
            and t.store_id= #{storeId}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
            and t.res_id like '%${resId}%'
        </if>
        <if test="resName !=null and resName != ''">
            and t.res_name like '%${resName}%'
        </if>
        <if test="startUserId !=null and startUserId != ''">
            and t.start_user_id= #{startUserId}
            and t.start_user_id like '%${startUserId}%'
        </if>
        <if test="startUserName !=null and startUserName != ''">
            and t.start_user_name like '%${startUserName}%'
        </if>
        <if test="ausId !=null and ausId != ''">
            and t.aus_id= #{ausId}
            and t.aus_id like '%${ausId}%'
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
@@ -229,7 +230,6 @@
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
    </update>
    <!-- 查询物品供应商数量 add by wuxw 2018-07-03 -->
@@ -239,11 +239,13 @@
        left join resource_store rs on t.res_id = rs.res_id and rs.status_cd = '0'
        left join resource_store_type rst on rs.rst_id = rst.rst_id and rst.status_cd = '0'
        left join resource_store_specification rss on rs.rss_id=rss.rss_id and rss.status_cd = '0'
        left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code'
        left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code'
        left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns
        = 'unit_code'
        left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and
        td2.table_columns = 'unit_code'
        where 1 =1
        <if test="acceptUserId !=null and acceptUserId != ''">
            and t.accept_user_id= #{acceptUserId}
            and t.accept_user_id like '%${acceptUserId}%'
        </if>
        <if test="acceptUserName !=null and acceptUserName != ''">
            and t.accept_user_name like '%${acceptUserName}%'
@@ -258,19 +260,19 @@
            and t.store_id= #{storeId}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
            and t.res_id like '%${resId}%'
        </if>
        <if test="resName !=null and resName != ''">
            and t.res_name like '%${resName}%'
        </if>
        <if test="startUserId !=null and startUserId != ''">
            and t.start_user_id= #{startUserId}
            and t.start_user_id like '%${startUserId}%'
        </if>
        <if test="startUserName !=null and startUserName != ''">
            and t.start_user_name like '%${startUserName}%'
        </if>
        <if test="ausId !=null and ausId != ''">
            and t.aus_id= #{ausId}
            and t.aus_id like '%${ausId}%'
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
java110-db/src/main/resources/mapper/store/ContractChangePlanServiceDaoImplMapper.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="contractChangePlanServiceDaoImpl">
    <!-- 保存合同变更计划信息 add by wuxw 2018-07-03 -->
    <insert id="saveContractChangePlanInfo" parameterType="Map">
        insert into contract_change_plan(
        plan_type,contract_id,plan_id,remark,change_person,state,store_id
        ) values (
        #{planType},#{contractId},#{planId},#{remark},#{changePerson},#{state},#{storeId}
        )
        insert into contract_change_plan(plan_type, contract_id, plan_id, remark, change_person, state, store_id)
        values (#{planType}, #{contractId}, #{planId}, #{remark}, #{changePerson}, #{state}, #{storeId})
    </insert>
    <!-- 查询合同变更计划信息 add by wuxw 2018-07-03 -->
    <select id="getContractChangePlanInfo" parameterType="Map" resultType="Map">
@@ -26,13 +20,19 @@
        partyB,c.contract_id,c.contract_id contractId,c.obj_id,c.obj_id objId,c.contract_name,c.contract_name
        contractName,c.start_time,c.start_time startTime,c.end_time,c.end_time
        endTime,c.contract_code,c.contract_code contractCode,c.obj_type,c.obj_type
        objType,c.operator_link,c.operator_link operatorLink,ct.type_name contractTypeName,td.`name` stateName,td1.name planTypeName,
        objType,c.operator_link,c.operator_link operatorLink,ct.type_name contractTypeName,td.`name` stateName,td1.name
        planTypeName,u.name changePersonName,
        t.create_time createTime
        from contract_change_plan t
        inner join contract_change_plan_detail c on t.contract_id = c.contract_id and t.plan_id = c.plan_id and c.store_id = t.store_id and c.operate = 'ADD'
        inner JOIN contract_type ct on c.contract_type = ct.contract_type_id and ct.status_cd = '0' and ct.store_id = c.store_id
        left JOIN t_dict td on td.status_cd = t.state and td.table_name = 'contract_change_plan' and td.table_columns = 'state'
        left JOIN t_dict td1 on td1.status_cd = t.plan_type and td1.table_name = 'contract_change_plan' and td1.table_columns = 'plan_type'
        left join contract_change_plan_detail c on t.contract_id = c.contract_id and t.plan_id = c.plan_id and
        c.store_id = t.store_id and c.operate = 'ADD'
        left JOIN contract_type ct on c.contract_type = ct.contract_type_id and ct.status_cd = '0' and ct.store_id =
        c.store_id
        left join u_user u on t.change_person = u.user_id and u.status_cd = '0'
        left JOIN t_dict td on td.status_cd = t.state and td.table_name = 'contract_change_plan' and td.table_columns =
        'state'
        left JOIN t_dict td1 on td1.status_cd = t.plan_type and td1.table_name = 'contract_change_plan' and
        td1.table_columns = 'plan_type'
        where 1 =1
        <if test="planType !=null and planType != ''">
            and t.plan_type= #{planType}
@@ -41,7 +41,7 @@
            and t.contract_id= #{contractId}
        </if>
        <if test="contractName !=null and contractName != ''">
            and c.contract_name= #{contractName}
            and c.contract_name like '%${contractName}%'
        </if>
        <if test="contractCode !=null and contractCode != ''">
            and c.contract_code= #{contractCode}
@@ -73,17 +73,21 @@
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
        <if test="startTime != null and startTime != ''">
        <!--<if test="startTime != null and startTime != ''">
            and t.create_time &gt; #{startTime}
            and t.create_time &lt; #{endTime}
        </if>-->
        <if test="logStartTime != null and logStartTime != ''">
            and t.create_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.create_time &lt;= #{logEndTime}
        </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="updateContractChangePlanInfo" parameterType="Map">
@@ -113,16 +117,21 @@
        <if test="planId !=null and planId != ''">
            and t.plan_id= #{planId}
        </if>
    </update>
    <!-- 查询合同变更计划数量 add by wuxw 2018-07-03 -->
    <select id="queryContractChangePlansCount" parameterType="Map" resultType="Map">
        select count(1) count
        from contract_change_plan t
        inner join contract c on t.contract_id = c.contract_id and c.status_cd = '0' and c.store_id = t.store_id
        inner JOIN contract_type ct on c.contract_type = ct.contract_type_id and ct.status_cd = '0' and ct.store_id = c.store_id
        left JOIN t_dict td on td.status_cd = t.state and td.table_name = 'contract_change_plan' and td.table_columns = 'state'
        left join contract_change_plan_detail c on t.contract_id = c.contract_id and t.plan_id = c.plan_id and
        c.store_id = t.store_id and c.operate = 'ADD'
        left JOIN contract_type ct on c.contract_type = ct.contract_type_id and ct.status_cd = '0' and ct.store_id =
        c.store_id
        left join u_user u on t.change_person = u.user_id and u.status_cd = '0'
        left JOIN t_dict td on td.status_cd = t.state and td.table_name = 'contract_change_plan' and td.table_columns =
        'state'
        left JOIN t_dict td1 on td1.status_cd = t.plan_type and td1.table_name = 'contract_change_plan' and
        td1.table_columns = 'plan_type'
        where 1 =1
        <if test="planType !=null and planType != ''">
            and t.plan_type= #{planType}
@@ -131,7 +140,7 @@
            and t.contract_id= #{contractId}
        </if>
        <if test="contractName !=null and contractName != ''">
            and c.contract_name= #{contractName}
            and c.contract_name like '%${contractName}%'
        </if>
        <if test="contractCode !=null and contractCode != ''">
            and c.contract_code= #{contractCode}
@@ -157,8 +166,11 @@
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
        <if test="logStartTime != null and logStartTime != ''">
            and t.create_time &gt;= #{logStartTime}
        </if>
        <if test="logEndTime != null and logEndTime != ''">
            and t.create_time &lt;= #{logEndTime}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/ContractPartyaServiceDaoImplMapper.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="contractPartyaServiceDaoImpl">
    <!-- 保存合同房屋信息 add by wuxw 2018-07-03 -->
    <insert id="saveContractPartyaInfo" parameterType="Map">
        insert into contract_partya(
        party_a,a_link,a_contacts,partya_id,store_id
        ) values (
        #{partyA},#{aLink},#{aContacts},#{partyaId},#{storeId}
        )
        insert into contract_partya(party_a, a_link, a_contacts, partya_id, store_id)
        values (#{partyA}, #{aLink}, #{aContacts}, #{partyaId}, #{storeId})
    </insert>
    <!-- 查询合同房屋信息 add by wuxw 2018-07-03 -->
    <select id="getContractPartyaInfo" parameterType="Map" resultType="Map">
@@ -22,13 +16,13 @@
        from contract_partya t
        where 1 =1
        <if test="partyA !=null and partyA != ''">
            and t.party_a= #{partyA}
            and t.party_a like concat('%',#{partyA},'%')
        </if>
        <if test="aLink !=null and aLink != ''">
            and t.a_link= #{aLink}
        </if>
        <if test="aContacts !=null and aContacts != ''">
            and t.a_contacts= #{aContacts}
            and t.a_contacts like concat('%',#{aContacts},'%')
        </if>
        <if test="partyaId !=null and partyaId != ''">
            and t.partya_id= #{partyaId}
@@ -43,9 +37,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改合同房屋信息 add by wuxw 2018-07-03 -->
    <update id="updateContractPartyaInfo" parameterType="Map">
@@ -69,7 +61,6 @@
        <if test="partyaId !=null and partyaId != ''">
            and t.partya_id= #{partyaId}
        </if>
    </update>
    <!-- 查询合同房屋数量 add by wuxw 2018-07-03 -->
@@ -78,13 +69,13 @@
        from contract_partya t
        where 1 =1
        <if test="partyA !=null and partyA != ''">
            and t.party_a= #{partyA}
            and t.party_a like concat('%',#{partyA},'%')
        </if>
        <if test="aLink !=null and aLink != ''">
            and t.a_link= #{aLink}
        </if>
        <if test="aContacts !=null and aContacts != ''">
            and t.a_contacts= #{aContacts}
            and t.a_contacts like concat('%',#{aContacts},'%')
        </if>
        <if test="partyaId !=null and partyaId != ''">
            and t.partya_id= #{partyaId}
@@ -95,8 +86,5 @@
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/ContractServiceDaoImplMapper.xml
@@ -1,23 +1,21 @@
<?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="contractServiceDaoImpl">
    <!-- 保存合同管理信息 add by wuxw 2018-07-03 -->
    <insert id="saveContractInfo" parameterType="Map">
        insert into contract(
        a_link,a_contacts,amount,contract_type,store_id,operator,signing_time,b_contacts,party_a,b_link,party_b,
        contract_id,obj_id,contract_name,start_time,end_time,state,contract_code,obj_type,operator_link,contract_parent_id,
        obj_name, obj_person_name, obj_person_id,start_user_id
        ) values (
        #{aLink},#{aContacts},#{amount},#{contractType},#{storeId},#{operator},#{signingTime},#{bContacts},#{partyA},#{bLink},#{partyB},
        #{contractId},#{objId},#{contractName},#{startTime},#{endTime},#{state},#{contractCode},#{objType},#{operatorLink},#{contractParentId},
        #{objName}, #{objPersonName}, #{objPersonId},#{startUserId}
        )
        insert into contract(a_link, a_contacts, amount, contract_type, store_id, operator, signing_time, b_contacts,
                             party_a, b_link, party_b,
                             contract_id, obj_id, contract_name, start_time, end_time, state, contract_code, obj_type,
                             operator_link, contract_parent_id,
                             obj_name, obj_person_name, obj_person_id, start_user_id)
        values (#{aLink}, #{aContacts}, #{amount}, #{contractType}, #{storeId}, #{operator}, #{signingTime},
                #{bContacts}, #{partyA}, #{bLink}, #{partyB},
                #{contractId}, #{objId}, #{contractName}, #{startTime}, #{endTime}, #{state}, #{contractCode},
                #{objType}, #{operatorLink}, #{contractParentId},
                #{objName}, #{objPersonName}, #{objPersonId}, #{startUserId})
    </insert>
    <!-- 查询合同管理信息 add by wuxw 2018-07-03 -->
    <select id="getContractInfo" parameterType="Map" resultType="Map">
@@ -30,13 +28,14 @@
        endTime,t.state,t.contract_code,t.contract_code contractCode,t.obj_type,t.obj_type
        objType,t.operator_link,t.operator_link operatorLink,ct.type_name contractTypeName,ct.audit,td.`name`
        stateName,t.state_desc stateDesc,t.contract_parent_id contractParentId,tt.contract_code parentContractCode,
        tt.contract_name parentContractName,t.obj_name objName, t.obj_person_name objPersonName, t.obj_person_id objPersonId,
        t.start_user_id startUserId,t.create_time createTime
        tt.contract_name parentContractName,t.obj_name objName, t.obj_person_name objPersonName, t.obj_person_id
        objPersonId,t.start_user_id startUserId,t.create_time createTime
        from contract t
        LEFT JOIN contract_type ct on t.contract_type = ct.contract_type_id and ct.status_cd = '0' and ct.store_id =
        t.store_id
        LEFT JOIN t_dict td on td.status_cd = t.state and td.table_name = 'contract' and td.table_columns = 'state'
        left join contract tt on t.contract_parent_id = tt.contract_id and tt.status_cd = '0' and tt.store_id = t.store_id
        left join contract tt on t.contract_parent_id = tt.contract_id and tt.status_cd = '0' and tt.store_id =
        t.store_id
        where 1 =1
        <if test="aLink !=null and aLink != ''">
            and t.a_link= #{aLink}
@@ -75,7 +74,7 @@
            and t.party_b= #{partyB}
        </if>
        <if test="partyBLike !=null and partyBLike != ''">
            and t.party_b like  concat('%',#{partyBLike},'%')
            and t.party_b like concat('%',#{partyBLike},'%')
        </if>
        <if test="contractId !=null and contractId != ''">
            and t.contract_id= #{contractId}
@@ -96,7 +95,7 @@
            and t.contract_name= #{contractName}
        </if>
        <if test="contractNameLike !=null and contractNameLike != ''">
            and t.contract_name like  concat('%',#{contractNameLike},'%')
            and t.contract_name like concat('%',#{contractNameLike},'%')
        </if>
        <if test="startTime !=null">
            and t.start_time= #{startTime}
@@ -123,7 +122,7 @@
            and t.contract_code= #{contractCode}
        </if>
        <if test="contractCodeLike !=null and contractCodeLike != ''">
            and t.contract_code like  concat('%',#{contractCodeLike},'%')
            and t.contract_code like concat('%',#{contractCodeLike},'%')
        </if>
        <if test="objType !=null and objType != ''">
            and t.obj_type= #{objType}
@@ -135,15 +134,13 @@
            and t.contract_parent_id= #{contractParentId}
        </if>
        <if test="parentContractCodeLike !=null and parentContractCodeLike != ''">
            and tt.contract_code like  concat('%',#{parentContractCodeLike},'%')
            and tt.contract_code like concat('%',#{parentContractCodeLike},'%')
        </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="updateContractInfo" parameterType="Map">
@@ -224,14 +221,14 @@
        <if test="contractId !=null and contractId != ''">
            and t.contract_id= #{contractId}
        </if>
    </update>
    <!-- 查询合同管理数量 add by wuxw 2018-07-03 -->
    <select id="queryContractsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from contract t
        left join contract tt on t.contract_parent_id = tt.contract_id and tt.status_cd = '0' and tt.store_id = t.store_id
        left join contract tt on t.contract_parent_id = tt.contract_id and tt.status_cd = '0' and tt.store_id =
        t.store_id
        where 1 =1
        <if test="aLink !=null and aLink != ''">
            and t.a_link= #{aLink}
@@ -270,7 +267,7 @@
            and t.party_b= #{partyB}
        </if>
        <if test="partyBLike !=null and partyBLike != ''">
            and t.party_b like  concat('%',#{partyBLike},'%')
            and t.party_b like concat('%',#{partyBLike},'%')
        </if>
        <if test="contractId !=null and contractId != ''">
            and t.contract_id= #{contractId}
@@ -291,10 +288,8 @@
            and t.contract_name= #{contractName}
        </if>
        <if test="contractNameLike !=null and contractNameLike != ''">
            and t.contract_name like  concat('%',#{contractNameLike},'%')
            and t.contract_name like concat('%',#{contractNameLike},'%')
        </if>
        <if test="startTime !=null">
            and t.start_time= #{startTime}
        </if>
@@ -320,7 +315,7 @@
            and t.contract_code= #{contractCode}
        </if>
        <if test="contractCodeLike !=null and contractCodeLike != ''">
            and t.contract_code like  concat('%',#{contractCodeLike},'%')
            and t.contract_code like concat('%',#{contractCodeLike},'%')
        </if>
        <if test="objType !=null and objType != ''">
            and t.obj_type= #{objType}
@@ -332,11 +327,9 @@
            and t.contract_parent_id= #{contractParentId}
        </if>
        <if test="parentContractCodeLike !=null and parentContractCodeLike != ''">
            and tt.contract_code like  concat('%',#{parentContractCodeLike},'%')
            and tt.contract_code like concat('%',#{parentContractCodeLike},'%')
        </if>
    </select>
    <select id="queryContractsByOwnerIds" parameterType="Map" resultType="Map">
        select t.obj_id ownerId,count(t.contract_id) contractCount
@@ -348,5 +341,4 @@
        </foreach>
        group by t.obj_id
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/ContractTypeServiceDaoImplMapper.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="contractTypeServiceDaoImpl">
    <!-- 保存合同类型信息 add by wuxw 2018-07-03 -->
    <insert id="saveContractTypeInfo" parameterType="Map">
        insert into contract_type(
        audit,type_name,remark,store_id,contract_type_id
        ) values (
        #{audit},#{typeName},#{remark},#{storeId},#{contractTypeId}
        )
        insert into contract_type(audit, type_name, remark, store_id, contract_type_id)
        values (#{audit}, #{typeName}, #{remark}, #{storeId}, #{contractTypeId})
    </insert>
    <!-- 查询合同类型信息 add by wuxw 2018-07-03 -->
    <select id="getContractTypeInfo" parameterType="Map" resultType="Map">
@@ -26,7 +20,7 @@
            and t.audit= #{audit}
        </if>
        <if test="typeName !=null and typeName != ''">
            and t.type_name= #{typeName}
            and t.type_name like concat('%',#{typeName},'%')
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
@@ -44,9 +38,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改合同类型信息 add by wuxw 2018-07-03 -->
    <update id="updateContractTypeInfo" parameterType="Map">
@@ -70,7 +62,6 @@
        <if test="contractTypeId !=null and contractTypeId != ''">
            and t.contract_type_id= #{contractTypeId}
        </if>
    </update>
    <!-- 查询合同类型数量 add by wuxw 2018-07-03 -->
@@ -82,7 +73,7 @@
            and t.audit= #{audit}
        </if>
        <if test="typeName !=null and typeName != ''">
            and t.type_name= #{typeName}
            and t.type_name like concat('%',#{typeName},'%')
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
@@ -96,8 +87,5 @@
        <if test="contractTypeId !=null and contractTypeId != ''">
            and t.contract_type_id= #{contractTypeId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/ContractTypeSpecServiceDaoImplMapper.xml
@@ -1,19 +1,15 @@
<?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="contractTypeSpecServiceDaoImpl">
    <!-- 保存合同类型规格信息 add by wuxw 2018-07-03 -->
    <insert id="saveContractTypeSpecInfo" parameterType="Map">
        insert into contract_type_spec(
        spec_type,spec_name,spec_holdplace,spec_value_type,spec_cd,store_id,spec_show,contract_type_id,required,list_show
        ) values (
        #{specType},#{specName},#{specHoldplace},#{specValueType},#{specCd},#{storeId},#{specShow},#{contractTypeId},#{required},#{listShow}
        )
        insert into contract_type_spec(spec_type, spec_name, spec_holdplace, spec_value_type, spec_cd, store_id,
                                       spec_show, contract_type_id, required, list_show)
        values (#{specType}, #{specName}, #{specHoldplace}, #{specValueType}, #{specCd}, #{storeId}, #{specShow},
                #{contractTypeId}, #{required}, #{listShow})
    </insert>
    <!-- 查询合同类型规格信息 add by wuxw 2018-07-03 -->
    <select id="getContractTypeSpecInfo" parameterType="Map" resultType="Map">
@@ -27,7 +23,7 @@
            and t.spec_type= #{specType}
        </if>
        <if test="specName !=null and specName != ''">
            and t.spec_name= #{specName}
            and t.spec_name like concat('%',#{specName},'%')
        </if>
        <if test="specHoldplace !=null and specHoldplace != ''">
            and t.spec_holdplace= #{specHoldplace}
@@ -60,9 +56,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改合同类型规格信息 add by wuxw 2018-07-03 -->
    <update id="updateContractTypeSpecInfo" parameterType="Map">
@@ -101,7 +95,6 @@
        <if test="specCd !=null and specCd != ''">
            and t.spec_cd= #{specCd}
        </if>
    </update>
    <!-- 查询合同类型规格数量 add by wuxw 2018-07-03 -->
@@ -113,7 +106,7 @@
            and t.spec_type= #{specType}
        </if>
        <if test="specName !=null and specName != ''">
            and t.spec_name= #{specName}
            and t.spec_name like concat('%',#{specName},'%')
        </if>
        <if test="specHoldplace !=null and specHoldplace != ''">
            and t.spec_holdplace= #{specHoldplace}
@@ -142,8 +135,5 @@
        <if test="listShow !=null and listShow != ''">
            and t.list_show= #{listShow}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/PurchaseApplyDetailServiceDaoImplMapper.xml
@@ -108,7 +108,7 @@
        left join t_dict td6 on rs.is_fixed = td6.status_cd and td6.table_name = 'resource_store' and td6.table_columns = 'is_fixed'
        where 1 = 1
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
            and t.apply_order_id like concat('%',#{applyOrderId},'%')
        </if>
        <if test="resName !=null and resName != ''">
            and rs.res_name like '%${resName}%'
@@ -257,7 +257,7 @@
        LEFT JOIN resource_store_specification rss on rs.rss_id=rss.rss_id and rss.status_cd = '0'
        where 1 = 1
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
            and t.apply_order_id like concat('%',#{applyOrderId},'%')
        </if>
        <if test="resName !=null and resName != ''">
            and rs.res_name like '%${resName}%'
java110-db/src/main/resources/mapper/store/PurchaseApplyDetailV1ServiceDaoImplMapper.xml
@@ -1,21 +1,17 @@
<?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="purchaseApplyDetailV1ServiceDaoImpl">
    <!-- 保存采购申请明细信息 add by wuxw 2018-07-03 -->
    <insert id="savePurchaseApplyDetailInfo" parameterType="Map">
        insert into purchase_apply_detail(
        original_stock,quantity,operate,price,purchase_remark,purchase_quantity,rs_id,apply_order_id,remark,id,res_id,
        times_id,consult_price
        ) values (
        #{originalStock},#{quantity},'ADD',#{price},#{purchaseRemark},#{purchaseQuantity},#{rsId},#{applyOrderId},#{remark},#{id},
        #{resId},#{timesId},#{consultPrice}
        )
        insert into purchase_apply_detail(original_stock, quantity, operate, price, purchase_remark, purchase_quantity,
                                          rs_id, apply_order_id, remark, id, res_id,
                                          times_id, consult_price, b_id)
        values (#{originalStock}, #{quantity}, 'ADD', #{price}, #{purchaseRemark}, #{purchaseQuantity}, #{rsId},
                #{applyOrderId}, #{remark}, #{id},
                #{resId}, #{timesId}, #{consultPrice}, #{bId})
    </insert>
    <!-- 查询采购申请明细信息 add by wuxw 2018-07-03 -->
    <select id="getPurchaseApplyDetailInfo" parameterType="Map" resultType="Map">
@@ -62,9 +58,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改采购申请明细信息 add by wuxw 2018-07-03 -->
    <update id="updatePurchaseApplyDetailInfo" parameterType="Map">
@@ -90,7 +84,6 @@
        <if test="rsId !=null and rsId != ''">
            , t.rs_id= #{rsId}
        </if>
        <if test="remark !=null and remark != ''">
            , t.remark= #{remark}
        </if>
@@ -104,7 +97,6 @@
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
    </update>
    <!-- 查询采购申请明细数量 add by wuxw 2018-07-03 -->
@@ -145,8 +137,5 @@
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/PurchaseApplyServiceDaoImplMapper.xml
@@ -1,7 +1,7 @@
<?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="purchaseApplyServiceDaoImpl">
    <resultMap type="com.java110.dto.purchase.PurchaseApplyDto" id="applyMap">
        <id column="applyOrderId" property="applyOrderId"/>
@@ -38,9 +38,10 @@
    <!-- 保存采购申请信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessPurchaseApplyInfo" parameterType="Map">
        insert into business_purchase_apply
        (operate,res_order_type,description,apply_order_id,state,store_id,user_id,user_name,b_id,end_user_name,end_user_tel,community_id)
        values
        (#{operate},#{resOrderType},#{description},#{applyOrderId},#{state},#{storeId},#{userId},#{userName},#{bId},#{endUserName},#{endUserTel},#{communityId})
        (operate, res_order_type, description, apply_order_id, state, store_id, user_id, user_name, b_id, end_user_name,
         end_user_tel, community_id)
        values (#{operate}, #{resOrderType}, #{description}, #{applyOrderId}, #{state}, #{storeId}, #{userId},
                #{userName}, #{bId}, #{endUserName}, #{endUserTel}, #{communityId})
    </insert>
    <!-- 保存采购明细表备份表 -->
@@ -218,14 +219,14 @@
        t.warehousing_way warehousingWay,
        t.community_id communityId
        from purchase_apply t
        <if test="resName != null and resName != ''" >
        left join purchase_apply_detail pad on t.apply_order_id = pad.apply_order_id and pad.status_cd = '0'
        left join resource_store rs on pad.res_id = rs.res_id and rs.status_cd = '0'
       </if>
        <if test="resName != null and resName != ''">
            left join purchase_apply_detail pad on t.apply_order_id = pad.apply_order_id and pad.status_cd = '0'
            left join resource_store rs on pad.res_id = rs.res_id and rs.status_cd = '0'
        </if>
        inner join t_dict d on t.state = d.status_cd and d.table_name = 'purchase_apply' and d.table_columns = 'state'
        where 1 = 1
        <if test="resName != null and resName != ''" >
        and rs.res_name like concat('%','','%')
        <if test="resName != null and resName != ''">
            and rs.res_name like concat('%',#{resName},'%')
        </if>
        <if test="resOrderType !=null and resOrderType != ''">
            and t.res_order_type= #{resOrderType}
@@ -234,7 +235,7 @@
            and t.description= #{description}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
            and t.apply_order_id like concat('%',#{applyOrderId},'%')
        </if>
        <if test="applyOrderIds !=null ">
            and t.apply_order_id in
@@ -274,7 +275,7 @@
            and t.create_time &gt;= #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.create_time &lt;= #{startTime}
            and t.create_time &lt;= #{endTime}
        </if>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
@@ -341,14 +342,17 @@
        p.res_id resId,p.quantity,p.remark,p.purchase_quantity purchaseQuantity,p.purchase_remark purchaseRemark,p.price
        purchasePrice,p.original_stock originalStock,p.consult_price consultPrice,p.times_id timesId,
        r.res_name resName,r.res_code resCode,
        r.price,r.price standardPrice,rstime.stock,rst.name rstName,rst1.name parentRstName,rss.spec_name specName,rs.supplier_name supplierName,
        r.price,r.price standardPrice,rstime.stock,rst.name rstName,rst1.name parentRstName,rss.spec_name
        specName,rs.supplier_name supplierName,
        td1.name unitCodeName,
        td2.name miniUnitCodeName
        from
        purchase_apply_detail p
        inner join resource_store r on p.res_id = r.res_id and r.status_cd = '0'
        left join t_dict td1 on r.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code'
        left join t_dict td2 on r.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code'
        left join t_dict td1 on r.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns
        = 'unit_code'
        left join t_dict td2 on r.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and
        td2.table_columns = 'unit_code'
        LEFT JOIN resource_supplier rs on p.rs_id=rs.rs_id
        LEFT JOIN resource_store_type rst on r.rst_id=rst.rst_id
        LEFT JOIN resource_store_type rst1 on r.parent_rst_id=rst1.rst_id
@@ -419,13 +423,13 @@
    <select id="queryPurchaseApplysCount" parameterType="Map" resultType="Map">
        select count(1) count
        from purchase_apply t
        <if test="resName != null and resName != ''" >
        <if test="resName != null and resName != ''">
            left join purchase_apply_detail pad on t.apply_order_id = pad.apply_order_id and pad.status_cd = '0'
            left join resource_store rs on pad.res_id = rs.res_id and rs.status_cd = '0'
        </if>
        where 1 = 1
        <if test="resName != null and resName != ''" >
            and rs.res_name like concat('%','','%')
        <if test="resName != null and resName != ''">
            and rs.res_name like concat('%',#{resName},'%')
        </if>
        <if test="resOrderType !=null and resOrderType != ''">
            and t.res_order_type= #{resOrderType}
@@ -434,7 +438,7 @@
            and t.description= #{description}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
            and t.apply_order_id like concat('%',#{applyOrderId},'%')
        </if>
        <if test="applyOrderIds !=null ">
            and t.apply_order_id in
@@ -477,7 +481,7 @@
            and t.create_time &gt;= #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.create_time &lt;= #{startTime}
            and t.create_time &lt;= #{endTime}
        </if>
        <if test='urgentFlag !=null and urgentFlag == "1"'>
            and date_format(t.create_time,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -487,11 +491,12 @@
    <!-- 保存采购申请信息 add by wuxw 2018-07-03 -->
    <insert id="savePurchaseApply" parameterType="Map">
        insert into purchase_apply
        (status_cd,res_order_type,description,apply_order_id,state,store_id,user_id,user_name,b_id,end_user_name,end_user_tel,
        create_time,create_user_id,create_user_name,warehousing_way,community_id)
        values
        ('0',#{resOrderType},#{description},#{applyOrderId},#{state},#{storeId},#{userId},#{userName},'-1',#{endUserName},#{endUserTel},
        #{createTime},#{createUserId},#{createUserName},#{warehousingWay},#{communityId})
        (status_cd, res_order_type, description, apply_order_id, state, store_id, user_id, user_name, b_id,
         end_user_name, end_user_tel,
         create_time, create_user_id, create_user_name, warehousing_way, community_id)
        values ('0', #{resOrderType}, #{description}, #{applyOrderId}, #{state}, #{storeId}, #{userId}, #{userName},
                '-1', #{endUserName}, #{endUserTel},
                #{createTime}, #{createUserId}, #{createUserName}, #{warehousingWay}, #{communityId})
    </insert>
    <!--查询下级用户id-->
java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.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="resourceResourceStoreServiceDaoImpl">
@@ -23,12 +22,12 @@
        insert into resource_store(res_id, b_id, store_id, res_name, res_code, unit_code, remark, out_low_price,
                                   out_high_price, show_mobile, description,
                                   price, stock, create_time, sh_id, warning_stock, average_price, rss_id, rst_id,
                                   mini_unit_code, mini_unit_stock, mini_stock, parent_rst_id, is_fixed,community_id)
                                   mini_unit_code, mini_unit_stock, mini_stock, parent_rst_id, is_fixed, community_id)
        values (#{resId}, #{bId}, #{storeId}, #{resName}, #{resCode}, #{unitCode}, #{remark}, #{outLowPrice},
                #{outHighPrice},
                #{showMobile}, #{description}, #{price}, #{stock}, #{createTime}, #{shId}, #{warningStock},
                #{averagePrice}, #{rssId}, #{rstId}, #{miniUnitCode}, #{miniUnitStock}, #{miniStock}, #{parentRstId},
                #{isFixed},#{communityId})
                #{isFixed}, #{communityId})
    </insert>
    <!-- 查询资源信息(Business) add by wuxw 2018-07-03 -->
@@ -211,13 +210,14 @@
        averagePrice,rss.spec_name rssName,t.mini_unit_code,t.mini_unit_code miniUnitCode,t.mini_stock,t.mini_stock
        miniStock,t.mini_unit_stock,t.mini_unit_stock miniUnitStock,td.name unitCodeName,td1.name
        miniUnitCodeName,t.parent_rst_id parentRstId,t.rst_id rstId,rst1.name parentRstName,rst.name
        rstName,
        rstName,rstm.times_id timesId,
        t.is_fixed,t.is_fixed isFixed,td2.name isFixedName,t.community_id communityId
        from resource_store t
        left join resource_store_type rst on t.rst_id = rst.rst_id and rst.status_cd = '0'
        left join resource_store_type rst1 on t.parent_rst_id = rst1.rst_id and rst1.status_cd = '0'
        left join resource_store_specification rss on t.rss_id = rss.rss_id and rss.status_cd = '0'
        left join storehouse sh on t.sh_id = sh.sh_id and t.store_id = sh.store_id and sh.status_cd = '0'
        left join resource_store_times rstm on t.res_code = rstm.res_code and rstm.status_cd = '0'
        left join t_dict td on t.unit_code = td.status_cd and td.table_name = 'resource_store' and td.table_columns =
        'unit_code'
        left join t_dict td1 on t.mini_unit_code = td1.status_cd and td1.table_name = 'resource_store' and
@@ -288,7 +288,6 @@
        <if test="shId !=null and shId != ''">
            and t.sh_id= #{shId}
        </if>
        <if test="shObjId !=null and shObjId != ''">
            and sh.sh_obj_id= #{shObjId}
        </if>
@@ -370,7 +369,6 @@
        <if test="description !=null and description != ''">
            , t.description= #{description}
        </if>
        , t.stock= #{stock}
        <if test="warningStock !=null and warningStock != ''">
            , t.warning_stock= #{warningStock}
@@ -412,7 +410,17 @@
    <select id="queryResourceStoresCount" parameterType="Map" resultType="Map">
        select count(1) count
        from resource_store t
        left join resource_store_type rst on t.rst_id = rst.rst_id and rst.status_cd = '0'
        left join resource_store_type rst1 on t.parent_rst_id = rst1.rst_id and rst1.status_cd = '0'
        left join resource_store_specification rss on t.rss_id = rss.rss_id and rss.status_cd = '0'
        left join storehouse sh on t.sh_id = sh.sh_id and t.store_id = sh.store_id and sh.status_cd = '0'
        left join resource_store_times rstm on t.res_code = rstm.res_code and rstm.status_cd = '0'
        left join t_dict td on t.unit_code = td.status_cd and td.table_name = 'resource_store' and td.table_columns =
        'unit_code'
        left join t_dict td1 on t.mini_unit_code = td1.status_cd and td1.table_name = 'resource_store' and
        td1.table_columns = 'unit_code'
        left join t_dict td2 on t.is_fixed = td2.status_cd and td2.table_name='resource_store' and td2.table_columns =
        'is_fixed'
        where 1 =1
        <if test="resName !=null and resName != ''">
            and t.res_name like concat('%',#{resName},'%')
@@ -508,6 +516,7 @@
            and t.stock > 0
        </if>
    </select>
    <!-- 查询资源信息 add by wuxw 2018-07-03 -->
    <select id="queryResourceStoresTotalPrice" parameterType="Map" resultType="Map">
        select IFNULL(sum(total_price),0) as totalPrice from(
java110-db/src/main/resources/mapper/store/ResourceStoreUseRecordServiceDaoImplMapper.xml
@@ -143,13 +143,13 @@
            and t.unit_price= #{unitPrice}
        </if>
        <if test="createUserId !=null and createUserId != ''">
            and t.create_user_id= #{createUserId}
            and t.create_user_id like '%${createUserId}%'
        </if>
        <if test="quantity !=null and quantity != ''">
            and t.quantity= #{quantity}
        </if>
        <if test="rsurId !=null and rsurId != ''">
            and t.rsur_id= #{rsurId}
            and t.rsur_id like '%${rsurId}%'
        </if>
        <if test="repairId !=null and repairId != ''">
            and t.repair_id= #{repairId}
@@ -276,13 +276,13 @@
            and t.unit_price= #{unitPrice}
        </if>
        <if test="createUserId !=null and createUserId != ''">
            and t.create_user_id= #{createUserId}
            and t.create_user_id like '%${createUserId}%'
        </if>
        <if test="quantity !=null and quantity != ''">
            and t.quantity= #{quantity}
        </if>
        <if test="rsurId !=null and rsurId != ''">
            and t.rsur_id= #{rsurId}
            and t.rsur_id like '%${rsurId}%'
        </if>
        <if test="repairId !=null and repairId != ''">
            and t.repair_id= #{repairId}
java110-db/src/main/resources/mapper/store/ResourceSupplierServiceDaoImplMapper.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="resourceSupplierServiceDaoImpl">
@@ -12,7 +11,6 @@
        values (#{supplierName}, #{createUserId}, #{address}, #{contactName}, #{rsId}, #{createUserName}, #{remark},
                #{storeId}, #{accountBank}, #{operate}, #{tel}, #{bankAccountNumber}, #{bId})
    </insert>
    <!-- 查询物品供应商信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessResourceSupplierInfo" parameterType="Map" resultType="Map">
@@ -63,6 +61,7 @@
            and t.b_id= #{bId}
        </if>
    </select>
    <!-- 保存物品供应商信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveResourceSupplierInfoInstance" parameterType="Map">
        insert into resource_supplier(
@@ -109,7 +108,6 @@
        </if>
    </insert>
    <!-- 查询物品供应商信息 add by wuxw 2018-07-03 -->
    <select id="getResourceSupplierInfo" parameterType="Map" resultType="Map">
        select t.supplier_name,t.supplier_name supplierName,t.create_user_id,t.create_user_id
@@ -132,7 +130,7 @@
            and t.contact_name= #{contactName}
        </if>
        <if test="rsId !=null and rsId != ''">
            and t.rs_id= #{rsId}
            and t.rs_id like '%${rsId}%'
        </if>
        <if test="createUserName !=null and createUserName != ''">
            and t.create_user_name= #{createUserName}
@@ -163,7 +161,6 @@
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改物品供应商信息 add by wuxw 2018-07-03 -->
    <update id="updateResourceSupplierInfoInstance" parameterType="Map">
@@ -222,7 +219,7 @@
            and t.contact_name= #{contactName}
        </if>
        <if test="rsId !=null and rsId != ''">
            and t.rs_id= #{rsId}
            and t.rs_id like '%${rsId}%'
        </if>
        <if test="createUserName !=null and createUserName != ''">
            and t.create_user_name= #{createUserName}
java110-db/src/main/resources/mapper/store/UserStorehouseServiceDaoImplMapper.xml
@@ -6,25 +6,24 @@
    <!-- 保存个人物品信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessUserStorehouseInfo" parameterType="Map">
        insert into business_user_storehouse(
        res_name,operate,b_id,store_id,stock,res_id,res_code,user_id,us_id,mini_stock,times_id
        ) values (
        #{resName},#{operate},#{bId},#{storeId},#{stock},#{resId},#{resCode},#{userId},#{usId},#{miniStock},#{timesId}
        )
        insert into business_user_storehouse(res_name, operate, b_id, store_id, stock, res_id, res_code, user_id, us_id,
                                             mini_stock, times_id)
        values (#{resName}, #{operate}, #{bId}, #{storeId}, #{stock}, #{resId}, #{resCode}, #{userId}, #{usId},
                #{miniStock}, #{timesId})
    </insert>
    <insert id="saveUserStorehouses" parameterType="Map">
        insert into user_storehouse(
        res_name,b_id,store_id,stock,res_id,res_code,user_id,us_id,mini_stock,times_id
        ) values (
        #{resName},'-1',#{storeId},#{stock},#{resId},#{resCode},#{userId},#{usId},#{miniStock},#{timesId}
        )
        insert into user_storehouse(res_name, b_id, store_id, stock, res_id, res_code, user_id, us_id, mini_stock,
                                    times_id)
        values (#{resName}, '-1', #{storeId}, #{stock}, #{resId}, #{resCode}, #{userId}, #{usId}, #{miniStock},
                #{timesId})
    </insert>
    <!-- 查询个人物品信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessUserStorehouseInfo" parameterType="Map" resultType="Map">
        select t.res_name,t.res_name resName,t.operate,t.b_id,t.b_id bId,t.store_id,t.store_id
        storeId,t.stock,t.res_id,t.res_id resId,t.res_code,t.res_code resCode,t.user_id,t.user_id userId,t.us_id,t.us_id usId,
        storeId,t.stock,t.res_id,t.res_id resId,t.res_code,t.res_code resCode,t.user_id,t.user_id userId,t.us_id,t.us_id
        usId,
        t.mini_stock,t.mini_stock miniStock,t.times_id,t.times_id timesId
        from business_user_storehouse t
        where 1 =1
@@ -67,7 +66,8 @@
    <insert id="saveUserStorehouseInfoInstance" parameterType="Map">
        insert into user_storehouse(
        res_name,status_cd,b_id,store_id,stock,res_id,res_code,user_id,us_id,mini_stock
        ) select t.res_name,'0',t.b_id,t.store_id,t.stock,t.res_id,t.res_code,t.user_id,t.us_id,t.mini_stock from business_user_storehouse t
        ) select t.res_name,'0',t.b_id,t.store_id,t.stock,t.res_id,t.res_code,t.user_id,t.us_id,t.mini_stock from
        business_user_storehouse t
        where 1=1
        <if test="resName !=null and resName != ''">
            and t.res_name= #{resName}
@@ -103,17 +103,22 @@
    <select id="getUserStorehouseInfo" parameterType="Map" resultType="Map">
        select t.res_name,t.res_name resName,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.store_id,t.store_id
        storeId,t.stock,t.res_id,t.res_id resId,t.user_id,t.user_id userId,t.us_id,t.us_id usId,rs.res_code resCode,
        rs.out_low_price outLowPrice,rs.out_high_price outHighPrice,rst.name rstName,rst1.name parentRstName,rss.spec_name specName,t.mini_stock miniStock,
        rs.unit_code unitCode,rs.mini_unit_code miniUnitCode,rs.mini_unit_stock miniUnitStock,t.times_id,t.times_id timesId,
        rs.out_low_price outLowPrice,rs.out_high_price outHighPrice,rst.name rstName,rst1.name
        parentRstName,rss.spec_name specName,t.mini_stock miniStock,
        rs.unit_code unitCode,rs.mini_unit_code miniUnitCode,rs.mini_unit_stock miniUnitStock,t.times_id,t.times_id
        timesId,
        td.name unitCodeName,td1.name miniUnitCodeName,u.name userName,rs.is_fixed isFixed,td2.name isFixedName
        from user_storehouse t
        left join resource_store rs on t.res_code = rs.res_code and rs.status_cd = '0' and t.res_id = rs.res_id
        left join resource_store_type rst on rs.rst_id = rst.rst_id
        left join resource_store_type rst1 on rs.parent_rst_id = rst1.rst_id
        left join resource_store_specification rss on rs.rss_id = rss.rss_id
        left join t_dict td on rs.unit_code = td.status_cd and td.table_name = 'resource_store' and td.table_columns = 'unit_code'
        left join t_dict td1 on rs.mini_unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code'
        left join t_dict td2 on rs.is_fixed = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'is_fixed'
        left join t_dict td on rs.unit_code = td.status_cd and td.table_name = 'resource_store' and td.table_columns =
        'unit_code'
        left join t_dict td1 on rs.mini_unit_code = td1.status_cd and td1.table_name = 'resource_store' and
        td1.table_columns = 'unit_code'
        left join t_dict td2 on rs.is_fixed = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns
        = 'is_fixed'
        left join u_user u on t.user_id = u.user_id
        where 1 = 1
        <if test='lagerStockZero !=null and lagerStockZero == "1"'>
@@ -138,14 +143,14 @@
            and t.stock= #{stock}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
            and t.res_id like '%${resId}%'
        </if>
        <if test="resCode !=null and resCode != ''">
            and rs.res_code= #{resCode}
        </if>
        <if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
        </if>
        <!--<if test="userId !=null and userId != ''">
            and t.user_id like '%${userId}%'
        </if>-->
        <if test="rstId !=null and rstId != ''">
            and rs.rst_id= #{rstId}
        </if>
@@ -162,13 +167,13 @@
            and t.us_id= #{usId}
        </if>
        <if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
            and t.user_id like '%${userId}%'
        </if>
        <if test="userName !=null and userName != ''">
            and u.name= #{userName}
        </if>
<!--        这里先注释 因为 mysql 8.0  有问题 后面遇到问题 分析 为啥重复 优化 sql-->
<!--        GROUP BY t.us_id-->
        <!--        这里先注释 因为 mysql 8.0  有问题 后面遇到问题 分析 为啥重复 优化 sql-->
        <!--        GROUP BY t.us_id-->
        order by t.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
@@ -236,7 +241,7 @@
            and t.stock= #{stock}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
            and t.res_id like '%${resId}%'
        </if>
        <if test="resCode !=null and resCode != ''">
            and t.res_code= #{resCode}
@@ -245,7 +250,7 @@
            and rs.res_code= #{resCode}
        </if>
        <if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
            and t.user_id like '%${userId}%'
        </if>
        <if test="rstId !=null and rstId != ''">
            and rs.rst_id= #{rstId}
@@ -262,9 +267,9 @@
        <if test="usId !=null and usId != ''">
            and t.us_id= #{usId}
        </if>
        <if test="userId !=null and userId != ''">
        <!--<if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
        </if>
        </if>-->
        <if test="userName !=null and userName != ''">
            and u.name= #{userName}
        </if>
java110-db/src/main/resources/mapper/user/OwnerAppUserServiceDaoImplMapper.xml
@@ -1,19 +1,17 @@
<?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="ownerAppUserServiceDaoImpl">
    <!-- 保存绑定业主信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessOwnerAppUserInfo" parameterType="Map">
        insert into business_owner_app_user(
        id_card,open_id,link,remark,operate,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id,user_id,app_type,nickname,headimgurl
        ) values (
        #{idCard},#{openId},#{link},#{remark},#{operate},#{appUserName},#{communityName},#{state},#{appUserId},#{communityId},
        #{appTypeCd},#{bId},#{memberId},#{userId},#{appType},#{nickName},#{headImgUrl}
        )
        insert into business_owner_app_user(id_card, open_id, link, remark, operate, app_user_name, community_name,
                                            state, app_user_id, community_id, app_type_cd, b_id, member_id, user_id,
                                            app_type, nickname, headimgurl)
        values (#{idCard}, #{openId}, #{link}, #{remark}, #{operate}, #{appUserName}, #{communityName}, #{state},
                #{appUserId}, #{communityId},
                #{appTypeCd}, #{bId}, #{memberId}, #{userId}, #{appType}, #{nickName}, #{headImgUrl})
    </insert>
    <!-- 查询绑定业主信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessOwnerAppUserInfo" parameterType="Map" resultType="Map">
@@ -67,9 +65,7 @@
        <if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
        </if>
    </select>
    <!-- 保存绑定业主信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveOwnerAppUserInfoInstance" parameterType="Map">
@@ -126,9 +122,7 @@
        <if test="headImgUrl !=null and headImgUrl != ''">
            and t.headimgurl= #{headImgUrl}
        </if>
    </insert>
    <!-- 查询绑定业主信息 add by wuxw 2018-07-03 -->
    <select id="getOwnerAppUserInfo" parameterType="Map" resultType="Map">
@@ -160,7 +154,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="appUserName !=null and appUserName != ''">
            and t.app_user_name= #{appUserName}
            and t.app_user_name like concat('%',#{appUserName},'%')
        </if>
        <if test="communityName !=null and communityName != ''">
            and t.community_name= #{communityName}
@@ -174,7 +168,6 @@
                #{item}
            </foreach>
        </if>
        <if test="appUserId !=null and appUserId != ''">
            and t.app_user_id= #{appUserId}
        </if>
@@ -196,8 +189,7 @@
        <if test="userIds !=null">
            and t.user_id in
            <foreach collection="userIds" open="(" close=")"
                     separator="," item="item">
                #{item}
                     separator="," item="item">#{item}
            </foreach>
        </if>
        <if test="userId !=null and userId != ''">
@@ -207,9 +199,7 @@
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改绑定业主信息 add by wuxw 2018-07-03 -->
    <update id="updateOwnerAppUserInfoInstance" parameterType="Map">
@@ -269,14 +259,16 @@
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
    </update>
    <!-- 查询绑定业主数量 add by wuxw 2018-07-03 -->
    <select id="queryOwnerAppUsersCount" parameterType="Map" resultType="Map">
        select count(1) count
        from owner_app_user t
        left join t_dict td1 on t.state = td1.status_cd and td1.table_name = 'owner_app_user' and td1.table_columns = 'state'
        left join t_dict td1 on t.state = td1.status_cd and td1.table_name = 'owner_app_user' and td1.table_columns =
        'state'
        left join building_owner bo on t.member_id = bo.member_id and t.community_id = bo.community_id and bo.status_cd
        = '0'
        where 1 =1
        and t.status_cd = '0'
        <if test="idCard !=null and idCard != ''">
@@ -295,7 +287,7 @@
            and t.status_cd= #{statusCd}
        </if>
        <if test="appUserName !=null and appUserName != ''">
            and t.app_user_name= #{appUserName}
            and t.app_user_name like concat('%',#{appUserName},'%')
        </if>
        <if test="communityName !=null and communityName != ''">
            and t.community_name= #{communityName}
@@ -324,15 +316,11 @@
        <if test="userIds !=null">
            and t.user_id in
            <foreach collection="userIds" open="(" close=")"
                     separator="," item="item">
                #{item}
                     separator="," item="item">#{item}
            </foreach>
        </if>
        <if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml
@@ -6,13 +6,12 @@
    <!-- 保存车辆管理信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessOwnerCarInfo" parameterType="Map">
        insert into business_owner_car(
        car_color,car_brand,car_type,operate,car_num,ps_id,remark,owner_id,b_id,user_id,car_id,community_id,start_time,
        end_time,state,car_type_cd,member_id
        ) values (
        #{carColor},#{carBrand},#{carType},#{operate},#{carNum},#{psId},#{remark},#{ownerId},#{bId},#{userId},#{carId},#{communityId},
        #{startTime},#{endTime},#{state},#{carTypeCd},#{memberId}
        )
        insert into business_owner_car(car_color, car_brand, car_type, operate, car_num, ps_id, remark, owner_id, b_id,
                                       user_id, car_id, community_id, start_time,
                                       end_time, state, car_type_cd, member_id)
        values (#{carColor}, #{carBrand}, #{carType}, #{operate}, #{carNum}, #{psId}, #{remark}, #{ownerId}, #{bId},
                #{userId}, #{carId}, #{communityId},
                #{startTime}, #{endTime}, #{state}, #{carTypeCd}, #{memberId})
    </insert>
    <!-- 查询车辆管理信息(Business) add by wuxw 2018-07-03 -->
@@ -78,7 +77,7 @@
        start_time,end_time,state,car_type_cd,member_id
        ) select
        t.car_color,t.car_brand,t.car_type,t.car_num,t.ps_id,t.remark,'0',t.owner_id,t.b_id,t.user_id,t.car_id,t.community_id,
        t.start_time,t.end_time,t.state,  t.car_type_cd,t.member_id
        t.start_time,t.end_time,t.state, t.car_type_cd,t.member_id
        from business_owner_car t where 1=1
        <if test="carColor !=null and carColor != ''">
            and t.car_color= #{carColor}
@@ -131,22 +130,26 @@
        t.owner_id ownerId,t.b_id,t.b_id bId,t.user_id,t.user_id userId,t.car_id,t.car_id carId ,t.create_time
        createTime,t.community_id communityId,bow.name ownerName,bow.id_card idCard,bow.link,t2.name stateName,
        t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.state,
        t.car_type_cd,t.car_type_cd carTypeCd,t.member_id,t.member_id memberId,ps.num,pa.num areaNum,t.lease_type leaseType,
        t.car_type_cd,t.car_type_cd carTypeCd,t.member_id,t.member_id memberId,ps.num,pa.num areaNum,t.lease_type
        leaseType,
        t3.name leaseTypeName,t4.name carTypeCdName
        <if test="carTypeCd != '1003'">
        ,count(moc.member_id) memberCarCount
            ,count(moc.member_id) memberCarCount
        </if>
        from owner_car t
        left join t_dict t1 on t.car_type=t1.status_cd and t1.table_name='owner_car' and t1.table_columns = 'car_type'
        left join t_dict t2 on t.state=t2.status_cd and t2.table_name='owner_car' and t2.table_columns = 'state'
        left join t_dict t4 on t.car_type_cd=t4.status_cd and t4.table_name='owner_car' and t4.table_columns = 'car_type_cd'
        left join t_dict t4 on t.car_type_cd=t4.status_cd and t4.table_name='owner_car' and t4.table_columns =
        'car_type_cd'
        left join building_owner bow on t.owner_id = bow.member_id and bow.status_cd = '0' and bow.community_id =
        t.community_id
        left join parking_space ps on t.ps_id = ps.ps_id and ps.status_cd = '0'
        left join parking_area pa on ps.pa_id = pa.pa_id and pa.status_cd = '0'
        left join t_dict t3 on t.lease_type = t3.status_cd and t3.table_name = 'owner_car' and t3.table_columns = 'lease_type'
        left join t_dict t3 on t.lease_type = t3.status_cd and t3.table_name = 'owner_car' and t3.table_columns =
        'lease_type'
        <if test="carTypeCd != '1003'">
        left join owner_car moc on t.car_id = moc.car_id and moc.car_type_cd != t.car_type_cd and moc.car_type_cd = '1002' and moc.status_cd = '0'
            left join owner_car moc on t.car_id = moc.car_id and moc.car_type_cd != t.car_type_cd and moc.car_type_cd =
            '1002' and moc.status_cd = '0'
        </if>
        where 1=1
        <if test="statusCd !=null and statusCd != ''">
@@ -180,13 +183,13 @@
            and t.car_num= #{carNum}
        </if>
        <if test="carNumLike !=null and carNumLike != ''">
            and t.car_num like  concat('%',#{carNumLike},'%')
            and t.car_num like concat('%',#{carNumLike},'%')
        </if>
        <if test="memberCarNum !=null and memberCarNum != '' and carTypeCd != '1003'">
            and moc.car_num= #{memberCarNum}
        </if>
        <if test="memberCarNumLike !=null and memberCarNumLike != '' and carTypeCd != '1003' ">
            and moc.car_num like  concat('%',#{memberCarNumLike},'%')
            and moc.car_num like concat('%',#{memberCarNumLike},'%')
        </if>
        <if test="carNums !=null">
            and t.car_num in
@@ -250,20 +253,21 @@
        </if>
        <if test="valid == 1">
            and t.end_time &gt; now()
            and t.state != '3003'
        </if>
        <if test="valid == 3">
            and t.end_time &lt; now()
            and (t.end_time &lt; now() or t.state = '3003')
        </if>
        <if test="valid == 2">
            and t.ps_id= '-1'
        </if>
        <if test="carTypeCd != '1003'">
        GROUP BY t.car_color,t.car_brand,t.car_type,t1.name,
        t.car_num,t.ps_id,t.remark,t.status_cd,t.owner_id,
        t.b_id,t.user_id,t.car_id,t.create_time
        ,t.community_id ,bow.name,bow.id_card ,bow.link,t2.name,t.start_time,t.end_time,t.state,
        t.car_type_cd,t.member_id,ps.num,t.lease_type ,
        t3.name ,t4.name
            GROUP BY t.car_color,t.car_brand,t.car_type,t1.name,
            t.car_num,t.ps_id,t.remark,t.status_cd,t.owner_id,
            t.b_id,t.user_id,t.car_id,t.create_time
            ,t.community_id ,bow.name,bow.id_card ,bow.link,t2.name,t.start_time,t.end_time,t.state,
            t.car_type_cd,t.member_id,ps.num,t.lease_type ,
            t3.name ,t4.name
        </if>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
@@ -341,7 +345,8 @@
        left join parking_space ps on t.ps_id = ps.ps_id and ps.status_cd = '0'
        left join parking_area pa on ps.pa_id = pa.pa_id and pa.status_cd = '0'
        <if test="memberCarNumLike !=null and memberCarNumLike != ''">
            left join owner_car moc on t.car_id = moc.car_id and moc.car_type_cd != t.car_type_cd and moc.car_type_cd = '1002'
            left join owner_car moc on t.car_id = moc.car_id and moc.car_type_cd != t.car_type_cd and moc.car_type_cd =
            '1002'
        </if>
        where 1=1
        <if test="statusCd !=null and statusCd != ''">
@@ -369,13 +374,13 @@
            and t.car_num= #{carNum}
        </if>
        <if test="carNumLike !=null and carNumLike != ''">
            and t.car_num like  concat('%',#{carNumLike},'%')
            and t.car_num like concat('%',#{carNumLike},'%')
        </if>
        <if test="memberCarNum !=null and memberCarNum != ''">
            and moc.car_num= #{memberCarNum}
        </if>
        <if test="memberCarNumLike !=null and memberCarNumLike != ''">
            and moc.car_num like  concat('%',#{memberCarNumLike},'%')
            and moc.car_num like concat('%',#{memberCarNumLike},'%')
        </if>
        <if test="carNums !=null">
            and t.car_num in
@@ -439,14 +444,14 @@
        </if>
        <if test="valid == 1">
            and t.end_time &gt; now()
            and t.state != '3003'
        </if>
        <if test="valid == 3">
            and t.end_time &lt; now()
            and (t.end_time &lt; now() or t.state = '3003')
        </if>
        <if test="valid == 2">
            and t.ps_id= '-1'
        </if>
    </select>
    <select id="queryOwnerParkingSpaceCount" parameterType="Map" resultType="Map">
java110-db/src/main/resources/mapper/user/OwnerCommitteeV1ServiceDaoImplMapper.xml
@@ -1,187 +1,174 @@
<?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="ownerCommitteeV1ServiceDaoImpl">
    <!-- 保存业主委员会信息 add by wuxw 2018-07-03 -->
    <insert id="saveOwnerCommitteeInfo" parameterType="Map">
        insert into owner_committee(
address,appoint_time,id_card,post_desc,sex,link,remark,cur_time,post,name,position,state,oc_id,community_id
) values (
#{address},#{appointTime},#{idCard},#{postDesc},#{sex},#{link},#{remark},#{curTime},#{post},#{name},#{position},#{state},#{ocId},#{communityId}
)
        insert into owner_committee(address, appoint_time, id_card, post_desc, sex, link, remark, cur_time, post, name,
                                    position, state, oc_id, community_id)
        values (#{address}, #{appointTime}, #{idCard}, #{postDesc}, #{sex}, #{link}, #{remark}, #{curTime}, #{post},
                #{name}, #{position}, #{state}, #{ocId}, #{communityId})
    </insert>
    <!-- 查询业主委员会信息 add by wuxw 2018-07-03 -->
    <select id="getOwnerCommitteeInfo" parameterType="Map" resultType="Map">
        select  t.address,t.appoint_time,t.appoint_time appointTime,t.id_card,t.id_card idCard,t.post_desc,t.post_desc postDesc,t.sex,t.link,t.remark,t.status_cd,t.status_cd statusCd,t.cur_time,t.cur_time curTime,t.post,t.name,t.position,t.state,t.oc_id,t.oc_id ocId,t.community_id,t.community_id communityId
from owner_committee t
where 1 =1
<if test="address !=null and address != ''">
   and t.address= #{address}
</if>
<if test="appointTime !=null and appointTime != ''">
   and t.appoint_time= #{appointTime}
</if>
<if test="idCard !=null and idCard != ''">
   and t.id_card= #{idCard}
</if>
<if test="postDesc !=null and postDesc != ''">
   and t.post_desc= #{postDesc}
</if>
<if test="sex !=null and sex != ''">
   and t.sex= #{sex}
</if>
<if test="link !=null and link != ''">
   and t.link= #{link}
</if>
<if test="remark !=null and remark != ''">
   and t.remark= #{remark}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="curTime !=null and curTime != ''">
   and t.cur_time= #{curTime}
</if>
<if test="post !=null and post != ''">
   and t.post= #{post}
</if>
<if test="name !=null and name != ''">
   and t.name= #{name}
</if>
<if test="position !=null and position != ''">
   and t.position= #{position}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="ocId !=null and ocId != ''">
   and t.oc_id= #{ocId}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
   limit #{page}, #{row}
</if>
        select t.address,t.appoint_time,t.appoint_time appointTime,t.id_card,t.id_card idCard,t.post_desc,t.post_desc
        postDesc,t.sex,t.link,t.remark,t.status_cd,t.status_cd statusCd,t.cur_time,t.cur_time
        curTime,t.post,t.name,t.position,t.state,t.oc_id,t.oc_id ocId,t.community_id,t.community_id communityId
        from owner_committee t
        where 1 =1
        <if test="address !=null and address != ''">
            and t.address= #{address}
        </if>
        <if test="appointTime !=null and appointTime != ''">
            and t.appoint_time= #{appointTime}
        </if>
        <if test="idCard !=null and idCard != ''">
            and t.id_card= #{idCard}
        </if>
        <if test="postDesc !=null and postDesc != ''">
            and t.post_desc= #{postDesc}
        </if>
        <if test="sex !=null and sex != ''">
            and t.sex= #{sex}
        </if>
        <if test="link !=null and link != ''">
            and t.link= #{link}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="curTime !=null and curTime != ''">
            and t.cur_time= #{curTime}
        </if>
        <if test="post !=null and post != ''">
            and t.post= #{post}
        </if>
        <if test="name !=null and name != ''">
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="position !=null and position != ''">
            and t.position= #{position}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="ocId !=null and ocId != ''">
            and t.oc_id= #{ocId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </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="updateOwnerCommitteeInfo" parameterType="Map">
        update  owner_committee t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="address !=null and address != ''">
, t.address= #{address}
</if>
<if test="appointTime !=null and appointTime != ''">
, t.appoint_time= #{appointTime}
</if>
<if test="idCard !=null and idCard != ''">
, t.id_card= #{idCard}
</if>
<if test="postDesc !=null and postDesc != ''">
, t.post_desc= #{postDesc}
</if>
<if test="sex !=null and sex != ''">
, t.sex= #{sex}
</if>
<if test="link !=null and link != ''">
, t.link= #{link}
</if>
<if test="remark !=null and remark != ''">
, t.remark= #{remark}
</if>
<if test="curTime !=null and curTime != ''">
, t.cur_time= #{curTime}
</if>
<if test="post !=null and post != ''">
, t.post= #{post}
</if>
<if test="name !=null and name != ''">
, t.name= #{name}
</if>
<if test="position !=null and position != ''">
, t.position= #{position}
</if>
<if test="state !=null and state != ''">
, t.state= #{state}
</if>
<if test="communityId !=null and communityId != ''">
, t.community_id= #{communityId}
</if>
 where 1=1 <if test="ocId !=null and ocId != ''">
and t.oc_id= #{ocId}
</if>
        update owner_committee t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="address !=null and address != ''">
            , t.address= #{address}
        </if>
        <if test="appointTime !=null and appointTime != ''">
            , t.appoint_time= #{appointTime}
        </if>
        <if test="idCard !=null and idCard != ''">
            , t.id_card= #{idCard}
        </if>
        <if test="postDesc !=null and postDesc != ''">
            , t.post_desc= #{postDesc}
        </if>
        <if test="sex !=null and sex != ''">
            , t.sex= #{sex}
        </if>
        <if test="link !=null and link != ''">
            , t.link= #{link}
        </if>
        <if test="remark !=null and remark != ''">
            , t.remark= #{remark}
        </if>
        <if test="curTime !=null and curTime != ''">
            , t.cur_time= #{curTime}
        </if>
        <if test="post !=null and post != ''">
            , t.post= #{post}
        </if>
        <if test="name !=null and name != ''">
            , t.name= #{name}
        </if>
        <if test="position !=null and position != ''">
            , t.position= #{position}
        </if>
        <if test="state !=null and state != ''">
            , t.state= #{state}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        where 1=1
        <if test="ocId !=null and ocId != ''">
            and t.oc_id= #{ocId}
        </if>
    </update>
    <!-- 查询业主委员会数量 add by wuxw 2018-07-03 -->
     <select id="queryOwnerCommitteesCount" parameterType="Map" resultType="Map">
        select  count(1) count
from owner_committee t
where 1 =1
<if test="address !=null and address != ''">
   and t.address= #{address}
</if>
<if test="appointTime !=null and appointTime != ''">
   and t.appoint_time= #{appointTime}
</if>
<if test="idCard !=null and idCard != ''">
   and t.id_card= #{idCard}
</if>
<if test="postDesc !=null and postDesc != ''">
   and t.post_desc= #{postDesc}
</if>
<if test="sex !=null and sex != ''">
   and t.sex= #{sex}
</if>
<if test="link !=null and link != ''">
   and t.link= #{link}
</if>
<if test="remark !=null and remark != ''">
   and t.remark= #{remark}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="curTime !=null and curTime != ''">
   and t.cur_time= #{curTime}
</if>
<if test="post !=null and post != ''">
   and t.post= #{post}
</if>
<if test="name !=null and name != ''">
   and t.name= #{name}
</if>
<if test="position !=null and position != ''">
   and t.position= #{position}
</if>
<if test="state !=null and state != ''">
   and t.state= #{state}
</if>
<if test="ocId !=null and ocId != ''">
   and t.oc_id= #{ocId}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
     </select>
    <select id="queryOwnerCommitteesCount" parameterType="Map" resultType="Map">
        select count(1) count
        from owner_committee t
        where 1 =1
        <if test="address !=null and address != ''">
            and t.address= #{address}
        </if>
        <if test="appointTime !=null and appointTime != ''">
            and t.appoint_time= #{appointTime}
        </if>
        <if test="idCard !=null and idCard != ''">
            and t.id_card= #{idCard}
        </if>
        <if test="postDesc !=null and postDesc != ''">
            and t.post_desc= #{postDesc}
        </if>
        <if test="sex !=null and sex != ''">
            and t.sex= #{sex}
        </if>
        <if test="link !=null and link != ''">
            and t.link= #{link}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="curTime !=null and curTime != ''">
            and t.cur_time= #{curTime}
        </if>
        <if test="post !=null and post != ''">
            and t.post= #{post}
        </if>
        <if test="name !=null and name != ''">
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="position !=null and position != ''">
            and t.position= #{position}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="ocId !=null and ocId != ''">
            and t.oc_id= #{ocId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/user/OwnerRoomRelV1ServiceDaoImplMapper.xml
@@ -15,8 +15,10 @@
        startTime,t.state,t.end_time,t.end_time endTime,t.owner_id,t.owner_id ownerId,t.user_id,t.user_id
        userId,t.room_id,t.room_id roomId,bo.name ownerName,bo.link
        from building_owner_room_rel t
        left join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
        where 1 =1
        inner join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
        inner join building_room br on t.room_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join f_floor fl on bu.floor_id = fl.floor_id and fl.status_cd = '0'
        <if test="ownerNameLike !=null and ownerNameLike != ''">
            and bo.`name` like concat('%',#{ownerNameLike},'%')
        </if>
@@ -41,9 +43,9 @@
        <if test="ownerId !=null and ownerId != ''">
            and t.owner_id= #{ownerId}
        </if>
        <if test="userId !=null and userId != ''">
        <!--<if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
        </if>
        </if>-->
        <if test="roomId !=null and roomId != ''">
            and t.room_id= #{roomId}
        </if>
@@ -96,6 +98,10 @@
    <select id="queryOwnerRoomRelsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from building_owner_room_rel t
        inner join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
        inner join building_room br on t.room_id = br.room_id and br.status_cd = '0'
        inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        inner join f_floor fl on bu.floor_id = fl.floor_id and fl.status_cd = '0'
        where 1 =1
        <if test="relId !=null and relId != ''">
            and t.rel_id= #{relId}
@@ -118,9 +124,9 @@
        <if test="ownerId !=null and ownerId != ''">
            and t.owner_id= #{ownerId}
        </if>
        <if test="userId !=null and userId != ''">
        <!--<if test="userId !=null and userId != ''">
            and t.user_id= #{userId}
        </if>
        </if>-->
        <if test="roomId !=null and roomId != ''">
            and t.room_id= #{roomId}
        </if>
java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml
@@ -157,9 +157,8 @@
            and t.sex= #{sex}
        </if>
        <if test="name !=null and name != ''">
            and t.name = #{name}
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="nameLike !=null and nameLike != ''">
            and t.name like concat('%',#{nameLike},'%')
        </if>
@@ -251,7 +250,7 @@
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="nameLike !=null and nameLike != ''">
            and t.name like concat('%',#{name},'%')
            and t.name like concat('%',#{nameLike},'%')
        </if>
        <if test="link !=null and link != ''">
            and t.link= #{link}
@@ -297,6 +296,12 @@
        </if>
        <if test="ownerTypeCd !=null and ownerTypeCd != ''">
            and t.owner_type_cd= #{ownerTypeCd}
        </if>
        <if test="ownerTypeCds != null">
            and t.owner_type_cd in
            <foreach collection="ownerTypeCds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
    </select>
@@ -535,19 +540,20 @@
    <select id="queryNoEnterRoomOwnerCount" parameterType="Map" resultType="Map">
        select COUNT(1) count
        from building_owner o
        left join building_owner_room_rel orr
            left join building_owner_room_rel orr
        on o.owner_id = orr.owner_id and orr.status_cd = '0'
        where o.status_cd = '0'
        and o.owner_type_cd = '1001'
        and o.community_id = #{communityId}
        and orr.rel_id is null
          and o.owner_type_cd = '1001'
          and o.community_id = #{communityId}
          and orr.rel_id is null
    </select>
    <!-- queryOwnersByRoom -->
    <!-- 根据房屋查询业主信息 -->
    <select id="queryOwnersByRoom" parameterType="Map" resultType="Map">
        SELECT t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id
        bId,t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd,
        bId,t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd
        ownerTypeCd,
        r.`room_id` roomId,r.`room_num` roomNum,t.community_id,t.community_id communityId,t.id_card, t.id_card
        idCard,orr.start_time startTime ,orr.end_time endTime,t.address
        FROM building_room r,building_owner_room_rel orr,building_owner t
@@ -621,10 +627,10 @@
    <select id="queryOwnerLogsCountByRoom" parameterType="Map" resultType="Map">
        select COUNT(1) count
        from building_owner_room_rel t
        inner join building_owner bo
            inner join building_owner bo
        on t.owner_id = bo.owner_id and bo.status_cd = '0' and bo.community_id = #{communityId}
        where bo.owner_type_cd = '1001'
        and t.room_id = #{roomId}
          and t.room_id = #{roomId}
    </select>
</mapper>
java110-db/src/main/resources/mapper/user/QuestionAnswerV1ServiceDaoImplMapper.xml
@@ -1,27 +1,26 @@
<?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="questionAnswerV1ServiceDaoImpl">
    <!-- 保存问卷投票信息 add by wuxw 2018-07-03 -->
    <insert id="saveQuestionAnswerInfo" parameterType="Map">
        insert into question_answer(
        qa_name,qa_type,start_time,remark,end_time,community_id,content,qa_id,state
        ) values (
        #{qaName},#{qaType},#{startTime},#{remark},#{endTime},#{communityId},#{content},#{qaId},#{state}
        )
        insert into question_answer(qa_name, qa_type, start_time, remark, end_time, community_id, content, qa_id, state,
                                    obj_type, obj_id)
        values (#{qaName}, #{qaType}, #{startTime}, #{remark}, #{endTime}, #{communityId}, #{content}, #{qaId},
                #{state}, #{objType}, #{objId})
    </insert>
    <!-- 查询问卷投票信息 add by wuxw 2018-07-03 -->
    <select id="getQuestionAnswerInfo" parameterType="Map" resultType="Map">
        select t.qa_name,t.qa_name qaName,t.qa_type,t.qa_type qaType,t.start_time,t.start_time
        startTime,t.remark,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time endTime,t.community_id,t.community_id
        communityId,t.content,t.qa_id,t.qa_id qaId,t.create_time createTime,t.state,count(uqa1.user_qa_id) voteCount
        communityId,t.content,t.qa_id,t.qa_id qaId,t.create_time createTime,t.state,t.obj_type,t.obj_type objType,
        t.obj_id,t.obj_id objId, count(uqa1.user_qa_id) voteCount,td.name qaTypeName
        from question_answer t
        left join user_question_answer uqa1 on t.qa_id = uqa1.qa_id and uqa1.status_cd = '0'
        left join t_dict td on t.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns =
        'qa_type'
        where 1 =1
        <if test="qaName !=null and qaName != ''">
            and t.qa_name= #{qaName}
@@ -53,14 +52,19 @@
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        group by t.qa_name,t.qa_type,t.start_time,t.remark,t.status_cd,t.end_time,t.community_id,t.content,t.qa_id,t.create_time,t.state
        <if test="objType !=null and objType != ''">
            and t.obj_type= #{objType}
        </if>
        <if test="objId !=null and objId != ''">
            and t.obj_id= #{objId}
        </if>
        group by
        t.qa_name,t.qa_type,t.start_time,t.remark,t.status_cd,t.end_time,t.community_id,t.content,t.qa_id,t.create_time,t.state
        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="updateQuestionAnswerInfo" parameterType="Map">
@@ -89,6 +93,12 @@
        <if test="content !=null and content != ''">
            , t.content= #{content}
        </if>
        <if test="objType !=null and objType != ''">
            , t.obj_type= #{objType}
        </if>
        <if test="objId !=null and objId != ''">
            , t.obj_id= #{objId}
        </if>
        where 1=1
        <if test="qaId !=null and qaId != ''">
            and t.qa_id= #{qaId}
@@ -96,7 +106,6 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </update>
    <!-- 查询问卷投票数量 add by wuxw 2018-07-03 -->
@@ -134,10 +143,13 @@
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="objType !=null and objType != ''">
            and t.obj_type= #{objType}
        </if>
        <if test="objId !=null and objId != ''">
            and t.obj_id= #{objId}
        </if>
    </select>
    <select id="queryVotedCountAndScore" parameterType="Map" resultType="Map">
        select qa_id qaId, count(1) votedCount,SUM(t.score) score
java110-db/src/main/resources/mapper/user/QuestionTitleV1ServiceDaoImplMapper.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="questionTitleV1ServiceDaoImpl">
    <!-- 保存问卷题目信息 add by wuxw 2018-07-03 -->
    <insert id="saveQuestionTitleInfo" parameterType="Map">
        insert into question_title(
        title_type,title_id,community_id,qa_title
        ) values (
        #{titleType},#{titleId},#{communityId},#{qaTitle}
        )
        insert into question_title(title_type, title_id, community_id, qa_title)
        values (#{titleType}, #{titleId}, #{communityId}, #{qaTitle})
    </insert>
    <!-- 查询问卷题目信息 add by wuxw 2018-07-03 -->
    <select id="getQuestionTitleInfo" parameterType="Map" resultType="Map">
@@ -21,11 +15,11 @@
        statusCd,t.community_id,t.community_id communityId,t.qa_title,t.qa_title qaTitle,t.create_time createTime
        from question_title t
        <if test="qaId !=null and qaId != ''">
             left join question_answer_title_rel qatr on t.title_id = qatr.title_id and qatr.status_cd = '0'
            left join question_answer_title_rel qatr on t.title_id = qatr.title_id and qatr.status_cd = '0'
        </if>
        where 1 =1
        <if test="qaId !=null and qaId != ''">
             and qatr.qa_id = #{qaId}
            and qatr.qa_id = #{qaId}
        </if>
        <if test="titleType !=null and titleType != ''">
            and t.title_type= #{titleType}
@@ -40,15 +34,13 @@
            and t.community_id= #{communityId}
        </if>
        <if test="qaTitle !=null and qaTitle != ''">
            and t.qa_title= #{qaTitle}
            and t.qa_title like concat('%',#{qaTitle},'%')
        </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="updateQuestionTitleInfo" parameterType="Map">
@@ -69,7 +61,6 @@
        <if test="titleId !=null and titleId != ''">
            and t.title_id= #{titleId}
        </if>
    </update>
    <!-- 查询问卷题目数量 add by wuxw 2018-07-03 -->
@@ -96,10 +87,7 @@
            and t.community_id= #{communityId}
        </if>
        <if test="qaTitle !=null and qaTitle != ''">
            and t.qa_title= #{qaTitle}
            and t.qa_title like concat('%',#{qaTitle},'%')
        </if>
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/report/IReportFeeMonthStatisticsInnerServiceSMO.java
@@ -430,12 +430,18 @@
    @RequestMapping(value = "/queryHuaningOweFee", method = RequestMethod.POST)
    List<ReportFeeMonthStatisticsDto> queryHuaningOweFee(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    @RequestMapping(value = "/queryHuaningOweFeeCounts", method = RequestMethod.POST)
    int queryHuaningOweFeeCounts(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    @RequestMapping(value = "/queryHuaningPayFeeCount", method = RequestMethod.POST)
    int queryHuaningPayFeeCount(@RequestBody Map paramInfo);
    @RequestMapping(value = "/queryHuaningPayFee", method = RequestMethod.POST)
    List<Map> queryHuaningPayFee(@RequestBody Map paramInfo);
    @RequestMapping(value = "/queryHuaningPayFeeCounts", method = RequestMethod.POST)
    int queryHuaningPayFeeCounts(@RequestBody Map paramInfo);
    @RequestMapping(value = "/queryHuaningPayFeeTwoCount", method = RequestMethod.POST)
    int queryHuaningPayFeeTwoCount(@RequestBody Map paramInfo);
java110-interface/src/main/java/com/java110/intf/report/IReportOweFeeInnerServiceSMO.java
@@ -81,11 +81,13 @@
    /**
     * 计算总欠费
     *
     * @param reportOweFeeDto
     * @return
     */
    @RequestMapping(value = "/computeReportOweFeeTotalAmount", method = RequestMethod.POST)
    double computeReportOweFeeTotalAmount(@RequestBody ReportOweFeeDto reportOweFeeDto);
    @RequestMapping(value = "/computeReportOweFeeItemAmount", method = RequestMethod.POST)
    List<ReportOweFeeItemDto> computeReportOweFeeItemAmount(@RequestBody ReportOweFeeDto reportOweFeeDto);
service-common/src/main/java/com/java110/common/cmd/itemRelease/SaveItemReleaseCmd.java
@@ -111,7 +111,7 @@
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Java110Cmd(serviceCode = "itemRelease.saveItemRelease")
@Java110Cmd(serviceCode = "   itemRelease.saveItemRelease")
public class SaveItemReleaseCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(SaveItemReleaseCmd.class);
service-community/src/main/java/com/java110/community/api/RepairApi.java
@@ -44,7 +44,6 @@
    @Autowired
    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
    /**
     * 报修评价
     *
@@ -57,7 +56,6 @@
        return appraiseRepairBMOImpl.appraiseRepair(appraiseDto);
    }
    /**
     * 微信保存消息模板
     *
@@ -68,23 +66,16 @@
     */
    @RequestMapping(value = "/saveRepairReturnVisit", method = RequestMethod.POST)
    public ResponseEntity<String> saveRepairReturnVisit(@RequestHeader(value = "user-id") String userId,
                                                        @RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "repairId", "请求报文中未包含repairId");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
        Assert.hasKeyAndValue(reqJson, "visitType", "请求报文中未包含满意度");
        Assert.hasKeyAndValue(reqJson, "context", "请求报文中未包含context");
        UserDto userDto = new UserDto();
        userDto.setUserId(userId);
        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
        Assert.listOnlyOne(userDtos,"未包含用户");
        String userName  = userDtos.get(0).getName();
        Assert.listOnlyOne(userDtos, "未包含用户");
        String userName = userDtos.get(0).getName();
        RepairReturnVisitPo repairReturnVisitPo = BeanConvertUtil.covertBean(reqJson, RepairReturnVisitPo.class);
        repairReturnVisitPo.setVisitPersonId(userId);
        repairReturnVisitPo.setVisitPersonName(userName);
@@ -101,14 +92,11 @@
     */
    @RequestMapping(value = "/updateRepairReturnVisit", method = RequestMethod.POST)
    public ResponseEntity<String> updateRepairReturnVisit(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "repairId", "请求报文中未包含repairId");
        Assert.hasKeyAndValue(reqJson, "visitPersonId", "请求报文中未包含visitPersonId");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
        Assert.hasKeyAndValue(reqJson, "context", "请求报文中未包含context");
        Assert.hasKeyAndValue(reqJson, "visitId", "visitId不能为空");
        RepairReturnVisitPo repairReturnVisitPo = BeanConvertUtil.covertBean(reqJson, RepairReturnVisitPo.class);
        return updateRepairReturnVisitBMOImpl.update(repairReturnVisitPo);
    }
@@ -124,10 +112,7 @@
    @RequestMapping(value = "/deleteRepairReturnVisit", method = RequestMethod.POST)
    public ResponseEntity<String> deleteRepairReturnVisit(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
        Assert.hasKeyAndValue(reqJson, "visitId", "visitId不能为空");
        RepairReturnVisitPo repairReturnVisitPo = BeanConvertUtil.covertBean(reqJson, RepairReturnVisitPo.class);
        return deleteRepairReturnVisitBMOImpl.delete(repairReturnVisitPo);
    }
@@ -158,7 +143,6 @@
        repairReturnVisitDto.setTel(tel);
        repairReturnVisitDto.setRepairType(repairType);
        repairReturnVisitDto.setState(state);
        return getRepairReturnVisitBMOImpl.get(repairReturnVisitDto);
    }
}
service-community/src/main/java/com/java110/community/api/RoomRenovationApi.java
@@ -426,6 +426,7 @@
        userDto.setUserId(userId);
        userDto.setStatusCd("0");
        List<UserDto> users = userInnerServiceSMOImpl.getUsers(userDto);
        Assert.listOnlyOne(users, "查询用户信息错误!");
        RoomRenovationRecordPo roomRenovationRecordPo = new RoomRenovationRecordPo();
        roomRenovationRecordPo.setrId(rId);
        roomRenovationRecordPo.setRemark(remark);
@@ -438,7 +439,7 @@
        roomRenovationRecordPo.setIsTrue(isTrue);
        saveRoomRenovationRecordBMO.saveRecord(roomRenovationRecordPo);
        for (String photo : photos) {
            photoSMOImpl.savePhoto(photo,roomRenovationRecordPo.getRecordId(),roomRenovationPo.getCommunityId(),"19000");
            photoSMOImpl.savePhoto(photo, roomRenovationRecordPo.getRecordId(), roomRenovationPo.getCommunityId(), "19000");
        }
        FileRelPo fileRelPo = new FileRelPo();
        fileRelPo.setObjId(roomRenovationRecordPo.getRecordId());
service-community/src/main/java/com/java110/community/cmd/ownerRepair/GrabbingRepairCmd.java
@@ -54,7 +54,6 @@
    @Autowired
    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
    //域
    public static final String DOMAIN_COMMON = "DOMAIN.COMMON";
@@ -74,7 +73,7 @@
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        String userId = context.getReqHeaders().get("user-id");
        if(userId.startsWith("-") || StringUtil.isEmpty(userId)){
        if (userId.startsWith("-") || StringUtil.isEmpty(userId)) {
            userId = reqJson.getString("userId");
        }
@@ -127,7 +126,7 @@
            repairTypeUser.setRepairType(repairType);
            //查询工单设置表
            List<RepairTypeUserDto> repairTypeUserDtos = repairTypeUserInnerServiceSMO.queryRepairTypeUsers(repairTypeUser);
            if (repairTypeUserDtos != null && repairTypeUserDtos.size() != 1) { //报修类型设置未添加改操作的员工!
            if (repairTypeUserDtos != null && repairTypeUserDtos.size() != 1) { //报修类型设置未添加该操作的员工!
                ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "对不起,您还没权限进行此操作,请联系管理员处理!");
                context.setResponseEntity(responseEntity);
                return;
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java
@@ -74,7 +74,6 @@
    @Autowired
    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
    //域
    public static final String DOMAIN_COMMON = "DOMAIN.COMMON";
@@ -102,13 +101,13 @@
//        RepairUserPo repairUserPo = BeanConvertUtil.covertBean(reqJson, RepairUserPo.class);
        String action = reqJson.getString("action");
        switch (action) {
            case ACTION_DISPATCH:
            case ACTION_DISPATCH: //派单
                dispacthRepair(context, reqJson);
                break;
            case ACTION_TRANSFER:
            case ACTION_TRANSFER: //转单
                transferRepair(context, reqJson);
                break;
            case ACTION_BACK:
            case ACTION_BACK: //退单
                backRepair(context, reqJson);
                break;
        }
@@ -180,8 +179,8 @@
        repair.setStates(new String[]{RepairUserDto.STATE_TRANSFER, RepairUserDto.STATE_CLOSE, RepairUserDto.STATE_STOP,RepairUserDto.STATE_EVALUATE});
        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())) {
            if (RepairDto.REPAIR_WAY_GRABBING.equals(repairDtos.get(0).getRepairWay())
                    || RepairDto.REPAIR_WAY_TRAINING.equals(repairDtos.get(0).getRepairWay())) {  //抢单、轮训
                modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_WAIT);//维修单变成未派单
                //把自己改成退单
                RepairUserPo repairUser = new RepairUserPo();
@@ -268,7 +267,7 @@
            context.setResponseEntity(responseEntity);
            return;
        }
        //插入派单者的信息
        //更改转单者的信息
        RepairUserPo repairUserPo = new RepairUserPo();
        repairUserPo.setRuId(repairUserDtos.get(0).getRuId());
        repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
@@ -278,7 +277,8 @@
        flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
        if (flag < 1) {
            throw new CmdException("修改用户失败");
        }        //处理人信息
        }
        //处理人信息
        repairUserPo = new RepairUserPo();
        repairUserPo.setRuId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ruId));
        repairUserPo.setState(RepairUserDto.STATE_DOING);
@@ -315,7 +315,7 @@
        String staffId = reqJson.getString("staffId");
        RepairDto repair = new RepairDto();
        repair.setStaffId(staffId);
        repair.setState("10001"); //处理中
        repair.setState("1100"); //接单状态
        int i = repairInnerServiceSMOImpl.queryStaffRepairsCount(repair);
        //取出开关映射的值(维修师傅未处理最大单数)
        String repairNumber = MappingCache.getValue(MappingConstant.REPAIR_DOMAIN, REPAIR_NUMBER);
@@ -335,7 +335,7 @@
        RepairDto repairDto = new RepairDto();
        repairDto.setRepairId(repairId);
        List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
        if (repairDtos == null || repairDtos.size() < 1) {
        if (repairDtos == null || repairDtos.size() != 1) {
            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "数据错误!");
            context.setResponseEntity(responseEntity);
        } else {
@@ -346,7 +346,7 @@
                String userName = reqJson.getString("userName");
                String ruId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ruId);
                // 自己的单子状态修改为转单
                // 自己的单子状态修改为派单
                RepairUserPo repairUserPo = new RepairUserPo();
                repairUserPo.setRuId(ruId);
                repairUserPo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
@@ -431,7 +431,6 @@
        JSONObject businessOwnerRepair = new JSONObject();
        businessOwnerRepair.putAll(BeanConvertUtil.beanCovertMap(repairDtos.get(0)));
        businessOwnerRepair.put("state", state);
        //计算 应收金额
        RepairPoolPo repairPoolPo = BeanConvertUtil.covertBean(businessOwnerRepair, RepairPoolPo.class);
        int flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
        if (flag < 1) {
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairForceFinishCmd.java
@@ -117,11 +117,6 @@
        repairDto.setState(RepairDto.STATE_TAKING);
        List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
        Assert.listOnlyOne(repairDtos, "当前没有需要处理订单");
        if (repairDtos != null && repairDtos.size() != 1) {
            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "非常抱歉当前不能退单!");
            context.setResponseEntity(responseEntity);
            return;
        }
        //查询正在处理 工单的师傅
        RepairUserDto repairUserDto = new RepairUserDto();
        repairUserDto.setRepairId(reqJson.getString("repairId"));
@@ -399,7 +394,7 @@
                throw new CmdException("添加维修工单流程信息失败");
            }
        }
        // 1.0 关闭自己订单吧
        // 1.0 关闭自己订单
        RepairUserPo repairUserPo = new RepairUserPo();
        repairUserPo.setRuId(repairUserDtos.get(0).getRuId());
        repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairStartCmd.java
@@ -5,6 +5,7 @@
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.repair.RepairDto;
import com.java110.dto.repair.RepairUserDto;
import com.java110.intf.community.IRepairInnerServiceSMO;
@@ -16,6 +17,7 @@
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.DateUtil;
import com.java110.utils.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -59,7 +61,7 @@
            repairPoolPo.setRepairId(reqJson.getString("repairId"));
            repairPoolPo.setState(RepairDto.STATE_TAKING); //状态变为接单状态
            flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
            if(flag < 1){
            if (flag < 1) {
                throw new CmdException("修改工单失败");
            }
            RepairUserDto repairUserDto = new RepairUserDto();
@@ -69,18 +71,30 @@
            List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto);
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            if (repairUserDtos != null && repairUserDtos.size() > 0) {
                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_START);
                repairUserPo.setContext("启动报修流程");
                repairUserPo.setStaffId(reqJson.getString("userId"));
                repairUserPo.setStaffName(reqJson.getString("userName"));
                for (RepairUserDto repairUser : repairUserDtos) {
                    if (repairUser.getEndTime() == null) {
                        RepairUserPo repairUserPo = new RepairUserPo();
                        repairUserPo.setRuId(repairUser.getRuId());
                        repairUserPo.setPreStaffId(repairUser.getStaffId());
                        repairUserPo.setPreStaffName(repairUser.getStaffName());
                        repairUserPo.setStartTime(simpleDateFormat.format(repairUser.getStartTime()));
                        repairUserPo.setEndTime(simpleDateFormat.format(new Date()));
                        //修改暂停报修状态
                        flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
                        if(flag < 1){
                            throw new CmdException("修改工单失败");
                        }
                        repairUserPo.setPreRuId(repairUser.getRuId());
                    }
                }
                repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_START_USER);
                flag = repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
                if (flag < 1) {
                    throw new CmdException("添加报修工单信息失败!");
                }
            } else {
                throw new IllegalArgumentException("启动报修单错误!");
            }
service-community/src/main/java/com/java110/community/cmd/room/QueryRoomsByOwnerCmd.java
@@ -33,25 +33,25 @@
)
@Java110ParamsDoc(params = {
        @Java110ParamDoc(name = "page", type = "int",length = 11, remark = "页数"),
        @Java110ParamDoc(name = "row", type = "int",length = 11, remark = "行数"),
        @Java110ParamDoc(name = "page", type = "int", length = 11, remark = "页数"),
        @Java110ParamDoc(name = "row", type = "int", length = 11, remark = "行数"),
        @Java110ParamDoc(name = "communityId", length = 30, remark = "小区ID"),
        @Java110ParamDoc(name = "ownerId", length = 30, remark = "业主ID"),
})
@Java110ResponseDoc(
        params = {
                @Java110ParamDoc(name = "records", type = "int", length = 11,  remark = "总页数"),
                @Java110ParamDoc(name = "records", type = "int", length = 11, remark = "总页数"),
                @Java110ParamDoc(name = "total", type = "int", length = 11, remark = "总数据"),
                @Java110ParamDoc(name = "rooms", type = "Object", remark = "有效数据"),
                @Java110ParamDoc(parentNodeName = "rooms",name = "roomName", type = "String", remark = "房屋名称"),
                @Java110ParamDoc(parentNodeName = "rooms",name = "roomId", type = "String", remark = "房屋编号"),
                @Java110ParamDoc(parentNodeName = "rooms", name = "roomName", type = "String", remark = "房屋名称"),
                @Java110ParamDoc(parentNodeName = "rooms", name = "roomId", type = "String", remark = "房屋编号"),
        }
)
@Java110ExampleDoc(
        reqBody="http://{ip}:{port}/app/room.queryRoomsByOwner?ownerId=123123&page=1&row=10&communityId=2022081539020475",
        resBody="{\"page\":0,\"records\":1,\"rooms\":[{\"apartment\":\"10101\",\"apartmentName\":\"一室一厅\",\"builtUpArea\":\"11.00\",\"endTime\":\"2037-01-01 00:00:00\",\"feeCoefficient\":\"1.00\",\"floorId\":\"732022081690440002\",\"floorNum\":\"D\",\"idCard\":\"\",\"layer\":\"1\",\"link\":\"18909711447\",\"ownerId\":\"772022082070860017\",\"ownerName\":\"张杰\",\"remark\":\"11\",\"roomArea\":\"11.00\",\"roomAttrDto\":[{\"attrId\":\"112022082081600012\",\"listShow\":\"Y\",\"page\":-1,\"records\":0,\"roomId\":\"752022082030880010\",\"row\":0,\"specCd\":\"9035007248\",\"specName\":\"精装修\",\"statusCd\":\"0\",\"total\":0,\"value\":\"20\",\"valueName\":\"20\"}],\"roomId\":\"752022082030880010\",\"roomName\":\"D-1-1001\",\"roomNum\":\"1001\",\"roomRent\":\"0.00\",\"roomSubType\":\"110\",\"roomSubTypeName\":\"住宅\",\"roomType\":\"1010301\",\"section\":\"1\",\"startTime\":\"2022-09-03 18:50:53\",\"state\":\"2001\",\"stateName\":\"已入住\",\"unitId\":\"742022082058950007\",\"unitNum\":\"1\"}],\"rows\":0,\"total\":2}"
        reqBody = "http://{ip}:{port}/app/room.queryRoomsByOwner?ownerId=123123&page=1&row=10&communityId=2022081539020475",
        resBody = "{\"page\":0,\"records\":1,\"rooms\":[{\"apartment\":\"10101\",\"apartmentName\":\"一室一厅\",\"builtUpArea\":\"11.00\",\"endTime\":\"2037-01-01 00:00:00\",\"feeCoefficient\":\"1.00\",\"floorId\":\"732022081690440002\",\"floorNum\":\"D\",\"idCard\":\"\",\"layer\":\"1\",\"link\":\"18909711447\",\"ownerId\":\"772022082070860017\",\"ownerName\":\"张杰\",\"remark\":\"11\",\"roomArea\":\"11.00\",\"roomAttrDto\":[{\"attrId\":\"112022082081600012\",\"listShow\":\"Y\",\"page\":-1,\"records\":0,\"roomId\":\"752022082030880010\",\"row\":0,\"specCd\":\"9035007248\",\"specName\":\"精装修\",\"statusCd\":\"0\",\"total\":0,\"value\":\"20\",\"valueName\":\"20\"}],\"roomId\":\"752022082030880010\",\"roomName\":\"D-1-1001\",\"roomNum\":\"1001\",\"roomRent\":\"0.00\",\"roomSubType\":\"110\",\"roomSubTypeName\":\"住宅\",\"roomType\":\"1010301\",\"section\":\"1\",\"startTime\":\"2022-09-03 18:50:53\",\"state\":\"2001\",\"stateName\":\"已入住\",\"unitId\":\"742022082058950007\",\"unitNum\":\"1\"}],\"rows\":0,\"total\":2}"
)
@Java110Cmd(serviceCode = "room.queryRoomsByOwner")
public class QueryRoomsByOwnerCmd extends Cmd {
@@ -62,25 +62,18 @@
    @Autowired
    private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
    @Autowired
    private IQueryRoomStatisticsBMO queryRoomStatisticsBMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        Assert.hasKeyAndValue(reqJson, "communityId", "请求中未包含communityId信息");
        //Assert.jsonObjectHaveKey(reqJson, "ownerId", "请求中未包含ownerId信息");
        Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
        //Assert.hasLength(reqJson.getString("ownerId"), "业主ID不能为空");
        String ownerId = reqJson.getString("ownerId");
        String ownerNameLike = reqJson.getString("ownerNameLike");
        if(StringUtil.isEmpty(ownerId) && StringUtil.isEmpty(ownerNameLike)){
        if (StringUtil.isEmpty(ownerId) && StringUtil.isEmpty(ownerNameLike)) {
            throw new IllegalArgumentException("未包含业主信息");
        }
    }
@@ -90,6 +83,14 @@
        RoomDto roomDto = BeanConvertUtil.covertBean(reqJson, RoomDto.class);
        if (reqJson.containsKey("roomNum") && !StringUtil.isEmpty(reqJson.getString("roomNum"))) {
            String[] roomNums = reqJson.getString("roomNum").split("-");
            if (roomNums != null && roomNums.length == 3) {
                roomDto.setFloorNum(roomNums[0]);
                roomDto.setUnitNum(roomNums[1]);
                roomDto.setRoomNum(roomNums[2]);
            }
        }
        ApiRoomVo apiRoomVo = new ApiRoomVo();
        List<RoomDto> roomDtoList = roomInnerServiceSMOImpl.queryRoomsByOwner(roomDto);
        roomDtoList = queryRoomStatisticsBMOImpl.queryRoomOweFee(roomDtoList);
service-fee/src/main/java/com/java110/fee/api/ApplyRoomDiscountApi.java
@@ -5,6 +5,7 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Transactional;
import com.java110.core.context.DataFlowContext;
import com.java110.core.factory.CommunitySettingFactory;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.room.ApplyRoomDiscountDto;
import com.java110.dto.room.ApplyRoomDiscountTypeDto;
@@ -27,6 +28,7 @@
import com.java110.po.room.ApplyRoomDiscountPo;
import com.java110.po.room.ApplyRoomDiscountTypePo;
import com.java110.po.file.FileRelPo;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
@@ -93,6 +95,12 @@
    @Autowired
    private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl;
    //域
    public static final String DOMAIN_COMMON = "DOMAIN.COMMON";
    //键
    public static final String TOTAL_FEE_PRICE = "TOTAL_FEE_PRICE";
    /**
     * 优惠申请
@@ -309,20 +317,116 @@
                        cashBackAmount = cashBackAmount.add(spec); //计算优惠的金额
                    }
                }
                //1表示四舍五入后保留小数点后两位;2表示四舍五入后保留小数点后一位;3表示向上取整;4 表示向下取整;5表示 四舍五入后取整 其他情况默认四舍五入后保留小数点后两位
                String val = CommunitySettingFactory.getValue(reqJson.getString("communityId"), TOTAL_FEE_PRICE);
                if (StringUtil.isEmpty(val)) {
                    //1表示四舍五入后保留小数点后两位;2表示四舍五入后保留小数点后一位;3表示向上取整;4 表示向下取整;5表示 四舍五入后取整 其他情况默认四舍五入后保留小数点后两位
                    val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
                }
                DecimalFormat df = new DecimalFormat("0.00");
                if (StringUtil.isEmpty(reqJson.getString("refundAmount"))) {
                    reqJson.put("cashBackAmount", df.format(cashBackAmount));
                    if (!StringUtil.isEmpty(val) && val.equals("2")) { //2表示四舍五入后保留小数点后一位
                        BigDecimal bigDecimal = cashBackAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("3")) { //3表示向上取整
                        BigDecimal bigDecimal = cashBackAmount.setScale(0, BigDecimal.ROUND_UP);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("4")) { //4 表示向下取整
                        BigDecimal bigDecimal = cashBackAmount.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("5")) { //5表示 四舍五入后取整
                        BigDecimal bigDecimal = cashBackAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        BigDecimal bigDecimal1 = bigDecimal.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal1));
                    }
                    if ((!val.equals("2") && !val.equals("3") && !val.equals("4") && !val.equals("5")) || StringUtil.isEmpty(val)) {
                        BigDecimal bigDecimal = cashBackAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                } else {
                    reqJson.put("cashBackAmount", reqJson.getString("refundAmount"));
                    if (!StringUtil.isEmpty(val) && val.equals("2")) { //2表示四舍五入后保留小数点后一位
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("3")) { //3表示向上取整
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(0, BigDecimal.ROUND_UP);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("4")) { //4 表示向下取整
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("5")) { //5表示 四舍五入后取整
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        BigDecimal bigDecimal1 = bigDecimal.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal1));
                    }
                    if ((!val.equals("2") && !val.equals("3") && !val.equals("4") && !val.equals("5")) || StringUtil.isEmpty(val)) {
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("cashBackAmount", String.valueOf(bigDecimal));
                    }
                }
                //处理账户返现
                JSONArray businesses = new JSONArray();
                updateAccountBMOImpl.cashBackAccount(reqJson, dataFlowContext, businesses);
                reqJson.put("inUse", 1);
                if (StringUtil.isEmpty(reqJson.getString("refundAmount"))) {
                    reqJson.put("returnAmount", df.format(cashBackAmount));
                    if (!StringUtil.isEmpty(val) && val.equals("2")) { //2表示四舍五入后保留小数点后一位
                        BigDecimal bigDecimal = cashBackAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("3")) { //3表示向上取整
                        BigDecimal bigDecimal = cashBackAmount.setScale(0, BigDecimal.ROUND_UP);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("4")) { //4 表示向下取整
                        BigDecimal bigDecimal = cashBackAmount.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("5")) { //5表示 四舍五入后取整
                        BigDecimal bigDecimal = cashBackAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        BigDecimal bigDecimal1 = bigDecimal.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal1));
                    }
                    if ((!val.equals("2") && !val.equals("3") && !val.equals("4") && !val.equals("5")) || StringUtil.isEmpty(val)) {
                        BigDecimal bigDecimal = cashBackAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                } else {
                    reqJson.put("returnAmount", reqJson.getString("refundAmount"));
                    if (!StringUtil.isEmpty(val) && val.equals("2")) { //2表示四舍五入后保留小数点后一位
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("3")) { //3表示向上取整
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(0, BigDecimal.ROUND_UP);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("4")) { //4 表示向下取整
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                    if (!StringUtil.isEmpty(val) && val.equals("5")) { //5表示 四舍五入后取整
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(1, BigDecimal.ROUND_HALF_UP);
                        BigDecimal bigDecimal1 = bigDecimal.setScale(0, BigDecimal.ROUND_DOWN);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal1));
                    }
                    if ((!val.equals("2") && !val.equals("3") && !val.equals("4") && !val.equals("5")) || StringUtil.isEmpty(val)) {
                        BigDecimal refundAmount = new BigDecimal(reqJson.getString("refundAmount"));
                        BigDecimal bigDecimal = refundAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
                        reqJson.put("returnAmount", String.valueOf(bigDecimal));
                    }
                }
            }
        } else {
@@ -334,6 +438,68 @@
    }
    /**
     * 处理返还金额
     *
     * @param reqJson
     * @return
     * @serviceCode /applyRoomDiscount/dealWithRefundAmount
     * @path /app/applyRoomDiscount/dealWithRefundAmount
     */
    @RequestMapping(value = "/dealWithRefundAmount", method = RequestMethod.POST)
    @Java110Transactional
    public JSONObject dealWithRefundAmount(@RequestBody JSONObject reqJson, @RequestHeader(value = "user-id") String userId, DataFlowContext dataFlowContext) {
        JSONArray fees = reqJson.getJSONArray("fees");
        if (fees != null && fees.size() > 0) {
            JSONObject fee = null;
            BigDecimal cashBackAmount = new BigDecimal("0.00");//返现总金额
            for (int index = 0; index < fees.size(); index++) {
                fee = fees.getJSONObject(index);
                if (fee.containsKey("checked") && !StringUtil.isEmpty(fee.getString("checked")) && fee.getString("checked").equals("true")) {
                    //获取优惠
                    JSONArray discounts = reqJson.getJSONArray("discounts");
                    for (int i = 0; i < discounts.size(); i++) {
                        JSONObject discountObject = discounts.getJSONObject(i);
                        if (!reqJson.getString("discountId").equals(discountObject.getString("discountId"))) {
                            continue;
                        }
                        JSONArray feeDiscountSpecs = discountObject.getJSONArray("feeDiscountSpecs");
                        //获取规则id
                        String ruleId = discounts.getJSONObject(i).getString("ruleId");
                        FeeDiscountRuleDto feeDiscountRuleDto = new FeeDiscountRuleDto();
                        feeDiscountRuleDto.setRuleId(ruleId);
                        List<FeeDiscountRuleDto> feeDiscountRuleDtos = feeDiscountRuleInnerServiceSMOImpl.queryFeeDiscountRules(feeDiscountRuleDto);
                        Assert.listOnlyOne(feeDiscountRuleDtos, "查询折扣规则错误!");
                        //获取折扣类型(1: 打折  2:减免  3:滞纳金  4:空置房打折  5:空置房减免)
                        String discountSmallType = feeDiscountRuleDtos.get(0).getDiscountSmallType();
                        String specValue = getRateSpecValueByFeeDiscountSpecs(feeDiscountSpecs);
                        if (!StringUtil.isEmpty(discountSmallType) && (discountSmallType.equals("1") || discountSmallType.equals("4"))) { //打折
                            FeeDetailDto feeDetailDto = new FeeDetailDto();
                            feeDetailDto.setDetailId(fee.getString("detailId"));
                            List<FeeDetailDto> feeDetailDtos = feeDetailInnerServiceSMOImpl.queryFeeDetails(feeDetailDto);
                            Assert.listOnlyOne(feeDetailDtos, "查询费用明细表错误!");
                            BigDecimal receivedAmount = new BigDecimal(feeDetailDtos.get(0).getReceivedAmount());//获取实收金额
                            BigDecimal spec = new BigDecimal(specValue);//折扣
                            //计算打折后的实收金额
                            BigDecimal money = receivedAmount.multiply(spec);
                            cashBackAmount = cashBackAmount.add(receivedAmount.subtract(money)); //计算优惠的金额
                        } else if (!StringUtil.isEmpty(discountSmallType) && (discountSmallType.equals("2") || discountSmallType.equals("5"))) { //减免
                            FeeDetailDto feeDetailDto = new FeeDetailDto();
                            feeDetailDto.setDetailId(fee.getString("detailId"));
                            List<FeeDetailDto> feeDetailDtos = feeDetailInnerServiceSMOImpl.queryFeeDetails(feeDetailDto);
                            Assert.listOnlyOne(feeDetailDtos, "查询费用明细表错误!");
                            BigDecimal spec = new BigDecimal(specValue);//减免金額
                            cashBackAmount = cashBackAmount.add(spec); //计算优惠的金额
                        }
                    }
                }
            }
            DecimalFormat df = new DecimalFormat("0.00");
            reqJson.put("returnAmount", df.format(cashBackAmount));
        }
        return reqJson;
    }
    /**
     * 89002020980001    102020001    月份
     * 89002020980002    102020001    打折率
     * 89002020980003    102020002    月份
service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java
@@ -20,10 +20,7 @@
import com.java110.dto.repair.RepairUserDto;
import com.java110.dto.user.UserDto;
import com.java110.fee.smo.impl.FeeReceiptInnerServiceSMOImpl;
import com.java110.intf.acct.IAccountDetailInnerServiceSMO;
import com.java110.intf.acct.IAccountInnerServiceSMO;
import com.java110.intf.acct.ICouponUserDetailV1InnerServiceSMO;
import com.java110.intf.acct.ICouponUserV1InnerServiceSMO;
import com.java110.intf.community.*;
import com.java110.intf.fee.*;
import com.java110.intf.fee.IFeeAccountDetailServiceSMO;
@@ -40,7 +37,6 @@
import com.java110.po.owner.RepairUserPo;
import com.java110.po.payFee.PayFeeDetailDiscountPo;
import com.java110.utils.cache.CommonCache;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.FeeFlagTypeConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.CmdException;
@@ -83,16 +79,10 @@
    private IFeeAttrInnerServiceSMO feeAttrInnerServiceSMOImpl;
    @Autowired
    private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
    @Autowired
    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
    @Autowired
    private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
    @Autowired
    private IFeeReceiptDetailInnerServiceSMO feeReceiptDetailInnerServiceSMOImpl;
    @Autowired
    private IRepairUserInnerServiceSMO repairUserInnerServiceSMO;
@@ -105,9 +95,6 @@
    @Autowired
    private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
    @Autowired
    private IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl;
    @Autowired
    private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
@@ -125,12 +112,6 @@
    private IRepairUserV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl;
    @Autowired
    private ICouponUserV1InnerServiceSMO couponUserV1InnerServiceSMOImpl;
    @Autowired
    private ICouponUserDetailV1InnerServiceSMO couponUserDetailV1InnerServiceSMOImpl;
    @Autowired
    private IOwnerCarNewV1InnerServiceSMO ownerCarNewV1InnerServiceSMOImpl;
    @Autowired
@@ -142,19 +123,16 @@
    @Autowired
    private FeeReceiptInnerServiceSMOImpl feeReceiptInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId节点");
        Assert.jsonObjectHaveKey(reqJson, "cycles", "请求报文中未包含cycles节点");
        Assert.jsonObjectHaveKey(reqJson, "receivedAmount", "请求报文中未包含receivedAmount节点");
        Assert.jsonObjectHaveKey(reqJson, "feeId", "请求报文中未包含feeId节点");
        Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
        Assert.hasLength(reqJson.getString("cycles"), "周期不能为空");
        Assert.hasLength(reqJson.getString("receivedAmount"), "实收金额不能为空");
        Assert.hasLength(reqJson.getString("feeId"), "费用ID不能为空");
        //判断是否 费用状态为缴费结束
        FeeDto feeDto = new FeeDto();
        feeDto.setFeeId(reqJson.getString("feeId"));
service-job/src/main/java/com/java110/job/export/adapt/DataMonthReceivedStatisticsAdapt.java
@@ -1,11 +1,8 @@
package com.java110.job.export.adapt;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.dto.data.ExportDataDto;
import com.java110.dto.dict.DictDto;
import com.java110.dto.report.QueryStatisticsDto;
import com.java110.dto.room.RoomDto;
import com.java110.intf.report.IReportFeeStatisticsInnerServiceSMO;
import com.java110.job.export.IExportDataAdapt;
import com.java110.utils.util.Assert;
@@ -16,10 +13,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * 月实收数据导出
@@ -36,7 +31,6 @@
    public SXSSFWorkbook exportData(ExportDataDto exportDataDto) {
        JSONObject reqJson = exportDataDto.getReqJson();
        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区");
        String startDate = reqJson.getString("feeStartDate");
        String endDate = reqJson.getString("feeEndDate");
        if (!StringUtil.isEmpty(startDate) && !startDate.contains(":")) {
@@ -47,11 +41,9 @@
            endDate += " 23:59:59";
            reqJson.put("feeEndDate", endDate);
        }
        SXSSFWorkbook workbook = null;  //工作簿
        workbook = new SXSSFWorkbook();
        workbook.setCompressTempFiles(false);
        Sheet sheet = workbook.createSheet("实收明细");
        Row row = sheet.createRow(0);
        row.createCell(0).setCellValue("房屋");
@@ -60,8 +52,7 @@
        row.createCell(3).setCellValue("费用名称");
        row.createCell(4).setCellValue("实收时间段");
        row.createCell(5).setCellValue("收银员");
        row.createCell(5).setCellValue("缴费时间");
        row.createCell(6).setCellValue("缴费时间");
        QueryStatisticsDto queryStatisticsDto = new QueryStatisticsDto();
        queryStatisticsDto.setCommunityId(reqJson.getString("communityId"));
        queryStatisticsDto.setStartDate(reqJson.getString("feeStartDate"));
@@ -72,7 +63,6 @@
        queryStatisticsDto.setOwnerName(reqJson.getString("ownerName"));
        queryStatisticsDto.setLink(reqJson.getString("link"));
        long count = reportFeeStatisticsInnerServiceSMOImpl.getMonthReceivedDetailCount(queryStatisticsDto);
        int maxPage = (int) Math.ceil((double) count / (double) MAX_ROW);
        List<Map> infos = null;
        for (int page = 1; page <= maxPage; page++) {
@@ -81,11 +71,9 @@
            infos = reportFeeStatisticsInnerServiceSMOImpl.getMonthReceivedDetailInfo(queryStatisticsDto);
            appendData(infos, sheet, (page - 1) * MAX_ROW);
        }
        //todo 实收金额
        double receivedAmount = reportFeeStatisticsInnerServiceSMOImpl.getMonthReceivedDetailAmount(queryStatisticsDto);
        row = sheet.createRow((int)count+1);
        row = sheet.createRow((int) count + 1);
        row.createCell(0).setCellValue("总收入");
        row.createCell(1).setCellValue(receivedAmount);
        return workbook;
@@ -110,9 +98,8 @@
            //row.createCell(4).setCellValue(getValue(dataObj, "startTime") + "~" + getValue(dataObj, "endTime"));
            row.createCell(4).setCellValue(getValue(dataObj, "curYearMonth"));
            row.createCell(5).setCellValue(getValue(dataObj, "cashierName"));
            row.createCell(5).setCellValue(getValue(dataObj, "createTime"));
            row.createCell(6).setCellValue(getValue(dataObj, "createTime"));
        }
    }
    private String getValue(Map data, String key) {
service-job/src/main/java/com/java110/job/export/adapt/ExportOwnerCarAdapt.java
@@ -1,12 +1,10 @@
package com.java110.job.export.adapt;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.dto.data.ExportDataDto;
import com.java110.dto.owner.OwnerCarDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.dto.parking.ParkingSpaceDto;
import com.java110.dto.reportFee.ReportFeeMonthStatisticsDto;
import com.java110.dto.room.RoomDto;
import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
import com.java110.intf.community.IRoomInnerServiceSMO;
@@ -23,8 +21,14 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 业主车辆导出
 *
 * @date 2023-09-08
 */
@Service("exportOwnerCar")
public class ExportOwnerCarAdapt implements IExportDataAdapt {
@@ -49,20 +53,19 @@
        //工作表
        workbook = new SXSSFWorkbook();
        workbook.setCompressTempFiles(false);
        Sheet sheet = workbook.createSheet("业主车辆");
        Row row = sheet.createRow(0);
        row.createCell(0).setCellValue("车牌号");
        row.createCell(1).setCellValue("房屋");
        row.createCell(2).setCellValue("车辆类型");
        row.createCell(3).setCellValue("颜色");
        row.createCell(4).setCellValue("业主");
        row.createCell(5).setCellValue("手机号");
        row.createCell(6).setCellValue("车位");
        row.createCell(7).setCellValue("开始时间");
        row.createCell(8).setCellValue("结束时间");
        row.createCell(1).setCellValue("成员车辆");
        row.createCell(2).setCellValue("房屋号");
        row.createCell(3).setCellValue("车辆品牌");
        row.createCell(4).setCellValue("车辆类型");
        row.createCell(5).setCellValue("颜色");
        row.createCell(6).setCellValue("业主");
        row.createCell(7).setCellValue("车位");
        row.createCell(8).setCellValue("有效期");
        row.createCell(9).setCellValue("状态");
        row.createCell(10).setCellValue("备注");
        JSONObject reqJson = exportDataDto.getReqJson();
        if (reqJson.containsKey("num") && !StringUtil.isEmpty(reqJson.getString("num"))) {
            ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
@@ -102,16 +105,38 @@
            row = sheet.createRow(roomIndex + step + 1);
            dataObj = ownerCarDtoList.get(roomIndex);
            row.createCell(0).setCellValue(dataObj.getCarNum());
            row.createCell(1).setCellValue(dataObj.getRoomName());
            row.createCell(2).setCellValue(dataObj.getCarTypeName());
            row.createCell(3).setCellValue(dataObj.getCarColor());
            row.createCell(4).setCellValue(dataObj.getOwnerName());
            row.createCell(5).setCellValue(dataObj.getLink());
            row.createCell(6).setCellValue(dataObj.getAreaNum()+"-"+dataObj.getNum());
            row.createCell(7).setCellValue(DateUtil.getFormatTimeStringA(dataObj.getStartTime()));
            row.createCell(8).setCellValue(DateUtil.getFormatTimeStringA(dataObj.getEndTime()));
            if (!StringUtil.isEmpty(dataObj.getMemberCarCount())) {
                row.createCell(1).setCellValue(dataObj.getMemberCarCount());
            } else {
                row.createCell(1).setCellValue("0");
            }
            row.createCell(2).setCellValue(dataObj.getRoomName());
            row.createCell(3).setCellValue(dataObj.getCarBrand());
            row.createCell(4).setCellValue(dataObj.getCarTypeName());
            row.createCell(5).setCellValue(dataObj.getCarColor());
            row.createCell(6).setCellValue(dataObj.getOwnerName() + "(" + dataObj.getLink() + ")");
            if (!StringUtil.isEmpty(dataObj.getAreaNum()) && dataObj.getState().equals("1001")) {
                row.createCell(7).setCellValue(dataObj.getAreaNum() + "-" + dataObj.getNum());
            } else {
                row.createCell(7).setCellValue("车位已释放");
            }
            if (!StringUtil.isEmpty(dataObj.getLeaseType()) && dataObj.getLeaseType().equals("H")) { //H 月租车;S出售车;I 内部车;NM 免费车;R 预约车
                row.createCell(8).setCellValue(DateUtil.getFormatTimeStringA(dataObj.getStartTime()) + "~" + DateUtil.getFormatTimeStringA(dataObj.getEndTime()));
            } else {
                row.createCell(8).setCellValue("--");
            }
            //结束时间
            Date endTime = dataObj.getEndTime();
            Date date = new Date();
            if (!StringUtil.isEmpty(dataObj.getState()) && dataObj.getState().equals("3003")) { //1001 正常;2002 欠费;3003 车位释放
                row.createCell(9).setCellValue("到期");
            } else if (endTime.getTime() > date.getTime()) {
                row.createCell(9).setCellValue("正常");
            } else {
                row.createCell(9).setCellValue("到期");
            }
            row.createCell(10).setCellValue(dataObj.getRemark());
        }
    }
    private void freshPs(List<OwnerCarDto> ownerCarDtoList) {
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java
@@ -456,7 +456,6 @@
        return getReportFeeMonthStatisticsBMOImpl.queryDeadlineFee(reportFeeMonthStatisticsDto);
    }
    /**
     * 查询费用分项表
     *
@@ -542,7 +541,6 @@
        return getReportFeeMonthStatisticsBMOImpl.queryNoFeeRooms(roomDto);
    }
    /**
     * 查询华宁物业 欠费统计报表
     * 作者: 吴学文
@@ -601,8 +599,8 @@
        paramInfo.put("page", page);
        paramInfo.put("row", row);
        paramInfo.put("startTime", DateUtil.getYear() + "-01-01");
        paramInfo.put("endTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_Q)+"-01");
        paramInfo.put("nextMonthTime",DateUtil.getFormatTimeStringB(DateUtil.getNextMonthFirstDate()));
        paramInfo.put("endTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_Q) + "-01");
        paramInfo.put("nextMonthTime", DateUtil.getFormatTimeStringB(DateUtil.getNextMonthFirstDate()));
        return getReportFeeMonthStatisticsBMOImpl.queryHuaningPayFee(paramInfo);
    }
@@ -646,6 +644,7 @@
                                                           @RequestParam(value = "year") int year,
                                                           @RequestParam(value = "month") int month,
                                                           @RequestParam(value = "feeTypeCd", required = false) String feeTypeCd,
                                                           @RequestParam(value = "floorNum", required = false) String floorNum,
                                                           @RequestParam(value = "page") int page,
                                                           @RequestParam(value = "row") int row) {
        Map paramInfo = new HashMap();
@@ -655,10 +654,9 @@
        paramInfo.put("page", page);
        paramInfo.put("row", row);
        paramInfo.put("feeTypeCd", feeTypeCd);
        paramInfo.put("floorNum", floorNum);
        paramInfo.put("startTime", DateUtil.getYear() + "-01-01");
        paramInfo.put("endTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B));
        return getReportFeeMonthStatisticsBMOImpl.queryHuaningOweFeeDetail(paramInfo);
    }
}
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -18,6 +18,7 @@
import com.java110.intf.user.IOwnerInnerServiceSMO;
import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
import com.java110.report.bmo.reportFeeMonthStatistics.IGetReportFeeMonthStatisticsBMO;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.DateUtil;
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
@@ -31,7 +32,6 @@
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@Service("getReportFeeMonthStatisticsBMOImpl")
@@ -126,9 +126,7 @@
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        return responseEntity;
    }
@@ -174,7 +172,6 @@
                    .setScale(2, BigDecimal.ROUND_HALF_UP);
            tmpReportFeeMonthStatisticsDto.setHisOweAmount(hisOweAmountDec.doubleValue());
            //当月应收
            curReceivableAmountDec = new BigDecimal(tmpReportFeeMonthStatisticsDto.getCurReceivableAmount());
            curReceivableAmountDec = curReceivableAmountDec.add(new BigDecimal(reportFeeMonthStatisticsDto.getCurReceivableAmount()))
@@ -211,7 +208,6 @@
                    .setScale(2, BigDecimal.ROUND_HALF_UP);
            tmpReportFeeMonthStatisticsDto.setReceivedAmount(receivedAmountDec.doubleValue() + "");
        }
        return reportFeeMonthStatisticsDtos;
    }
@@ -229,7 +225,6 @@
                return tmpReportFeeMonthStatisticsDto;
            }
        }
        return null;
    }
@@ -238,7 +233,6 @@
        reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
        reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFloorUnitFeeSummaryCount(reportFeeMonthStatisticsDto);
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        if (count > 0) {
            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFloorUnitFeeSummary(reportFeeMonthStatisticsDto);
@@ -267,7 +261,6 @@
    @Override
    public ResponseEntity<String> queryFeeBreakdown(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        if (StringUtil.isEmpty(reportFeeMonthStatisticsDto.getYearMonth())) {
            reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
            reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
@@ -322,8 +315,6 @@
    @Override
    public ResponseEntity<String> queryFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
        reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
@@ -376,7 +367,6 @@
    @Override
    public ResponseEntity<String> queryOweFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetailCount(reportFeeMonthStatisticsDto);
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        if (count > 0) {
            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetail(reportFeeMonthStatisticsDto);
@@ -410,7 +400,6 @@
    public ResponseEntity<String> queryPayFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        ResultVo resultVo = queryPayFeeDetailInnerServiceSMOImpl.query(reportFeeMonthStatisticsDto);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        return responseEntity;
    }
@@ -419,7 +408,6 @@
     * @param reportFeeMonthStatisticsDtos
     */
    private void refreshReportFeeMonthStatistics(List<String> ownerIds, List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) {
        if (ownerIds == null || ownerIds.size() < 1) {
            return;
        }
@@ -496,7 +484,6 @@
    @Override
    public ResponseEntity<String> queryPrePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePaymentCount(reportFeeMonthStatisticsDto);
@@ -510,7 +497,6 @@
    @Override
    public ResponseEntity<String> queryDeadlinePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryDeadlinePaymentCount(reportFeeMonthStatisticsDto);
@@ -524,7 +510,6 @@
    @Override
    public ResponseEntity<String> queryOwePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        List<ReportFeeMonthStatisticsDto> reportAllFeeMonthStatisticsDtos = null;
@@ -542,7 +527,6 @@
                }
            }
        }
        ResultVo resultVo = new ResultVo(reportAllFeeMonthStatisticsDtos);
@@ -709,7 +693,7 @@
        //获取总条数
        int size = staffs.size();
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) size / (double) repairUserDto.getRow()), repairUserList.size(), repairUserList, staffs, repairUser);
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) size / (double) repairUserDto.getRow()), size, repairUserList, staffs, repairUser);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
@@ -832,24 +816,33 @@
    @Override
    public ResponseEntity<String> queryHuaningOweFee(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningOweFee(reportFeeMonthStatisticsDto);
        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningOweFeeCounts(reportFeeMonthStatisticsDto);
        if (count > 0) {
            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningOweFee(reportFeeMonthStatisticsDto);
        } else {
            reportFeeMonthStatisticsDtos = new ArrayList<>();
        }
        ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(reportFeeMonthStatisticsDtos);
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        return responseEntity;
    }
    @Override
    public ResponseEntity<String> queryHuaningPayFee(Map paramInfo) {
        List<Map> reportFeeMonthStatisticsDtos = null;
        reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFee(paramInfo);
        ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(reportFeeMonthStatisticsDtos);
        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFeeCounts(paramInfo);
        if (count > 0) {
            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFee(paramInfo);
        } else {
            reportFeeMonthStatisticsDtos = new ArrayList<>();
        }
        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = BeanConvertUtil.covertBean(paramInfo, ReportFeeMonthStatisticsDto.class);
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        return responseEntity;
    }
@@ -905,9 +898,7 @@
        calendar.set(Calendar.MONTH, 0);
        Date curStart = calendar.getTime();
        for (Map paramIn : reportFeeMonthStatisticsDtos) {
            startTime = (Date) paramIn.get("startTime");
            endTime = (Date) paramIn.get("endTime");
            BigDecimal money = (BigDecimal) paramIn.get("oweAmount");
@@ -917,10 +908,8 @@
                paramIn.put("bfAmount", 0);
                continue;
            }
            //每月金额
            BigDecimal monthAmount = money.divide(new BigDecimal(month), 2, BigDecimal.ROUND_HALF_EVEN);
            if (startTime.getTime() < curStart.getTime()) {
                BigDecimal btAmountDec = monthAmount.multiply(new BigDecimal(curMonth)).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                paramIn.put("btAmount", btAmountDec.doubleValue());
@@ -929,20 +918,16 @@
                paramIn.put("bfAmount", bfAmountDec.doubleValue());
                continue;
            }
            if (startTime.getTime() >= curStart.getTime()) {
                paramIn.put("btAmount", money.doubleValue());
                paramIn.put("bfAmount", 0);
            }
        }
    }
    @Override
    public ResponseEntity<String> queryPrePayment(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePaymentNewCount(reportFeeMonthStatisticsDto);
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        if (count > 0) {
            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePayment(reportFeeMonthStatisticsDto);
@@ -973,7 +958,6 @@
    }
    private void freshReportOweDay(List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) {
        int day = 0;
        for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) {
            try {
@@ -986,11 +970,8 @@
        }
    }
    private void freshReportDeadlineDay(List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) {
        Date nowDate = DateUtil.getCurrentDate();
        for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) {
            try {
                int day = DateUtil.daysBetween(DateUtil.getDateFromString(reportFeeMonthStatisticsDto.getDeadlineTime(),
@@ -1002,6 +983,4 @@
        }
    }
}
service-report/src/main/java/com/java110/report/bmo/reportFeeYearCollection/impl/GetReportFeeYearCollectionBMOImpl.java
@@ -24,7 +24,6 @@
     */
    public ResponseEntity<String> get(ReportFeeYearCollectionDto reportFeeYearCollectionDto) {
        int count = reportFeeYearCollectionInnerServiceSMOImpl.queryReportFeeYearCollectionsCount(reportFeeYearCollectionDto);
        List<ReportFeeYearCollectionDto> reportFeeYearCollectionDtos = null;
service-report/src/main/java/com/java110/report/cmd/room/QueryHisRoomCmd.java
@@ -41,8 +41,8 @@
        RoomDto roomDto = BeanConvertUtil.covertBean(reqJson, RoomDto.class);
        String roomName = reqJson.getString("roomName");
        if(StringUtil.isEmpty(roomName)){
            String[] roomNames = roomName.split(roomName,3);
        if(!StringUtil.isEmpty(roomName)){
            String[] roomNames = roomName.split("-");
            if(roomNames.length == 3) {
                roomDto.setFloorNum(roomNames[0]);
                roomDto.setUnitNum(roomNames[1]);
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java
@@ -376,8 +376,12 @@
    int queryHuaningPayFeeCount(Map paramInfo);
    int queryHuaningOweFeeCounts(Map paramInfo);
    List<Map> queryHuaningPayFee(Map beanCovertMap);
    int queryHuaningPayFeeCounts(Map paramInfo);
    int queryHuaningPayFeeTwoCount(Map paramInfo);
    List<Map> queryHuaningPayFeeTwo(Map beanCovertMap);
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java
@@ -380,6 +380,18 @@
    }
    @Override
    public int queryHuaningOweFeeCounts(Map info) {
        logger.debug("查询queryHuaningOweFeeCounts数据 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryHuaningOweFeeCounts", info);
        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
    }
    @Override
    public List<Map> queryHuaningPayFee(Map info) {
        logger.debug("查询queryHuaningPayFee 入参 info : {}", info);
@@ -389,6 +401,18 @@
    }
    @Override
    public int queryHuaningPayFeeCounts(Map info) {
        logger.debug("查询queryHuaningPayFeeCounts数据 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeCounts", info);
        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
    }
    @Override
    public int queryHuaningPayFeeTwoCount(Map info) {
        logger.debug("查询queryHuaningPayFeeTwoCount数据 入参 info : {}", info);
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -542,6 +542,11 @@
    }
    @Override
    public int queryHuaningOweFeeCounts(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        return reportFeeMonthStatisticsServiceDaoImpl.queryHuaningOweFeeCounts(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
    }
    @Override
    public int queryHuaningPayFeeCount(@RequestBody Map paramInfo) {
        return reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeCount(paramInfo);
    }
@@ -556,6 +561,12 @@
        List<Map> deposits = reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFee(paramInfo);
        return deposits;
    }
    @Override
    public int queryHuaningPayFeeCounts(@RequestBody Map paramInfo) {
        return reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeCounts(paramInfo);
    }
    @Override
    public int queryHuaningPayFeeTwoCount(@RequestBody Map paramInfo) {
        return reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeTwoCount(paramInfo);
service-store/src/main/java/com/java110/store/api/ContractApi.java
@@ -363,7 +363,6 @@
    }
    /**
     * 合同起草待办
     *
@@ -909,8 +908,8 @@
                                                          @RequestParam(value = "contractType", required = false) String contractType,
                                                          @RequestParam(value = "logStartTime", required = false) String logStartTime,
                                                          @RequestParam(value = "logEndTime", required = false) String logEndTime,
                                                          @RequestParam(value = "planId", required = false) String planId
    ) {
                                                          @RequestParam(value = "staffNameLike", required = false) String staffNameLike,
                                                          @RequestParam(value = "planId", required = false) String planId) {
        ContractChangePlanDto contractChangePlanDto = new ContractChangePlanDto();
        contractChangePlanDto.setPage(page);
        contractChangePlanDto.setRow(row);
@@ -922,6 +921,7 @@
        contractChangePlanDto.setContractType(contractType);
        contractChangePlanDto.setStartTime(logStartTime);
        contractChangePlanDto.setEndTime(logEndTime);
        contractChangePlanDto.setStaffNameLike(staffNameLike);
        return getContractChangePlanBMOImpl.get(contractChangePlanDto);
    }
service-store/src/main/java/com/java110/store/cmd/assetInventory/SaveAssetInventoryCmd.java
@@ -132,6 +132,7 @@
                throw new CmdException("保存数据盘点明细失败");
            }
        }
        //assetInventoryPo.setState("4488"); //4488 盘点中,4477 盘点结束,4466 盘点入库
        int flag = assetInventoryV1InnerServiceSMOImpl.saveAssetInventory(assetInventoryPo);
        if (flag < 1) {
            throw new CmdException("保存数据失败");
service-store/src/main/java/com/java110/store/cmd/collection/GoodsCollectionCmd.java
@@ -17,7 +17,6 @@
import com.java110.dto.store.StorehouseDto;
import com.java110.dto.user.UserDto;
import com.java110.dto.user.UserStorehouseDto;
import com.java110.intf.common.IGoodCollectionUserInnerServiceSMO;
import com.java110.intf.common.IOaWorkflowActivitiInnerServiceSMO;
import com.java110.intf.oa.IOaWorkflowInnerServiceSMO;
import com.java110.intf.store.*;
@@ -49,7 +48,6 @@
    @Autowired
    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
    @Autowired
    private IPurchaseApplyInnerServiceSMO purchaseApplyInnerServiceSMOImpl;
@@ -63,9 +61,8 @@
    private IOaWorkflowActivitiInnerServiceSMO oaWorkflowActivitiInnerServiceSMOImpl;
    @Autowired
    private IGoodCollectionUserInnerServiceSMO goodCollectionUserInnerServiceSMOImpl;
    @Autowired
    private IResourceStoreInnerServiceSMO resourceStoreInnerServiceSMOImpl;
    @Autowired
    private IPurchaseApplyDetailInnerServiceSMO purchaseApplyDetailInnerServiceSMOImpl;
@@ -83,10 +80,8 @@
        Assert.hasKeyAndValue(reqJson, "endUserName", "必填,请填写采购联系人");
        Assert.hasKeyAndValue(reqJson, "endUserTel", "必填,请填写采购联系电话");
        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
        JSONArray resourceStores = reqJson.getJSONArray("resourceStores");
        String storeId = CmdContextUtils.getStoreId(context);
        if (resourceStores == null || resourceStores.size() < 1) {
            throw new CmdException("未包含领用物品");
        }
@@ -95,38 +90,29 @@
        for (int resourceStoreIndex = 0; resourceStoreIndex < resourceStores.size(); resourceStoreIndex++) {
            JSONObject resourceStore = resourceStores.getJSONObject(resourceStoreIndex);
            Assert.hasKeyAndValue(resourceStore, "timesId", "必填,未选择价格");
            ResourceStoreTimesDto resourceStoreTimesDto = new ResourceStoreTimesDto();
            resourceStoreTimesDto.setTimesId(resourceStore.getString("timesId"));
            resourceStoreTimesDto.setStoreId(storeId);
            List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
            Assert.listOnlyOne(resourceStoreTimesDtos, "价格不存在");
            quanitity = resourceStore.getIntValue("quantity");
            if (quanitity < 1) {
                throw new CmdException("申请数量不正确");
            }
            stock = Integer.parseInt(resourceStoreTimesDtos.get(0).getStock());
            if (quanitity > stock) {
                throw new CmdException(resourceStoreTimesDtos.get(0).getResCode() + "出库不足,库存为=" + stock + ",申请数为=" + quanitity);
            }
            resourceStore.put("resourceStoreTimesDtos", resourceStoreTimesDtos);
        }
        //todo 查询仓库是否存在
        StorehouseDto storehouseDto = new StorehouseDto();
        storehouseDto.setShId(reqJson.getString("shId"));
        List<StorehouseDto> storehouseDtos = storehouseV1InnerServiceSMOImpl.queryStorehouses(storehouseDto);
        Assert.listOnlyOne(storehouseDtos, "仓库不存在");
        if (!StorehouseDto.SWITCH_ON.equals(storehouseDtos.get(0).getUseSwitch())) {
            return;
        }
        OaWorkflowDto oaWorkflowDto = new OaWorkflowDto();
        oaWorkflowDto.setStoreId(storeId);
        oaWorkflowDto.setFlowId(storehouseDtos.get(0).getUseFlowId());
@@ -135,12 +121,9 @@
        if (!OaWorkflowDto.STATE_COMPLAINT.equals(oaWorkflowDtos.get(0).getState())) {
            throw new IllegalArgumentException(oaWorkflowDtos.get(0).getFlowName() + "流程未部署");
        }
        if (StringUtil.isEmpty(oaWorkflowDtos.get(0).getProcessDefinitionKey())) {
            throw new IllegalArgumentException(oaWorkflowDtos.get(0).getFlowName() + "流程未部署");
        }
    }
    /**
@@ -157,21 +140,16 @@
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        String storeId = context.getReqHeaders().get("store-id");
        String userId = context.getReqHeaders().get("user-id");
        //todo 查询仓库是否存在
        StorehouseDto storehouseDto = new StorehouseDto();
        storehouseDto.setShId(reqJson.getString("shId"));
        List<StorehouseDto> storehouseDtos = storehouseV1InnerServiceSMOImpl.queryStorehouses(storehouseDto);
        Assert.listOnlyOne(storehouseDtos, "仓库不存在");
        UserDto userDto = new UserDto();
        userDto.setUserId(userId);
        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
        Assert.listOnlyOne(userDtos, "未包含用户");
        String userName = userDtos.get(0).getName();
        PurchaseApplyPo purchaseApplyPo = new PurchaseApplyPo();
        purchaseApplyPo.setApplyOrderId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyOrderId));
        purchaseApplyPo.setDescription(reqJson.getString("description"));
@@ -201,7 +179,6 @@
            purchaseApplyDetailPo.setTimesId(resourceStoreTimesDtos.get(0).getTimesId());
            purchaseApplyDetailPo.setOriginalStock(resourceStoreTimesDtos.get(0).getStock());
            purchaseApplyDetailPo.setPurchaseQuantity(resourceStore.getString("quantity"));
            //todo 获取批次采购参考价格
            String consultPrice = null;
            JSONArray timeList = resourceStore.getJSONArray("times");
@@ -217,9 +194,7 @@
            purchaseApplyDetailPos.add(purchaseApplyDetailPo);
        }
        purchaseApplyPo.setPurchaseApplyDetailPos(purchaseApplyDetailPos);
        int saveFlag = purchaseApplyInnerServiceSMOImpl.savePurchaseApply(purchaseApplyPo);
        if (saveFlag < 1) {
            throw new CmdException("物品领用申请失败");
        }
@@ -228,7 +203,6 @@
        purchaseApplyDto.setNextStaffId(reqJson.getString("staffId"));
        //todo 启动审核流程
        toStartWorkflow(purchaseApplyDto, storehouseDtos.get(0), reqJson);
        context.setResponseEntity(ResultVo.createResponseEntity(ResultVo.CODE_OK, "物品领用成功"));
    }
@@ -238,18 +212,15 @@
     * @param purchaseApplyDto
     */
    private void toStartWorkflow(PurchaseApplyDto purchaseApplyDto, StorehouseDto storehouseDto, JSONObject reqJson) {
        if (!StorehouseDto.SWITCH_ON.equals(storehouseDto.getUseSwitch())) {
            //todo 直接入库
            toPurchaseOutStorehouse(purchaseApplyDto, storehouseDto, reqJson);
            return;
        }
        OaWorkflowDto oaWorkflowDto = new OaWorkflowDto();
        oaWorkflowDto.setStoreId(purchaseApplyDto.getStoreId());
        oaWorkflowDto.setFlowId(storehouseDto.getUseFlowId());
        List<OaWorkflowDto> oaWorkflowDtos = oaWorkflowInnerServiceSMOImpl.queryOaWorkflows(oaWorkflowDto);
        //todo 提交审核
        JSONObject flowJson = new JSONObject();
        flowJson.put("processDefinitionKey", oaWorkflowDtos.get(0).getProcessDefinitionKey());
@@ -260,13 +231,16 @@
        flowJson.put("storeId", purchaseApplyDto.getStoreId());
        reqJson.put("processDefinitionKey", oaWorkflowDtos.get(0).getProcessDefinitionKey());
        JSONObject result = oaWorkflowActivitiInnerServiceSMOImpl.startProcess(flowJson);
        JSONObject audit = reqJson.getJSONObject("audit");
        String nextUserId = "-1";
        if (audit != null) {
            nextUserId = reqJson.getJSONObject("audit").getString("staffId");
            String staffId = reqJson.getJSONObject("audit").getString("staffId");
            if (!StringUtil.isEmpty(staffId)) {
                nextUserId = reqJson.getJSONObject("audit").getString("staffId");
            } else {
                nextUserId = reqJson.getJSONObject("audit").getString("assignee");
            }
        }
        //提交者提交
        flowJson = new JSONObject();
        flowJson.put("processInstanceId", result.getString("processInstanceId"));
@@ -275,7 +249,6 @@
        flowJson.put("storeId", purchaseApplyDto.getStoreId());
        flowJson.put("id", purchaseApplyDto.getApplyOrderId());
        flowJson.put("flowId", oaWorkflowDtos.get(0).getFlowId());
        oaWorkflowActivitiInnerServiceSMOImpl.autoFinishFirstTask(flowJson);
    }
@@ -287,16 +260,13 @@
     * @param reqJson
     */
    private void toPurchaseOutStorehouse(PurchaseApplyDto purchaseApplyDto, StorehouseDto storehouseDto, JSONObject reqJson) {
        PurchaseApplyDetailDto purchaseApplyDetailDto = new PurchaseApplyDetailDto();
        purchaseApplyDetailDto.setApplyOrderId(purchaseApplyDto.getApplyOrderId());
        purchaseApplyDetailDto.setStoreId(purchaseApplyDto.getStoreId());
        List<PurchaseApplyDetailDto> purchaseApplyDetailDtos = purchaseApplyDetailInnerServiceSMOImpl.queryPurchaseApplyDetails(purchaseApplyDetailDto);
        if (purchaseApplyDetailDtos == null || purchaseApplyDetailDtos.size() < 1) {
            return;
        }
        int stock = 0;
        for (PurchaseApplyDetailDto tmpPurchaseApplyDetailDto : purchaseApplyDetailDtos) {
            ResourceStorePo resourceStorePo = new ResourceStorePo();
@@ -330,7 +300,6 @@
//            }
//            resourceStorePo.setMiniStock(String.valueOf(nowMiniStock));
            resourceStoreInnerServiceSMOImpl.updateResourceStore(resourceStorePo);
            // 保存至 物品 times表
            ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
            resourceStoreTimesPo.setApplyOrderId(tmpPurchaseApplyDetailDto.getApplyOrderId());
@@ -359,7 +328,6 @@
     * @param resourceStoreDtos
     */
    private void addPersonStorehouse(PurchaseApplyDto purchaseApplyDto, List<ResourceStoreDto> resourceStoreDtos, PurchaseApplyDetailDto purchaseApplyDetailDto) {
        //获取物品单位
        String unitCode = resourceStoreDtos.get(0).getUnitCode();
        //获取物品最小计量单位
service-store/src/main/java/com/java110/store/cmd/purchase/PurchaseApplyCmd.java
@@ -230,9 +230,13 @@
        JSONObject audit = reqJson.getJSONObject("audit");
        String nextUserId = "-1";
        if (audit != null) {
            nextUserId = reqJson.getJSONObject("audit").getString("staffId");
            String staffId = reqJson.getJSONObject("audit").getString("staffId");
            if(!StringUtil.isEmpty(staffId)) {
                nextUserId = reqJson.getJSONObject("audit").getString("staffId");
            } else {
                nextUserId = reqJson.getJSONObject("audit").getString("assignee");
            }
        }
        //提交者提交
        flowJson = new JSONObject();
        flowJson.put("processInstanceId", result.getString("processInstanceId"));
service-store/src/main/java/com/java110/store/cmd/purchase/UrgentPurchaseApplyCmd.java
@@ -75,6 +75,7 @@
    @Autowired
    private IStorehouseV1InnerServiceSMO storehouseV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        Assert.hasKeyAndValue(reqJson, "resourceStores", "必填,请填写申请采购的物资");
@@ -82,17 +83,14 @@
        Assert.hasKeyAndValue(reqJson, "resOrderType", "必填,请填写申请类型");
        Assert.hasKeyAndValue(reqJson, "shId", "必填,请填写仓库");
        JSONArray resourceStores = reqJson.getJSONArray("resourceStores");
        if (resourceStores == null || resourceStores.size() < 1) {
            throw new CmdException("未包含采购物品");
        }
        //todo 查询仓库是否存在
        StorehouseDto storehouseDto = new StorehouseDto();
        storehouseDto.setShId(reqJson.getString("shId"));
        List<StorehouseDto> storehouseDtos = storehouseV1InnerServiceSMOImpl.queryStorehouses(storehouseDto);
        Assert.listOnlyOne(storehouseDtos, "仓库不存在");
        //todo 不允许采购
        if (!"ON".equals(storehouseDtos.get(0).getAllowPurchase())) {
            throw new CmdException(storehouseDtos.get(0).getShName() + "不允许采购");
@@ -117,11 +115,8 @@
        userDto.setRow(1);
        userDto.setPage(1);
        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
        Assert.listOnlyOne(userDtos, "用户不存在");
        userName = userDtos.get(0).getName();
        String storeId = context.getReqHeaders().get("store-id");
        PurchaseApplyDto purchaseApplyDto = new PurchaseApplyDto();
        purchaseApplyDto.setResOrderType(reqJson.getString("resOrderType"));
@@ -178,12 +173,10 @@
            //查询当前小区仓库下该物品信息
            ResourceStoreDto resourceStoreDto = new ResourceStoreDto();
            resourceStoreDto.setResCode(resourceStore.getString("resCode"));
            if (StringUtil.isEmpty(resourceStore.getString("shzId"))) {
                resourceStore.put("shzId", resourceStore.getString("shId"));
            }
            resourceStoreDto.setShId(resourceStore.getString("shzId")); //小区目标仓库
            List<ResourceStoreDto> resourceStoreDtos = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto);
            //调整集团仓库物品信息
            ResourceStorePo resourceStorePo = new ResourceStorePo();
@@ -201,10 +194,9 @@
            resourceStoreTimesPo1.setStock("0");
            resourceStoreTimesPo1.setStoreId(storeId);
            resourceStoreTimesPo1.setShId(resourceStore.getString("shId"));
            resourceStoreTimesPo1.setCommunityId(reqJson.getString("communityId"));
            resourceStoreTimesV1InnerServiceSMOImpl.saveOrUpdateResourceStoreTimes(resourceStoreTimesPo1);
            AllocationStorehouseDto allocationStorehouseDto = new AllocationStorehouseDto();
            if (resourceStoreDtos != null && resourceStoreDtos.size() == 1) {//目标仓库有此物品
                //生成调拨详情记录
                allocationStorehouseDto.setAsId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_allocationStorehouseId));
@@ -237,15 +229,12 @@
                //调拨
                allocationStorehouseApplyDto.setApplyType("30000");
                allocationStorehouseApplyInnerServiceSMOImpl.saveAllocationStorehouseApplys(allocationStorehouseApplyDto);
                //调整小区仓库物品均价、数量
                //集团仓库商品信息
                ResourceStoreDto resourceStoreDto2 = new ResourceStoreDto();
                resourceStoreDto2.setResCode(resourceStore.getString("resCode"));
                resourceStoreDto2.setResId(purchaseApplyDetailPo.getResId());
                List<ResourceStoreDto> resourceStoreDtoList = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto2);
                ResourceStorePo resourceStorePo1 = new ResourceStorePo();
                resourceStorePo1.setPurchasePrice(resourceStore.getString("urgentPrice"));
                resourceStorePo1.setResId(resourceStoreDtos.get(0).getResId());
@@ -270,8 +259,6 @@
                BigDecimal newMiniStock = purchaseQuantity.multiply(miniUnitStock).add(miniStock);
                resourceStorePo1.setMiniStock(String.valueOf(newMiniStock));
                resourceStoreInnerServiceSMOImpl.updateResourceStore(resourceStorePo1);
            } else if (resourceStoreDtos != null && resourceStoreDtos.size() > 1) {
                throw new IllegalArgumentException("查询商品错误!");
            } else {
service-store/src/main/java/com/java110/store/cmd/purchaseApply/ListPurchaseApplysCmd.java
@@ -110,6 +110,9 @@
        if (privileges.size() != 0 || (!StringUtil.isEmpty(reqJson.getString("applyOrderId")))) {
            purchaseApplyDto.setUserId("");
        }
        if (!StringUtil.isEmpty(reqJson.getString("applyUserName"))) {
            purchaseApplyDto.setUserName(reqJson.getString("applyUserName"));
        }
        int count = purchaseApplyInnerServiceSMOImpl.queryPurchaseApplysCount(purchaseApplyDto);
        List<ApiPurchaseApplyDataVo> purchaseApplys = null;
        if (count > 0) {
service-store/src/main/java/com/java110/store/cmd/purchaseApply/UpdatePurchaseApplyCmd.java
@@ -36,10 +36,6 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
/**
 * 类表述:更新
 * 服务编码:purchaseApply.updatePurchaseApply
@@ -55,7 +51,6 @@
    private static Logger logger = LoggerFactory.getLogger(UpdatePurchaseApplyCmd.class);
    @Autowired
    private IPurchaseApplyV1InnerServiceSMO purchaseApplyV1InnerServiceSMOImpl;
@@ -70,9 +65,7 @@
        Assert.hasKeyAndValue(reqJson, "endUserTel", "必填,请填写采购联系电话");
        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
        Assert.hasKey(reqJson, "resourceStores", "必填,请填写申请采购的物资");
        JSONArray resourceStores = reqJson.getJSONArray("resourceStores");
        if (resourceStores == null || resourceStores.size() < 1) {
            throw new CmdException("未包含采购物品");
        }
@@ -85,17 +78,13 @@
        reqJson.remove("resourceStores");
        PurchaseApplyPo purchaseApplyPo = BeanConvertUtil.covertBean(reqJson, PurchaseApplyPo.class);
        int flag = purchaseApplyV1InnerServiceSMOImpl.updatePurchaseApply(purchaseApplyPo);
        if (flag < 1) {
            throw new CmdException("更新数据失败");
        }
        //todo 删除
        PurchaseApplyDetailPo purchaseApplyDetailPo = new PurchaseApplyDetailPo();
        purchaseApplyDetailPo.setApplyOrderId(purchaseApplyPo.getApplyOrderId());
        purchaseApplyDetailV1InnerServiceSMOImpl.deletePurchaseApplyDetail(purchaseApplyDetailPo);
        for (int resourceStoreIndex = 0; resourceStoreIndex < resourceStores.size(); resourceStoreIndex++) {
            JSONObject resourceStore = resourceStores.getJSONObject(resourceStoreIndex);
            resourceStore.put("originalStock", resourceStore.getString("stock"));
@@ -115,9 +104,9 @@
                }
            }
            purchaseApplyDetailPo.setConsultPrice(consultPrice);
            purchaseApplyDetailPo.setbId("-1");
            purchaseApplyDetailV1InnerServiceSMOImpl.savePurchaseApplyDetail(purchaseApplyDetailPo);
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-store/src/main/java/com/java110/store/cmd/resourceStore/ListResourceStoreUseRecordCmd.java
@@ -27,13 +27,14 @@
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import com.java110.dto.resource.ResourceStoreUseRecordDto;
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;
/**
 * 类表述:查询
@@ -48,13 +49,13 @@
@Java110Cmd(serviceCode = "resourceStore.listResourceStoreUseRecords")
public class ListResourceStoreUseRecordCmd extends Cmd {
  private static Logger logger = LoggerFactory.getLogger(ListResourceStoreUseRecordCmd.class);
    private static Logger logger = LoggerFactory.getLogger(ListResourceStoreUseRecordCmd.class);
    @Autowired
    private IResourceStoreUseRecordV1InnerServiceSMO resourceStoreUseRecordV1InnerServiceSMOImpl;
    @Autowired
    private IResourceStoreUseRecordInnerServiceSMO resourceStoreUseRecordInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java
@@ -12,7 +12,6 @@
import com.java110.dto.oaWorkflow.OaWorkflowDto;
import com.java110.dto.purchase.AllocationStorehouseDto;
import com.java110.dto.purchase.AllocationStorehouseApplyDto;
import com.java110.dto.purchase.PurchaseApplyDto;
import com.java110.dto.resource.ResourceStoreDto;
import com.java110.dto.resource.ResourceStoreTimesDto;
import com.java110.dto.store.StorehouseDto;
@@ -32,7 +31,6 @@
import com.java110.utils.exception.CmdException;
import com.java110.utils.lock.DistributedLock;
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;
@@ -76,7 +74,6 @@
    @Autowired
    private IResourceStoreTimesV1InnerServiceSMO resourceStoreTimesV1InnerServiceSMOImpl;
    @Autowired
    private IStorehouseV1InnerServiceSMO storehouseV1InnerServiceSMOImpl;
@@ -111,19 +108,15 @@
            validateResoureStore(reqJson, resourceStores, applyType, resIndex);
        }
        reqJson.put("resourceStores", resourceStores);
        //todo 查询仓库是否存在
        StorehouseDto storehouseDto = new StorehouseDto();
        storehouseDto.setShId(reqJson.getString("shId"));
        List<StorehouseDto> storehouseDtos = storehouseV1InnerServiceSMOImpl.queryStorehouses(storehouseDto);
        Assert.listOnlyOne(storehouseDtos, "仓库不存在");
        if (!StorehouseDto.SWITCH_ON.equals(storehouseDtos.get(0).getAllocationSwitch())) {
            return;
        }
        String storeId = CmdContextUtils.getStoreId(cmdDataFlowContext);
        OaWorkflowDto oaWorkflowDto = new OaWorkflowDto();
        oaWorkflowDto.setStoreId(storeId);
        oaWorkflowDto.setFlowId(storehouseDtos.get(0).getAllocationFlowId());
@@ -132,7 +125,6 @@
        if (!OaWorkflowDto.STATE_COMPLAINT.equals(oaWorkflowDtos.get(0).getState())) {
            throw new IllegalArgumentException(oaWorkflowDtos.get(0).getFlowName() + "流程未部署");
        }
        if (StringUtil.isEmpty(oaWorkflowDtos.get(0).getProcessDefinitionKey())) {
            throw new IllegalArgumentException(oaWorkflowDtos.get(0).getFlowName() + "流程未部署");
        }
@@ -163,7 +155,6 @@
            }
            resourceStores.getJSONObject(resIndex).put("resName", resourceStoreDtos.get(0).getResName());
            resourceStores.getJSONObject(resIndex).put("stockA", stockA);
        } else if (AllocationStorehouseApplyDto.STORE_TYPE_RETURN.equals(applyType)) { //返还
            UserStorehouseDto userStorehouseDto = new UserStorehouseDto();
            userStorehouseDto.setResId(resourceStores.getJSONObject(resIndex).getString("resId"));
@@ -201,16 +192,12 @@
        int flag = 0;
        //获取调拨返还状态标识
        String applyType = reqJson.getString("apply_type");
        // 查询用户名称
        UserDto userDto = new UserDto();
        userDto.setUserId(reqJson.getString("userId"));
        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
        Assert.listOnlyOne(userDtos, "用户不存在");
        reqJson.put("userName", userDtos.get(0).getName());
        //封装调拨对象
        AllocationStorehouseApplyPo allocationStorehouseApplyPo = covertAllocationStorehouseApply(reqJson);
        //todo 默认写0 后面 相加
@@ -231,13 +218,11 @@
        if (flag < 1) {
            throw new CmdException("保存修改物品失败");
        }
        if (!AllocationStorehouseApplyDto.STORE_TYPE_ALLOCATION.equals(applyType)) {
            return;
        }
        // todo 开启流程
        toStartWorkflow(allocationStorehouseApplyPo, reqJson);
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
@@ -247,24 +232,20 @@
     * @param allocationStorehouseApplyPo
     */
    private void toStartWorkflow(AllocationStorehouseApplyPo allocationStorehouseApplyPo, JSONObject reqJson) {
        //todo 查询仓库是否存在
        StorehouseDto storehouseDto = new StorehouseDto();
        storehouseDto.setShId(reqJson.getString("shId"));
        List<StorehouseDto> storehouseDtos = storehouseV1InnerServiceSMOImpl.queryStorehouses(storehouseDto);
        Assert.listOnlyOne(storehouseDtos, "仓库不存在");
        if (!StorehouseDto.SWITCH_ON.equals(storehouseDtos.get(0).getAllocationSwitch())) {
            //todo 直接调拨
            toAllocationStorehouse(allocationStorehouseApplyPo, storehouseDto, reqJson);
            return;
        }
        OaWorkflowDto oaWorkflowDto = new OaWorkflowDto();
        oaWorkflowDto.setStoreId(allocationStorehouseApplyPo.getStoreId());
        oaWorkflowDto.setFlowId(storehouseDtos.get(0).getAllocationFlowId());
        List<OaWorkflowDto> oaWorkflowDtos = oaWorkflowInnerServiceSMOImpl.queryOaWorkflows(oaWorkflowDto);
        //todo 提交审核
        JSONObject flowJson = new JSONObject();
        flowJson.put("processDefinitionKey", oaWorkflowDtos.get(0).getProcessDefinitionKey());
@@ -275,13 +256,16 @@
        flowJson.put("storeId", allocationStorehouseApplyPo.getStoreId());
        reqJson.put("processDefinitionKey", oaWorkflowDtos.get(0).getProcessDefinitionKey());
        JSONObject result = oaWorkflowActivitiInnerServiceSMOImpl.startProcess(flowJson);
        JSONObject audit = reqJson.getJSONObject("audit");
        String nextUserId = "-1";
        if (audit != null) {
            nextUserId = reqJson.getJSONObject("audit").getString("staffId");
            String staffId = reqJson.getJSONObject("audit").getString("staffId");
            if (!StringUtil.isEmpty(staffId)) {
                nextUserId = reqJson.getJSONObject("audit").getString("staffId");
            } else {
                nextUserId = reqJson.getJSONObject("audit").getString("assignee");
            }
        }
        //提交者提交
        flowJson = new JSONObject();
        flowJson.put("processInstanceId", result.getString("processInstanceId"));
@@ -290,10 +274,7 @@
        flowJson.put("storeId", allocationStorehouseApplyPo.getStoreId());
        flowJson.put("id", allocationStorehouseApplyPo.getApplyId());
        flowJson.put("flowId", oaWorkflowDtos.get(0).getFlowId());
        oaWorkflowActivitiInnerServiceSMOImpl.autoFinishFirstTask(flowJson);
    }
    /**
@@ -304,22 +285,18 @@
     * @param reqJson
     */
    private void toAllocationStorehouse(AllocationStorehouseApplyPo allocationStorehouseApplyPo, StorehouseDto storehouseDto, JSONObject reqJson) {
        //查询调拨记录
        AllocationStorehouseDto allocationStorehouseDto = new AllocationStorehouseDto();
        allocationStorehouseDto.setApplyId(allocationStorehouseApplyPo.getApplyId());
        List<AllocationStorehouseDto> allocationStorehouseDtos = allocationStorehouseV1InnerServiceSMOImpl.queryAllocationStorehouses(allocationStorehouseDto);
        if (allocationStorehouseDtos == null || allocationStorehouseDtos.size() < 1) {
            return;
        }
        for (AllocationStorehouseDto tmpAllocationStorehouseDto : allocationStorehouseDtos) {
            int allocationStock = Integer.parseInt(tmpAllocationStorehouseDto.getStock());
            //todo 每条记录调拨
            allocationBMOImpl.doToAllocationStorehouse(tmpAllocationStorehouseDto, allocationStock);
        }
        String applyId = allocationStorehouseApplyPo.getApplyId();
        AllocationStorehouseApplyPo tmpAllocationStorehouseApplyPo = new AllocationStorehouseApplyPo();
        tmpAllocationStorehouseApplyPo.setApplyId(applyId);
@@ -450,7 +427,6 @@
                ResourceStoreTimesDto resourceStoreTimesDto = new ResourceStoreTimesDto();
                resourceStoreTimesDto.setTimesId(resObj.getString("timesId"));
                List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
                ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
                resourceStoreTimesPo.setApplyOrderId(GenerateCodeFactory.getGeneratorId("10"));
                resourceStoreTimesPo.setPrice(resourceStoreTimesDtos.get(0).getPrice());
@@ -515,7 +491,6 @@
            ResourceStoreTimesDto resourceStoreTimesDto = new ResourceStoreTimesDto();
            resourceStoreTimesDto.setTimesId(resObj.getString("timesId"));
            List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
            ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
            resourceStoreTimesPo.setApplyOrderId(GenerateCodeFactory.getGeneratorId("10"));
            resourceStoreTimesPo.setPrice(resourceStoreTimesDtos.get(0).getPrice());
@@ -562,7 +537,6 @@
            BigDecimal curStockNew = new BigDecimal(resObj.getString("curStock"));
            BigDecimal curStock = miniUnitStock.multiply(curStockNew); //当前调拨的最小计量总数
            BigDecimal newMiniStock = miniStock.subtract(curStock); //调拨后剩余的最小计量总数
            resourceStorePo.setMiniStock(String.valueOf(newMiniStock));
            flag = resourceStoreV1InnerServiceSMOImpl.updateResourceStore(resourceStorePo);
            if (flag < 1) {
@@ -573,7 +547,6 @@
            allocationStorehouseApplyPo.setApplyCount(oldCurStore.toString());
            //加入 从库存中扣减
            subResourceStoreTimesStock(resObj);
        } finally {
            DistributedLock.releaseDistributedLock(requestId, key);
        }
@@ -602,11 +575,9 @@
        allocationStorehousePo.setStartUserName(reqJson.getString("userName"));
        allocationStorehousePo.setTimesId(resObj.getString("timesId"));
        int flag = allocationStorehouseV1InnerServiceSMOImpl.saveAllocationStorehouse(allocationStorehousePo);
        if (flag < 1) {
            throw new CmdException("保存调拨物品失败");
        }
        int applyCount = Integer.parseInt(allocationStorehouseApplyPo.getApplyCount());
        applyCount += resObj.getIntValue("curStock");
        allocationStorehouseApplyPo.setApplyCount(applyCount + "");
@@ -619,7 +590,6 @@
     * @return
     */
    private AllocationStorehouseApplyPo covertAllocationStorehouseApply(JSONObject reqJson) {
        AllocationStorehouseApplyPo allocationStorehouseApplyPo = new AllocationStorehouseApplyPo();
        allocationStorehouseApplyPo.setApplyId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyId));
        allocationStorehouseApplyPo.setApplyCount("0");
@@ -636,7 +606,6 @@
        allocationStorehouseApplyPo.setCommunityId(reqJson.getString("communityId"));
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        allocationStorehouseApplyPo.setCreateTime(format.format(new Date()));
        return allocationStorehouseApplyPo;
    }
@@ -651,19 +620,16 @@
        resourceStoreTimesDto.setResCode(resObj.getString("resCode"));
        resourceStoreTimesDto.setTimesId(resObj.getString("timesId"));
        List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
        if (resourceStoreTimesDtos == null || resourceStoreTimesDtos.size() < 1) {
            return;
        }
        int stock = 0;
        int quantity = Integer.parseInt(applyQuantity);
        ResourceStoreTimesPo resourceStoreTimesPo = null;
        stock = Integer.parseInt(resourceStoreTimesDtos.get(0).getStock());
        if (stock < quantity) {
            throw new CmdException(resourceStoreTimesDtos.get(0).getResCode() + "价格为:" + resourceStoreTimesDtos.get(0).getPrice() + "的库存" + resourceStoreTimesDtos.get(0).getStock() + ",库存不足");
        }
        stock = stock - quantity;
        resourceStoreTimesPo = new ResourceStoreTimesPo();
        resourceStoreTimesPo.setTimesId(resourceStoreTimesDtos.get(0).getTimesId());
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/SaveResourceSupplierCmd.java
@@ -57,39 +57,36 @@
        Assert.hasKeyAndValue(reqJson, "supplierName", "请求报文中未包含supplierName");
        Assert.hasKeyAndValue(reqJson, "address", "请求报文中未包含address");
        Assert.hasKeyAndValue(reqJson, "tel", "请求报文中未包含tel");
        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
        String regex = "1[3-9]\\d{9}";
        String regex2 = "0\\d{2,3}-?[1-9]\\d{4,9}";
        String tel = reqJson.getString("tel"); //获取手机号
        if (!tel.matches(regex) && !tel.matches(regex2)) {
            throw new IllegalArgumentException("供应商联系方式格式不对!");
        }
        if (!reqJson.containsKey("storeId")) {
            String storeId =cmdDataFlowContext.getReqHeaders().get("store-id");
            String storeId = cmdDataFlowContext.getReqHeaders().get("store-id");
            reqJson.put("storeId", storeId);
        }
        if (!reqJson.containsKey("userId")) {
            reqJson.put("userId", "-1");
        }
        if (!reqJson.containsKey("userName")) {
            reqJson.put("userName", "未知");
        }
        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        reqJson.put("createUserId", reqJson.getString("userId"));
        reqJson.put("createUserName", reqJson.getString("userName"));
        ResourceSupplierPo resourceSupplierPo = BeanConvertUtil.covertBean(reqJson, ResourceSupplierPo.class);
        resourceSupplierPo.setRsId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
        int flag = resourceSupplierV1InnerServiceSMOImpl.saveResourceSupplier(resourceSupplierPo);
        if (flag < 1) {
            throw new CmdException("保存数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/UpdateResourceSupplierCmd.java
@@ -31,7 +31,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:更新
 * 服务编码:resourceSupplier.updateResourceSupplier
@@ -47,7 +46,6 @@
  private static Logger logger = LoggerFactory.getLogger(UpdateResourceSupplierCmd.class);
    @Autowired
    private IResourceSupplierV1InnerServiceSMO resourceSupplierV1InnerServiceSMOImpl;
@@ -57,6 +55,13 @@
        Assert.hasKeyAndValue(reqJson, "supplierName", "请求报文中未包含supplierName");
        Assert.hasKeyAndValue(reqJson, "address", "请求报文中未包含address");
        Assert.hasKeyAndValue(reqJson, "tel", "请求报文中未包含tel");
        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
        String regex = "1[3-9]\\d{9}";
        String regex2 = "0\\d{2,3}-?[1-9]\\d{4,9}";
        String tel = reqJson.getString("tel"); //获取手机号
        if (!tel.matches(regex) && !tel.matches(regex2)) {
            throw new IllegalArgumentException("供应商联系方式格式不对!");
        }
        if (!reqJson.containsKey("storeId")) {
            String storeId = cmdDataFlowContext.getReqHeaders().get("store-id");
            reqJson.put("storeId", storeId);
@@ -64,26 +69,19 @@
        if (!reqJson.containsKey("userId")) {
            reqJson.put("userId", "-1");
        }
        if (!reqJson.containsKey("userName")) {
            reqJson.put("userName", "未知");
        }
        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
       ResourceSupplierPo resourceSupplierPo = BeanConvertUtil.covertBean(reqJson, ResourceSupplierPo.class);
        int flag = resourceSupplierV1InnerServiceSMOImpl.updateResourceSupplier(resourceSupplierPo);
        if (flag < 1) {
            throw new CmdException("更新数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-store/src/main/java/com/java110/store/smo/impl/ResourceStoreTimesV1InnerServiceSMOImpl.java
@@ -65,6 +65,7 @@
        resourceStoreTimesDto.setPrice(resourceStoreTimesPo.getPrice());
        resourceStoreTimesDto.setResCode(resourceStoreTimesPo.getResCode());
        resourceStoreTimesDto.setShId(resourceStoreTimesPo.getShId());
        resourceStoreTimesDto.setCommunityId(resourceStoreTimesPo.getCommunityId());
        List<ResourceStoreTimesDto> resourceStoreTimesDtos = queryResourceStoreTimess(resourceStoreTimesDto);
        if (resourceStoreTimesDtos == null || resourceStoreTimesDtos.size() < 1) {
            resourceStoreTimesPo.setTimesId(GenerateCodeFactory.getGeneratorId("11"));
service-user/src/main/java/com/java110/user/cmd/owner/QueryOwnerMembersCmd.java
@@ -41,14 +41,12 @@
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求中未包含communityId信息");
        // Assert.jsonObjectHaveKey(reqJson, "ownerTypeCd", "请求中未包含ownerTypeCd信息");
        if(!reqJson.containsKey("page")){
            reqJson.put("page",1);
        if (!reqJson.containsKey("page")) {
            reqJson.put("page", 1);
        }
        if(!reqJson.containsKey("row")){
            reqJson.put("row",10);
        if (!reqJson.containsKey("row")) {
            reqJson.put("row", 10);
        }
    }
    @Override
@@ -64,7 +62,7 @@
        List<OwnerDto> ownerDtoList = null;
        if (total > 0) {
            ownerDtoList = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
        }else {
        } else {
            ownerDtoList = new ArrayList<>();
        }
        //查询是否有脱敏权限
@@ -91,7 +89,7 @@
            FileRelDto fileRelDto = new FileRelDto();
            fileRelDto.setObjId(ownerdto.getMemberId());
            List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto);
            if(fileRelDtos != null && fileRelDtos.size() > 0){
            if (fileRelDtos != null && fileRelDtos.size() > 0) {
                ownerdto.setUrl(fileRelDtos.get(0).getFileSaveName());
            }
        }
service-user/src/main/java/com/java110/user/cmd/question/ListQuestionAnswerCmd.java
@@ -20,10 +20,7 @@
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.questionTitleValue.QuestionTitleValueDto;
import com.java110.intf.user.IQuestionAnswerV1InnerServiceSMO;
import com.java110.intf.user.IQuestionTitleV1InnerServiceSMO;
import com.java110.intf.user.IQuestionTitleValueV1InnerServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
@@ -39,7 +36,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:查询
 * 服务编码:questionAnswer.listQuestionAnswer
@@ -54,15 +50,9 @@
public class ListQuestionAnswerCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(ListQuestionAnswerCmd.class);
    @Autowired
    private IQuestionAnswerV1InnerServiceSMO questionAnswerV1InnerServiceSMOImpl;
    @Autowired
    private IQuestionTitleV1InnerServiceSMO questionTitleV1InnerServiceSMOImpl;
    @Autowired
    private IQuestionTitleValueV1InnerServiceSMO questionTitleValueV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
@@ -88,7 +78,6 @@
        //todo 查询已投票数据和 得分
        computeVotedCountAndScore(questionAnswerDtos);
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, questionAnswerDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
@@ -102,7 +91,6 @@
     * @param questionAnswerDtos
     */
    private void computeVotedCountAndScore(List<QuestionAnswerDto> questionAnswerDtos) {
        if (questionAnswerDtos == null || questionAnswerDtos.size() < 1) {
            return;
        }
@@ -110,24 +98,19 @@
        for (QuestionAnswerDto questionAnswerDto : questionAnswerDtos) {
            qaIds.add(questionAnswerDto.getQaId());
        }
        // todo 查询投票人数和得分
        List<QuestionAnswerDto> votedQAs = questionAnswerV1InnerServiceSMOImpl.queryVotedCountAndScore(qaIds.toArray(new String[qaIds.size()]));
        if (votedQAs == null || votedQAs.size() < 1) {
            return;
        }
        for(QuestionAnswerDto questionAnswerDto:questionAnswerDtos){
            for(QuestionAnswerDto votedQa : votedQAs){
                if(!questionAnswerDto.getQaId().equals(votedQa.getQaId())){
        for (QuestionAnswerDto questionAnswerDto : questionAnswerDtos) {
            for (QuestionAnswerDto votedQa : votedQAs) {
                if (!questionAnswerDto.getQaId().equals(votedQa.getQaId())) {
                    continue;
                }
                questionAnswerDto.setVotedCount(votedQa.getVotedCount());
                questionAnswerDto.setScore(votedQa.getScore());
            }
        }
    }
}
service-user/src/main/java/com/java110/user/cmd/question/ListQuestionTitleCmd.java
@@ -40,7 +40,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:查询
 * 服务编码:questionTitle.listQuestionTitle
@@ -55,6 +54,7 @@
public class ListQuestionTitleCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(ListQuestionTitleCmd.class);
    @Autowired
    private IQuestionTitleV1InnerServiceSMO questionTitleV1InnerServiceSMOImpl;
@@ -65,12 +65,10 @@
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        super.validatePageInfo(reqJson);
        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        QuestionTitleDto questionTitleDto = BeanConvertUtil.covertBean(reqJson, QuestionTitleDto.class);
        int count = questionTitleV1InnerServiceSMOImpl.queryQuestionTitlesCount(questionTitleDto);
@@ -79,7 +77,6 @@
        if (count > 0) {
            questionTitleDtos = questionTitleV1InnerServiceSMOImpl.queryQuestionTitles(questionTitleDto);
            refreshTitileValues(questionTitleDtos);
        } else {
            questionTitleDtos = new ArrayList<>();
@@ -93,7 +90,6 @@
    }
    private void refreshTitileValues(List<QuestionTitleDto> questionTitleDtos) {
        if (questionTitleDtos == null || questionTitleDtos.size() < 1) {
            return;
        }
@@ -119,7 +115,5 @@
            }
            questionTitle.setTitleValues(tmpQuestionTitleValueDtos);
        }
    }
}
service-user/src/main/java/com/java110/user/cmd/question/SaveOwnerVoteCmd.java
@@ -22,6 +22,7 @@
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;
@@ -116,6 +117,13 @@
        questionAnswerPo.setCommunityId(reqJson.getString("communityId"));
        questionAnswerPo.setQaType(QuestionAnswerDto.QA_TYPE_VOTE);
        questionAnswerPo.setState(QuestionAnswerDto.STATE_WAIT);
        if (!StringUtil.isEmpty(reqJson.getString("communityId"))) {
            questionAnswerPo.setObjType("3306"); //3306 是小区,3307 是商户
            questionAnswerPo.setObjId(reqJson.getString("communityId"));
        } else if (!StringUtil.isEmpty(reqJson.getString("storeId"))) {
            questionAnswerPo.setObjType("3307"); //3306 是小区,3307 是商户
            questionAnswerPo.setObjId(reqJson.getString("storeId"));
        }
        questionAnswerV1InnerServiceSMOImpl.saveQuestionAnswer(questionAnswerPo);
        QuestionAnswerTitleRelPo questionAnswerTitleRelPo = new QuestionAnswerTitleRelPo();
@@ -127,6 +135,6 @@
        questionAnswerTitleRelPo.setQatrId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
        questionAnswerTitleRelV1InnerServiceSMOImpl.saveQuestionAnswerTitleRel(questionAnswerTitleRelPo);
        questionAnswerBMOImpl.saveUserQuestionAnswer(questionAnswerPo,reqJson.getJSONArray("roomIds"));
        questionAnswerBMOImpl.saveUserQuestionAnswer(questionAnswerPo, reqJson.getJSONArray("roomIds"));
    }
}
service-user/src/main/java/com/java110/user/cmd/question/SaveQuestionAnswerCmd.java
@@ -31,7 +31,7 @@
import com.java110.user.bmo.question.IQuestionAnswerBMO;
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;
@@ -70,20 +70,17 @@
        Assert.hasKey(reqJson, "roomIds", "请求报文中未包含投票房屋");
        Assert.hasKeyAndValue(reqJson, "startTime", "未包含开始时间");
        Assert.hasKeyAndValue(reqJson, "endTime", "未包含结束时间");
        Assert.hasKeyAndValue(reqJson, "content", "未包含说明");
        Assert.hasKeyAndValue(reqJson, "content", "未包含调研说明");
        Assert.hasKey(reqJson, "questionTitles", "请求报文中未包含题目");
        JSONArray questionTitles = reqJson.getJSONArray("questionTitles");
        if (questionTitles == null || questionTitles.size() < 1) {
            throw new IllegalArgumentException("未包含题目");
        }
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        //todo 写入投票信息
        QuestionAnswerPo questionAnswerPo = new QuestionAnswerPo();
        questionAnswerPo.setContent(reqJson.getString("content"));
@@ -94,30 +91,34 @@
        questionAnswerPo.setCommunityId(reqJson.getString("communityId"));
        questionAnswerPo.setQaType(QuestionAnswerDto.QA_TYPE_QUESTION);
        questionAnswerPo.setState(QuestionAnswerDto.STATE_WAIT);
        if (!StringUtil.isEmpty(reqJson.getString("communityId"))) {
            questionAnswerPo.setObjType("3306"); //3306 是小区,3307 是商户
            questionAnswerPo.setObjId(reqJson.getString("communityId"));
        } else if (!StringUtil.isEmpty(reqJson.getString("storeId"))) {
            questionAnswerPo.setObjType("3307"); //3306 是小区,3307 是商户
            questionAnswerPo.setObjId(reqJson.getString("storeId"));
        }
        int flag = questionAnswerV1InnerServiceSMOImpl.saveQuestionAnswer(questionAnswerPo);
        if (flag < 1) {
            throw new CmdException("保存数据失败");
        }
        JSONArray questionTitles = reqJson.getJSONArray("questionTitles");
        JSONObject title = null;
        for (int titleIndex = 0; titleIndex < questionTitles.size(); titleIndex++) {
            title= questionTitles.getJSONObject(titleIndex);
            title = questionTitles.getJSONObject(titleIndex);
            QuestionAnswerTitleRelPo questionAnswerTitleRelPo = new QuestionAnswerTitleRelPo();
            questionAnswerTitleRelPo.setCommunityId(reqJson.getString("communityId"));
            questionAnswerTitleRelPo.setTitleId(title.getString("titleId"));
            questionAnswerTitleRelPo.setSeq((titleIndex + 1) + "");
            questionAnswerTitleRelPo.setScore("0");
            if(title.containsKey("score")){
            if (title.containsKey("score")) {
                questionAnswerTitleRelPo.setScore(title.getString("score"));
            }
            questionAnswerTitleRelPo.setQaId(questionAnswerPo.getQaId());
            questionAnswerTitleRelPo.setQatrId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
            questionAnswerTitleRelV1InnerServiceSMOImpl.saveQuestionAnswerTitleRel(questionAnswerTitleRelPo);
        }
        questionAnswerBMOImpl.saveUserQuestionAnswer(questionAnswerPo, reqJson.getJSONArray("roomIds"));
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-user/src/main/java/com/java110/user/cmd/question/UpdateQuestionAnswerCmd.java
@@ -74,7 +74,7 @@
        Assert.hasKeyAndValue(reqJson, "qaId", "请求报文中未包含题目");
        Assert.hasKeyAndValue(reqJson, "startTime", "未包含开始时间");
        Assert.hasKeyAndValue(reqJson, "endTime", "未包含结束时间");
        Assert.hasKeyAndValue(reqJson, "content", "未包含说明");
        Assert.hasKeyAndValue(reqJson, "content", "未包含调研说明");
        Assert.hasKey(reqJson, "questionTitles", "请求报文中未包含题目");
        JSONArray questionTitles = reqJson.getJSONArray("questionTitles");