Kaynağa Gözat

支付二维码问题

wks 1 yıl önce
ebeveyn
işleme
d9f25ebde2

+ 25 - 0
src/main/java/com/ydtech/modules/order/controller/QrCodeController.java

@@ -10,6 +10,7 @@ import com.ydtech.modules.admin.service.SysBarcodeConfigService;
 import com.ydtech.modules.admin.service.SysQRCodeRelationService;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
+import com.ydtech.modules.inv.utils.LocalDateTimeUtils;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrderQrCode;
 import com.ydtech.modules.order.entity.InsOrders;
@@ -20,6 +21,10 @@ import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.constants.ValidStatus;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
+import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
+import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
+import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
+import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewService;
 import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -131,16 +136,36 @@ public class QrCodeController {
         throw new SystemException("二维码销毁失败");
     }
 
+    @Autowired
+    private InsFeeOrderNewService insFeeOrderNewService;
+
+    @Autowired
+    private PtlAgreementProductCostsNewService ptlAgreementProductCostsNewService;
+
+
     @GetMapping(value = "/index")
     @ApiOperation(value = "扫描二维码地址")
     @SaIgnore
     public Object index(String areaCompanyId) throws IOException {
         InsOrderQrCode insOrderQrCode = insOrderQrCodeService.getOne(areaCompanyId);
         InsAreaCompany insAreaCompany = insAreaCompanyService.getById(areaCompanyId);
+
+        InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getByInsOrderNo(insAreaCompany.getId());
+        PtlAgreementProductCostsNew ptlAgreementProductCostsNew = ptlAgreementProductCostsNewService.getById(insFeeOrderNew.getCostsId());
+        String costsStartDate = ptlAgreementProductCostsNew.getCostsStartDate();
+        String costsEndDate = ptlAgreementProductCostsNew.getCostsEndDate();
+        boolean b = LocalDateTimeUtils.nowIsBetweenStartAndEnd(costsStartDate, costsEndDate);
+        // 先判断时间
+        if (!b) {
+            //重定向到错误页面中
+            return getModelAndView("费用失效,请重新报价。");
+        }
+        // 在判断状态
         if (ValidStatus.AVS_0.getCode().equals(Integer.parseInt(insAreaCompany.getCodeValidStatus()))) {
             //重定向到错误页面中
             return getModelAndView("费用失效,请重新报价。");
         }
+
         // 根据保险公司获取二维码配置方式
         LambdaQueryWrapper<SysBarcodeConfig> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(SysBarcodeConfig::getCompanyId, insAreaCompany.getCompanyId())