Explorar el Código

Merge branch 'refs/heads/test-1' into test

wks hace 1 año
padre
commit
3df51f48d7

+ 48 - 0
src/main/java/com/ydtech/modules/order/controller/InsAreaCompanyController.java

@@ -0,0 +1,48 @@
+package com.ydtech.modules.order.controller;
+
+
+import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.service.InsAreaCompanyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/subOrder")
+@Api(tags = "子订单")
+@Slf4j
+@RequiredArgsConstructor
+public class InsAreaCompanyController {
+
+    private final InsAreaCompanyService insAreaCompanyService;
+
+    @GetMapping("/statusInquiry/{subOrderNo}")
+    @ApiOperation("状态查询")
+    public HttpResult<String> statusInquiry(@PathVariable String subOrderNo) {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
+        return HttpResult.ok(insAreaCompany.getOrderstatus());
+    }
+
+    @GetMapping("/close/{subOrderNo}")
+    @ApiOperation("关闭订单")
+    public HttpResult<String> close(@PathVariable String subOrderNo) {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
+        insAreaCompany.setDelFlag("0");
+        insAreaCompanyService.updateById(insAreaCompany);
+        return HttpResult.ok();
+    }
+
+    @GetMapping("/cancelUnderwriting/{subOrderNo}")
+    @ApiOperation("取消核保")
+    public HttpResult<String> cancelUnderwriting(@PathVariable String subOrderNo) {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
+        insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
+        insAreaCompanyService.updateById(insAreaCompany);
+        return HttpResult.ok();
+    }
+
+}

+ 15 - 6
src/main/java/com/ydtech/modules/order/controller/InsOrdersController.java

@@ -61,8 +61,6 @@ public class InsOrdersController extends BaseController {
 
     private final InsAreaCompanyPositionService insAreaCompanyPositionService;
 
-
-
     @Value("${upload.file.path}")
     private String uploadPath;
 
@@ -97,7 +95,7 @@ public class InsOrdersController extends BaseController {
     public HttpResult<InsOrders> generateOrder(@Validated @RequestBody BaseQuoteInfoVo quoteInfoVo) {
         SysUser user = getUser();
         //app 订单取消了商业险信息
-        if(Objects.isNull(quoteInfoVo.getKindList())){
+        if (Objects.isNull(quoteInfoVo.getKindList())) {
             quoteInfoVo.setKindList(new ArrayList<>());
         }
 
@@ -161,9 +159,12 @@ public class InsOrdersController extends BaseController {
     public HttpResult<List<InsAreaCompanyHistoryVo>> queryQuoteHistory(@RequestBody QuoteHistoryVo quoteHistoryVo) {
         InsOrders insOrders = this.insOrdersService.existOrder(quoteHistoryVo.getOrderNo());
 
-        LambdaQueryWrapper<InsAreaCompany> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(!ObjectUtils.isEmpty(quoteHistoryVo.getOrderNo()), InsAreaCompany::getOrderno, quoteHistoryVo.getOrderNo()).eq(!ObjectUtils.isEmpty(quoteHistoryVo.getOrderStatus()), InsAreaCompany::getOrderstatus, quoteHistoryVo.getOrderStatus()).orderByDesc(InsAreaCompany::getCreatetime);
-        List<InsAreaCompany> insAreaCompanies = this.insAreaCompanyService.getBaseMapper().selectList(wrapper);
+        List<InsAreaCompany> insAreaCompanies = this.insAreaCompanyService.lambdaQuery()
+                .eq(!ObjectUtils.isEmpty(quoteHistoryVo.getOrderNo()), InsAreaCompany::getOrderno, quoteHistoryVo.getOrderNo())
+                .eq(!ObjectUtils.isEmpty(quoteHistoryVo.getOrderStatus()), InsAreaCompany::getOrderstatus, quoteHistoryVo.getOrderStatus())
+                .eq(InsAreaCompany::getDelFlag, "1")
+                .orderByDesc(InsAreaCompany::getCreatetime)
+                .list();
 
         List<InsAreaCompanyHistoryVo> collect = insAreaCompanies.stream().map(a -> {
             InsAreaCompanyHistoryVo insAreaCompanyHistoryVo = new InsAreaCompanyHistoryVo();
@@ -487,4 +488,12 @@ public class InsOrdersController extends BaseController {
     }
 
 
+    @PostMapping("/queryLicenseInOrder")
+    @ApiOperation(value = "查询订单中的车牌")
+    public HttpResult<List<String>> queryLicenseInOrder(@RequestBody QueryLicenseInOrderVo queryLicenseInOrderVo){
+        List<String> licenseList =  insOrdersService.queryLicenseInOrder(queryLicenseInOrderVo);
+        return HttpResult.ok(licenseList);
+    }
+
+
 }

+ 6 - 0
src/main/java/com/ydtech/modules/order/dao/InsOrdersMapper.java

@@ -136,4 +136,10 @@ public interface InsOrdersMapper extends BaseMapper<InsOrders> {
      */
     List<TelemarketingAuditOrderDTO> getTelemarketingAudit(@Param("telemarketingAuditOrderQueryVo") TelemarketingAuditOrderQueryVo telemarketingAuditOrderQueryVo, @Param("userId") String userId);
 
+    /**
+     * 查询某个时间段的车牌号
+     * @param queryLicenseInOrderVo
+     * @return
+     */
+    List<String> queryLicense(@Param("queryLicenseInOrderVo") QueryLicenseInOrderVo queryLicenseInOrderVo, @Param("userId") String userId);
 }

+ 7 - 3
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -507,13 +507,17 @@ public class InsAreaCompany implements Serializable {
 
     /**
      * @see com.ydtech.modules.order.constants.PcPhoneStatus
-     *  报价状态  0 pc   1.app
+     * 报价状态  0 pc   1.app
      */
     @TableField("order_source")
     private Integer orderSource;
 
-     @TableField(value = "del_flag")
-     private String delFlag;
+    /**
+     * 0 删除 1 正常
+     * 删除订单
+     */
+    @TableField(value = "del_flag")
+    private String delFlag;
 
     public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
         this.id = IdGenerate.nextId();

+ 18 - 0
src/main/java/com/ydtech/modules/order/entity/vo/QueryLicenseInOrderVo.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.order.entity.vo;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("查询订单参数")
+public class QueryLicenseInOrderVo {
+
+    @ApiModelProperty("开始时间")
+    private String startDate;
+
+    @ApiModelProperty("结算时间")
+    private String endDate;
+
+}

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

@@ -235,4 +235,11 @@ public interface InsOrdersService extends IService<InsOrders> {
      * @return
      */
     BasePageResult<TelemarketingAuditOrderDTO> getTelemarketingAudit(TelemarketingAuditOrderQueryVo telemarketingAuditOrderQueryVo);
+
+    /**
+     * 查询订单中的车牌
+     * @param queryLicenseInOrderVo 查询参数
+     * @return 车牌列表
+     */
+    List<String> queryLicenseInOrder(QueryLicenseInOrderVo queryLicenseInOrderVo);
 }

+ 20 - 13
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -383,7 +383,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             throw new SystemException("1001", "车牌与此订单不符,请重新录单");
         }
 
-        if(StringUtils.isNotEmpty(productId) && !productId.equals(insOrders1.getProductid())){
+        if (StringUtils.isNotEmpty(productId) && !productId.equals(insOrders1.getProductid())) {
             throw new SystemException("1001", "产品类型不符,请重新录单");
         }
 
@@ -769,15 +769,15 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                 insDrivingIntentionInsuranceSon.get(0).setPremium(orderAndAreaCompany.getJypremium().toString());
             }
             JSONArray accidentInfo = JSON.parseArray(JSON.toJSONString(insDrivingIntentionInsuranceSon));
-            if(accidentInfo.isEmpty()){
+            if (accidentInfo.isEmpty()) {
                 InsDrivingIntentionInsurance one = insDrivingIntentionInsuranceService.getOne(new LambdaQueryWrapper<InsDrivingIntentionInsurance>()
                         .eq(InsDrivingIntentionInsurance::getProjectCode, insAreaCompanyAccidentalDriving.getRideRiskCode())
                         .or()
                         .eq(InsDrivingIntentionInsurance::getRiskCode, insAreaCompanyAccidentalDriving.getRideRiskCode()));
-                if(!Objects.isNull(one)){
+                if (!Objects.isNull(one)) {
                     JSONObject accidentInfoObject = new JSONObject();
-                    accidentInfoObject.put("name",one.getProjectName());
-                    accidentInfoObject.put("premium",orderAndAreaCompany.getJypremium());
+                    accidentInfoObject.put("name", one.getProjectName());
+                    accidentInfoObject.put("premium", orderAndAreaCompany.getJypremium());
                     accidentInfo.add(accidentInfoObject);
                 }
             }
@@ -829,12 +829,12 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         InsAreaCompanyExternalFee insAreaCompanyExternalFee = null;
         BeanUtils.copyProperties(insOrders, insOrdersEditingVo);
         List<InsBusinessInsurance> businessInsurance = insBusinessInsuranceService.getBusinessInsurance();
-        for(int i=0;i<insOrdersEditingVo.getKing().size();i++){
+        for (int i = 0; i < insOrdersEditingVo.getKing().size(); i++) {
             int finalI = i;
             InsBusinessInsurance insurance = businessInsurance.stream().filter(x -> x.getKindCode()
                     .equals(insOrdersEditingVo.getKing().getJSONObject(finalI).getString("kindCode"))).findFirst().orElse(null);
-            if(!Objects.isNull(insurance)){
-                insOrdersEditingVo.getKing().getJSONObject(i).put("grouping",insurance.getGrouping());
+            if (!Objects.isNull(insurance)) {
+                insOrdersEditingVo.getKing().getJSONObject(i).put("grouping", insurance.getGrouping());
             }
         }
         //如果是外部订单才回显这些数据
@@ -907,12 +907,12 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                 insAreaCompanyQueryDtos.stream().map(InsOrdersEditingVo.InsAreaCompanyEditingDto::new).collect(Collectors.toList());
 
 
-        insAreaCompanyEditingDtos.forEach(item->{
+        insAreaCompanyEditingDtos.forEach(item -> {
             InsAreaCompanyQueryDto insAreaCompanyQueryDto = insAreaCompanyQueryDtos.stream().filter(x -> x.getId().equals(item.getCompanyId())).findFirst().orElse(null);
             item.setProductid(insAreaCompanyQueryDto.getProductid());
-            if(item.getProductid().equals(ProductsType.PT_0330.getCode()) ||
-            item.getProductid().equals(ProductsType.PT_0330034002.getCode()) ||
-            item.getProductid().equals(ProductsType.PT_0330034001.getCode())) {
+            if (item.getProductid().equals(ProductsType.PT_0330.getCode()) ||
+                    item.getProductid().equals(ProductsType.PT_0330034002.getCode()) ||
+                    item.getProductid().equals(ProductsType.PT_0330034001.getCode())) {
                 JSONArray jsonArray = JqInsuranceType.toJsonArray();
                 item.setJqList(jsonArray);
             }
@@ -1071,7 +1071,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         List<InsOrdersEditingVo.InsAreaCompanyEditingDto> insAreaCompanyEditingDtos =
                 insAreaCompanyQueryDtos.stream().map(InsOrdersEditingVo.InsAreaCompanyEditingDto::new).collect(Collectors.toList());
 
-        ptlAgreementInsCompanyDtos.forEach(companyDto->{
+        ptlAgreementInsCompanyDtos.forEach(companyDto -> {
             InsOrdersEditingVo.InsAreaCompanyEditingDto insAreaCompanyEditingDto = insAreaCompanyEditingDtos.stream().filter(x -> x.getInscompany().equals(companyDto.getNamesimple())).findFirst().orElse(null);
             companyDto.setEditingDto(insAreaCompanyEditingDto);
         });
@@ -1963,4 +1963,11 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                 , pageInfo.getList());
     }
 
+    @Override
+    public List<String> queryLicenseInOrder(QueryLicenseInOrderVo queryLicenseInOrderVo) {
+        String userId = BaseController.getUserId();
+        List<String> license = baseMapper.queryLicense(queryLicenseInOrderVo, userId);
+        return license;
+    }
+
 }

+ 1 - 1
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -839,7 +839,7 @@
         sys_user su
         LEFT JOIN sys_user_info info ON info.id = su.id
         LEFT JOIN sys_dept sd ON su.dept_id = sd.id
-        left join sys_dept psd on psd.id = sd.parent_id
+        LEFT JOIN sys_dept psd on psd.id = sd.parent_id
         LEFT JOIN sys_user_role t3 ON su.id = t3.user_id
         LEFT JOIN sys_role t4 ON t3.role_id = t4.id
         AND sd.del_flag = '0'

+ 11 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -1712,4 +1712,15 @@
 
     </select>
 
+
+    <select id="queryLicense" resultType="java.lang.String">
+        SELECT DISTINCT licenseno
+        from ins_orders
+        WHERE userid = #{userId}
+        <if test="queryLicenseInOrderVo.startDate != null and queryLicenseInOrderVo.startDate != '' and queryLicenseInOrderVo.endDate != null and queryLicenseInOrderVo.endDate != ''">
+            AND createtime BETWEEN #{queryLicenseInOrderVo.startDate} AND
+            #{queryLicenseInOrderVo.endDate}
+        </if>
+    </select>
+
 </mapper>