ソースを参照

1.结算bug3.0

wuhp 2 年 前
コミット
418163013f

+ 12 - 0
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -424,6 +424,18 @@ public class InsPlyIncomeController extends BaseController {
     public HttpResult<List<PlatformSettlementRecordDto>> platformSettlementRecord(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
         return HttpResult.ok(insPlyIncomeService.platformSettlementRecord(insPlyIncomeVo));
     }
+
+    /**
+     * @param insPlyIncomeVo
+     * @Description:  平台新增
+     * @return   InsPlyIncome
+     */
+    @PostMapping("/ptInsert")
+    @ApiModelProperty(value = "新增")
+    public HttpResult<InsPlyIncome> ptInsert(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.ptInsert(insPlyIncomeVo);
+    }
+
 }
 
 

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/controller/SettlementDocumentaryFeesController.java

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.List;
 
 @RestController
 @Api(tags = "跟单费结算")
@@ -47,5 +48,11 @@ public class SettlementDocumentaryFeesController extends BaseController {
         HttpResult<Object>  result= settlementDocumentaryFeesService.voidInvoicing(settlementDocumentaryFeesVo);
         return HttpResult.ok(result);
     }
+    @GetMapping("/getRecord/{id}")
+    @ApiOperation(value = "查询")
+    public HttpResult<List<SettlementDocumentaryFeesEntity>>getRecord(@PathVariable("id") String id) {
+        return  settlementDocumentaryFeesService.getRecord(id);
+    }
+
 
 }

+ 2 - 0
src/main/java/com/ydtech/modules/fnc/dao/SettlementDocumentaryFeesMapper.java

@@ -33,4 +33,6 @@ public interface SettlementDocumentaryFeesMapper  extends BaseMapper<SettlementD
     List<SettlementDocumentaryFeesEntity> queryNew(HashMap<String, Object> params);
 
     List<SettlementDocumentaryFeesEntity> querySettleNew(HashMap<String, Object> params);
+
+    List<SettlementDocumentaryFeesEntity> getRecord(@Param("id") String id);
 }

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -145,4 +145,11 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
      *  @Description:  查询平台已结算记录
      */
     List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeV);
+
+    /**
+     * @param insPlyIncomeVo
+     * @Description:  平台新增
+     * @return   InsPlyIncome
+     */
+    HttpResult<InsPlyIncome> ptInsert(InsPlyIncomeVo insPlyIncomeVo);
 }

+ 1 - 0
src/main/java/com/ydtech/modules/fnc/service/SettlementDocumentaryFeesService.java

@@ -35,4 +35,5 @@ public interface SettlementDocumentaryFeesService extends IService<SettlementDoc
     List<SettlementDocumentaryFeesEntity> queryNew(HashMap<String, Object> params);
     List<SettlementDocumentaryFeesEntity> querySettleNew(HashMap<String, Object> params);
 
+    HttpResult<List<SettlementDocumentaryFeesEntity>> getRecord(String id);
 }

+ 2 - 3
src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java

@@ -390,7 +390,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                 params.put("isOther", "1");
                 params.put("isNotCar", isNotCar);
                 InsPlyIncome insPlyIncome = insPlyIncomeMapper.findByBxLicenseno(params);
-                if(StringUtils.isNotEmpty(insPlyIncome.getTaskId())){
+                if( ObjectUtils.isNotEmpty(insPlyIncome) && StringUtils.isNotEmpty(insPlyIncome.getTaskId())){
                     throw  new SystemException("表中有已经结算的数据");
                 }
                 if (ObjectUtils.isNotEmpty(insPlyIncome) && open) {
@@ -412,7 +412,6 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getOtherFeevalue() != null && insPlyIncome.getOtherFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getOtherFeevalue());  //添加总手续费
                     }
-                    
                 } else {
                     reason = "查询不到该车辆";
                 }
@@ -510,7 +509,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0&&  excelItem.getNoSuperviseCostsProportion().compareTo(insPlyIncome.getNoSuperviseCostsProportion()) != 0 ) {
+                    if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 &&  excelItem.getNoSuperviseCostsProportion().compareTo(insPlyIncome.getNoSuperviseCostsProportion()) != 0 ) {
                         BigDecimal noSuperviseCostsProportion = excelItem.getNoSuperviseCostsProportion();//商业保单号
                         params.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);

+ 18 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -1473,8 +1473,9 @@ handlingProportion,
     public void uodateBalance(InsPlyIncomeVo insPlyIncomeVo) {
         InsPlyIncome insPlyIncome = new InsPlyIncome();
         insPlyIncomeVo.setHandlingFeesStatus("1");
-        insPlyIncomeVo.setSettlementTime(LocalDate.now());
+        insPlyIncomeVo.setSettlementTime(LocalDate.now());  //结算日期
         BeanUtils.copyProperties(insPlyIncomeVo, insPlyIncome);
+        insPlyIncome.setSettlementUserId(BaseController.getUser().getId());
         baseMapper.updateById(insPlyIncome);
 
 //        生成记录
@@ -2658,4 +2659,20 @@ handlingProportion,
         return baseMapper.platformSettlementRecord(insPlyIncomeVo.getPartnerCompaniesId(),insPlyIncomeVo.getHandlingFeesStatus());
     }
 
+
+    /**
+     * @param insPlyIncomeVo
+     * @Description:  平台新增
+     * @return   InsPlyIncome
+     */
+    @Override
+    public HttpResult<InsPlyIncome> ptInsert(InsPlyIncomeVo insPlyIncomeVo) {
+        InsPlyIncome insPlyIncome = new InsPlyIncome();
+        BeanUtils.copyProperties(insPlyIncomeVo, insPlyIncome);
+        insPlyIncome.setCreateTime(LocalDate.now());
+        insPlyIncomeVo.setAgreementType("1");
+        baseMapper.insert(insPlyIncome);
+        return HttpResult.ok();
+    }
+
 }

+ 8 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/SettlementDocumentaryFeesServiceImpl.java

@@ -228,6 +228,14 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
         return baseMapper.querySettleNew(params);
     }
 
+    @Override
+    public HttpResult<List<SettlementDocumentaryFeesEntity>> getRecord(String id) {
+        List<SettlementDocumentaryFeesEntity>  resultList=  baseMapper.getRecord(id);
+
+        return HttpResult.ok(resultList);
+
+    }
+
     private int compareAmount(BigDecimal settlementAmount, BigDecimal settlementAmount1) {
 
         return settlementAmount.compareTo(settlementAmount1);

+ 4 - 1
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -806,6 +806,9 @@
                 <if test="policyno !=null  and  policyno  !=''">
                     and a.policyno =#{policyno}
                 </if>
+                <if test="dockingPerson !=null  and  dockingPerson  !=''">
+                    and pa.docking_person =#{dockingPerson}
+                </if>
 
                 <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                     and a.handling_fees_status =#{handlingFeesStatus}
@@ -1691,7 +1694,7 @@
     <select id="platformSettlementRecord" resultType="com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto">
         SELECT
             DATE_FORMAT(a.settlement_time, '%Y-%m-%d %H:%i:%s') as "settlementTime",
-            SUM( a.commission_feevalue + a.other_feevalue ) AS "settlementAmount"
+            ( a.commission_feevalue + a.other_feevalue) AS "settlementAmount"
         FROM
             ins_ply_income a
             LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id

+ 39 - 0
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -311,6 +311,45 @@
         ORDER  BY  a.create_time desc
     </select>
 
+    <select id="getRecord" resultType="com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity">
+        select
+        a.id as "id",
+        a.total_orders as "totalOrders",
+        a.time_frame as "timeFrame",
+        a.total_amount as "totalAmount",
+        a.start_time as "startTime",
+        a.end_time as "endTime",
+        a.settlement_amount as "settlementAmount",
+        a.settlement_amount as "invoicCommissionFeevalue",
+        a.agree_ment_id as "agreeMentId",
+        a.partner_companies_id as "partnerCompaniesId",
+        a.invoicing_method as "invoicingMethod",
+        a.tax_points as "taxPoints",
+        a.expend_amount as "expendAmount",
+        a.parent_id as "parentId",
+        a.handling_fees_status as "handlingFeesStatus",
+        a.agreement_type as "agreementType",
+        a.settlement_time as "settlementTime",
+        a.settlement_image_id as "settlementImageId",
+        a.task_id as "taskId",
+        a.create_time as "invoicTime",
+        a.invoice_id AS  "invoicId",
+        a.invoiced_settled_amount as "invoicedSettledAmount",
+        a.Invoiced_not_settled_amount as "InvoicedNotSettledAmount",
+        a.completion_status as "completionStatus",
+        upf.url as "imageUrl",
+        a.unsettled_amount as "unsettledAmount"
+        from  settlement_documentary_fees  a
+        LEFT  JOIN   ins_upload_files  upf   on  a.settlement_image_id=upf.id
+        <where>
+            1=1
+            <if test="id !=null  and  id  !=''">
+                and a.parent_id =#{id}
+            </if>
+        </where>
+        ORDER  BY  a.create_time desc
+    </select>
+