Browse Source

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

FengChaoYu 5 months ago
parent
commit
d52efa6391

+ 7 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/order/PayOrderLogic.java

@@ -485,6 +485,13 @@ public class PayOrderLogic {
         workerOrder.setPayType(payType);
         workerOrder.setUserId(currentCompanyWechat.getUserId());
         workerOrder.setPayStatus(PayStatusEnum.PAID.getKey());
+        
+        workerOrder.setUserId(currentCompanyWechat.getUserId());
+        workerOrder.setWorkerMobile(currentCompanyWechat.getUser().getMobile());
+        workerOrder.setWorkerNumber(currentCompanyWechat.getUser().getWorkerNumber());
+        workerOrder.setWorkerName(currentCompanyWechat.getUser().getNickName());
+        workerOrder.setIdentity(currentCompanyWechat.getUser().getIdCard());
+        workerOrder.setOpenId(currentCompanyWechat.getUser().getMiniOpenId());
         workerOrder.updateById();
 
         //插入手工结算数据

+ 4 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/workorder/OrderBaseLogic.java

@@ -558,6 +558,10 @@ public class OrderBaseLogic {
             pgOrderBase.setWorkerReceTime(new Date());
             pgOrderBase.updateById();
         }else {
+            if(pgOrderBase.getOrderStatus().equals(OrderBaseStatusEnum.DJD.getKey())){
+                pgOrderBase.setOrderStatus(OrderBaseStatusEnum.FWZ.getKey());
+                pgOrderBase.setOrderStatusText(OrderBaseStatusEnum.FWZ.getRemark());
+            }
             pgOrderBase.setIsMeet(true);
             pgOrderBase.updateById();
         }

+ 4 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/AgreementLogic.java

@@ -1443,6 +1443,10 @@ public class AgreementLogic {
             }
 
             AdminWebsit adminWebsit = adminWebsitService.getById(workerPolicy.getWebsitId());
+
+            if (adminWebsit == null)
+                continue;
+
             WebsitUser websitUser = websitUserService.getById(workerPolicy.getWebsitUserId());
             User user = userService.getById(websitUser.getUserId());
 

+ 55 - 44
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/ChangeOrderLogic.java

@@ -517,55 +517,66 @@ public class ChangeOrderLogic {
             String categoryName = (String)row.get(8);
             String sourceName = (String)row.get(9);
 
-            AdminWebsit adminWebsit = adminWebsitMap.get(websitId);
+            String[] channelNames = channelName.split("/");
+            String[] smallNames = smallName.split("/");
+            String[] categoryNames = categoryName.split("/");
+            String[] sourceNames = sourceName.split("/");
 
+            AdminWebsit adminWebsit = adminWebsitMap.get(websitId);
             Region region = orderBaseLogic.getRegion(pName, cName, aName, sName);
 
-            SysDictCompany orderChanne = orderChannelMap.get(channelName);
-
-            GoodsCategory goodsCategory = categoryMap1.get(categoryName);
-
-            OrderSmallType orderSmallType = orderSmallTypeMap.get(smallName);
-
-            SysDictCompany orderSource = orderSourceMap.get(sourceName);
-
-            WebsitDispatch websitDispatch = new WebsitDispatch();
-            websitDispatch.setWebsitId(adminWebsit.getWebsitId());
-            websitDispatch.setWebsitName(adminWebsit.getName());
-            websitDispatch.setProvinceCode(region.getProvinceCode());
-            websitDispatch.setProvinceName(region.getProvinceName());
-            websitDispatch.setCityCode(region.getCityCode());
-            websitDispatch.setCityName(region.getCityName());
-            websitDispatch.setAreaCode(region.getAreaCode());
-            websitDispatch.setAreaName(region.getAreaName());
-            websitDispatch.setStreetCode(region.getId());
-            websitDispatch.setStreetName(region.getName());
-            websitDispatch.setCompanyWechatId(adminUser.getCompanyWechatId());
-            websitDispatch.setCompanyWechatName(adminUser.getCompanyName());
-
-
-            websitDispatch.setOrderSmallTypeText(orderSmallType.getOrderSmallTypeText());
-            websitDispatch.setOrderSmallId(orderSmallType.getId());
-
-            websitDispatch.setCategoryId(goodsCategory.getCategoryId());
-            websitDispatch.setCategoryName(goodsCategory.getName());
-
-            websitDispatch.setDictCode(orderChanne.getDictCode());
-            websitDispatch.setDictValue(orderChanne.getDictValue());
-
-            websitDispatch.setOrderSource(orderSource.getDictValue());
-            websitDispatch.setOrderSourceId(orderSource.getDictCode());
-
-            if (websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode,region.getId())
-                    .eq(WebsitDispatch::getOrderSmallId,websitDispatch.getOrderSmallId())
-                    .eq(WebsitDispatch::getCategoryId,websitDispatch.getCategoryId())
-                    .eq(WebsitDispatch::getDictCode,websitDispatch.getDictCode())
-                    .eq(WebsitDispatch::getOrderSourceId,websitDispatch.getOrderSourceId()).count() > 0) {
-                throw new RemoteServiceException("存在街道:"+websitDispatch.getStreetName()+",产品大类:"+websitDispatch.getCategoryName()+
-                        ",工单渠道:"+websitDispatch.getDictValue()+",工单来源:"+websitDispatch.getOrderSource()+",工单类型:"+websitDispatch.getOrderSmallTypeText());
+            for (String channel : channelNames) {
+                SysDictCompany orderChanne = orderChannelMap.get(channel);
+                for (String small : smallNames) {
+                    OrderSmallType orderSmallType = orderSmallTypeMap.get(small);
+                    for (String category : categoryNames) {
+                        GoodsCategory goodsCategory = categoryMap1.get(category);
+                        for (String source : sourceNames) {
+
+                            SysDictCompany orderSource = orderSourceMap.get(source);
+
+                            WebsitDispatch websitDispatch = new WebsitDispatch();
+                            websitDispatch.setWebsitId(adminWebsit.getWebsitId());
+                            websitDispatch.setWebsitName(adminWebsit.getName());
+                            websitDispatch.setProvinceCode(region.getProvinceCode());
+                            websitDispatch.setProvinceName(region.getProvinceName());
+                            websitDispatch.setCityCode(region.getCityCode());
+                            websitDispatch.setCityName(region.getCityName());
+                            websitDispatch.setAreaCode(region.getAreaCode());
+                            websitDispatch.setAreaName(region.getAreaName());
+                            websitDispatch.setStreetCode(region.getId());
+                            websitDispatch.setStreetName(region.getName());
+                            websitDispatch.setCompanyWechatId(adminUser.getCompanyWechatId());
+                            websitDispatch.setCompanyWechatName(adminUser.getCompanyName());
+
+
+                            websitDispatch.setOrderSmallTypeText(orderSmallType.getOrderSmallTypeText());
+                            websitDispatch.setOrderSmallId(orderSmallType.getId());
+
+                            websitDispatch.setCategoryId(goodsCategory.getCategoryId());
+                            websitDispatch.setCategoryName(goodsCategory.getName());
+
+                            websitDispatch.setDictCode(orderChanne.getDictCode());
+                            websitDispatch.setDictValue(orderChanne.getDictValue());
+
+                            websitDispatch.setOrderSource(orderSource.getDictValue());
+                            websitDispatch.setOrderSourceId(orderSource.getDictCode());
+
+                            if (websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode,region.getId())
+                                    .eq(WebsitDispatch::getOrderSmallId,websitDispatch.getOrderSmallId())
+                                    .eq(WebsitDispatch::getCategoryId,websitDispatch.getCategoryId())
+                                    .eq(WebsitDispatch::getDictCode,websitDispatch.getDictCode())
+                                    .eq(WebsitDispatch::getOrderSourceId,websitDispatch.getOrderSourceId()).count() > 0) {
+                                throw new RemoteServiceException("存在街道:"+websitDispatch.getStreetName()+",产品大类:"+websitDispatch.getCategoryName()+
+                                        ",工单渠道:"+websitDispatch.getDictValue()+",工单来源:"+websitDispatch.getOrderSource()+",工单类型:"+websitDispatch.getOrderSmallTypeText());
+                            }
+
+                            websitDispatches.add(websitDispatch);
+                        }
+                    }
+                }
             }
 
-            websitDispatches.add(websitDispatch);
 
         }
 

+ 3 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseExcelLogic.java

@@ -1021,6 +1021,9 @@ public class OrderBaseExcelLogic {
             pgOrderBase.setSource(source);
             pgOrderBase.setUrgent(urgent);
             pgOrderBase.setEvaluate(evaluate);
+            if (!StringUtil.isEmpty(evaluate)){
+                pgOrderBase.setAppraiseStatus(evaluate.equals("好评")?"A":evaluate.equals("中评")?"B":evaluate.equals("差价")?"C":evaluate.equals("默认好评")?"D":"O");
+            }
             pgOrderBase.setSalesPlatform(salesSource);
             pgOrderBase.setSaleCompany(buyName);
             pgOrderBase.setSalesTypeName(salesTypeName);

+ 1 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseLogic.java

@@ -97,6 +97,7 @@ public class OrderBaseLogic {
         if (zfireParamBean.getParamValue("a.order_status") instanceof String) {
             String paramValue = (String) zfireParamBean.getParamValue("a.order_status");
             if (StringUtils.equals(paramValue, OrderBaseStatusEnum.YCD.getKey()) || StringUtils.equals(paramValue, OrderBaseStatusEnum.DYY.getKey())
+                    || StringUtils.equals(paramValue, OrderBaseStatusEnum.DJD.getKey())
                     || StringUtils.equals(paramValue, "PJSQZ") || StringUtils.equals(paramValue, "PJYDH") || StringUtils.equals(paramValue, "PJYQX")) {
                 zfireParamBean.removeParam("a.order_status");
 

+ 5 - 2
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -325,9 +325,9 @@
           <if test="ex.orderSmallType != null and ex.orderSmallType !=''">
               and a.order_small_type = #{ex.orderSmallType}
           </if>
-        <if test="ex.orderStatus != null and ex.orderStatus.key !='YCD'.toString() and ex.orderStatus.key !='DYY'.toString() and ex.orderStatus.key !='PJSQZ'.toString() and ex.orderStatus.key !='PJYDH'.toString() and ex.orderStatus.key !='PJYQX'.toString()">
+      <!--  <if test="ex.orderStatus != null and ex.orderStatus.key !='YCD'.toString() and ex.orderStatus.key !='DYY'.toString() and ex.orderStatus.key !='PJSQZ'.toString() and ex.orderStatus.key !='PJYDH'.toString() and ex.orderStatus.key !='PJYQX'.toString()">
             and a.order_status = #{ex.orderStatus.key}
-        </if>
+        </if>-->
         <if test="ex.orderStatus != null and ex.orderStatus.key =='YCD'.toString()">
             and a.is_exception =1 and a.order_status NOT IN ('YWG','YWGO','YJS')
         </if>
@@ -336,6 +336,9 @@
             'FWQX','FL','YJS','LRCD','DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP'
             )
         </if>
+        <if test="ex.orderStatus != null and ex.orderStatus.key =='DJD'.toString()">
+            and (a.is_meet =0 or a.order_status  IN ('DJD')) and a.order_status not in ('YQX','FWQX','FL','FWZT','YCGB')
+        </if>
         <if test="ex.partsApplyStatus != null and ex.partsApplyStatus =='PJSQZ'.toString()">
             and a.id in(select order_base_id from websit_parts_apply where `status` = 'ING')
         </if>

+ 21 - 4
mall-server-api/src/main/resources/mapper/workorder/OrderBaseCMapper.xml

@@ -20,7 +20,7 @@
         <if test="startTime != null and startTime != ''">
             and a.create_time between #{startTime} and #{endTime}
         </if>
-        and a.order_status != 'DYY'
+        and a.order_status not in ('DYY','DJD')
         group by order_status_text
     union
         select
@@ -39,6 +39,23 @@
         <if test="startTime != null and startTime != ''">
             and a.create_time between #{startTime} and #{endTime}
         </if>
+        union
+        select
+        count(distinct a.id)  'total',
+        'DJD' as 'orderStatus',
+        '待接单' as 'orderStatusText'
+        from pg_order_base a
+        where (is_meet=0 or a.order_status  IN ('DJD')) and a.order_status not in ('YQX','FWQX','FL','FWZT','YCGB')
+        <include refid="orderBaseSqlWhere"></include>
+        <if test="orderSmallType != null and orderSmallType != ''">
+            and a.order_small_type = #{orderSmallType}
+        </if>
+        <if test="orderSmallTypeText != null and orderSmallTypeText != ''">
+            and a.order_small_type_text = #{orderSmallTypeText}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            and a.create_time between #{startTime} and #{endTime}
+        </if>
     union
         select
             count(distinct a.id)  'total',
@@ -113,10 +130,10 @@
 
     <select id="countOrderBaseIndex" resultType="com.gree.mall.manager.bean.workorder.OrderBaseCountBean">
         select
-            count(if(order_status in ('DSHPG','DWDPG'),1,null)) as 'dpg',
-            count(if(order_status in ('DJD'),1,null)) as 'djs',
+            count(if(order_status in ('DSHPG','DWDPG','DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP','DFZXPD','DFZXSPGP'),1,null)) as 'dpg',
+            count(if((a.is_meet =0 or a.order_status  IN ('DJD')) and a.order_status not in ('YQX','FWQX','FL','FWZT','YCGB'),1,null)) as 'djs',
             count(if(order_status in ('DQD'),1,null)) as 'dqd',
-            count(if(order_status in ('FWZ'),1,null)) as 'fwz',
+            count(if(order_status in ('FWZ','GCSZT','BFWG','DSM','YZP','WDBH','XSBH','TJXSBH','ZBBH','FZXBH'),1,null)) as 'fwz',
             count(if(appointment_time is null  and a.order_status not in ('YWG','GCSZX','WDWG','YWGO','YQX','FWZT','YCGB',
         'FWQX','FL','YJS','LRCD','DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP'
         ),1,null)) as 'dyy',

BIN
mall-server-api/src/main/resources/template/4.0工单导入模板.xlsx


BIN
mall-server-api/src/main/resources/template/自动派工配置.xlsx