Explorar o código

订单没有进到订单管理

lipf hai 5 meses
pai
achega
468cdcf548

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/dto/InsOrdersParamVO.java

@@ -13,6 +13,9 @@ import java.util.Date;
 public class InsOrdersParamVO extends PageRequest {
 
     // --------------- 你原有字段 ---------------
+    @Schema(description = "sys_user_jzg_info表的序号")
+    private String jzgInfoId;
+
     @Schema(description = "订单号")
     private String orderNo;
 

+ 17 - 9
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/client/OrgClient.java

@@ -21,6 +21,18 @@ import java.util.Map;
 @FeignClient(name = "jzg-organization")
 public interface OrgClient {
 
+    /**
+     * 根据用户userId序号查找指定租户下的用户信息
+     *
+     * @param userId 用户序号
+     * @param systemCode 租户代码
+     * @author lipf
+     * @date 2026/4/28 9:37
+     */
+    @GetMapping("/api/v1/organization/queryUserByUserId")
+    HttpResult<SysUserJzgInfo> queryUserByUserId(@RequestParam("userId") String userId,
+                                                 @RequestParam("systemCode") String systemCode);
+
     /**
      * 查找人员信息地区
      *
@@ -50,8 +62,7 @@ public interface OrgClient {
      * 根据id获取费用信息
      *
      * @param id
-     * @param authToken
-     * @return
+     * @return HttpResult<PtlAgreementCostVo>
      */
     @GetMapping(value = "/ptlAgreementCost/queryById")
     HttpResult<PtlAgreementCostVo> queryCostById(@RequestParam Long id);
@@ -75,8 +86,7 @@ public interface OrgClient {
      * 获取用户唯一id
      *
      * @param mobile
-     * @param authToken
-     * @return
+     * @return HttpResult<SysUser>
      */
     @GetMapping(value = "/userInfo/getUserOnlyIdByMobile")
     HttpResult<SysUser> getUserOnlyIdByMobile(@RequestParam String mobile);
@@ -85,8 +95,7 @@ public interface OrgClient {
      * 用户账户信息查询
      *
      * @param userId
-     * @param authToken
-     * @return
+     * @return HttpResult<SysUserAccount>
      */
     @GetMapping(value = "/userAccount/accountGet")
     HttpResult<SysUserAccount> accountGet(@RequestParam String userId);
@@ -94,9 +103,8 @@ public interface OrgClient {
     /**
      * 用户账户信息保存
      *
-     * @param userAccount
-     * @param authToken
-     * @return
+     * @param userAccount 用户账号
+     * @return HttpResult
      */
     @PostMapping(value = "/userAccount/saveOrUpdate")
     HttpResult saveOrUpdate(@RequestBody SysUserAccount userAccount);

+ 12 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsOrdersController.java

@@ -28,6 +28,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.RequiredArgsConstructor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -45,6 +47,8 @@ import java.util.stream.Collectors;
 @RequiredArgsConstructor
 public class InsOrdersController extends BaseController {
 
+    private static final Logger log = LoggerFactory.getLogger(InsOrdersController.class);
+
     @Resource
     private InsOrdersService insOrdersService;
 
@@ -72,10 +76,17 @@ public class InsOrdersController extends BaseController {
         return insOrdersService.updateOrders(ordersEnd);
     }
 
+    /**
+     * 删除车险订单/补录订单
+     *
+     * @author lipf
+     * @date 2026/4/28 11:24
+     */
     @OperatorTrajectory(moduleName = "车险订单/补录订单删除)",mapperClass = InsOrdersMapper.class,entityClass = InsOrdersAdd.class,type = "D")
     @GetMapping("deleteById")
     @Operation(summary = "删除订单")
-    public HttpResult deleteById(@RequestParam("id") Long id) {
+    public HttpResult<String> deleteById(@RequestParam("id") Long id) {
+        log.info("删除车险订单:id=[{}]",id);
         return insOrdersService.removeById(id) ? HttpResult.ok("删除成功") : HttpResult.error("删除失败");
     }
 

+ 6 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/mapper/InsOrdersMapper.java

@@ -31,6 +31,12 @@ public interface InsOrdersMapper extends BaseMapper<InsOrders> {
 
     Page<InsOrdersVo> queryList(@Param("page") Page page, @Param("insOrdersParam") InsOrdersParam insOrdersParam);
 
+    /**
+     * 查询车险报价订单
+     *
+     * @author lipf
+     * @date 2026/4/28 9:22
+     */
     Page<OrderListVo> queryOrderList(@Param("page") Page page, @Param("insOrdersParam") InsOrdersParamVO insOrdersParam);
 
     List<OrderListVo> queryOrderListAll(@Param("insOrdersParam") InsOrdersParamVO insOrdersParam);

+ 15 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -1142,10 +1142,24 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     }
 
 
+    /**
+     * 查询车险报价订单
+     *
+     * @author lipf
+     * @date 2026/4/28 9:21
+     */
     @Override
     public Page<OrderListVo> queryList(InsOrdersParamVO insOrdersParam) {
         String userName = baseController.getUserName();
-        insOrdersParam.setSalesman(userName);
+        log.info("订单管理查询车险报价订单:insOrdersParam=[{}]. userName=[{}]", JSONUtil.toJsonStr(insOrdersParam), userName);
+        HttpResult<SysUserJzgInfo> sysUserJzgInfoHttpResult = orgClient.queryUserByUserId(baseController.getUserId(), baseController.getSystemCode());
+        SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoHttpResult.getData();
+        // modify by lipf, 为了支持能查询成员下面所有业务员的数据添加jzgInfoId这个字段 2026年4月28日11:54:43
+        String jzgInfoId = null;
+        if(sysUserJzgInfo != null){
+            jzgInfoId = sysUserJzgInfo.getId();
+            insOrdersParam.setJzgInfoId(jzgInfoId);
+        }
         Page<OrderListVo> orderListVoPage = insOrdersMapper.queryOrderList(insOrdersParam.getPage(), insOrdersParam);
         if (StringUtils.equals("1",insOrdersParam.getIsLargeOrder())){
             processMainOrder(orderListVoPage);

+ 117 - 115
tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrdersMapper.xml

@@ -736,6 +736,7 @@
         order by create_time desc
     </select>
 
+    <!--查询车险报价订单 modify by lipf 2026年4月28日09:22:46 -->
     <select id="queryOrderList" resultType="com.jzg.commons.entity.orders.vo.OrderListVo">
         SELECT
         io.id as order_no,
@@ -811,122 +812,123 @@
         FROM ins_order_adjust t where t.status = 2 and t.is_delete = 0
         ) x WHERE x.rn = 1
         ) ioa1 ON io.id = ioa1.order_no
-        where
-        1=1
-
-        <if test="insOrdersParam.orderNo != null and insOrdersParam.orderNo != ''">
-            AND io.id = #{insOrdersParam.orderNo}
-        </if>
-        <if test="insOrdersParam.parentId == 0 ">
-            AND io.parent_id = 0
-        </if>
-        <if test="insOrdersParam.parentId == 1 ">
-            AND io.parent_id != 0
-        </if>
-        <if test="insOrdersParam.licenseNo != null and insOrdersParam.licenseNo != ''">
-            AND ioci.license_no = #{insOrdersParam.licenseNo}
-        </if>
-        <if test="insOrdersParam.orderStatus!= null and insOrdersParam.orderStatus!= ''">
-            AND io.order_status = #{insOrdersParam.orderStatus}
-        </if>
-        <if test="insOrdersParam.adjustStatus!= null and insOrdersParam.adjustStatus!= ''">
-            AND ioa.status = #{insOrdersParam.adjustStatus}
-        </if>
-        <if test="insOrdersParam.salesman!= null">
-            AND io.real_quote_user_id = #{insOrdersParam.salesman}
-        </if>
-        <if test="insOrdersParam.companyId != null and insOrdersParam.companyId != ''">
-            AND io.company_id = #{insOrdersParam.companyId}
-        </if>
-        <if test="insOrdersParam.startDate != null and insOrdersParam.startDate != ''and insOrdersParam.endDate != null and insOrdersParam.endDate != ''">
-            AND io.create_time BETWEEN #{insOrdersParam.startDate} and #{insOrdersParam.endDate}
-        </if>
-
-        <if test="insOrdersParam.companyName != null and insOrdersParam.companyName != ''">
-            AND io.company_name = #{insOrdersParam.companyName}
-        </if>
-        <if test="insOrdersParam.productCode != null and insOrdersParam.productCode != ''">
-            AND io.product_id = #{insOrdersParam.productCode}
-        </if>
-        <if test="insOrdersParam.productName != null and insOrdersParam.productName != ''">
-            AND io.product_name = #{insOrdersParam.productName}
-        </if>
-        <if test="insOrdersParam.vinNo != null and insOrdersParam.vinNo != ''">
-            AND ioci.vin_no = #{insOrdersParam.vinNo}
-        </if>
-        <if test="insOrdersParam.ownerName != null and insOrdersParam.ownerName != ''">
-            AND owner_u.name = #{insOrdersParam.ownerName}
-        </if>
-        <if test="insOrdersParam.ownerMobile != null and insOrdersParam.ownerMobile != ''">
-            AND owner_u.mobile = #{insOrdersParam.ownerMobile}
-        </if>
-        <if test="insOrdersParam.policyName != null and insOrdersParam.policyName != ''">
-            AND policy_u.name = #{insOrdersParam.policyName}
-        </if>
-        <if test="insOrdersParam.policyMobile != null and insOrdersParam.policyMobile != ''">
-            AND policy_u.mobile = #{insOrdersParam.policyMobile}
-        </if>
-        <if test="insOrdersParam.insurName != null and insOrdersParam.insurName != ''">
-            AND insur_u.name = #{insOrdersParam.insurName}
-        </if>
-        <if test="insOrdersParam.insurMobile != null and insOrdersParam.insurMobile != ''">
-            AND insur_u.mobile = #{insOrdersParam.insurMobile}
-        </if>
-        <if test="insOrdersParam.ciStartDate != null">
-            AND iorci.start_date = #{insOrdersParam.ciStartDate}
-        </if>
-        <if test="insOrdersParam.biStartDate != null">
-            AND iorbi.start_date = #{insOrdersParam.biStartDate}
-        </if>
-        <if test="insOrdersParam.sumPremium != null">
-            AND iorco.sum_premium = #{insOrdersParam.sumPremium}
-        </if>
-        <if test="insOrdersParam.ciPremium != null">
-            AND iorco.jq_premium = #{insOrdersParam.ciPremium}
-        </if>
-        <if test="insOrdersParam.biPremium != null">
-            AND iorco.sy_premium = #{insOrdersParam.biPremium}
-        </if>
-        <if test="insOrdersParam.niPremium != null">
-            AND iorco.jy_premium = #{insOrdersParam.niPremium}
-        </if>
-        <if test="insOrdersParam.vvTax != null">
-            AND iorco.tax_premium = #{insOrdersParam.vvTax}
-        </if>
-        <if test="insOrdersParam.recorder != null and insOrdersParam.recorder != ''">
-            AND su.username = #{insOrdersParam.recorder}
-        </if>
-        <if test="insOrdersParam.salesmanInfo != null and insOrdersParam.salesmanInfo != ''">
-            AND suji.name = #{insOrdersParam.salesmanInfo}
-        </if>
-        <if test="insOrdersParam.salesmanType != null and insOrdersParam.salesmanType != ''">
-            AND suji.type_attr = #{insOrdersParam.salesmanType}
-        </if>
-        <if test="insOrdersParam.agreementName != null and insOrdersParam.agreementName != ''">
-            AND pa.agreement_name = #{insOrdersParam.agreementName}
-        </if>
-        <if test="insOrdersParam.deptId != null and insOrdersParam.deptId != ''">
-            AND sd.id = #{insOrdersParam.deptId}
-        </if>
-        <if test="insOrdersParam.deptName != null and insOrdersParam.deptName != ''">
-            AND sd.name = #{insOrdersParam.deptName}
-        </if>
-        <if test="insOrdersParam.paymentLink != null and insOrdersParam.paymentLink != ''">
-            AND io.pay_link = #{insOrdersParam.paymentLink}
-        </if>
-        <if test="insOrdersParam.adjustId != null">
-            AND ioa.id = #{insOrdersParam.adjustId}
-        </if>
-        <if test="insOrdersParam.adjustPremium != null">
-            AND ioa1.after_premium = #{insOrdersParam.adjustPremium}
-        </if>
-        <if test="insOrdersParam.startSigningTime != null and insOrdersParam.startSigningTime != ''and insOrdersParam.endSigningTime != null and insOrdersParam.endSigningTime != ''">
-            AND io.signing_time BETWEEN #{insOrdersParam.startSigningTime} and #{insOrdersParam.endSigningTime}
-        </if>
-        <if test="insOrdersParam.startPayTime != null and insOrdersParam.startPayTime != ''and insOrdersParam.endPayTime != null and insOrdersParam.endPayTime != ''">
-            AND io.pay_time BETWEEN #{insOrdersParam.startPayTime} and #{insOrdersParam.endPayTime}
-        </if>
+        <where>
+            io.is_delete = 0
+            <if test="insOrdersParam.jzgInfoId != null and insOrdersParam.jzgInfoId != ''">
+                and io.real_quote_user_id in (select username from  sys_user bbb where bbb.id in (
+                select ss.user_id from sys_user_jzg_info ss where ss.leader_id = #{insOrdersParam.jzgInfoId}
+                ) )
+            </if>
+            <if test="insOrdersParam.orderNo != null and insOrdersParam.orderNo != ''">
+                AND io.id = #{insOrdersParam.orderNo}
+            </if>
+            <if test="insOrdersParam.parentId == 0 ">
+                AND io.parent_id = 0
+            </if>
+            <if test="insOrdersParam.parentId == 1 ">
+                AND io.parent_id != 0
+            </if>
+            <if test="insOrdersParam.licenseNo != null and insOrdersParam.licenseNo != ''">
+                AND ioci.license_no = #{insOrdersParam.licenseNo}
+            </if>
+            <if test="insOrdersParam.orderStatus!= null and insOrdersParam.orderStatus!= ''">
+                AND io.order_status = #{insOrdersParam.orderStatus}
+            </if>
+            <if test="insOrdersParam.adjustStatus!= null and insOrdersParam.adjustStatus!= ''">
+                AND ioa.status = #{insOrdersParam.adjustStatus}
+            </if>
+            <if test="insOrdersParam.salesman!= null">
+                AND io.real_quote_user_id = #{insOrdersParam.salesman}
+            </if>
+            <if test="insOrdersParam.companyId != null and insOrdersParam.companyId != ''">
+                AND io.company_id = #{insOrdersParam.companyId}
+            </if>
+            <if test="insOrdersParam.startDate != null and insOrdersParam.startDate != ''and insOrdersParam.endDate != null and insOrdersParam.endDate != ''">
+                AND io.create_time BETWEEN #{insOrdersParam.startDate} and #{insOrdersParam.endDate}
+            </if>
 
+            <if test="insOrdersParam.companyName != null and insOrdersParam.companyName != ''">
+                AND io.company_name = #{insOrdersParam.companyName}
+            </if>
+            <if test="insOrdersParam.productCode != null and insOrdersParam.productCode != ''">
+                AND io.product_id = #{insOrdersParam.productCode}
+            </if>
+            <if test="insOrdersParam.productName != null and insOrdersParam.productName != ''">
+                AND io.product_name = #{insOrdersParam.productName}
+            </if>
+            <if test="insOrdersParam.vinNo != null and insOrdersParam.vinNo != ''">
+                AND ioci.vin_no = #{insOrdersParam.vinNo}
+            </if>
+            <if test="insOrdersParam.ownerName != null and insOrdersParam.ownerName != ''">
+                AND owner_u.name = #{insOrdersParam.ownerName}
+            </if>
+            <if test="insOrdersParam.ownerMobile != null and insOrdersParam.ownerMobile != ''">
+                AND owner_u.mobile = #{insOrdersParam.ownerMobile}
+            </if>
+            <if test="insOrdersParam.policyName != null and insOrdersParam.policyName != ''">
+                AND policy_u.name = #{insOrdersParam.policyName}
+            </if>
+            <if test="insOrdersParam.policyMobile != null and insOrdersParam.policyMobile != ''">
+                AND policy_u.mobile = #{insOrdersParam.policyMobile}
+            </if>
+            <if test="insOrdersParam.insurName != null and insOrdersParam.insurName != ''">
+                AND insur_u.name = #{insOrdersParam.insurName}
+            </if>
+            <if test="insOrdersParam.insurMobile != null and insOrdersParam.insurMobile != ''">
+                AND insur_u.mobile = #{insOrdersParam.insurMobile}
+            </if>
+            <if test="insOrdersParam.ciStartDate != null">
+                AND iorci.start_date = #{insOrdersParam.ciStartDate}
+            </if>
+            <if test="insOrdersParam.biStartDate != null">
+                AND iorbi.start_date = #{insOrdersParam.biStartDate}
+            </if>
+            <if test="insOrdersParam.sumPremium != null">
+                AND iorco.sum_premium = #{insOrdersParam.sumPremium}
+            </if>
+            <if test="insOrdersParam.ciPremium != null">
+                AND iorco.jq_premium = #{insOrdersParam.ciPremium}
+            </if>
+            <if test="insOrdersParam.biPremium != null">
+                AND iorco.sy_premium = #{insOrdersParam.biPremium}
+            </if>
+            <if test="insOrdersParam.niPremium != null">
+                AND iorco.jy_premium = #{insOrdersParam.niPremium}
+            </if>
+            <if test="insOrdersParam.vvTax != null">
+                AND iorco.tax_premium = #{insOrdersParam.vvTax}
+            </if>
+            <if test="insOrdersParam.salesmanInfo != null and insOrdersParam.salesmanInfo != ''">
+                AND su.username = #{insOrdersParam.salesmanInfo}
+            </if>
+            <if test="insOrdersParam.salesmanType != null and insOrdersParam.salesmanType != ''">
+                AND suji.type_attr = #{insOrdersParam.salesmanType}
+            </if>
+            <if test="insOrdersParam.agreementName != null and insOrdersParam.agreementName != ''">
+                AND pa.agreement_name = #{insOrdersParam.agreementName}
+            </if>
+            <if test="insOrdersParam.deptId != null and insOrdersParam.deptId != ''">
+                AND sd.id = #{insOrdersParam.deptId}
+            </if>
+            <if test="insOrdersParam.deptName != null and insOrdersParam.deptName != ''">
+                AND sd.name = #{insOrdersParam.deptName}
+            </if>
+            <if test="insOrdersParam.paymentLink != null and insOrdersParam.paymentLink != ''">
+                AND io.pay_link = #{insOrdersParam.paymentLink}
+            </if>
+            <if test="insOrdersParam.adjustId != null">
+                AND ioa.id = #{insOrdersParam.adjustId}
+            </if>
+            <if test="insOrdersParam.adjustPremium != null">
+                AND ioa1.after_premium = #{insOrdersParam.adjustPremium}
+            </if>
+            <if test="insOrdersParam.startSigningTime != null and insOrdersParam.startSigningTime != ''and insOrdersParam.endSigningTime != null and insOrdersParam.endSigningTime != ''">
+                AND io.signing_time BETWEEN #{insOrdersParam.startSigningTime} and #{insOrdersParam.endSigningTime}
+            </if>
+            <if test="insOrdersParam.startPayTime != null and insOrdersParam.startPayTime != ''and insOrdersParam.endPayTime != null and insOrdersParam.endPayTime != ''">
+                AND io.pay_time BETWEEN #{insOrdersParam.startPayTime} and #{insOrdersParam.endPayTime}
+            </if>
+        </where>
         order by io.create_time desc
     </select>
 

+ 2 - 2
tenant/organization/src/main/java/com/jzg/organization/controller/SysOrganizationController.java

@@ -148,12 +148,12 @@ public class SysOrganizationController {
 
     /**
      * 新增团队、渠道、电销组用户
-     * @param
+     * @param setPerson
      * @return
      */
     @Operation(summary = "设置团队、渠道、电销组负责人")
     @PostMapping("setResponsiblePerson")
-    public HttpResult setResponsiblePerson(@Validated @RequestBody SysOrganizationSetPerson setPerson){
+    public HttpResult<String> setResponsiblePerson(@Validated @RequestBody SysOrganizationSetPerson setPerson){
         return sysOrganizationService.setResponsiblePerson(setPerson);
     }
 

+ 37 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/SysUserJzgInfoController.java

@@ -0,0 +1,37 @@
+package com.jzg.organization.controller;
+
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.po.SysUserJzgInfo;
+
+import com.jzg.organization.service.SysUserJzgInfoService;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+public class SysUserJzgInfoController {
+
+    private static final Logger log = LoggerFactory.getLogger(SysUserJzgInfoController.class);
+
+    @Autowired
+    private SysUserJzgInfoService sysUserJzgInfoService;
+
+    /**
+     * 根据用户userId序号查找指定租户下的用户信息
+     *
+     * @param userId 用户序号
+     * @param systemCode 租户代码
+     * @author lipf
+     * @date 2026/4/28 9:37
+     */
+    @GetMapping("/api/v1/organization/queryUserByUserId")
+    public HttpResult<SysUserJzgInfo> queryUserByUserId(String userId, String systemCode){
+        log.info("根据用户userId序号查找指定租户下的用户信息. userId=[{}], systemCode=[{}]", userId, systemCode);
+        SysUserJzgInfo jzgInfo = sysUserJzgInfoService.getUserByUserId(userId);
+        return  HttpResult.ok(jzgInfo);
+    }
+}

+ 7 - 1
tenant/organization/src/main/java/com/jzg/organization/service/SysOrganizationService.java

@@ -30,7 +30,13 @@ public interface SysOrganizationService extends IService<SysOrganization> {
 
     HttpResult addTeamUsers(SysOrganizationUserLinkAdd organizationUserLinkAdd);
 
-    HttpResult setResponsiblePerson(SysOrganizationSetPerson setPerson);
+    /**
+     * 设置团队负责人
+     *
+     * @author lipf
+     * @date 2026/4/28 9:09
+     */
+    HttpResult<String> setResponsiblePerson(SysOrganizationSetPerson setPerson);
 
     /**
      * 删除团队、电销、渠道关联的用户

+ 8 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysOrganizationServiceImpl.java

@@ -120,8 +120,15 @@ public class SysOrganizationServiceImpl extends ServiceImpl<SysOrganizationMappe
         return sysOrganizationUserLinkService.save(organizationUserLink) ? HttpResult.ok("添加成功") : HttpResult.error("添加失败");
     }
 
+    /**
+     * 设置团队负责人
+     *
+     * @param setPerson 要设置的团队负责人
+     * @author lipf
+     * @date 2026/4/28 9:08
+     */
     @Override
-    public HttpResult setResponsiblePerson(SysOrganizationSetPerson setPerson) {
+    public HttpResult<String> setResponsiblePerson(SysOrganizationSetPerson setPerson) {
         SysOrganization sysOrganization = sysOrganizationMapper.selectById(setPerson.getId());
         if (ObjectUtil.isNotEmpty(sysOrganization)){
             sysOrganization.setManagerId(setPerson.getManagerId());