Explorar el Código

个贷口估外部数据接口&大中型统计优化

wucl hace 3 meses
padre
commit
86f0d2d7a1

+ 7 - 0
biz-base/src/main/java/com/dayou/controller/DyoaController.java

@@ -166,4 +166,11 @@ public class DyoaController {
         Boolean ret = dyoaHistoryService.personalEntityInfo();
         return RestResponse.data(ret);
     }
+
+    @IgnoreAuth
+    @GetMapping("/update/commission/productionId")
+    public RestResponse<Boolean> commissionProductionId(){
+        Boolean ret = dyoaHistoryService.commissionProductionId();
+        return RestResponse.data(ret);
+    }
 }

+ 13 - 0
dao/src/main/java/com/dayou/mapper/ExternalDyDataBaseMapper.java

@@ -1,4 +1,17 @@
 package com.dayou.mapper;
 
+import com.dayou.vo.ExternalPersonalVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
 public interface ExternalDyDataBaseMapper {
+
+    List<ExternalPersonalVO> queryQiYuDealPrice(@Param("communityNames") List<String> communityNames);
+
+    List<ExternalPersonalVO> queryQiYuUpPrice(@Param("communityNames") List<String> communityNames);
+
+    List<ExternalPersonalVO> queryLianJiaDealPrice(@Param("communityNames") List<String> communityNames);
+
+    List<ExternalPersonalVO> queryLianJiaUpPrice(@Param("communityNames") List<String> communityNames);
 }

+ 3 - 0
dao/src/main/java/com/dayou/mapper/FinanceClaimMapper.java

@@ -5,6 +5,7 @@ import com.dayou.dto.RealFundAssetsStatDTO;
 import com.dayou.dto.history.HisClaimProd;
 import com.dayou.entity.FinanceClaim;
 import com.dayou.dao.CustomBaseMapper;
+import com.dayou.entity.MajorProduction;
 import com.dayou.entity.OrderFund;
 import com.dayou.vo.*;
 import org.apache.ibatis.annotations.Param;
@@ -60,4 +61,6 @@ public interface FinanceClaimMapper extends CustomBaseMapper<FinanceClaim> {
     List<FinanceClaimsVO> exportList(@Param("vo")FinanceClaimsVO financeClaimVO, @Param("keyword") String keyword);
 
     List<HisClaimProd> updateClaimProductionId(@Param("businessType") String businessType);
+
+    MajorProduction getProductionIdByMajorId(@Param("businessId") Long businessId);
 }

+ 1 - 0
dao/src/main/java/com/dayou/mapper/PersonalFacePriceMapper.java

@@ -10,4 +10,5 @@ public interface PersonalFacePriceMapper {
 
     List<DayouPersonalPriceVO> queryByFuzzyAddress(@Param("address") String roadNumberAddress, @Param("valueTiming") Date startDate);
 
+    List<String> queryCommunityNameByFuzzyAddress(@Param("address") String address);
 }

+ 20 - 0
dao/src/main/resources/mapper/ExternalDyDataBaseMapper.xml

@@ -2,5 +2,25 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.dayou.mapper.ExternalDyDataBaseMapper">
 
+    <select id="queryQiYuDealPrice" parameterType="java.util.List" resultType="com.dayou.vo.ExternalPersonalVO">
+        select * from data_data_qiyu_deal
+            <where>
+                <foreach collection="communityNames" index="index" separator="or" item="item">
+                   houses like concat('%', #{item},'%')
+                </foreach>
+            </where>
+    </select>
+
+    <select id="queryQiYuUpPrice" parameterType="java.util.List" resultType="com.dayou.vo.ExternalPersonalVO">
+
+    </select>
+
+    <select id="queryLianJiaDealPrice" parameterType="java.util.List" resultType="com.dayou.vo.ExternalPersonalVO">
+
+    </select>
+
+    <select id="queryLianJiaUpPrice" parameterType="java.util.List" resultType="com.dayou.vo.ExternalPersonalVO">
+
+    </select>
 
 </mapper>

+ 18 - 2
dao/src/main/resources/mapper/FinanceClaimMapper.xml

@@ -114,7 +114,8 @@
         p.id AS pId,
         p.business_id,
         p.production_no,
-        p.production_should_amount AS shouldAmount
+        p.production_should_amount AS shouldAmount,
+        p.production_type
         FROM
         production_fund p
         WHERE
@@ -137,7 +138,7 @@
         LEFT JOIN ( SELECT production_no, production_type, real_amount FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) ppf ON ( mpp.report_no = ppf.production_no AND mpp.production = ppf.production_type )
         WHERE
         ppf.real_amount IS NOT NULL
-        ) mp ON ( mp.major_id = m.id AND mp.report_no = f.production_no )
+        ) mp ON ( mp.major_id = m.id AND mp.report_no = f.production_no and mp.production = f.production_type )
         LEFT JOIN user u2 ON u2.id = fc.claim_user_id
         LEFT JOIN user u ON u.id = m.client_manager_id
         LEFT JOIN user u1 ON u1.id = m.principal_id
@@ -462,4 +463,19 @@
         ORDER BY
             t.created DESC
     </select>
+
+    <select id="getProductionIdByMajorId" parameterType="java.lang.Long" resultType="com.dayou.entity.MajorProduction">
+        select production_type as production,production_no as reportNo from production_fund where id = ( SELECT
+                                                                                    production_fund_id
+                                                                                FROM
+                                                                                    finance_claim
+                                                                                WHERE
+                                                                                    order_fund_id = (select id
+                                                                                                     FROM
+                                                                                                         order_fund
+                                                                                                     WHERE
+                                                                                                         business_id = #{businessId}
+                                                                                                       AND business_type = 'MAJOR_BUSINESS'
+                                                                                                       AND real_amount IS NOT NULL) and production_fund_id is not null limit 1) and deleted = 0
+    </select>
 </mapper>

+ 14 - 10
dao/src/main/resources/mapper/FinanceRealFundMapper.xml

@@ -683,10 +683,8 @@
                 WHERE
                     deleted = 0
                   AND production_fund_id IS NOT NULL
-                  AND claim_datetime &gt;= #{vo.startDate}
-                  AND claim_datetime  &lt;= #{vo.endDate}
             ) fc
-                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
+                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no,production_type FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
                 INNER JOIN (
                 SELECT
                     id,
@@ -704,7 +702,7 @@
                 WHERE
                     fund.real_amount IS NOT NULL
                   AND mpr.save_file_date IS NOT NULL
-            ) mp ON mp.report_no = pf.production_no
+            ) mp ON (mp.report_no = pf.production_no and mp.production = pf.production_type)
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_EVALUATE' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
@@ -715,7 +713,11 @@
                 LEFT JOIN user u on u.id = mpa.user_id
         WHERE
             m.financial is not null and
-            mpa.user_id = #{vo.userId}
+            mpa.user_id = #{vo.userId} and
+            (select IF
+                    ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date )) &gt;= #{vo.startDate}
+                     AND  (select IF
+                     ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date )) &lt;= #{vo.endDate}
         order by settleDate DESC
     </select>
 
@@ -928,10 +930,8 @@
                 WHERE
                     deleted = 0
                   AND production_fund_id IS NOT NULL
-                  AND claim_datetime &gt;= #{vo.startDate}
-                  AND claim_datetime  &lt;= #{vo.endDate}
             ) fc
-                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
+                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no,production_type FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
                 INNER JOIN (
                 SELECT
                     id,
@@ -950,7 +950,7 @@
                     fund.real_amount IS NOT NULL
                   AND mpr.delivery_date IS NOT NULL
 
-            ) mp ON mp.report_no = pf.production_no
+            ) mp ON (mp.report_no = pf.production_no and mp.production = pf.production_type)
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_MARKET' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
@@ -961,7 +961,11 @@
                 LEFT JOIN user u on u.id = mpa.user_id
         WHERE
             m.financial is not null and
-            mpa.user_id = #{vo.userId}
+            mpa.user_id = #{vo.userId} and
+        (select IF
+        ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date )) &gt;= #{vo.startDate}
+        AND  (select IF
+        ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date )) &lt;= #{vo.endDate}
         order by settleDate DESC
     </select>
 

+ 16 - 0
dao/src/main/resources/mapper/PersonalFacePriceMapper.xml

@@ -30,4 +30,20 @@
     </select>
 
 
+    <select id="queryCommunityNameByFuzzyAddress" parameterType="java.lang.String" resultType="java.lang.String">
+        SELECT
+            pe.communityName
+        FROM
+            (
+                SELECT
+                    id AS targetId
+                FROM
+                    personal_target
+                WHERE
+                    location LIKE CONCAT( '%', #{address}, '%' )) pt
+                LEFT JOIN ( SELECT JSON_UNQUOTE( JSON_EXTRACT( location, '$.valueA' )) AS communityName, target_id AS tid FROM personal_example WHERE is_example = 0 AND deleted = 0 ) pe ON pe.tid = pt.targetId
+        where pe.communityName is not null
+    </select>
+
+
 </mapper>

+ 72 - 0
domain/src/main/java/com/dayou/vo/ExternalPersonalVO.java

@@ -0,0 +1,72 @@
+package com.dayou.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class ExternalPersonalVO {
+
+    /**
+     * 小区名字
+     */
+    private String communityName;
+    /**
+     * 坐落
+     */
+    private String location;
+    /**
+     * 区域名字
+     */
+    private String areaName;
+    /**
+     * 城市名字
+     */
+    private String cityName;
+    /**
+     * 面积
+     */
+    private BigDecimal acreage;
+    /**
+     * 单价
+     */
+    private BigDecimal price;
+    /**
+     * 总价
+     */
+    private BigDecimal amount;
+    /**
+     * 用途
+     */
+    private String useType;
+    /**
+     * 装修
+     */
+    private String decoration;
+    /**
+     * 楼层
+     */
+    private String floor;
+    /**
+     * 户型
+     */
+    private String houseType;
+    /**
+     * 建筑结构
+     */
+    private String structure;
+    /**
+     * 成交日期
+     */
+    private Date dealDate;
+    /**
+     * 挂牌日期
+     */
+    private Date upDate;
+
+    /**
+     * 数据源类型
+     */
+    private String dataResource;
+}

+ 84 - 20
service/src/main/java/com/dayou/dyoa/DyoaHistoryServiceImpl.java

@@ -546,26 +546,51 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
                 (x.getBusinessType().equals(MAJOR_BUSINESS.name())|| x.getBusinessType().equals(ASSET_BUSINESS.name())))
                 .collect(Collectors.toList());
         majorOrderFund.stream().forEach(x->{
+            BigDecimal totalAmount = x.getRealAmount();
+
             List<ProductionFund> prods = productionFundService.list(new LambdaQueryWrapper<ProductionFund>()
-                    .eq(ProductionFund::getOrderFundId, x.getId()).select(ProductionFund::getProductionType));
+                    .eq(ProductionFund::getOrderFundId, x.getId()).select(ProductionFund::getProductionType,ProductionFund::getRealAmount,BaseEntity::getId));
             if (CollectionUtil.isNotEmpty(prods)){
-                if (prods.size()>1){
-                    List<ProductionFund> noStatement = prods.stream().filter(p -> !p.getProductionType().equals(ProductionEnum.STATEMENT.name())).collect(Collectors.toList());
-                    if (noStatement.size()>1){
-                        productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
-                                .eq(ProductionFund::getOrderFundId,x.getId())
-                                .eq(ProductionFund::getProductionType,ProductionEnum.REPORT.name())
-                                .set(ProductionFund::getRealAmount,x.getRealAmount()));
-                    }else {
-                        productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
-                                .eq(ProductionFund::getOrderFundId,x.getId())
-                                .eq(ProductionFund::getProductionType,noStatement.get(0).getProductionType())
-                                .set(ProductionFund::getRealAmount,x.getRealAmount()));
-                    }
-                }else{
-                    productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
-                            .eq(ProductionFund::getOrderFundId,x.getId()).set(ProductionFund::getRealAmount,x.getRealAmount()));
-                }
+                  for (ProductionFund prod : prods) {
+                      if (prod.getRealAmount()!=null && prod.getRealAmount().compareTo(BigDecimal.ZERO)>0){
+                          productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
+                            .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
+                          break;
+                      }
+                      if (prod.getProductionType().equals(REPORT.name())){
+                          productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
+                                  .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
+                          break;
+                      }
+                      if (prod.getProductionType().equals(LETTER.name())){
+                          productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
+                                  .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
+                          break;
+                      }
+                      if (prod.getProductionType().equals(STATEMENT.name())){
+                          productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
+                                  .eq(ProductionFund::getOrderFundId,prod.getId()).set(ProductionFund::getRealAmount, totalAmount));
+                          break;
+                      }
+                  }
+//                if (prods.size()>1){
+//
+//                    List<ProductionFund> noStatement = prods.stream().filter(p -> !p.getProductionType().equals(ProductionEnum.STATEMENT.name())).collect(Collectors.toList());
+//                    if (noStatement.size()>1){
+//                        productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
+//                                .eq(ProductionFund::getOrderFundId,x.getId())
+//                                .eq(ProductionFund::getProductionType,ProductionEnum.REPORT.name())
+//                                .set(ProductionFund::getRealAmount, totalAmount));
+//                    }else {
+//                        productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
+//                                .eq(ProductionFund::getOrderFundId,x.getId())
+//                                .eq(ProductionFund::getProductionType,noStatement.get(0).getProductionType())
+//                                .set(ProductionFund::getRealAmount, totalAmount));
+//                    }
+//                }else{
+//                    productionFundService.update(new LambdaUpdateWrapper<ProductionFund>()
+//                            .eq(ProductionFund::getOrderFundId,x.getId()).set(ProductionFund::getRealAmount, totalAmount));
+//                }
             }
         });
 
@@ -1681,12 +1706,12 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
                     Date archiveTime = productionNo.getArchiveTime();
                     Date confirmTime = productionNo.getConfirmTime();
                     Date bgOutTime = productionNo.getBgOutTime();
-                    if (archiveTime!=null){
+                    if (archiveTime!=null && majorProduction.getSaveFileDate()==null){
                         flog = true;
                         majorProduction.setIfSaveFile(true);
                         majorProduction.setSaveFileDate(DateUtils.dateToLocalDate(archiveTime));
                     }
-                    if (confirmTime!=null){
+                    if (confirmTime!=null && majorProduction.getDeliveryDate() == null){
                         flog = true;
                         majorProduction.setDelivery(true);
                         majorProduction.setDeliveryDate(DateUtils.dateToLocalDate(confirmTime));
@@ -2184,6 +2209,45 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
         return true;
     }
 
+    @Override
+    public Boolean commissionProductionId() {
+        List<CommissionDeclare> result = commissionDeclareService.list(new LambdaQueryWrapper<CommissionDeclare>().eq(CommissionDeclare::getDeclareResult, "审核通过")
+                .isNull(CommissionDeclare::getProductionId).eq(BaseEntity::getDeleted, false).select(BaseEntity::getId, CommissionDeclare::getBusinessId));
+
+        for (CommissionDeclare commissionDeclare : result){
+            MajorProduction production = financeClaimService.getProductionIdByMajorId(commissionDeclare.getBusinessId());
+
+            if (production==null){
+                List<MajorProduction> list = majorProductionService.list(new LambdaQueryWrapper<MajorProduction>().eq(MajorProduction::getMajorId, commissionDeclare.getBusinessId())
+                        .select(BaseEntity::getId, MajorProduction::getProduction));
+                Long productionId = null;
+                for (MajorProduction majorProduction : list){
+                    if (majorProduction.getProduction().equals(REPORT.name())){
+                        productionId = majorProduction.getId();
+                        break;
+                    }
+                    if (majorProduction.getProduction().equals(LETTER.name())){
+                        productionId = majorProduction.getId();
+                        break;
+                    }
+                    if (majorProduction.getProduction().equals(STATEMENT.name())){
+                        productionId = majorProduction.getId();
+                        break;
+                    }
+                }
+                if (productionId!=null){
+                    commissionDeclareService.update(new LambdaUpdateWrapper<CommissionDeclare>().eq(BaseEntity::getId,commissionDeclare.getId())
+                            .set(CommissionDeclare::getProductionId,productionId));
+                }
+            }else {
+                MajorProduction one = majorProductionService.getOne(new LambdaQueryWrapper<MajorProduction>().eq(MajorProduction::getProduction, production.getProduction())
+                        .eq(MajorProduction::getReportNo, production.getReportNo()));
+                commissionDeclareService.update(new LambdaUpdateWrapper<CommissionDeclare>().eq(BaseEntity::getId,commissionDeclare.getId())
+                        .set(CommissionDeclare::getProductionId,one.getId()));
+            }
+        }
+        return null;
+    }
 
 
     @Override

+ 2 - 0
service/src/main/java/com/dayou/dyoa/IDyoaHistoryService.java

@@ -63,4 +63,6 @@ public interface IDyoaHistoryService {
     Boolean orderFundClientManagerId();
 
     Boolean personalEntityInfo();
+
+    Boolean commissionProductionId();
 }

+ 2 - 4
service/src/main/java/com/dayou/service/IExternalDyDataBaseService.java

@@ -1,9 +1,7 @@
 package com.dayou.service;
 
-import com.dayou.dto.PersonalFacePriceQueryDTO;
-import com.dayou.vo.DayouPersonalPriceVO;
+import com.dayou.vo.ExternalPersonalVO;
 
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -11,6 +9,6 @@ import java.util.List;
  */
 public interface IExternalDyDataBaseService {
 
-    List<DayouPersonalPriceVO> externalPrice(PersonalFacePriceQueryDTO facePriceQuery,Date startDate);
 
+    List<ExternalPersonalVO> externalPriceByCommunityName(List<String> communityNames);
 }

+ 3 - 0
service/src/main/java/com/dayou/service/IFinanceClaimService.java

@@ -5,6 +5,7 @@ import com.dayou.dto.history.HisClaimProd;
 import com.dayou.entity.FinanceClaim;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.dayou.entity.MajorProduction;
 import com.dayou.entity.OrderFund;
 import com.dayou.vo.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -91,4 +92,6 @@ public interface IFinanceClaimService extends IService<FinanceClaim> {
     List<FinanceClaimsVO> exportList(FinanceClaimsVO financeClaimVO, String keyword);
 
     List<HisClaimProd> updateClaimProductionId(String businessType);
+
+    MajorProduction getProductionIdByMajorId(Long businessId);
 }

+ 13 - 1
service/src/main/java/com/dayou/service/impl/ExternalDyDataBaseServiceImpl.java

@@ -5,6 +5,8 @@ import com.dayou.dto.PersonalFacePriceQueryDTO;
 import com.dayou.mapper.ExternalDyDataBaseMapper;
 import com.dayou.service.IExternalDyDataBaseService;
 import com.dayou.vo.DayouPersonalPriceVO;
+import com.dayou.vo.ExternalPersonalVO;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -20,7 +22,17 @@ public class ExternalDyDataBaseServiceImpl implements IExternalDyDataBaseService
     private ExternalDyDataBaseMapper externalDyDataBaseMapper;
 
     @Override
-    public List<DayouPersonalPriceVO> externalPrice(PersonalFacePriceQueryDTO facePriceQuery, Date startDate) {
+    public List<ExternalPersonalVO> externalPriceByCommunityName(List<String> communityNames){
+
+        //1.七鱼成交
+        List<ExternalPersonalVO> qyDeals = externalDyDataBaseMapper.queryQiYuDealPrice(communityNames);
+        //2.七鱼挂牌
+        List<ExternalPersonalVO> qyUps = externalDyDataBaseMapper.queryQiYuUpPrice(communityNames);
+        //3.链家成交
+        List<ExternalPersonalVO> ljDeals = externalDyDataBaseMapper.queryLianJiaDealPrice(communityNames);
+        //4.链家挂牌
+        List<ExternalPersonalVO> ljUps = externalDyDataBaseMapper.queryLianJiaUpPrice(communityNames);
+
         return Collections.emptyList();
     }
 }

+ 5 - 0
service/src/main/java/com/dayou/service/impl/FinanceClaimServiceImpl.java

@@ -284,6 +284,11 @@ public class FinanceClaimServiceImpl extends ServiceImpl<FinanceClaimMapper, Fin
         return financeClaimMapper.updateClaimProductionId(businessType);
     }
 
+    @Override
+    public MajorProduction getProductionIdByMajorId(Long businessId) {
+        return financeClaimMapper.getProductionIdByMajorId(businessId);
+    }
+
 
     @Override
     public synchronized BigDecimal checkFinanceFound(Long financeFundId) {

+ 8 - 0
service/src/main/java/com/dayou/service/impl/MajorProductionServiceImpl.java

@@ -339,6 +339,10 @@ public class MajorProductionServiceImpl extends ServiceImpl<MajorProductionMappe
     public Boolean confirmDelivery(TaskRecordDTO<Long> taskRecordDTO) {
         Long id = taskRecordDTO.getTaskData();
         if (id!=null){
+            MajorProduction mp = this.getById(id);
+            if (mp.getDeliveryDate()!=null){
+                return Boolean.TRUE;
+            }
             boolean update = this.update(new LambdaUpdateWrapper<MajorProduction>()
                     .set(MajorProduction::getDelivery, Boolean.TRUE)
                     .set(MajorProduction::getDeliveryDate,new Date()).eq(BaseEntity::getId, id));
@@ -482,6 +486,10 @@ public class MajorProductionServiceImpl extends ServiceImpl<MajorProductionMappe
 
     @Override
     public Boolean noTaskConfirmDelivery(Long id) {
+        MajorProduction mp = this.getById(id);
+        if (mp.getDeliveryDate()!=null){
+            return Boolean.TRUE;
+        }
         boolean update = this.update(new LambdaUpdateWrapper<MajorProduction>()
                 .set(MajorProduction::getDelivery, Boolean.TRUE)
                 .set(MajorProduction::getDeliveryDate,new Date()).eq(BaseEntity::getId, id));

+ 35 - 1
service/src/main/java/com/dayou/service/impl/PersonalFacePriceServiceImpl.java

@@ -10,6 +10,7 @@ import com.dayou.service.IPersonalFacePriceService;
 import com.dayou.utils.AddressUtil;
 import com.dayou.utils.DateUtils;
 import com.dayou.vo.DayouPersonalPriceVO;
+import com.dayou.vo.ExternalPersonalVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -72,7 +73,30 @@ public class PersonalFacePriceServiceImpl implements IPersonalFacePriceService {
     public List<DayouPersonalPriceVO> externalPersonalPrice(PersonalFacePriceQueryDTO facePriceQuery) {
         //获取配置的价值点范围
         Date startDate = DateUtils.addYears(new Date(),-1);
-        return externalDyDataBaseService.externalPrice(facePriceQuery,startDate);
+        String location = facePriceQuery.getLocation();
+
+        AddressDTO targetAddress = AddressUtil.parseAddress(location);
+
+        //获取全路名 查询小区名称
+        String roadNumberAddress = AddressUtil.getRoadNumberAddress(location);
+        List<String> communityName1 = personalFacePriceMapper.queryCommunityNameByFuzzyAddress(roadNumberAddress);
+
+        //获取路名路号
+        String roadAndRoadNumber = AddressUtil.getRoadAndRoadNumber(location);
+        List<String> communityName2 = personalFacePriceMapper.queryCommunityNameByFuzzyAddress(roadAndRoadNumber);
+
+        //获取小区名字 从地址中获取
+        String communityNameFromAddress = AddressUtil.getCommunityNameFromAddress(location);
+
+        communityName1.addAll(communityName2);
+
+        if (StrUtil.isNotBlank(communityNameFromAddress)){
+            communityName1.add(communityNameFromAddress);
+        }
+
+        List<String> communityNames = communityName1.stream().distinct().collect(Collectors.toList());
+        List<ExternalPersonalVO> externalPersonalVOS = externalDyDataBaseService.externalPriceByCommunityName(communityNames);
+        return null;
     }
 
 
@@ -101,4 +125,14 @@ public class PersonalFacePriceServiceImpl implements IPersonalFacePriceService {
         }
     }
 
+    /**
+     * 根据小区名字在个贷评估历史中查询小区名字
+     * @param address
+     * @return
+     */
+    private String getCommunityNameByAddress(String address){
+        String roadNumberAddress = AddressUtil.getRoadNumberAddress(address);
+       // personalFacePriceMapper.queryCommuintyName(roadNumberAddress);
+        return null;
+    }
 }