瀏覽代碼

查询已承保的保单数据的接口提交

hxl13994548489 1 年之前
父節點
當前提交
0333a5121a

+ 20 - 0
src/main/java/com/ydtech/modules/order/controller/InsOrderReadPdfController.java

@@ -8,11 +8,14 @@ import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.SysUserLinkAreaService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.dto.InsOrderReadPdfContentDto;
 import com.ydtech.modules.order.entity.po.InsOrderReadPdf;
 import com.ydtech.modules.order.entity.vo.InsOrderReadPdfContentVo;
 import com.ydtech.modules.order.entity.vo.InsOrderReadPdfVo;
+import com.ydtech.modules.order.entity.vo.OrderQueryVo;
 import com.ydtech.modules.order.service.InsOrderReadPdfService;
+import com.ydtech.modules.order.service.InsOrdersService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
@@ -37,6 +40,10 @@ public class InsOrderReadPdfController extends BaseController {
     @Autowired
     private InsOrderReadPdfService insOrderReadPdfService;
 
+    @Autowired
+    private InsOrdersService insOrdersService;
+
+
     @PostMapping("queryPage")
     @ApiOperation(value = "读取保单配置分页")
     public HttpResult<BasePageResult<InsOrderReadPdf>> queryPage(@RequestBody InsOrderReadPdfVo insOrderReadPdfVo) {
@@ -113,4 +120,17 @@ public class InsOrderReadPdfController extends BaseController {
         }
 
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/17 10:51
+     *  @Description:  查询已承保的保单数据
+     */
+    @PostMapping("/queryPageOrder")
+    @ApiOperation(value = "查询已承保的保单数据口")
+    public HttpResult<BasePageResult<InsOrders>> queryPageOrderCB(@RequestBody OrderQueryVo orderQueryVo) {
+        orderQueryVo.setOrderStatus("3");//3已承保
+        BasePageResult<InsOrders> quoteResult = insOrdersService.queryPageOrderCB(orderQueryVo);
+        return HttpResult.ok("success", quoteResult);
+    }
 }

+ 7 - 1
src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyMapper.java

@@ -377,7 +377,13 @@ public interface InsAreaCompanyMapper extends BaseMapper<InsAreaCompany> {
      * @date: 2024/10/12
      **/
     TaskStatisticsDto getCountBusinessData(@Param("vo") TaskStatisticsVo taskStatisticsVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/17 10:57
+     *  @Description: 查询已承保的保单数据
+     */
+    Page<InsOrders> queryPageOrderCB(@Param("page") Page<InsAreaCompany> page, @Param("params") OrderQueryVo orderQueryVo);
 }
 
 

+ 7 - 0
src/main/java/com/ydtech/modules/order/service/InsAreaCompanyService.java

@@ -267,4 +267,11 @@ public interface InsAreaCompanyService extends IService<InsAreaCompany> {
      * @return
      */
     boolean updateFeeMatchErrMsg(String companyId,String feeMatchErrMsg);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/17 10:55
+     *  @Description: 查詢已承保的保单数据
+     */
+    Page<InsOrders> queryPageOrderCB(Page<InsAreaCompany> page, OrderQueryVo orderQueryVo);
 }

+ 7 - 1
src/main/java/com/ydtech/modules/order/service/InsOrdersService.java

@@ -281,5 +281,11 @@ public interface InsOrdersService extends IService<InsOrders> {
      * @return
      */
     boolean responseFailedOrder(BaseQuoteVo quoteVo, PtlAgreementAttribution ptlAgreementAttribution, InsOrders insOrder, String errorMessage, InsOrderStatusEnum statusEnum);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/17 10:52
+     *  @Description: 查詢已承保的保单数据
+     */
+    BasePageResult<InsOrders> queryPageOrderCB(OrderQueryVo orderQueryVo);
 }

+ 24 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -2168,6 +2168,30 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDriving);
         return true;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/17 10:53
+     *  @Description:  查詢已承保
+     */
+    @Override
+    public BasePageResult<InsOrders> queryPageOrderCB(OrderQueryVo orderQueryVo) {
+        Page<InsAreaCompany> page = PageRequest.buildPageRequest(orderQueryVo.getPageRequest());
+        Page<InsOrders> resultOrders;
+        resultOrders = insAreaCompanyService.queryPageOrderCB(page, orderQueryVo);
+        //查找机构来源字典 遍历
+        Map<String, DictionaryManagement> m = DictEnumConfig.getDmMap();
+        DictionaryManagement organizationSource = m.get("organizationSource");
+        resultOrders.getRecords().forEach(item -> {
+            DictionaryData dictionaryData = organizationSource.getDdList().stream().filter(x -> x.getDictValue().equals(item.getManagementSource())).findFirst().orElse(null);
+            if (dictionaryData != null) {
+                item.setManagementSource(dictionaryData.getDictTag());
+            }
+        });
+        return new BasePageResult<>(resultOrders.getCurrent(), page.getSize(), resultOrders.getTotal(),
+                resultOrders.getPages(),
+                resultOrders.getRecords());
+    }
 
     /**
      * 更新订单的起保与终保时间

+ 136 - 0
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -3146,5 +3146,141 @@
         </if>
         order by  io.createtime
     </select>
+    <select id="queryPageOrderCB" resultType="com.ydtech.modules.order.entity.InsOrders">
+        SELECT
+        iac.id as orderno,
+        io.quoteno,
+        io.orderstatus,
+        io.company_id,
+        io.ins_company,
+        io.carinfo,
+        io.userid,
+        io.username,
+        io.deptid,
+        io.deptname,
+        io.agreeid,
+        iac.productid,
+        iac.product,
+        iac.createtime,
+        io.frameno,
+        io.licenseno,
+        JSON_UNQUOTE(json_extract(io.insureinfo, '$.name')) as insuredname,
+        io.is_external,
+        iac.jq_start_date as jqstartdate,
+        iac.jq_end_date as jqenddate,
+        iac.sy_start_date as systartdate,
+        iac.sy_end_date as syenddate,
+        io.vehicle_and_vessel_tax,
+        io.operatorid,
+        iac.operator_name,
+        sd.management_source,
+        iac.problem_order,
+        eic.namesimple as partnerCompaniesName,
+        iac.id as subOrderId,
+        iac.signing_time as signingTime,
+        iac.pay_date as payDate,
+        pa.agreement_code as agreementCode,
+        pa.agreement_name as agreementName,
+        pa.business_description as businessDescription,
+        pa.job_description as jobDescription,
+        pa.agreement_title as agreementTitle,
+        pa.docking_person as dockingPerson,
+        io.entry_status
+        FROM
+        ins_area_company iac
+        LEFT JOIN ins_orders io ON iac.orderno = io.orderno
+        LEFT JOIN sys_user su ON su.id = io.userid
+        LEFT JOIN sys_dept sd ON sd.id = su.dept_id
+        LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
+        LEFT JOIN esm_ins_company eic ON eic.id = pa.partner_companies_id
+        WHERE
+        iac.orderstatus = 3
+        <if test="params.quoteStartDateStr != null and params.quoteStartDateStr != '' and params.quoteEndDateStr != null and params.quoteEndDateStr != ''">
+            and DATE_FORMAT(iac.createtime, '%Y-%m-%d') between #{params.quoteStartDateStr} AND
+            #{params.quoteEndDateStr}
+        </if>
+        <if test="params.orderNo != null and params.orderNo != ''">
+            AND iac.id= #{params.orderNo}
+        </if>
+        <if test="params.licenseNo != null and params.licenseNo != ''">
+            AND io.licenseno = #{params.licenseNo}
+        </if>
+        <if test="params.frameNo != null and params.frameNo != ''">
+            AND io.frameno = #{params.frameNo}
+        </if>
+        <if test="params.insuredName != null and params.insuredName != ''">
+            AND json_extract(io.insureinfo, '$.name') = #{params.insuredName}
+        </if>
+        <if test="params.companyId != null and params.companyId != ''">
+            AND io.company_id = #{params.companyId}
+        </if>
+        <if test="params.engineNo != null and params.engineNo != ''">
+            and JSON_EXTRACT( io.carinfo, '$.engineNo' ) = #{params.engineNo}
+        </if>
+        <if test="params.riskCode != null and params.riskCode != ''">
+            and iac.product = #{params.riskCode}
+        </if>
+
+        <if test="params.attachStartDateStr != null and params.attachStartDateStr != '' and params.attachStartDateStr != null and params.attachStartDateStr != '' ">
+            and ((
+            DATE_FORMAT(iac.jq_start_date, '%Y-%m-%d') BETWEEN #{params.attachStartDateStr}
+            AND #{params.attachEndDateStr}
+            )
+            OR ( DATE_FORMAT(iac.sy_start_date, '%Y-%m-%d') BETWEEN #{params.attachStartDateStr} AND
+            #{params.attachEndDateStr} )
+            )
+        </if>
+        <if test="params.provinceId != null and params.provinceId != ''">
+            and io.deptid like "${params.provinceId}%"
+        </if>
+        <if test="params.problemOrder != null and params.problemOrder != ''">
+            and iac.problem_order like "${params.problemOrder}%"
+        </if>
+        <if test="params.cityId != null and params.cityId != ''">
+            and io.deptid like "${params.cityId}%"
+        </if>
+        <if test="params.countyId != null and params.countyId != ''">
+            and io.deptid like "${params.countyId}%"
+        </if>
+        <if test="params.houseId != null and params.houseId != ''">
+            and io.deptid like "${params.houseId}%"
+        </if>
+        <if test="params.operatorId != null and params.operatorId != ''">
+            and io.userid = #{params.operatorId}
+        </if>
+        <if test="params.operatorName != null and params.operatorName != ''">
+            and io.username = #{params.operatorName}
+        </if>
+        <if test="params.auditId != null and params.auditId != ''">
+            and iac.new_operator_id = #{params.auditId}
+        </if>
+        <if test="params.agreeId != null and params.agreeId != ''">
+            and iac.agreement_id = #{params.agreeId}
+        </if>
+        <if test="params.managementSource != null and params.managementSource != ''">
+            and sd.management_source = #{params.managementSource}
+        </if>
+        <if test="params.signStartDateStr != null and params.signStartDateStr != '' and params.signEndDateStr != null and params.signEndDateStr != ''">
+            and DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{params.signStartDateStr} AND
+            #{params.signEndDateStr}
+        </if>
+        <if test="params.payStartDateStr != null and params.payStartDateStr != '' and params.payEndDateStr != null and params.payEndDateStr != ''">
+            and iac.pay_date between #{params.payStartDateStr} AND #{params.payEndDateStr}
+        </if>
+
+        <if test="params.isExternal != null and params.isExternal != ''">
+            and io.is_external = #{params.isExternal}
+        </if>
+        <if test="params.jqPolicyNo != null and params.jqPolicyNo != ''">
+            and iac.jqpolicyno = #{params.jqPolicyNo}
+        </if>
+        <if test="params.syPolicyNo != null and params.syPolicyNo != ''">
+            and iac.sypolicyno = #{params.syPolicyNo}
+        </if>
+        <if test="params.noPolicyNo != null and params.noPolicyNo != ''">
+            and iac.cross_insurance like concat('%', #{params.noPolicyNo}, '%')
+        </if>
+        order by iac.createtime desc
+    </select>
 
 </mapper>