Explorar el Código

Merge remote-tracking branch 'origin/test' into test

wks hace 1 año
padre
commit
bea7bc5a24

+ 7 - 1
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -1,7 +1,6 @@
 package com.ydtech.modules.fnc.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
@@ -231,4 +230,11 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
     BigDecimal queryDateByNotTypeSumAmount(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
 
     BigDecimal queryDateByTypeNotSumAmount(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/30 10:08
+     *  @Description:  查询签单日期为空的结算日期
+     */
+    List<InsPlyIncome> findListByDate(@Param("benginDate") String benginDate, @Param("endDate") String endDate);
 }

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

@@ -281,5 +281,11 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
      * 纠正数据
      */
     void correctData(InsPlyIncomeVo insPlyIncomeVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/30 10:36
+     *  @Description:  查询签单日期为空的结算数据
+     */
+    List<InsPlyIncome> findListByDate(String benginDate, String endDate);
 }

+ 10 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -4198,4 +4198,14 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             }
         }
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/30 10:36
+     *  @Description: 查询签单日期为空的数据
+     */
+    @Override
+    public List<InsPlyIncome> findListByDate(String benginDate, String endDate) {
+        return baseMapper.findListByDate(benginDate,endDate);
+    }
 }

+ 17 - 7
src/main/java/com/ydtech/modules/order/controller/InsOrderReadPdfController.java

@@ -2,10 +2,6 @@ package com.ydtech.modules.order.controller;
 
 
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.modules.admin.model.dto.SysUserDto;
-import com.ydtech.modules.admin.model.dto.SysUserLinkAreaDto;
-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;
@@ -17,14 +13,11 @@ 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;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
-import java.io.IOException;
-import java.util.List;
 
 /**
  *  @version
@@ -136,6 +129,23 @@ public class InsOrderReadPdfController extends BaseController {
     }
 
 
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/30 10:40
+     *  @Description: 手动更新结算表的签单时间
+     */
+    @GetMapping("updatePlySignDate")
+    @ApiOperation("手动更新结算表的签单时间")
+    public HttpResult<Object> updatePlySignDate(String id) {
 
+        try{
+            insOrderReadPdfService.updatePlySignDate(id);
+            return HttpResult.ok("操作成功");
+        }catch (Exception e){
+            return HttpResult.error("操作失败"+e.getMessage());
+        }
+
+    }
 
 }

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

@@ -34,4 +34,11 @@ public interface InsOrderPayDateRecordService extends IService<InsOrderPayDateRe
      *  @Description: 定时更新订单的时间
      */
      void batchOrderDate(String beginDate,String endDate);
+     /**
+      *  @version
+      *  @author: hxl
+      *  @Date: 2024/12/30 10:02
+      *  @Description: 自动更新应收单表中的签单日期
+      */
+    void batchOrderPlyOrderDate(String benginDate, String endDate);
 }

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

@@ -35,4 +35,11 @@ public interface InsOrderReadPdfService extends IService<InsOrderReadPdf> {
      *  @Description:  通過保險公司和pdf路徑读取配置信息
      */
     InsOrderReadPdfContentDto readPdfContent(InsOrderReadPdfContentVo insOrderReadPdfContentVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/30 10:41
+     *  @Description: 手动更新结算表的签单时间
+     */
+    void updatePlySignDate(String id);
 }

+ 50 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsOrderPayDateRecordServiceImpl.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.ydtech.modules.order.dao.InsOrderPayDateRecordMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.api.pingan.utils.PDFUtil;
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Service;
 
 import java.io.File;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -54,6 +57,9 @@ public class InsOrderPayDateRecordServiceImpl extends ServiceImpl<InsOrderPayDat
     @Autowired
     private InsOrdersTrackService insOrdersTrackService;
 
+
+    @Autowired
+    private InsPlyIncomeService insPlyIncomeService;
     /**
      *  @version
      *  @author: hxl
@@ -137,6 +143,16 @@ public class InsOrderPayDateRecordServiceImpl extends ServiceImpl<InsOrderPayDat
             }
             //更新时间表
              insAreaCompanyService.updateById(subOrder);
+            //判斷又沒有結算表如果有更新  add  by hxl  2024-12-30
+            if(subOrder.getSigningTime()!=null){
+                LambdaQueryWrapper<InsPlyIncome> lqw = new LambdaQueryWrapper<>();
+                lqw.eq(InsPlyIncome::getOrderno, subOrder.getId());
+                InsPlyIncome insPlyIncome = insPlyIncomeService.getOne(lqw);
+                if(insPlyIncome!=null){
+                    insPlyIncome.setSignDate(subOrder.getSigningTime());
+                    insPlyIncomeService.updateById(insPlyIncome);
+                }
+            }
 
         }else{
            throw   new SystemException("生成保单失败");
@@ -175,6 +191,40 @@ public class InsOrderPayDateRecordServiceImpl extends ServiceImpl<InsOrderPayDat
            }
        }
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/30 10:03
+     *  @Description: 自动更新签单表的日期
+     */
+    @Override
+    public void batchOrderPlyOrderDate(String benginDate, String endDate) {
+        //查询签单日期为空的数据
+        List<InsPlyIncome> list = insPlyIncomeService.findListByDate(benginDate,endDate);
+        List<InsPlyIncome>  newList =new ArrayList<>();
+        if(list!=null && list.size()>0){
+            for(InsPlyIncome  insPlyIncome : list){
+                //更新子订单的签单时间
+                if(insPlyIncome.getSignDate()==null){
+                    try{
+                       updateOrderDate(insPlyIncome.getOrderno());
+                    }catch(Exception e){
+
+                    }
+                }
+                //更新時間
+                InsPlyIncome  ply = insPlyIncomeService.getById(insPlyIncome.getId());
+                if(ply!=null){
+                    InsAreaCompany iac = insAreaCompanyService.getById(insPlyIncome.getOrderno());
+                    if(iac.getSigningTime()!=null){
+                        ply.setSignDate(iac.getSigningTime());
+                        newList.add(ply);
+                    }
+                }
+            }
+            insPlyIncomeService.saveOrUpdateBatch(newList);
+        }
+    }
 }
 
 

+ 45 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsOrderReadPdfServiceImpl.java

@@ -3,16 +3,22 @@ package com.ydtech.modules.order.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.SysUserRole;
 import com.ydtech.modules.admin.model.dto.SysUserLinkAreaDto;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.ydtech.modules.order.dao.InsOrderReadPdfMapper;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.api.pingan.utils.PDFUtil;
 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.service.InsAreaCompanyService;
+import com.ydtech.modules.order.service.InsOrderPayDateRecordService;
 import com.ydtech.modules.order.service.InsOrderReadPdfService;
 import com.ydtech.utils.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -35,6 +41,15 @@ public class InsOrderReadPdfServiceImpl extends ServiceImpl<InsOrderReadPdfMappe
     @Autowired
     private InsOrderReadPdfMapper  insOrderReadPdfMapper;
 
+    @Autowired
+    private InsAreaCompanyService insAreaCompanyService;
+
+    @Autowired
+    private InsPlyIncomeService insPlyIncomeService;
+
+    @Autowired
+    private InsOrderPayDateRecordService insOrderPayDateRecordService;
+
     @Override
     public BasePageResult<InsOrderReadPdf> queryPage(InsOrderReadPdfVo insOrderReadPdfVo) {
         Page<InsOrderReadPdf> page = new Page<>(insOrderReadPdfVo.getPageNum(),
@@ -89,4 +104,34 @@ public class InsOrderReadPdfServiceImpl extends ServiceImpl<InsOrderReadPdfMappe
         }
         return new InsOrderReadPdfContentDto(pdfText,content);
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/12/30 10:42
+     *  @Description:  手动更新结算表的签单时间
+     */
+    @Override
+    public void updatePlySignDate(String id) {
+        InsPlyIncome  ply = insPlyIncomeService.getById(id);
+        if(ply!=null){
+           if(ply.getOrderno() ==null){
+               new SystemException("子订单编号为空不允许更新");
+           }else{
+               InsAreaCompany iac = insAreaCompanyService.getById(ply.getOrderno());
+               //更新子订单的签单时间
+               if(iac.getSigningTime()==null){
+                   try{
+                       insOrderPayDateRecordService.updateOrderDate(ply.getOrderno());
+                   }catch(Exception e){
+                       new SystemException("更新保单签单时期失败");
+                   }
+               }
+               InsAreaCompany newIac = insAreaCompanyService.getById(ply.getOrderno());
+               if(newIac.getSigningTime()!=null){
+                   ply.setSignDate(iac.getSigningTime());
+                   insPlyIncomeService.saveOrUpdate(ply);
+               }
+           }
+        }
+    }
 }

+ 3 - 0
src/main/java/com/ydtech/modules/order/service/impl/SysQuoteConfigServiceImpl.java

@@ -326,6 +326,9 @@ public class SysQuoteConfigServiceImpl extends ServiceImpl<SysQuoteConfigMapper,
         if(quoteDetailsQueryVo.getDeptId() == null) {
             quoteDetailsQueryVo.setDeptId(BaseController.getDeptId());
         }
+        if(quoteDetailsQueryVo.getOperator() == null){
+            quoteDetailsQueryVo.setOperator(BaseController.getUserId());
+        }
         Page<QuoteDetailsVo> quoteRecordPage = sysQuoteRecordMapper.getQuoteRecordPage(page, quoteDetailsQueryVo);
         quoteRecordPage.getRecords().forEach(item -> {
             item.setAction(QuoteNumberConstant.QuoteAction.getByCode(item.getAction()));

+ 20 - 0
src/main/java/com/ydtech/modules/order/timer/UpdateOrderTimer.java

@@ -67,4 +67,24 @@ public class UpdateOrderTimer {
             log.error("定时更新订单的签单时间和缴费日期失败:{}", e.getMessage());
         }
     }
+
+
+     /**
+      *  @version
+      *  @author: hxl
+      *  @Date: 2024/12/30 9:59
+      *  @Description:  自动更新结算表中签单日期为空的数据
+      */
+    @Scheduled(cron = "0 0/10 * * * ?")
+    private void updateOrderPlyDateMinite() {
+        String benginDate = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd")+" 00:00:00";
+        String endDate = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd")+" 23:59:59";
+        try {
+            insOrderPayDateRecordService.batchOrderPlyOrderDate(benginDate,endDate);
+            log.info("定时更新结算表的签单时间和缴费日期成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("定时更新结算表的签单时间和缴费日期失败:{}", e.getMessage());
+        }
+    }
 }

+ 15 - 0
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -3572,4 +3572,19 @@
 
 
     </select>
+    <select id="findListByDate" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
+        SELECT
+        iac.id  as orderno,
+        ipi.id  as id,
+        iac.signing_time  as signDate
+        FROM
+        ins_area_company iac
+        LEFT JOIN ins_ply_income ipi ON iac.id = ipi.orderno
+        WHERE
+        iac.orderstatus =3
+        AND ipi.signdate IS NULL
+        AND iac.createtime <![CDATA[ >= ]]> #{benginDate}
+        AND iac.createtime <![CDATA[ <= ]]> #{endDate}
+        and ipi.id IS NOT NULL
+    </select>
 </mapper>

+ 10 - 9
src/main/resources/mapper/modules/order/SysQuoteRecordMapper.xml

@@ -54,17 +54,18 @@
             <if test="param.result!= null and param.result!= ''">
                 AND sqr.result = #{param.result}
             </if>
-            <if test="param.agent != null and param.agent != ''">
-                AND (sqr.user_id = #{param.agent} or su.name = #{param.agent})
-            </if>
-            <if test="param.operator != null and param.operator != ''">
-                AND sqr.operator = #{param.operator}
-            </if>
+
+
             <if test="param.deptId!= null and param.deptId!= ''">
-                AND sd.id like '${param.deptId}%'
+                <if test="param.operator != null and param.operator != ''">
+                    AND (sd.id like '${param.deptId}%' or sqr.operator = #{param.operator} or su.name = #{param.operator})
+                </if>
+                <if test="param.operator == null or param.operator == ''">
+                    AND sd.id like '${param.deptId}%'
+                </if>
             </if>
-            <if test="param.action != null and param.action!= ''">
-                AND sqr.action = #{param.action}
+            <if test="param.agent != null and param.agent!= ''">
+                AND sqr.user_id = #{param.agent}
             </if>
         ORDER BY sqr.create_time DESC
     </select>