Browse Source

创建订单时,主订单加上区域公司id

LiRong 1 day ago
parent
commit
14d699eca1

+ 2 - 0
leromro-core/src/main/java/com/leromro/core/domain/dto/WebMainOrdersDTO.java

@@ -61,4 +61,6 @@ public class WebMainOrdersDTO {
     /** 区级名称 */
     @ApiModelProperty("区级名称")
     private String districtName;
+
+    private Long deptId;
 }

+ 6 - 1
leromro-core/src/main/java/com/leromro/core/service/impl/MainOrderServiceImpl.java

@@ -272,6 +272,7 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
             if (sysDept.getDistrictCode().equals(address.getDistrictCode()) && sysDept.getAreaType().equals("3")){
                 secondOrder.setAreaDistributionRatio(sysDept.getDistributionRatio());
                 secondOrder.setAreaDistributionId(sysDept.getDeptId());
+                orders.setAreaDistributionId(sysDept.getDeptId());
             }
         }
 
@@ -362,7 +363,11 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
 
     @Override
     public List<webMainOrderListVO> webMainOrderList(WebMainOrdersDTO dto) {
-            List<webMainOrderListVO> vos = baseMapper.webMainOrderList(new ListPermission(MainOrders.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT) ,dto);
+        //区分服务中心
+        if (SecurityUtils.getAreaType().equals("4")){
+            dto.setDeptId(SecurityUtils.getDeptId());
+        }
+        List<webMainOrderListVO> vos = baseMapper.webMainOrderList(new ListPermission(MainOrders.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT) ,dto);
         return vos;
     }
 

+ 1 - 0
leromro-core/src/main/resources/mapper/core/MainOrdersMapper.xml

@@ -141,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select lmo.*,lvi.project_name,lvi.business_tier_name,lvi.name,lvi.phonenumber
         from l_main_orders lmo left join l_volunteer_info lvi on lmo.volunteer_info_id = lvi.volunteer_info_id
         <where>
+            <if test="dto.deptId != null and dto.deptId != ''">and lmo.service_center_id = #{dto.deptId}</if>
             <if test="dto.name != null and dto.name !=''">and lvi.name = #{dto.name}</if>
             <if test="dto.clientTelephone != null and dto.clientTelephone != ''">and lmo.client_telephone = #{dto.clientTelephone}</if>
             <if test="dto.phonenumber != null and dto.phonenumber != ''">and lvi.phonenumber = #{dto.phonenumber}</if>