chengf
2025-08-18 eb0d880929fccd4998d6b9836077961d1f975fea
暂存0815
18个文件已修改
7个文件已添加
554 ■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/fee/FeeDetailDto.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/fee/FeeReceiptDto.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertHistoryDto.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/user/LoginOwnerResDto.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/user/UserDto.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/FeeQueryParams.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/FeeDetailServiceDaoImplMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/ReportFeeServiceDaoImplMapper.xml 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/fee/IReportFeeInnerServiceSMO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/smo/impl/SmallProgramAdvertServiceSMOImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/api/FeeApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/bmo/feeReceipt/impl/GetFeeReceiptBMOImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/fee/QueryFeeDetailCmd.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/dao/IReportFeeServiceDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/dao/impl/IReportFeeServiceDaoImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/smo/impl/ReportFeeInnerServiceSMOImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/login/PhoneWechatLoginCmd.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/owner/AppUserBindingOwnerCmd.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/owner/OwnerRegisterCmd.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/user/OwnerUserLoginCmd.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/user/UserLoginCmd.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot/src/main/resources/application-debug.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/fee/FeeDetailDto.java
@@ -57,7 +57,7 @@
    private Date createTime;
    private Date startTime;
    private Date endTime;
    private String contractFee;
    private String statusCd = "0";
    private String state;
    private String stateName;
@@ -506,4 +506,12 @@
    public void setTransferorName(String transferorName) {
        this.transferorName = transferorName;
    }
    public String getContractFee() {
        return contractFee;
    }
    public void setContractFee(String contractFee) {
        this.contractFee = contractFee;
    }
}
java110-bean/src/main/java/com/java110/dto/fee/FeeReceiptDto.java
@@ -53,6 +53,50 @@
    private String receiptCode;
    //小区名称
    private String communityName;
    //物业公章
    private String officialSeal;
    //财务记账员
    private String FinancialAccountant;
    //财务收款员
    private String FinancialCashier;
    public String getCommunityName() {
        return communityName;
    }
    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }
    public String getOfficialSeal() {
        return officialSeal;
    }
    public void setOfficialSeal(String officialSeal) {
        this.officialSeal = officialSeal;
    }
    public String getFinancialAccountant() {
        return FinancialAccountant;
    }
    public void setFinancialAccountant(String financialAccountant) {
        FinancialAccountant = financialAccountant;
    }
    public String getFinancialCashier() {
        return FinancialCashier;
    }
    public void setFinancialCashier(String financialCashier) {
        FinancialCashier = financialCashier;
    }
    public String getAmount() {
        return amount;
    }
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertHistoryDto.java
@@ -38,6 +38,19 @@
     */
    private String operateUserId;
    /**
     * 操作者姓名
     */
    private String operateUserName;
    public String getOperateUserName() {
        return operateUserName;
    }
    public void setOperateUserName(String operateUserName) {
        this.operateUserName = operateUserName;
    }
    public String getId() {
        return id;
    }
java110-bean/src/main/java/com/java110/dto/user/LoginOwnerResDto.java
@@ -36,6 +36,17 @@
    private String communityQrCode;
    //认证状态 10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
    private String auditState;
    public String getAuditState() {
        return auditState;
    }
    public void setAuditState(String auditState) {
        this.auditState = auditState;
    }
    public String getUserId() {
        return userId;
java110-bean/src/main/java/com/java110/dto/user/UserDto.java
@@ -104,7 +104,16 @@
    private String storeTypeCd;
    //认证状态 10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
    private String auditState;
    public String getAuditState() {
        return auditState;
    }
    public void setAuditState(String auditState) {
        this.auditState = auditState;
    }
    public String getUserId() {
        return userId;
java110-bean/src/main/java/com/java110/vo/FeeQueryParams.java
New file
@@ -0,0 +1,33 @@
package com.java110.vo;
public class FeeQueryParams {
    private String communityId;
    private Integer startYear;
    private Integer endYear;
    // getters and setters
    public String getCommunityId() {
        return communityId;
    }
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    public Integer getStartYear() {
        return startYear;
    }
    public void setStartYear(Integer startYear) {
        this.startYear = startYear;
    }
    public Integer getEndYear() {
        return endYear;
    }
    public void setEndYear(Integer endYear) {
        this.endYear = endYear;
    }
}
java110-db/src/main/resources/mapper/fee/FeeDetailServiceDaoImplMapper.xml
@@ -122,7 +122,7 @@
        importFeeName,pfc.fee_name feeName,t.payable_amount,t.payable_amount payableAmount,
        mw.cur_degrees curDegrees,mw.pre_degrees preDegrees, mw.pre_reading_time preReadingTime,mw.cur_reading_time
        curReadingTime,t.pay_order_id payOrderId,pfc.config_id configId,td.`name` primeRateName,pfao1.`value`
        payerObjName,
        payerObjName,pf.contract_fee,pf.contract_fee contractFee
        t.cashier_id cashierId,t.cashier_name cashierName,pfc.fee_flag feeFlag,fr.receipt_code
        receiptCode,t.open_invoice openInvoice,t.acct_amount acctAmount,t.discount_amount discountAmount,t.deduction_amount deductionAmount,
        t.late_amount lateAmount,t.gift_amount giftAmount,t.invoice_no invoiceNo,t.transferor_name transferorName
@@ -152,6 +152,9 @@
        </if>
        <if test="ownerId != null and ownerId != ''">
            and pfao.value = #{ownerId}
        </if>
        <if test="contractFee !=null and contractFee != ''">
            and pf.contract_fee= #{contractFee}
        </if>
        <if test="primeRate !=null and primeRate != ''">
            and t.prime_rate= #{primeRate}
@@ -297,6 +300,9 @@
        <if test="detailId !=null and detailId != ''">
            and t.detail_id= #{detailId}
        </if>
        <if test="contractFee !=null and contractFee != ''">
            and t.contract_fee= #{contractFee}
        </if>
        <if test="detailIds !=null ">
            and t.detail_id in
            <foreach collection="detailIds" item="item" open="(" close=")" separator=",">
java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
@@ -203,7 +203,7 @@
            and t.fee_id= #{feeId}
        </if>
        <if test="payerObjId !=null and payerObjId != ''">
            and t.payer_obj_id= #{payerObjId}
            and (t.payer_obj_id= #{payerObjId} or t.contract_fee = #{payerObjId})
        </if>
        <if test="payerObjIds != null and payerObjIds.length > 0">
            and t.payer_obj_id in
java110-db/src/main/resources/mapper/fee/ReportFeeServiceDaoImplMapper.xml
New file
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="reportFeeServiceDaoImpl">
    <select id="repostInFee" resultType="java.util.Map">
        SELECT
        pfd.community_id as communityId,
        td.name AS feeTypeName,
        pf.fee_type_cd AS feeTypeCode,
        <foreach collection="yearList" item="year" separator=",">
            SUM(
            CASE
            WHEN pfd.start_time &lt; #{year}+1 AND pfd.end_time &gt;= #{year}
            THEN pfd.received_amount *
            DATEDIFF(
            LEAST(pfd.end_time, #{year}-12-31),
            GREATEST(pfd.start_time, #{year}-01-01)
            ) / DATEDIFF(pfd.end_time, pfd.start_time)
            ELSE 0
            END
            ) AS 'amount${year}'
        </foreach>
        SUM(pfd.received_amount) AS totalAmount
        FROM
        pay_fee_detail pfd
        LEFT JOIN pay_fee pf ON pf.fee_id = pfd.fee_id
        LEFT JOIN t_dict td ON td.table_name = "pay_fee_config"
        AND td.table_columns = "fee_type_cd"
        AND td.status_cd = pf.fee_type_cd
        WHERE
        pfd.status_cd = '0' AND
        pfd.community_id = #{params.communityId}
        AND (
        <foreach collection="yearList" item="year" separator="OR">
            (pfd.start_time &lt; #{year}+1 AND pfd.end_time &gt;= #{year})
        </foreach>
        )
        GROUP BY
        td.name, pf.fee_type_cd, pfd.community_id
        ORDER BY
        td.name
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/fee/IReportFeeInnerServiceSMO.java
New file
@@ -0,0 +1,18 @@
package com.java110.intf.fee;
import com.java110.config.feign.FeignConfiguration;
import com.java110.dto.fee.TempCarFeeConfigDto;
import com.java110.vo.FeeQueryParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
import java.util.Map;
@FeignClient(name = "fee-service", configuration = {FeignConfiguration.class})
@RequestMapping("/reportFeeMonthStatisticsApi")
public interface IReportFeeInnerServiceSMO {
    List<Map> repostPaidInFee(FeeQueryParams feeQueryParams);
}
service-common/src/main/java/com/java110/common/smo/impl/SmallProgramAdvertServiceSMOImpl.java
@@ -8,7 +8,9 @@
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.PageDto;
import com.java110.dto.smallProgramAdvert.*;
import com.java110.dto.user.UserDto;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.BusinessException;
import com.java110.utils.exception.DAOException;
@@ -42,6 +44,8 @@
    private ISmallProgramAdvertServiceDao smallProgramAdvertServiceDao;
    @Resource
    private ISmallProgramAdvertHistoryServiceDao smallProgramAdvertHistoryServiceDao;
    @Resource
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    @Override
    public ResultVo querySmallAdverts(QuertAdvertDto quertAdvertDto) {
@@ -66,6 +70,14 @@
            SmallProgramAdvertDto smallProgramAdvert = BeanConvertUtil.covertBean(map,SmallProgramAdvertDto.class);
            List<Map> historyMap = smallProgramAdvertHistoryServiceDao.querySmallProgramAdvertInfoList(smallProgramAdvert.getId());
            List<SmallProgramAdvertHistoryDto> historyList = BeanConvertUtil.covertBeanList(historyMap, SmallProgramAdvertHistoryDto.class);
            for(SmallProgramAdvertHistoryDto smallProgramAdvertHistoryDto : historyList){
                UserDto userDto = new UserDto();
                userDto.setUserId(smallProgramAdvertHistoryDto.getOperateUserId());
                List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto);
                if(!CollectionUtils.isEmpty(userDtos)){
                    smallProgramAdvertHistoryDto.setOperateUserName(userDtos.get(0).getName());
                }
            }
            smallProgramAdvert.setHistoryList(historyList);
            return smallProgramAdvert;
        }else{
service-fee/src/main/java/com/java110/fee/api/FeeApi.java
@@ -177,9 +177,9 @@
                                              @RequestParam(value = "ownerId", required = false) String ownerId,
                                              @RequestParam(value = "targetEndTime", required = false) String targetEndTime,
                                              @RequestParam(value = "communityId") String communityId) {
        if (StringUtil.isEmpty(payObjId) && StringUtil.isEmpty(ownerId)) {
            throw new IllegalArgumentException("费用对象或者业主不能都为空");
        }
//        if (StringUtil.isEmpty(payObjId) && StringUtil.isEmpty(ownerId)) {
//            throw new IllegalArgumentException("费用对象或者业主不能都为空");
//        }
        FeeDto feeDto = new FeeDto();
        if (!StringUtil.isEmpty(payObjId)) {
            if (payObjId.contains(",")) {
service-fee/src/main/java/com/java110/fee/bmo/feeReceipt/impl/GetFeeReceiptBMOImpl.java
@@ -1,5 +1,6 @@
package com.java110.fee.bmo.feeReceipt.impl;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.room.RoomDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.fee.FeeReceiptDto;
@@ -7,6 +8,7 @@
import com.java110.dto.owner.OwnerCarDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.fee.bmo.feeReceipt.IGetFeeReceiptBMO;
import com.java110.intf.community.ICommunityInnerServiceSMO;
import com.java110.intf.community.IRoomInnerServiceSMO;
import com.java110.intf.fee.IFeeReceiptInnerServiceSMO;
import com.java110.intf.user.IOwnerCarInnerServiceSMO;
@@ -18,6 +20,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
@@ -35,6 +38,8 @@
    @Autowired
    private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
    @Autowired
    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
    /**
     * @param feeReceiptDto
@@ -50,6 +55,16 @@
            feeReceiptDtos = feeReceiptInnerServiceSMOImpl.queryFeeReceipts(feeReceiptDto);
            for (FeeReceiptDto feeReceipt : feeReceiptDtos) {
                feeReceipt.setStoreName(feeReceiptDto.getStoreName());
                //查询小区名称
                CommunityDto communityDto = new CommunityDto();
                communityDto.setCommunityId(feeReceipt.getCommunityId());
                List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
                if(!CollectionUtils.isEmpty(communityDtos)){
                    feeReceipt.setCommunityName(communityDtos.get(0).getName());
                }
                feeReceipt.setOfficialSeal("");
                feeReceiptDto.setFinancialAccountant("");
                feeReceiptDto.setFinancialCashier("");
            }
            //输入房屋信息
            freshRoomInfo(feeReceiptDtos);
service-fee/src/main/java/com/java110/fee/cmd/fee/QueryFeeDetailCmd.java
@@ -64,7 +64,7 @@
        //查询总记录数
        ApiFeeDetailVo apiFeeDetailVo = new ApiFeeDetailVo();
        FeeDetailDto feeDetailDto = BeanConvertUtil.covertBean(reqJson, FeeDetailDto.class);
        feeDetailDto.setContractFee(reqJson.getString("contractId"));
        int total = feeDetailInnerServiceSMOImpl.queryFeeDetailsCount(feeDetailDto);
        apiFeeDetailVo.setTotal(total);
        if (total > 0) {
service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java
New file
@@ -0,0 +1,47 @@
package com.java110.fee.cmd.fee;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.community.CommunityDto;
import com.java110.intf.community.ICommunityInnerServiceSMO;
import com.java110.intf.fee.IReportFeeInnerServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.vo.FeeQueryParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
@Java110Cmd(serviceCode = "fee.reportFeeCmd")
public class ReportFeeCmd extends Cmd {
    @Autowired
    private IReportFeeInnerServiceSMO reportFeeInnerServiceSMOImpl;
    @Autowired
    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        Assert.hasKey(reqJson, "communityId", "请求报文中未包含小区编号");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        CommunityDto communityDto = new CommunityDto();
        communityDto.setCommunityId(reqJson.getString("communityId"));
        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
        FeeQueryParams feeQueryParams = new FeeQueryParams();
        feeQueryParams.setCommunityId(reqJson.getString("communityId"));
        feeQueryParams.setStartYear(communityDtos.get(0).getCreateTime().getYear());
        List<Map> result = reportFeeInnerServiceSMOImpl.repostPaidInFee(feeQueryParams);
        context.setResponseEntity(new ResponseEntity<>(result, HttpStatus.OK));
    }
}
service-fee/src/main/java/com/java110/fee/dao/IReportFeeServiceDao.java
New file
@@ -0,0 +1,11 @@
package com.java110.fee.dao;
import com.java110.vo.FeeQueryParams;
import org.springframework.http.ResponseEntity;
import java.util.List;
import java.util.Map;
public interface IReportFeeServiceDao {
    List<Map> repostPaidInFee(FeeQueryParams feeQueryParams);
}
service-fee/src/main/java/com/java110/fee/dao/impl/IReportFeeServiceDaoImpl.java
New file
@@ -0,0 +1,37 @@
package com.java110.fee.dao.impl;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.core.log.LoggerFactory;
import com.java110.fee.dao.IInitializePayFeeServiceDao;
import com.java110.fee.dao.IReportFeeServiceDao;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.FeeQueryParams;
import org.slf4j.Logger;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("iReportFeeServiceDaoImpl")
public class IReportFeeServiceDaoImpl extends BaseServiceDao implements IReportFeeServiceDao {
    private static Logger logger = LoggerFactory.getLogger(InitializePayFeeServiceDaoImpl.class);
    @Override
    public List<Map> repostPaidInFee(FeeQueryParams feeQueryParams) {
        List<Integer> yearList = new ArrayList<>();
        for (int year = feeQueryParams.getStartYear(); year <= feeQueryParams.getEndYear(); year++) {
            yearList.add(year);
        }
        Map<String, Object> params = new HashMap<>();
        params.put("communityId", feeQueryParams.getCommunityId());
        params.put("startYear", feeQueryParams.getStartYear());
        params.put("endYear", feeQueryParams.getEndYear());
        params.put("yearList", yearList);
        return sqlSessionTemplate.selectList("reportFeeServiceDaoImpl.repostInFee", params);
    }
}
service-fee/src/main/java/com/java110/fee/smo/impl/ReportFeeInnerServiceSMOImpl.java
New file
@@ -0,0 +1,27 @@
package com.java110.fee.smo.impl;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.dto.fee.TempCarFeeConfigDto;
import com.java110.fee.dao.IPrestoreFeeServiceDao;
import com.java110.fee.dao.IReportFeeServiceDao;
import com.java110.intf.fee.IPrestoreFeeInnerServiceSMO;
import com.java110.intf.fee.IReportFeeInnerServiceSMO;
import com.java110.vo.FeeQueryParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
public class ReportFeeInnerServiceSMOImpl extends BaseServiceSMO implements IReportFeeInnerServiceSMO {
    @Autowired
    private IReportFeeServiceDao iReportFeeServiceDao;
    @Override
    public List<Map> repostPaidInFee(FeeQueryParams feeQueryParams) {
        return iReportFeeServiceDao.repostPaidInFee(feeQueryParams);
    }
}
service-user/src/main/java/com/java110/user/cmd/login/PhoneWechatLoginCmd.java
@@ -39,6 +39,7 @@
import org.apache.commons.net.util.Base64;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
@@ -153,12 +154,14 @@
        ownerAppUserDto.setLink(userDtos.get(0).getTel());
        ownerAppUserDto.setState(OwnerAppUserDto.STATE_AUDIT_SUCCESS);
        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
        LoginOwnerResDto loginOwnerResDto = new LoginOwnerResDto();
        if (ListUtil.isNull(ownerAppUserDtos)) {
            autoBindUserToOwner(userDtos.get(0), phoneNumber);
            loginOwnerResDto.setAuditState(userDtos.get(0).getAuditState());
            communityId = smallWeChatDtos.get(0).getObjId();
        } else {
            communityId = ownerAppUserDtos.get(0).getCommunityId();
            loginOwnerResDto.setAuditState(ownerAppUserDtos.get(0).getState());
        }
        CommunityDto communityDto = new CommunityDto();
@@ -173,7 +176,7 @@
        //todo 生成登录token
        String token = generatorLoginToken(tmpUserDto);
        LoginOwnerResDto loginOwnerResDto = new LoginOwnerResDto();
        loginOwnerResDto.setCommunityId(communityDtos.get(0).getCommunityId());
        loginOwnerResDto.setCommunityName(communityDtos.get(0).getName());
@@ -188,40 +191,51 @@
    }
    private void autoBindUserToOwner(UserDto userDto, String phoneNumber) {
        // todo 查询业主或成员
        OwnerDto ownerDto = new OwnerDto();
        ownerDto.setLink(phoneNumber);
        ownerDto.setPage(1);
        ownerDto.setRow(1);
        List<OwnerDto> ownerDtos = ownerV1InnerServiceSMOImpl.queryOwners(ownerDto);
        //查询用户是否已经有认证状态记录
        //todo 查询业主是否 认证了,如果认证了获取小区ID
        OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
        ownerAppUserDto.setUserId(userDto.getUserId());
        ownerAppUserDto.setLink(userDto.getTel());
        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
        if(CollectionUtils.isEmpty(ownerAppUserDtos)){
            // todo 查询业主或成员
            OwnerDto ownerDto = new OwnerDto();
            ownerDto.setLink(phoneNumber);
            ownerDto.setPage(1);
            ownerDto.setRow(1);
            List<OwnerDto> ownerDtos = ownerV1InnerServiceSMOImpl.queryOwners(ownerDto);
        // 说明业主不存在 直接返回跑异常
        if (ListUtil.isNull(ownerDtos)) {
            return;
        }
        CommunityDto communityDto = new CommunityDto();
        communityDto.setCommunityId(ownerDtos.get(0).getCommunityId());
        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
        if (ListUtil.isNull(communityDtos)) {
            return;
        }
        CommunityDto tmpCommunityDto = communityDtos.get(0);
            // 说明业主不存在 直接返回跑异常
            if (ListUtil.isNull(ownerDtos)) {
                return;
            }
            CommunityDto communityDto = new CommunityDto();
            communityDto.setCommunityId(ownerDtos.get(0).getCommunityId());
            List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
            if (ListUtil.isNull(communityDtos)) {
                return;
            }
            CommunityDto tmpCommunityDto = communityDtos.get(0);
        OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo();
        //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
        ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT);
        ownerAppUserPo.setAppTypeCd("10010");
        ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId));
        ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId());
        ownerAppUserPo.setCommunityName(tmpCommunityDto.getName());
        ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId());
        ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName());
        ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard());
        ownerAppUserPo.setAppType("WECHAT");
        ownerAppUserPo.setLink(ownerDtos.get(0).getLink());
        ownerAppUserPo.setUserId(userDto.getUserId());
        ownerAppUserPo.setOpenId("-1");
        ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo);
            OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo();
            //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
            ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT);
            ownerAppUserPo.setAppTypeCd("10010");
            ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId));
            ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId());
            ownerAppUserPo.setCommunityName(tmpCommunityDto.getName());
            ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId());
            ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName());
            ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard());
            ownerAppUserPo.setAppType("WECHAT");
            ownerAppUserPo.setLink(ownerDtos.get(0).getLink());
            ownerAppUserPo.setUserId(userDto.getUserId());
            ownerAppUserPo.setOpenId("-1");
            ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo);
            userDto.setAuditState(ownerAppUserPo.getState());
        }else{
            userDto.setAuditState(ownerAppUserDtos.get(0).getState());
        }
    }
    private void registerUser(String phoneNumber) {
service-user/src/main/java/com/java110/user/cmd/owner/AppUserBindingOwnerCmd.java
@@ -94,7 +94,7 @@
        Assert.hasLength(openId, "该用户不是能力开放用户");
        OwnerAppUserDto ownerAppUserDto = BeanConvertUtil.covertBean(reqJson, OwnerAppUserDto.class);
        ownerAppUserDto.setStates(new String[]{"10000", "12000"});
        ownerAppUserDto.setStates(new String[]{"10000", "11000", "12000"});
        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
service-user/src/main/java/com/java110/user/cmd/owner/OwnerRegisterCmd.java
@@ -39,6 +39,7 @@
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.util.List;
@@ -165,6 +166,14 @@
        List<CommunityDto> communityDtos = null;
        for (OwnerDto tmpOwnerDto : ownerDtos) {
            //用userId和手机号查询绑定关系,没有则新增
            OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
            ownerAppUserDto.setLink(reqJson.getString("link"));
            ownerAppUserDto.setUserId(tmpOwnerDto.getUserId());
            List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
            if(!CollectionUtils.isEmpty(ownerAppUserDtos)){
                continue;
            }
            CommunityDto communityDto = new CommunityDto();
            communityDto.setState("1100");
            communityDto.setCommunityId(tmpOwnerDto.getCommunityId());
@@ -183,7 +192,7 @@
            ownerAppUserPo.setLink(tmpOwnerDto.getLink());
            ownerAppUserPo.setOpenId("-1");
            ownerAppUserPo.setAppTypeCd("10010");
            ownerAppUserPo.setState(OwnerAppUserDto.STATE_AUDITING);
            ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT);
            ownerAppUserPo.setRemark("注册自动关联");
            ownerAppUserPo.setUserId(userPo.getUserId());
            ownerAppUserPo.setAppType(appType);
service-user/src/main/java/com/java110/user/cmd/user/OwnerUserLoginCmd.java
@@ -38,6 +38,7 @@
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.text.ParseException;
import java.util.HashMap;
@@ -147,11 +148,13 @@
        ownerAppUserDto.setLink(userDtos.get(0).getTel());
        ownerAppUserDto.setState(OwnerAppUserDto.STATE_AUDIT_SUCCESS);
        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
        LoginOwnerResDto loginOwnerResDto = new LoginOwnerResDto();
        loginOwnerResDto.setAuditState(userDtos.get(0).getAuditState());
        String communityId = "";
        if (!ListUtil.isNull(ownerAppUserDtos)) {
            // todo 4.0 查询小区是否存在
            communityId = ownerAppUserDtos.get(0).getCommunityId();
            loginOwnerResDto.setAuditState(ownerAppUserDtos.get(0).getState());
        } else {
            SystemInfoDto systemInfoDto = new SystemInfoDto();
            List<SystemInfoDto> systemInfoDtos = systemInfoV1InnerServiceSMOImpl.querySystemInfos(systemInfoDto);
@@ -168,7 +171,7 @@
        //todo 生成登录token
        String token = generatorLoginToken(tmpUserDto);
        LoginOwnerResDto loginOwnerResDto = new LoginOwnerResDto();
        loginOwnerResDto.setCommunityId(communityDtos.get(0).getCommunityId());
        loginOwnerResDto.setCommunityName(communityDtos.get(0).getName());
@@ -278,34 +281,37 @@
        if (flag < 1) {
            throw new CmdException("注册失败");
        }
        OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo();
        //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
        ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT);
        ownerAppUserPo.setAppTypeCd("10010");
        ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId));
        ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId());
        ownerAppUserPo.setCommunityName(tmpCommunityDto.getName());
        ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId());
        ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName());
        ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard());
        ownerAppUserPo.setAppType("WECHAT");
        ownerAppUserPo.setLink(ownerDtos.get(0).getLink());
        ownerAppUserPo.setUserId(userPo.getUserId());
        ownerAppUserPo.setOpenId("-1");
        ownerAppUserPo.setOwnerTypeCd(ownerDtos.get(0).getOwnerTypeCd());
        queryOwnerRoom(ownerDtos.get(0), ownerAppUserPo);
        flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo);
        if (flag < 1) {
            throw new CmdException("添加用户业主关系失败");
        }
        UserDto userDto = new UserDto();
        userDto.setUserId(userPo.getUserId());
        List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto);
        //用userId和手机号查询绑定关系,没有则新增
        OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
        ownerAppUserDto.setLink(userPo.getTel());
        ownerAppUserDto.setUserId(userPo.getUserId());
        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
        if(CollectionUtils.isEmpty(ownerAppUserDtos)){
            OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo();
            //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
            ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT);
            ownerAppUserPo.setAppTypeCd("10010");
            ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId));
            ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId());
            ownerAppUserPo.setCommunityName(tmpCommunityDto.getName());
            ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId());
            ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName());
            ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard());
            ownerAppUserPo.setAppType("WECHAT");
            ownerAppUserPo.setLink(ownerDtos.get(0).getLink());
            ownerAppUserPo.setUserId(userPo.getUserId());
            ownerAppUserPo.setOpenId("-1");
            ownerAppUserPo.setOwnerTypeCd(ownerDtos.get(0).getOwnerTypeCd());
            queryOwnerRoom(ownerDtos.get(0), ownerAppUserPo);
            flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo);
            if (flag < 1) {
                throw new CmdException("添加用户业主关系失败");
            }
            userDtos.get(0).setAuditState(ownerAppUserPo.getState());
        }
        return userDtos;
    }
service-user/src/main/java/com/java110/user/cmd/user/UserLoginCmd.java
@@ -30,6 +30,7 @@
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
@@ -216,29 +217,35 @@
        if (flag < 1) {
            throw new CmdException("注册失败");
        }
        OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo();
        //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
        ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT);
        ownerAppUserPo.setAppTypeCd("10010");
        ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId));
        ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId());
        ownerAppUserPo.setCommunityName(tmpCommunityDto.getName());
        ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId());
        ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName());
        ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard());
        ownerAppUserPo.setAppType("WECHAT");
        ownerAppUserPo.setLink(ownerDtos.get(0).getLink());
        ownerAppUserPo.setUserId(userPo.getUserId());
        ownerAppUserPo.setOpenId("-1");
        flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo);
        if (flag < 1) {
            throw new CmdException("添加用户业主关系失败");
        }
        UserDto userDto = new UserDto();
        userDto.setUserId(userPo.getUserId());
        List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto);
        //用userId和手机号查询绑定关系,没有则新增
        OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
        ownerAppUserDto.setLink(userPo.getTel());
        ownerAppUserDto.setUserId(userPo.getUserId());
        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
        if(CollectionUtils.isEmpty(ownerAppUserDtos)){
            OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo();
            //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败
            ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT);
            ownerAppUserPo.setAppTypeCd("10010");
            ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId));
            ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId());
            ownerAppUserPo.setCommunityName(tmpCommunityDto.getName());
            ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId());
            ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName());
            ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard());
            ownerAppUserPo.setAppType("WECHAT");
            ownerAppUserPo.setLink(ownerDtos.get(0).getLink());
            ownerAppUserPo.setUserId(userPo.getUserId());
            ownerAppUserPo.setOpenId("-1");
            flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo);
            if (flag < 1) {
                throw new CmdException("添加用户业主关系失败");
            }
            userDtos.get(0).setAuditState(ownerAppUserPo.getState());
        }
        return userDtos;
    }
springboot/src/main/resources/application-debug.yml
@@ -34,7 +34,7 @@
  datasource:
    url: jdbc:mysql://localhost:3306/TT?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false
    username: root
    password: win2020
    password: 123456
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    druid:
springboot/src/main/resources/application.yml
@@ -1,6 +1,6 @@
spring:
  profiles:
    active:  devlocal
    active:  debug
#  docker build -t lx .