Parcourir la source

订单信息修改

zangguocen il y a 4 ans
Parent
commit
db1be333ff

+ 1 - 1
yijia-admin/src/main/java/com/yijia/web/controller/common/CommonController.java

@@ -67,7 +67,7 @@ public class CommonController
     /**
      * 通用上传请求
      */
-    @PostMapping("/upload")
+    @PostMapping("/common/upload")
     public AjaxResult uploadFile(MultipartFile file) throws Exception
     {
         try

+ 2 - 1
yijia-admin/src/main/resources/application-druid.yml

@@ -7,7 +7,8 @@ spring:
             # 主库数据源
             master:
                 #url: jdbc:mysql://47.105.116.204:3306/jiaduoduo_db_debug?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                url: jdbc:mysql://115.28.211.17:3306/jiaduoduo_db_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                #url: jdbc:mysql://115.28.211.17:3306/jiaduoduo_db_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://47.105.116.204:3306/jiaduoduo_db_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: develop
                 password: 1234.Abcd
                 #url: jdbc:mysql://localhost:3306/jiaduoduo_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8

+ 6 - 6
yijia-admin/src/main/resources/application.yml

@@ -10,15 +10,15 @@ yijia:
   demoEnabled: true
   # 文件路径
   #正式服务器
-  #profile: /home/uploadfile/images
-    # imageurl: http://image.huijy.net:8088/images
+  profile: /home/uploadfile/images
+  imageurl: http://image.huijy.net:8088/images
   #测试服务器
-   #profile: /home/uploadfile/images
-   #imageurl: http://upload.huijy.net:8088/images
+  #profile: /home/uploadfile/images
+  #imageurl: http://upload.huijy.net:8088/images
   #本地测试服务
-  profile: E:/img
+  #profile: E:/img
   #图片地址
-  imageUrl: http://localhost:8080/profile
+  #imageUrl: http://localhost:8080/profile
   # 获取ip地址开关
   addressEnabled: false
   # 验证码开关

+ 2 - 1
yijia-admin/src/main/resources/logback.xml

@@ -2,7 +2,8 @@
 <configuration>
     <!-- 日志存放路径 -->
 <!--    <property name="log.path" value="/home/testDemo/logs" />-->
-    <property name="log.path" value="/home/devnote/deBugJar/logs" />
+<!--    <property name="log.path" value="/home/devnote/deBugJar/logs" />-->
+    <property name="log.path" value="/home/prodJar/logs" />
 
     <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />

+ 2 - 3
yijia-customer/src/main/java/com/yijia/customer/controller/CustomerCardUseRecordController.java

@@ -48,9 +48,8 @@ public class CustomerCardUseRecordController extends BaseController
     public TableDataInfo list(CustomerCardUseRecord customerCardUseRecord)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
-        SysDept dept =new SysDept();
-        dept.setDeptId(currentUser.getUser().getDeptId());
-        List<String> list = sysDeptService.selectDeptId(dept);
+        SysDept sysDept = sysDeptService.selectDeptById(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.deptCardInfoList(sysDept);
         if(list!=null && list.size()>0){
             customerCardUseRecord.setStationIdList(list);
             customerCardUseRecord.setStationId(null);

+ 4 - 10
yijia-customer/src/main/java/com/yijia/customer/controller/CustomerElectronicCardController.java

@@ -122,9 +122,8 @@ public class CustomerElectronicCardController extends BaseController
     public AjaxResult listSum(CustomerElectronicCard customerElectronicCard)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
-        SysDept dept =new SysDept();
-        dept.setDeptId(currentUser.getUser().getDeptId());
-        List<String> list = deptService.selectDeptId(dept);
+        SysDept sysDept = deptService.selectDeptById(currentUser.getUser().getDeptId());
+        List<String> list = deptService.deptCardInfoList(sysDept);
         if(list!=null && list.size()>0){
             customerElectronicCard.setStationIdList(list);
             customerElectronicCard.setStationId(null);
@@ -135,23 +134,18 @@ public class CustomerElectronicCardController extends BaseController
     public TableDataInfo selectCard(CustomerElectronicCard customerElectronicCard)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
-        SysDept dept =new SysDept();
-        dept.setDeptId(currentUser.getUser().getDeptId());
-        List<String> list = deptService.selectDeptId(dept);
+        SysDept sysDept = deptService.selectDeptById(currentUser.getUser().getDeptId());
+        List<String> list = deptService.deptCardInfoList(sysDept);
         if(list!=null && list.size()>0){
             customerElectronicCard.setStationIdList(list);
             customerElectronicCard.setStationId(null);
             customerElectronicCard.setStrSql(StringUtils.join(list, ","));
         }
-       // startPage();
         List<CustomerElectronicCard>  querylist= customerElectronicCardService.selectCard(customerElectronicCard) ;
         List<CustomerElectronicCard> pagelist = customerElectronicCardService.selectCardPage(customerElectronicCard) ;
-       //TableDataInfo  ss =getDataPageTable(querylist,pagelist);
-//        PageInfo<CustomerElectronicCard> pageInfo= new PageInfo<CustomerElectronicCard>(querylist,customerElectronicCard.getPageSetting());
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
         rspData.setMsg("查询成功");
-//        List<CustomerElectronicCard>  querylist= new ArrayList<>();
         rspData.setRows(querylist);
         rspData.setTotal(pagelist.size());
         return rspData;

+ 42 - 8
yijia-customer/src/main/java/com/yijia/customer/service/impl/CustomerManageServiceImpl.java

@@ -1,17 +1,22 @@
 package com.yijia.customer.service.impl;
 
 
+import com.yijia.common.core.domain.entity.SysDept;
+import com.yijia.common.core.domain.model.LoginUser;
+import com.yijia.common.utils.SecurityUtils;
 import com.yijia.customer.domain.CustomerManage;
 import com.yijia.customer.mapper.CustomerManageMapper;
 import com.yijia.customer.service.ICustomerManageService;
+import com.yijia.system.mapper.SysDeptMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
  * 客户管理Service业务层处理
- * 
+ *
  * @author yijia
  * @date 2020-12-21
  */
@@ -20,10 +25,9 @@ public class CustomerManageServiceImpl implements ICustomerManageService
 {
     @Autowired
     private CustomerManageMapper customerManageMapper;
-
     /**
      * 查询客户管理
-     * 
+     *
      * @param id 客户管理ID
      * @return 客户管理
      */
@@ -35,7 +39,7 @@ public class CustomerManageServiceImpl implements ICustomerManageService
 
     /**
      * 查询客户管理列表
-     * 
+     *
      * @param customerManage 客户管理
      * @return 客户管理
      */
@@ -47,7 +51,7 @@ public class CustomerManageServiceImpl implements ICustomerManageService
 
     /**
      * 新增客户管理
-     * 
+     *
      * @param customerManage 客户管理
      * @return 结果
      */
@@ -59,7 +63,7 @@ public class CustomerManageServiceImpl implements ICustomerManageService
 
     /**
      * 修改客户管理
-     * 
+     *
      * @param customerManage 客户管理
      * @return 结果
      */
@@ -71,7 +75,7 @@ public class CustomerManageServiceImpl implements ICustomerManageService
 
     /**
      * 批量删除客户管理
-     * 
+     *
      * @param ids 需要删除的客户管理ID
      * @return 结果
      */
@@ -83,7 +87,7 @@ public class CustomerManageServiceImpl implements ICustomerManageService
 
     /**
      * 删除客户管理信息
-     * 
+     *
      * @param id 客户管理ID
      * @return 结果
      */
@@ -100,6 +104,36 @@ public class CustomerManageServiceImpl implements ICustomerManageService
      */
     @Override
     public List<CustomerManage> selectCustomerManage(CustomerManage customerManage) {
+//        List<CustomerManage> list =new ArrayList<>();
+//        LoginUser currentUser = SecurityUtils.getLoginUser();
+//        SysDept dept = deptMapper.selectDeptById(currentUser.getUser().getDeptId());
+//        if(dept!=null &&dept.getJiBie()!=null  && dept.getJiBie()==1 ){
+//            if(dept.getIntegralRuleFlag()!=null &&dept.getIntegralRuleFlag().equals("1")&&dept.getCardRuleFlag().equals("1") ){
+//
+//            }else if(dept.getIntegralRuleFlag()!=null &&dept.getIntegralRuleFlag().equals("0") && dept.getCardRuleFlag().equals("1") ){
+//
+//            }else if(dept.getIntegralRuleFlag()!=null &&dept.getIntegralRuleFlag().equals("1") && dept.getCardRuleFlag().equals("0") ){
+//
+//            }else{
+//
+//            }
+//        }else if(dept!=null && dept.getJiBie()!=null  && dept.getJiBie()==2){
+//            SysDept sysDept  = deptMapper.selectDeptById(dept.getParentId());
+//            if(sysDept.getIntegralRuleFlag()!=null &&sysDept.getIntegralRuleFlag().equals("1")&&sysDept.getCardRuleFlag().equals("1") ){
+//                list = customerManageMapper.selectCustomerManageInteralrule(customerManage);
+//            }else if(sysDept.getIntegralRuleFlag()!=null &&sysDept.getIntegralRuleFlag().equals("0") && sysDept.getCardRuleFlag().equals("1") ){
+//
+//            }else if(sysDept.getIntegralRuleFlag()!=null &&sysDept.getIntegralRuleFlag().equals("1") && sysDept.getCardRuleFlag().equals("0") ){
+//
+//                list = customerManageMapper.selectCustomerManageInteralrule(customerManage);
+//            }else{
+//                customerManage.setStationId(dept.getDeptId());
+//                list = customerManageMapper.selectCustomerManage(customerManage);
+//            }
+//        }else if(dept!=null && dept.getJiBie()!=null  && dept.getJiBie()==0) {
+//
+//        }
+
         return customerManageMapper.selectCustomerManage(customerManage);
     }
 }

+ 8 - 0
yijia-customer/src/main/resources/mapper/customer/CustomerCardUseRecordMapper.xml

@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
             <if test="status != null  and status != ''"> and c.status = #{status}</if>
         </where>
+        order by id desc
     </select>
 
     <select id="selectCustomerCardUseRecordById" parameterType="Long" resultMap="CustomerCardUseRecordResult">
@@ -76,6 +77,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="balance != null "> and c.balance = #{balance}</if>
             <if test="stationId != null "> and c.station_id = #{stationId}</if>
             <if test="status != null  and status != ''"> and c.status = #{status}</if>
+            <if test="stationIdList != null ">
+                and station_id in
+                <foreach item="item" index="index" collection="stationIdList"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
      </select>
     <insert id="insertCustomerCardUseRecord" parameterType="CustomerCardUseRecord" useGeneratedKeys="true" keyProperty="id">

+ 12 - 2
yijia-customer/src/main/resources/mapper/customer/CustomerManageMapper.xml

@@ -64,6 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="stationId != null ">
+                and station_id  = #{stationId}
+            </if>
         </where>
         order by  id desc
     </select>
@@ -157,10 +160,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sum(CASE c.card_oils_type  WHEN '3' THEN  c.amt ELSE 0 END ) fy_amt,
         sum(CASE c.card_oils_type  WHEN '4' THEN  c.amt ELSE 0 END ) lng_amt,
         sum(CASE c.card_oils_type  WHEN '5' THEN  c.amt ELSE 0 END ) cng_amt,
-        m.mina_user_id
+        m.mina_user_id,m.station_id,d.dept_name as station_name
             from customer_manage m
             left join customer_points p on m.union_id = p.union_id and m.station_id = p.station_id
             left join customer_electronic_card c on c.union_id =m.union_id and c.station_id = m.station_id
+            left join sys_dept d on m.station_id = d.dept_id
             <where>
                 <if test="stationIdList != null ">
                     and m.station_id in
@@ -169,13 +173,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                         #{item}
                     </foreach>
                 </if>
+                <if test="stationId != null ">
+                    and m.station_id  = #{stationId}
+                </if>
                 <if test="carNumber != null  and carNumber != ''"> and car_number like concat('%', #{carNumber}, '%')</if>
                 <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
                 <if test="grade != null  and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
                 <if test="phoneNumber != null  and phoneNumber != ''"> and phone_number like concat('%', #{phoneNumber}, '%')</if>
                 <if test="customerName != null  and customerName != ''"> and m.customer_name  like concat('%', #{customerName}, '%')</if>
             </where>
-            GROUP BY m.union_id,m.member_id,m.customer_name,m.phone_number,m.mina_user_id, m.car_number,p.points,c.station_id
+            GROUP BY m.union_id,m.member_id,m.customer_name,m.phone_number,m.mina_user_id, m.car_number,p.points,m.station_id
         ) sy
         LEFT JOIN (SELECT max(pay_date) pay_date ,po.consumer_id
         from pay_order po
@@ -187,6 +194,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="stationId != null ">
+                and po.station_id  = #{stationId}
+            </if>
         </where>
         GROUP BY  po.consumer_id) px on sy.mina_user_id =  px.consumer_id
         order by px.pay_date desc

+ 40 - 19
yijia-station/src/main/resources/mapper/station/PayOrderMapper.xml

@@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
         <include refid="selectPayOrderVo"/>
         <where>
-            <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
+            <if test="orderNo != null  and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
             <if test="status != null  and status != ''"> and p.status = #{status}</if>
             <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
@@ -281,24 +281,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <!--日报数据-->
     <select id="selectDayReport" parameterType="Long" resultMap="PayOrderResult">
-        SELECT date_format( b.created_date, '%Y-%m-%d' ) as created_date,sum(b.amt) as amt,sum(b.qyamt) as qy_amt, sum(b.cyamt) as cy_amt,sum(b.order_liters) as order_liters ,count(b.order_no) order_no ,sum(b.member_amt) as menber_amt,sum(receivable_amt) as receivable_amt,sum(received_amt) as received_amt
-        from (SELECT a.*,(SELECT sum(amt) as qyamt from pay_order where order_no=a.order_no and oil_type=1) as qyamt , (SELECT sum(amt) as qyamt from pay_order where order_no=a.order_no and oil_type=2) as cyamt
-        from pay_order a
-            <where>
-                <if test="stationId != null "> and a.station_id = #{stationId}</if>
-                <if test="status != null "> and a.status = #{status}</if>
-                <if test="orderType != null  and orderType != ''"> and a.order_type = #{orderType}</if>
-                <if test="stationIdList != null ">
-                    and a.station_id in
-                    <foreach item="item" index="index" collection="stationIdList"
-                             open="(" separator="," close=")">
-                        #{item}
-                    </foreach>
-                </if>
-            </where>
-        ) b
-        GROUP BY  date_format( created_date, '%Y-%m-%d' )
-        ORDER BY date_format( created_date, '%Y-%m-%d' ) DESC
+         SELECT
+        b.created_date,
+        sum( b.amt ) amt,
+        sum( b.order_liters ) order_liters,
+        sum( b.member_amt ) member_amt,
+        sum( b.receivable_amt ) receivable_amt,
+        sum( b.received_amt ) received_amt,
+        MAX(CASE b.oil_type WHEN '1' THEN amt ELSE 0 END) AS qy_amt,
+        MAX(CASE b.oil_type WHEN '2' THEN amt ELSE 0 END) AS cy_amt,
+        sum(b.order_no) order_no
+        from (
+        SELECT
+        date_format( a.created_date, '%Y-%m-%d' ) as created_date,
+        sum( a.amt ) amt,
+        sum( a.order_liters ) order_liters,
+        sum( a.member_amt ) member_amt,
+        sum( a.receivable_amt ) receivable_amt,
+        sum( a.received_amt ) received_amt,
+        a.oil_type,
+        count( 1 ) order_no
+        FROM
+        pay_order a
+        <where>
+            <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="status != null "> and a.status = #{status}</if>
+            <if test="orderType != null  and orderType != ''"> and a.order_type = #{orderType}</if>
+            <if test="stationIdList != null ">
+                and a.station_id in
+                <foreach item="item" index="index" collection="stationIdList"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        GROUP BY
+        date_format( a.created_date, '%Y-%m-%d' ),a.oil_type
+        )  b
+        GROUP BY b.created_date
+        ORDER BY b.created_date desc
     </select>
 <!-- 日报折线图油品数据-->
     <select id="listQydata" parameterType="Long" resultMap="PayOrderResult">

+ 8 - 4
yijia-station/src/main/resources/mapper/station/StationOilPriceMapper.xml

@@ -51,10 +51,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectOilPriceList" parameterType="StationOilPrice" resultMap="StationOilPriceResult">
-        select oil_price_id, oil_name, oil_price, station_id, d.dept_name as station_name, s.dict_value as oil_type
-            from station_oil_price p
-            join sys_dept d  on  p.station_id = d.dept_id
-            join sys_dict_data s  on s.dict_label = p.oil_name and s.dict_type = "oil_name"
+--         select oil_price_id, oil_name, oil_price, station_id, d.dept_name as station_name, s.dict_value as oil_type
+--             from station_oil_price p
+--             join sys_dept d  on  p.station_id = d.dept_id
+--             join sys_dict_data s  on s.dict_label = p.oil_name and s.dict_type = "oil_name"
+        select DISTINCT oil_name,s.dict_value as oil_type
+         from station_oil_price p
+         join sys_dept d  on  p.station_id = d.dept_id
+         join sys_dict_data s  on s.dict_label = p.oil_name and s.dict_type = "oil_name"
         <where>
             <if test="oilName != null  and oilName != ''"> and p.oil_name like concat('%', #{oilName}, '%')</if>
             <if test="oilPrice != null  and oilPrice != ''"> and p.oil_price = #{oilPrice}</if>

+ 2 - 2
yijia-system/src/main/java/com/yijia/system/service/impl/SysDeptServiceImpl.java

@@ -343,9 +343,9 @@ public class SysDeptServiceImpl implements ISysDeptService
             }
         }else if(dept!=null && dept.getJiBie()!=null  && dept.getJiBie()==2){
             SysDept sysDept  = deptMapper.selectDeptById(dept.getParentId());
-            if(sysDept.getCouponFlag()!=null &&sysDept.getCouponFlag().equals("1")){
+            if(sysDept.getIntegralRuleFlag()!=null &&sysDept.getIntegralRuleFlag().equals("1")){
                 list.add(sysDept.getDeptId().toString());
-            }else if(sysDept.getCouponFlag()!=null &&sysDept.getCouponFlag().equals("0")){
+            }else if(sysDept.getIntegralRuleFlag()!=null &&sysDept.getIntegralRuleFlag().equals("0")){
                 list.add(dept.getDeptId()+"");
             }
         }else if(dept!=null && dept.getJiBie()!=null  && dept.getJiBie()==0) {