瀏覽代碼

优化油站管理,获取当前登录人的油站信息,班结信息

MS-QJVSRANLTYEO\Administrator 4 年之前
父節點
當前提交
32b98389f1
共有 15 個文件被更改,包括 435 次插入428 次删除
  1. 7 7
      yijia-station/src/main/java/com/yijia/station/controller/NoOilOrderController.java
  2. 86 91
      yijia-station/src/main/java/com/yijia/station/controller/PayOrderController.java
  3. 42 42
      yijia-station/src/main/java/com/yijia/station/controller/StationClassStructureController.java
  4. 16 21
      yijia-station/src/main/java/com/yijia/station/controller/StationClassesSummaryController.java
  5. 14 19
      yijia-station/src/main/java/com/yijia/station/controller/StationDeviceManageController.java
  6. 14 16
      yijia-station/src/main/java/com/yijia/station/controller/StationInfoController.java
  7. 21 25
      yijia-station/src/main/java/com/yijia/station/controller/StationOilGunController.java
  8. 7 12
      yijia-station/src/main/java/com/yijia/station/controller/StationOilPriceAdjustController.java
  9. 14 20
      yijia-station/src/main/java/com/yijia/station/controller/StationOilPriceController.java
  10. 19 24
      yijia-station/src/main/java/com/yijia/station/controller/StationPayController.java
  11. 14 18
      yijia-station/src/main/java/com/yijia/station/controller/StationPersonnelController.java
  12. 0 6
      yijia-station/src/main/java/com/yijia/station/controller/StationPicController.java
  13. 75 53
      yijia-station/src/main/java/com/yijia/station/domain/StationClassesSummary.java
  14. 73 65
      yijia-station/src/main/resources/mapper/station/StationClassStructureMapper.xml
  15. 33 9
      yijia-station/src/main/resources/mapper/station/StationClassesSummaryMapper.xml

+ 7 - 7
yijia-station/src/main/java/com/yijia/station/controller/NoOilOrderController.java

@@ -30,20 +30,20 @@ public class NoOilOrderController  extends BaseController {
     /**
      * 查询订单支付列表
      */
-    @PreAuthorize("@ss.hasPermi('station:noorder:list')")
     @GetMapping("/list")
     public TableDataInfo list(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
         startPage();
         payOrder.setStatus("1");
-        List<PayOrder> list = payOrderService.selectPayOrderList(payOrder);
-        return getDataTable(list);
+        List<PayOrder> payOrderlist = payOrderService.selectPayOrderList(payOrder);
+        return getDataTable(payOrderlist);
     }
 }

+ 86 - 91
yijia-station/src/main/java/com/yijia/station/controller/PayOrderController.java

@@ -47,40 +47,40 @@ public class PayOrderController extends BaseController
     /**
      * 查询订单支付列表
      */
-    @PreAuthorize("@ss.hasPermi('station:order:list')")
     @GetMapping("/list")
     public TableDataInfo list(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
         startPage();
         payOrder.setStatus("1");
-        List<PayOrder> list = payOrderService.selectPayOrderList(payOrder);
-        return getDataTable(list);
+        List<PayOrder> payOrderList = payOrderService.selectPayOrderList(payOrder);
+        return getDataTable(payOrderList);
     }
     /**
      * 查询订单支付列表
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listInfo')")
     @GetMapping("/listInfo")
     public TableDataInfo listInfo(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
         payOrder.setOrderType("1");
         payOrder.setStatus("1");
-        List<PayOrder> list = payOrderService.selectPayOrderList(payOrder);
-        return getTable(list);
+        List<PayOrder> payOrderList = payOrderService.selectPayOrderList(payOrder);
+        return getTable(payOrderList);
     }
 
     /**
@@ -88,14 +88,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:selectDaySources')")
     @GetMapping("/selectDaySources")
     public AjaxResult selectDaySources(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -110,14 +110,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:selectOilTypeSources')")
     @GetMapping("/selectOilTypeSources")
     public TableDataInfo selectOilTypeSources(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -132,14 +132,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:dayOilTypeSources')")
     @GetMapping("/dayOilTypeSources")
     public TableDataInfo dayOilTypeSources(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -153,14 +153,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:selectOverViewData')")
     @GetMapping("/selectOverViewData")
     public AjaxResult selectOverViewData(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -173,14 +173,14 @@ public class PayOrderController extends BaseController
     /**
      * 日报数据详细
      */
-    @PreAuthorize("@ss.hasPermi('station:order:selectDayReportDetail')")
     @GetMapping("/selectDayReportDetail")
     public TableDataInfo selectDayReportDetail(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -197,14 +197,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:selectDayReport')")
     @GetMapping("/selectDayReport")
     public TableDataInfo selectDayReport(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -217,31 +217,30 @@ public class PayOrderController extends BaseController
     /**
      * 导出订单支付列表
      */
-    @PreAuthorize("@ss.hasPermi('station:order:export')")
     @Log(title = "订单支付", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
         payOrder.setStatus("1");
         payOrder.setOrderType("1");
-        List<PayOrder> list = payOrderService.selectPayOrderExport(payOrder);
+        List<PayOrder> payOrderList = payOrderService.selectPayOrderExport(payOrder);
         ExcelUtil<PayOrder> util = new ExcelUtil<PayOrder>(PayOrder.class);
 
-        return util.exportExcel(list, "order");
+        return util.exportExcel(payOrderList, "order");
     }
 
 
     /**
      * 获取订单支付详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:order:query')")
     @GetMapping(value = "/{orderId}")
     public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
     {
@@ -253,14 +252,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listQydata92')")
     @GetMapping("/listQydata92")
     public TableDataInfo listQydata92(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -275,14 +274,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listQydata95')")
     @GetMapping("/listQydata95")
     public TableDataInfo listQydata95(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -297,14 +296,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listQydata98')")
     @GetMapping("/listQydata98")
     public TableDataInfo listQydata98(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -320,14 +319,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listQydata20')")
     @GetMapping("/listQydata20")
     public TableDataInfo listQydata20(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -342,14 +341,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listQydata0')")
     @GetMapping("/listQydata0")
     public TableDataInfo listQydata0(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -364,14 +363,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listQydata10')")
     @GetMapping("/listQydata10")
     public TableDataInfo listQydata10(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -386,14 +385,14 @@ public class PayOrderController extends BaseController
      * @param payOrder
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:order:listXdata')")
     @GetMapping("/listXdata")
     public TableDataInfo listXdata(PayOrder payOrder)
     {
-        if(payOrder!=null &&payOrder.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(payOrder.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             payOrder.setStationIdList(list);
             payOrder.setStationId(null);
         }
@@ -405,7 +404,6 @@ public class PayOrderController extends BaseController
     /**
      * 查询油站第一笔订单的数据
      */
-    @PreAuthorize("@ss.hasPermi('station:order:getPayOrderInfoMin')")
     @GetMapping("/getPayOrderInfoMin")
     public AjaxResult getPayOrderInfoMin(PayOrder payOrder)
     {
@@ -418,7 +416,6 @@ public class PayOrderController extends BaseController
     /**
      * 新增订单支付
      */
-    @PreAuthorize("@ss.hasPermi('station:order:add')")
     @Log(title = "订单支付", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody PayOrder payOrder)
@@ -429,7 +426,6 @@ public class PayOrderController extends BaseController
     /**
      * 修改订单支付
      */
-    @PreAuthorize("@ss.hasPermi('station:order:edit')")
     @Log(title = "订单支付", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody PayOrder payOrder)
@@ -440,7 +436,6 @@ public class PayOrderController extends BaseController
     /**
      * 删除订单支付
      */
-    @PreAuthorize("@ss.hasPermi('station:order:remove')")
     @Log(title = "订单支付", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{orderIds}")
     public AjaxResult remove(@PathVariable Long[] orderIds)

+ 42 - 42
yijia-station/src/main/java/com/yijia/station/controller/StationClassStructureController.java

@@ -45,7 +45,7 @@ import com.yijia.common.core.page.TableDataInfo;
 
 /**
  * 班结管理Controller
- * 
+ *
  * @author yijia
  * @date 2020-12-31
  */
@@ -89,7 +89,7 @@ public class StationClassStructureController extends BaseController
     {
         List<StationClassStructure> list = new ArrayList<>();
         if(stationClassStructure!=null &&stationClassStructure.getStationId()!=null ){
-          list = stationClassStructureService.listPersonnelStructure(stationClassStructure);
+            list = stationClassStructureService.listPersonnelStructure(stationClassStructure);
         }
         return getTable(list);
     }
@@ -180,7 +180,7 @@ public class StationClassStructureController extends BaseController
                     cell.setCellStyle(style);
                     cell.setCellValue(summary.getClassesMan());
                 }else if(i == 1){// 生成第一行(表头)
-                     row = sheet.createRow(i);
+                    row = sheet.createRow(i);
                     // 合并单元格CellRangeAddress构造参数依次表示起始行,截至行,起始列, 截至列
                     sheet.addMergedRegion(new CellRangeAddress(i, i, 0, 5));
                     cell = row.createCell(0);
@@ -205,9 +205,9 @@ public class StationClassStructureController extends BaseController
                         cell.setCellValue("销售笔数");
                         cell.setCellStyle(style);
                     } else if (i > 2 && i < personlist) {
-                         row = sheet.createRow(i);
+                        row = sheet.createRow(i);
                         int j = i - 3;
-                         cell = row.createCell(0);
+                        cell = row.createCell(0);
                         cell.setCellValue(listP.get(j).getOilPersonnel());
                         cell.setCellStyle(style);
                         cell = row.createCell(1);
@@ -292,9 +292,9 @@ public class StationClassStructureController extends BaseController
                         cell.setCellValue(oillistSum.getOrderNo());
                         cell.setCellStyle(style);
                     }else if(i==oillist+1){
-                         row = sheet.createRow(i);
+                        row = sheet.createRow(i);
                         sheet.addMergedRegion(new CellRangeAddress(i, i, 0, 11));
-                         cell = row.createCell(0);
+                        cell = row.createCell(0);
                         cell.setCellStyle(style);
                         cell.setCellValue("按员工/支付方式汇总");
                     }else if(i==oillist+2){
@@ -363,7 +363,7 @@ public class StationClassStructureController extends BaseController
                         cell.setCellValue(list.get(j).getZfbAmt()+"");
                         cell.setCellStyle(style);
                         cell = row.createCell(9);
-                        cell.setCellValue(listP.get(j).getXjAmt()+"");
+                        cell.setCellValue(list.get(j).getXjAmt()+"");
                         cell.setCellStyle(style);
                         cell = row.createCell(10);
                         cell.setCellValue(list.get(j).getMemberAmt()+"");
@@ -442,7 +442,7 @@ public class StationClassStructureController extends BaseController
     }
 
     private String encodingFilename(String filename) {
-         filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx";
+        filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx";
         return filename;
     }
 
@@ -985,7 +985,7 @@ public class StationClassStructureController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('station:structure:remove')")
     @Log(title = "班结管理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
+    @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
         return toAjax(stationClassStructureService.deleteStationClassStructureByIds(ids));
@@ -1030,7 +1030,7 @@ public class StationClassStructureController extends BaseController
                 list.add(classStructure);
             }
         }else{
-           //根据上次班结时间,和油站去订单表中查询数据,并按照人员汇总数据
+            //根据上次班结时间,和油站去订单表中查询数据,并按照人员汇总数据
             PayOrder payOrder =new PayOrder();
             payOrder.setStatus("1");
             payOrder.setStationId(stationClassStructure.getStationId());
@@ -1065,37 +1065,37 @@ public class StationClassStructureController extends BaseController
         List<StationClassStructure> list = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         //根据上次班结时间,和油站去订单表中查询数据,并按照人员汇总数据
-       if(structure!=null){
-           PayOrder payOrder =new PayOrder();
-           payOrder.setStatus("1");
-           payOrder.setStationId(structure.getStationId());
-           System.out.println("日期:"+structure.getClassStructureDate());
-           payOrder.setBeginTime(sdf.format(structure.getClassStructureDate()));
-           List<PayOrder> payOrderList =  payOrderService.selectOilStructure(payOrder);
-           for(PayOrder order:payOrderList){
-               StationClassStructure classStructure =new StationClassStructure();
-               classStructure.setOilName(order.getOilName());
-               classStructure.setOilGun(order.getOilGun());
-               classStructure.setAmt(order.getAmt());
-               classStructure.setOrderLiters(order.getOrderLiters());
-               classStructure.setOrderNo(order.getOrderNo());
-               list.add(classStructure);
-           }
-       }else{
-           PayOrder payOrder =new PayOrder();
-           payOrder.setStatus("1");
-           payOrder.setStationId(stationClassStructure.getStationId());
-           List<PayOrder> payOrderList =  payOrderService.selectOilStructure(payOrder);
-           for(PayOrder order:payOrderList){
-               StationClassStructure classStructure =new StationClassStructure();
-               classStructure.setOilName(order.getOilName());
-               classStructure.setOilGun(order.getOilGun());
-               classStructure.setAmt(order.getAmt());
-               classStructure.setOrderLiters(order.getOrderLiters());
-               classStructure.setOrderNo(order.getOrderNo());
-               list.add(classStructure);
-           }
-       }
+        if(structure!=null){
+            PayOrder payOrder =new PayOrder();
+            payOrder.setStatus("1");
+            payOrder.setStationId(structure.getStationId());
+            System.out.println("日期:"+structure.getClassStructureDate());
+            payOrder.setBeginTime(sdf.format(structure.getClassStructureDate()));
+            List<PayOrder> payOrderList =  payOrderService.selectOilStructure(payOrder);
+            for(PayOrder order:payOrderList){
+                StationClassStructure classStructure =new StationClassStructure();
+                classStructure.setOilName(order.getOilName());
+                classStructure.setOilGun(order.getOilGun());
+                classStructure.setAmt(order.getAmt());
+                classStructure.setOrderLiters(order.getOrderLiters());
+                classStructure.setOrderNo(order.getOrderNo());
+                list.add(classStructure);
+            }
+        }else{
+            PayOrder payOrder =new PayOrder();
+            payOrder.setStatus("1");
+            payOrder.setStationId(stationClassStructure.getStationId());
+            List<PayOrder> payOrderList =  payOrderService.selectOilStructure(payOrder);
+            for(PayOrder order:payOrderList){
+                StationClassStructure classStructure =new StationClassStructure();
+                classStructure.setOilName(order.getOilName());
+                classStructure.setOilGun(order.getOilGun());
+                classStructure.setAmt(order.getAmt());
+                classStructure.setOrderLiters(order.getOrderLiters());
+                classStructure.setOrderNo(order.getOrderNo());
+                list.add(classStructure);
+            }
+        }
 
         return getTable(list);
     }

+ 16 - 21
yijia-station/src/main/java/com/yijia/station/controller/StationClassesSummaryController.java

@@ -1,6 +1,8 @@
 package com.yijia.station.controller;
 import java.util.List;
 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.system.service.ISysDeptService;
 import com.yijia.system.service.ISysUserService;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -35,53 +37,49 @@ public class StationClassesSummaryController extends BaseController
     @Autowired
     private IStationClassesSummaryService stationClassesSummaryService;
     @Autowired
-    private ISysUserService sysUserService;
-
-    @Autowired
     private ISysDeptService deptService;
     /**
      * 查询班结汇总列表
      */
-    @PreAuthorize("@ss.hasPermi('station:summary:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationClassesSummary stationClassesSummary)
     {
-        if(stationClassesSummary!=null &&stationClassesSummary.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationClassesSummary.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationClassesSummary.setStationIdList(list);
             stationClassesSummary.setStationId(null);
         }
         startPage();
-        List<StationClassesSummary> list = stationClassesSummaryService.selectStationClassesSummaryList(stationClassesSummary);
-        return getDataTable(list);
+        List<StationClassesSummary> summaryList = stationClassesSummaryService.selectStationClassesSummaryList(stationClassesSummary);
+        return getDataTable(summaryList);
     }
 
     /**
      * 导出班结汇总列表
      */
-    @PreAuthorize("@ss.hasPermi('station:summary:export')")
     @Log(title = "班结汇总", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationClassesSummary stationClassesSummary)
     {
-        if(stationClassesSummary!=null &&stationClassesSummary.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationClassesSummary.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationClassesSummary.setStationIdList(list);
             stationClassesSummary.setStationId(null);
         }
-        List<StationClassesSummary> list = stationClassesSummaryService.selectStationClassesSummaryList(stationClassesSummary);
+        List<StationClassesSummary> summaryList = stationClassesSummaryService.selectStationClassesSummaryList(stationClassesSummary);
         ExcelUtil<StationClassesSummary> util = new ExcelUtil<StationClassesSummary>(StationClassesSummary.class);
-        return util.exportExcel(list, "summary");
+        return util.exportExcel(summaryList, "summary");
     }
 
     /**
      * 获取班结汇总详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:summary:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -91,7 +89,6 @@ public class StationClassesSummaryController extends BaseController
     /**
      * 新增班结汇总
      */
-    @PreAuthorize("@ss.hasPermi('station:summary:add')")
     @Log(title = "班结汇总", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationClassesSummary stationClassesSummary)
@@ -102,7 +99,6 @@ public class StationClassesSummaryController extends BaseController
     /**
      * 修改班结汇总
      */
-    @PreAuthorize("@ss.hasPermi('station:summary:edit')")
     @Log(title = "班结汇总", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationClassesSummary stationClassesSummary)
@@ -113,7 +109,6 @@ public class StationClassesSummaryController extends BaseController
     /**
      * 删除班结汇总
      */
-    @PreAuthorize("@ss.hasPermi('station:summary:remove')")
     @Log(title = "班结汇总", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 14 - 19
yijia-station/src/main/java/com/yijia/station/controller/StationDeviceManageController.java

@@ -47,46 +47,45 @@ public class StationDeviceManageController extends BaseController
     /**
      * 查询油站设备管理列表
      */
-    @PreAuthorize("@ss.hasPermi('station:manage:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationDeviceManage stationDeviceManage)
     {
-        if(stationDeviceManage!=null &&stationDeviceManage.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationDeviceManage.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationDeviceManage.setStationIdList(list);
             stationDeviceManage.setStationId(null);
         }
         startPage();
-        List<StationDeviceManage> list = stationDeviceManageService.selectStationDeviceManageList(stationDeviceManage);
-        return getDataTable(list);
+        List<StationDeviceManage> manageList = stationDeviceManageService.selectStationDeviceManageList(stationDeviceManage);
+        return getDataTable(manageList);
     }
 
     /**
      * 导出油站设备管理列表
      */
-    @PreAuthorize("@ss.hasPermi('station:manage:export')")
     @Log(title = "油站设备管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationDeviceManage stationDeviceManage)
     {
-        if(stationDeviceManage!=null &&stationDeviceManage.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationDeviceManage.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationDeviceManage.setStationIdList(list);
             stationDeviceManage.setStationId(null);
         }
-        List<StationDeviceManage> list = stationDeviceManageService.selectStationDeviceManageList(stationDeviceManage);
+        List<StationDeviceManage> manageList = stationDeviceManageService.selectStationDeviceManageList(stationDeviceManage);
         ExcelUtil<StationDeviceManage> util = new ExcelUtil<StationDeviceManage>(StationDeviceManage.class);
-        return util.exportExcel(list, "manage");
+        return util.exportExcel(manageList, "manage");
     }
 
     /**
      * 获取油站设备管理详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:manage:query')")
     @GetMapping(value = "/{deviceId}")
     public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
     {
@@ -96,7 +95,6 @@ public class StationDeviceManageController extends BaseController
     /**
      * 新增油站设备管理
      */
-    @PreAuthorize("@ss.hasPermi('station:manage:add')")
     @Log(title = "油站设备管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationDeviceManage stationDeviceManage)
@@ -107,7 +105,6 @@ public class StationDeviceManageController extends BaseController
     /**
      * 修改油站设备管理
      */
-    @PreAuthorize("@ss.hasPermi('station:manage:edit')")
     @Log(title = "油站设备管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationDeviceManage stationDeviceManage)
@@ -118,7 +115,6 @@ public class StationDeviceManageController extends BaseController
     /**
      * 删除油站设备管理
      */
-    @PreAuthorize("@ss.hasPermi('station:manage:remove')")
     @Log(title = "油站设备管理", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{deviceIds}")
     public AjaxResult remove(@PathVariable Long[] deviceIds)
@@ -129,7 +125,6 @@ public class StationDeviceManageController extends BaseController
     /**
      * 状态修改
      */
-    @PreAuthorize("@ss.hasPermi('station:manage:changeManageStatus')")
     @Log(title = "油站设备管理", businessType = BusinessType.UPDATE)
     @PutMapping("/changeManageStatus")
     public AjaxResult changeManageStatus(@RequestBody StationDeviceManage stationDeviceManage)

+ 14 - 16
yijia-station/src/main/java/com/yijia/station/controller/StationInfoController.java

@@ -44,43 +44,42 @@ public class StationInfoController extends BaseController
     /**
      * 查询油站信息列表
      */
-    @PreAuthorize("@ss.hasPermi('station:info:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysDept sysDept)
     {
-        if(sysDept!=null &&sysDept.getDeptId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(sysDept.getDeptId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             sysDept.setDeptIdList(list);
             sysDept.setDeptId(null);
         }
         startPage();
         sysDept.setJiBie(Integer.valueOf("2"));
-        List<SysDept> list = sysDeptService.selectDeptList(sysDept);
-        return getDataTable(list);
+        List<SysDept> deptList = sysDeptService.selectDeptList(sysDept);
+        return getDataTable(deptList);
     }
 
-    @PreAuthorize("@ss.hasPermi('station:info:selectStationInfo')")
     @GetMapping("/selectStationInfo")
     public TableDataInfo selectStationInfo(SysDept sysDept)
     {
-        if(sysDept!=null &&sysDept.getDeptId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(sysDept.getDeptId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             sysDept.setDeptIdList(list);
             sysDept.setDeptId(null);
         }
         sysDept.setJiBie(Integer.valueOf("2"));
-        List<SysDept> list = sysDeptService.selectDeptList(sysDept);
-        return getTable(list);
+        List<SysDept> deptList = sysDeptService.selectDeptList(sysDept);
+        return getTable(deptList);
     }
 
     /**
      * 获取油站信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:info:query')")
     @GetMapping(value = "/{deptId}")
     public AjaxResult getInfo(@PathVariable("deptId") Long deptId)
     {
@@ -90,7 +89,6 @@ public class StationInfoController extends BaseController
     /**
      * 修改油站信息
      */
-    @PreAuthorize("@ss.hasPermi('station:info:edit')")
     @Log(title = "油站信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody SysDept sysDept)

+ 21 - 25
yijia-station/src/main/java/com/yijia/station/controller/StationOilGunController.java

@@ -51,64 +51,63 @@ public class StationOilGunController extends BaseController
     /**
      * 查询油枪管理列表
      */
-    @PreAuthorize("@ss.hasPermi('station:gun:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationOilGun stationOilGun)
     {
-        if(stationOilGun!=null &&stationOilGun.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationOilGun.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationOilGun.setStationIdList(list);
             stationOilGun.setStationId(null);
         }
         startPage();
-        List<StationOilGun> list = stationOilGunService.selectStationOilGunList(stationOilGun);
-        return getDataTable(list);
+        List<StationOilGun> stationOilGunList = stationOilGunService.selectStationOilGunList(stationOilGun);
+        return getDataTable(stationOilGunList);
     }
 
     /**
      * 导出油枪管理列表
      */
-    @PreAuthorize("@ss.hasPermi('station:gun:export')")
     @Log(title = "油枪管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationOilGun stationOilGun)
     {
-        if(stationOilGun!=null &&stationOilGun.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationOilGun.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationOilGun.setStationIdList(list);
             stationOilGun.setStationId(null);
         }
-        List<StationOilGun> list = stationOilGunService.selectStationOilGunList(stationOilGun);
+        List<StationOilGun> stationOilGunList = stationOilGunService.selectStationOilGunList(stationOilGun);
         ExcelUtil<StationOilGun> util = new ExcelUtil<StationOilGun>(StationOilGun.class);
-        return util.exportExcel(list, "gun");
+        return util.exportExcel(stationOilGunList, "gun");
     }
 
     /**
      * 获取油枪管理详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:gun:selectGun')")
     @GetMapping(value = "/selectGun")
     public TableDataInfo selectGun(StationOilGun stationOilGun)
     {
-        if(stationOilGun!=null &&stationOilGun.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationOilGun.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationOilGun.setStationIdList(list);
             stationOilGun.setStationId(null);
         }
-        List<StationOilGun> list = stationOilGunService.selectStationOilGunList(stationOilGun);
-        return getTable(list);
+        List<StationOilGun> stationOilGunList = stationOilGunService.selectStationOilGunList(stationOilGun);
+        return getTable(stationOilGunList);
     }
 
     /**
      * 根据油站id查询油枪
      */
-    @PreAuthorize("@ss.hasPermi('station:gun:query')")
     @GetMapping(value = "/{oilGunId}")
     public AjaxResult getInfo(@PathVariable("oilGunId") Long oilGunId)
     {
@@ -118,7 +117,6 @@ public class StationOilGunController extends BaseController
     /**
      * 新增油枪管理
      */
-    @PreAuthorize("@ss.hasPermi('station:gun:add')")
     @Log(title = "油枪管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationOilGun stationOilGun) throws ParseException {
@@ -133,7 +131,6 @@ public class StationOilGunController extends BaseController
     /**
      * 修改油枪管理
      */
-    @PreAuthorize("@ss.hasPermi('station:gun:edit')")
     @Log(title = "油枪管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationOilGun stationOilGun)
@@ -144,7 +141,6 @@ public class StationOilGunController extends BaseController
     /**
      * 删除油枪管理
      */
-    @PreAuthorize("@ss.hasPermi('station:gun:remove')")
     @Log(title = "油枪管理", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{oilGunIds}")
     public AjaxResult remove(@PathVariable Long[] oilGunIds)

+ 7 - 12
yijia-station/src/main/java/com/yijia/station/controller/StationOilPriceAdjustController.java

@@ -58,26 +58,25 @@ public class StationOilPriceAdjustController extends BaseController
     /**
      * 查询油品调价信息列表
      */
-    @PreAuthorize("@ss.hasPermi('station:adjust:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationOilPriceAdjust stationOilPriceAdjust)
     {
-        if(stationOilPriceAdjust!=null &&stationOilPriceAdjust.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationOilPriceAdjust.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationOilPriceAdjust.setStationIdList(list);
             stationOilPriceAdjust.setStationId(null);
         }
         startPage();
-        List<StationOilPriceAdjust> list = stationOilPriceAdjustService.selectStationOilPriceAdjustList(stationOilPriceAdjust);
-        return getDataTable(list);
+        List<StationOilPriceAdjust> adjustList = stationOilPriceAdjustService.selectStationOilPriceAdjustList(stationOilPriceAdjust);
+        return getDataTable(adjustList);
     }
 
     /**
      * 导出油品调价信息列表
      */
-    @PreAuthorize("@ss.hasPermi('station:adjust:export')")
     @Log(title = "油品调价信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationOilPriceAdjust stationOilPriceAdjust)
@@ -90,7 +89,6 @@ public class StationOilPriceAdjustController extends BaseController
     /**
      * 获取油品调价信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:adjust:query')")
     @GetMapping(value = "/{adjustPriceId}")
     public AjaxResult getInfo(@PathVariable("adjustPriceId") Long adjustPriceId)
     {
@@ -100,7 +98,6 @@ public class StationOilPriceAdjustController extends BaseController
     /**
      * 新增油品调价信息
      */
-    @PreAuthorize("@ss.hasPermi('station:adjust:add')")
     @Log(title = "油品调价信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationOilPriceAdjust stationOilPriceAdjust) throws ParseException {
@@ -150,7 +147,6 @@ public class StationOilPriceAdjustController extends BaseController
     /**
      * 修改油品调价信息
      */
-    @PreAuthorize("@ss.hasPermi('station:adjust:edit')")
     @Log(title = "油品调价信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationOilPriceAdjust stationOilPriceAdjust)
@@ -161,7 +157,6 @@ public class StationOilPriceAdjustController extends BaseController
     /**
      * 删除油品调价信息
      */
-    @PreAuthorize("@ss.hasPermi('station:adjust:remove')")
     @Log(title = "油品调价信息", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{adjustPriceIds}")
     public AjaxResult remove(@PathVariable Long[] adjustPriceIds)

+ 14 - 20
yijia-station/src/main/java/com/yijia/station/controller/StationOilPriceController.java

@@ -50,46 +50,45 @@ public class StationOilPriceController extends BaseController
     /**
      * 查询油品价格列表
      */
-    @PreAuthorize("@ss.hasPermi('station:price:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationOilPrice stationOilPrice)
     {
-        if(stationOilPrice!=null &&stationOilPrice.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationOilPrice.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationOilPrice.setStationIdList(list);
             stationOilPrice.setStationId(null);
         }
         startPage();
-        List<StationOilPrice> list = stationOilPriceService.selectStationOilPriceList(stationOilPrice);
-        return getDataTable(list);
+        List<StationOilPrice> priceList = stationOilPriceService.selectStationOilPriceList(stationOilPrice);
+        return getDataTable(priceList);
     }
 
     /**
      * 导出油品价格列表
      */
-    @PreAuthorize("@ss.hasPermi('station:price:export')")
     @Log(title = "油品价格", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationOilPrice stationOilPrice)
     {
-        if(stationOilPrice!=null &&stationOilPrice.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationOilPrice.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationOilPrice.setStationIdList(list);
             stationOilPrice.setStationId(null);
         }
-        List<StationOilPrice> list = stationOilPriceService.selectStationOilPriceList(stationOilPrice);
+        List<StationOilPrice> priceList = stationOilPriceService.selectStationOilPriceList(stationOilPrice);
         ExcelUtil<StationOilPrice> util = new ExcelUtil<StationOilPrice>(StationOilPrice.class);
-        return util.exportExcel(list, "price");
+        return util.exportExcel(priceList, "price");
     }
 
     /**
      * 获取油品价格详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:price:query')")
     @GetMapping(value = "/{oilPriceId}")
     public AjaxResult getInfo(@PathVariable("oilPriceId") Long oilPriceId)
     {
@@ -99,7 +98,6 @@ public class StationOilPriceController extends BaseController
     /**
      * 新增油品价格
      */
-    @PreAuthorize("@ss.hasPermi('station:price:add')")
     @Log(title = "油品价格", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationOilPrice stationOilPrice) throws ParseException {
@@ -114,7 +112,6 @@ public class StationOilPriceController extends BaseController
     /**
      * 修改油品价格
      */
-    @PreAuthorize("@ss.hasPermi('station:price:edit')")
     @Log(title = "油品价格", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationOilPrice stationOilPrice)
@@ -125,7 +122,6 @@ public class StationOilPriceController extends BaseController
     /**
      * 删除油品价格
      */
-    @PreAuthorize("@ss.hasPermi('station:price:remove')")
     @Log(title = "油品价格", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{oilPriceIds}")
     public AjaxResult remove(@PathVariable Long[] oilPriceIds)
@@ -136,7 +132,6 @@ public class StationOilPriceController extends BaseController
     /**
      * 查询当前油站对应的油品名称
      */
-    @PreAuthorize("@ss.hasPermi('station:price:oilNameList')")
     @GetMapping("/oilNameList")
     public TableDataInfo oilNameList(StationOilPrice stationOilPrice)
     {
@@ -146,7 +141,6 @@ public class StationOilPriceController extends BaseController
     /**
      * 查询当前油站对应的油品名称(不包括非油品)
      */
-    @PreAuthorize("@ss.hasPermi('station:price:oilNameInfo')")
     @GetMapping("/oilNameInfo")
     public TableDataInfo oilNameInfo(StationOilPrice stationOilPrice)
     {

+ 19 - 24
yijia-station/src/main/java/com/yijia/station/controller/StationPayController.java

@@ -48,46 +48,45 @@ public class StationPayController extends BaseController
     /**
      * 查询油站支付设置列表
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationPay stationPay)
     {
-        if(stationPay!=null &&stationPay.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationPay.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationPay.setStationIdList(list);
             stationPay.setStationId(null);
         }
         startPage();
-        List<StationPay> list = stationPayService.selectStationPayList(stationPay);
-        return getDataTable(list);
+        List<StationPay> stationPayList = stationPayService.selectStationPayList(stationPay);
+        return getDataTable(stationPayList);
     }
 
     /**
      * 导出油站支付设置列表
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:export')")
     @Log(title = "油站支付设置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationPay stationPay)
     {
-        if(stationPay!=null &&stationPay.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationPay.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationPay.setStationIdList(list);
             stationPay.setStationId(null);
         }
-        List<StationPay> list = stationPayService.selectStationPayList(stationPay);
+        List<StationPay> stationPayList = stationPayService.selectStationPayList(stationPay);
         ExcelUtil<StationPay> util = new ExcelUtil<StationPay>(StationPay.class);
-        return util.exportExcel(list, "pay");
+        return util.exportExcel(stationPayList, "pay");
     }
 
     /**
      * 获取油站支付设置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:query')")
     @GetMapping(value = "/{payId}")
     public AjaxResult getInfo(@PathVariable("payId") Long payId)
     {
@@ -99,14 +98,14 @@ public class StationPayController extends BaseController
      * @param
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:queryOne')")
     @GetMapping(value = "/queryOne")
     public AjaxResult queryOne(StationPay stationPay)
     {
-        if(stationPay!=null &&stationPay.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationPay.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationPay.setStationIdList(list);
             stationPay.setStationId(null);
         }
@@ -118,7 +117,6 @@ public class StationPayController extends BaseController
      * @param
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:query')")
     @GetMapping(value = "/{stationId}")
     public AjaxResult getPayInfo(@PathVariable("stationId") Long stationId)
     {
@@ -148,7 +146,6 @@ public class StationPayController extends BaseController
     /**
      * 新增油站支付设置
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:add')")
     @Log(title = "油站支付设置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationPay stationPay)
@@ -159,7 +156,6 @@ public class StationPayController extends BaseController
     /**
      * 修改油站支付设置
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:edit')")
     @Log(title = "油站支付设置", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationPay stationPay)
@@ -170,7 +166,6 @@ public class StationPayController extends BaseController
     /**
      * 删除油站支付设置
      */
-    @PreAuthorize("@ss.hasPermi('station:pay:remove')")
     @Log(title = "油站支付设置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{payIds}")
     public AjaxResult remove(@PathVariable Long[] payIds)

+ 14 - 18
yijia-station/src/main/java/com/yijia/station/controller/StationPersonnelController.java

@@ -46,46 +46,45 @@ public class StationPersonnelController extends BaseController
     /**
      * 查询油站员工信息列表
      */
-    @PreAuthorize("@ss.hasPermi('station:personnel:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationPersonnel stationPersonnel)
     {
-        if(stationPersonnel!=null &&stationPersonnel.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationPersonnel.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationPersonnel.setStationIdList(list);
             stationPersonnel.setStationId(null);
         }
         startPage();
-        List<StationPersonnel> list = stationPersonnelService.selectStationPersonnelList(stationPersonnel);
-        return getDataTable(list);
+        List<StationPersonnel> stationPersonnelList = stationPersonnelService.selectStationPersonnelList(stationPersonnel);
+        return getDataTable(stationPersonnelList);
     }
 
     /**
      * 导出油站员工信息列表
      */
-    @PreAuthorize("@ss.hasPermi('station:personnel:export')")
     @Log(title = "油站员工信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationPersonnel stationPersonnel)
     {
-        if(stationPersonnel!=null &&stationPersonnel.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(stationPersonnel.getStationId());
-            List<String> list = sysDeptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             stationPersonnel.setStationIdList(list);
             stationPersonnel.setStationId(null);
         }
-        List<StationPersonnel> list = stationPersonnelService.selectStationPersonnelList(stationPersonnel);
+        List<StationPersonnel> stationPersonnelList = stationPersonnelService.selectStationPersonnelList(stationPersonnel);
         ExcelUtil<StationPersonnel> util = new ExcelUtil<StationPersonnel>(StationPersonnel.class);
-        return util.exportExcel(list, "personnel");
+        return util.exportExcel(stationPersonnelList, "personnel");
     }
 
     /**
      * 获取油站员工信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:personnel:query')")
     @GetMapping(value = "/{personnelId}")
     public AjaxResult getInfo(@PathVariable("personnelId") Long personnelId)
     {
@@ -95,7 +94,6 @@ public class StationPersonnelController extends BaseController
     /**
      * 新增油站员工信息
      */
-    @PreAuthorize("@ss.hasPermi('station:personnel:add')")
     @Log(title = "油站员工信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationPersonnel stationPersonnel)
@@ -106,7 +104,6 @@ public class StationPersonnelController extends BaseController
     /**
      * 修改油站员工信息
      */
-    @PreAuthorize("@ss.hasPermi('station:personnel:edit')")
     @Log(title = "油站员工信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationPersonnel stationPersonnel)
@@ -117,7 +114,6 @@ public class StationPersonnelController extends BaseController
     /**
      * 删除油站员工信息
      */
-    @PreAuthorize("@ss.hasPermi('station:personnel:remove')")
     @Log(title = "油站员工信息", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{personnelIds}")
     public AjaxResult remove(@PathVariable Long[] personnelIds)

+ 0 - 6
yijia-station/src/main/java/com/yijia/station/controller/StationPicController.java

@@ -36,7 +36,6 @@ public class StationPicController extends BaseController
     /**
      * 查询油站支付管理图片列表
      */
-    @PreAuthorize("@ss.hasPermi('station:pic:list')")
     @GetMapping("/list")
     public TableDataInfo list(StationPic stationPic)
     {
@@ -48,7 +47,6 @@ public class StationPicController extends BaseController
     /**
      * 导出油站支付管理图片列表
      */
-    @PreAuthorize("@ss.hasPermi('station:pic:export')")
     @Log(title = "油站支付管理图片", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(StationPic stationPic)
@@ -61,7 +59,6 @@ public class StationPicController extends BaseController
     /**
      * 获取油站支付管理图片详细信息
      */
-    @PreAuthorize("@ss.hasPermi('station:pic:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -71,7 +68,6 @@ public class StationPicController extends BaseController
     /**
      * 新增油站支付管理图片
      */
-    @PreAuthorize("@ss.hasPermi('station:pic:add')")
     @Log(title = "油站支付管理图片", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody StationPic stationPic)
@@ -82,7 +78,6 @@ public class StationPicController extends BaseController
     /**
      * 修改油站支付管理图片
      */
-    @PreAuthorize("@ss.hasPermi('station:pic:edit')")
     @Log(title = "油站支付管理图片", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody StationPic stationPic)
@@ -93,7 +88,6 @@ public class StationPicController extends BaseController
     /**
      * 删除油站支付管理图片
      */
-    @PreAuthorize("@ss.hasPermi('station:pic:remove')")
     @Log(title = "油站支付管理图片", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 75 - 53
yijia-station/src/main/java/com/yijia/station/domain/StationClassesSummary.java

@@ -12,7 +12,7 @@ import com.yijia.common.core.domain.BaseEntity;
 
 /**
  * 班结汇总对象 station_classes_summary
- * 
+ *
  * @author yijia
  * @date 2021-01-27
  */
@@ -28,13 +28,13 @@ public class StationClassesSummary extends BaseEntity
     private String classesNo;
 
     /** 班次开始时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
-    @Excel(name = "班次开始时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "班次开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date startDate;
 
     /** 班次结束时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
-    @Excel(name = "班次结束时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "班次结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date endDate;
 
     /** 油站id */
@@ -85,6 +85,28 @@ public class StationClassesSummary extends BaseEntity
     @Excel(name = "班结人")
     private String classesMan;
 
+    /**
+     * 查询班次号,查询班结名称
+     */
+    private String likeClassesNo;
+    private String likeClassesMan;
+
+    public String getLikeClassesNo() {
+        return likeClassesNo;
+    }
+
+    public void setLikeClassesNo(String likeClassesNo) {
+        this.likeClassesNo = likeClassesNo;
+    }
+
+    public String getLikeClassesMan() {
+        return likeClassesMan;
+    }
+
+    public void setLikeClassesMan(String likeClassesMan) {
+        this.likeClassesMan = likeClassesMan;
+    }
+
     private List<String> stationIdList;
 
     public List<String> getStationIdList() {
@@ -100,142 +122,142 @@ public class StationClassesSummary extends BaseEntity
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setClassesNo(String classesNo) 
+    public void setClassesNo(String classesNo)
     {
         this.classesNo = classesNo;
     }
 
-    public String getClassesNo() 
+    public String getClassesNo()
     {
         return classesNo;
     }
-    public void setStartDate(Date startDate) 
+    public void setStartDate(Date startDate)
     {
         this.startDate = startDate;
     }
 
-    public Date getStartDate() 
+    public Date getStartDate()
     {
         return startDate;
     }
-    public void setEndDate(Date endDate) 
+    public void setEndDate(Date endDate)
     {
         this.endDate = endDate;
     }
 
-    public Date getEndDate() 
+    public Date getEndDate()
     {
         return endDate;
     }
-    public void setStationId(Long stationId) 
+    public void setStationId(Long stationId)
     {
         this.stationId = stationId;
     }
 
-    public Long getStationId() 
+    public Long getStationId()
     {
         return stationId;
     }
-    public void setStationName(String stationName) 
+    public void setStationName(String stationName)
     {
         this.stationName = stationName;
     }
 
-    public String getStationName() 
+    public String getStationName()
     {
         return stationName;
     }
-    public void setOrderNum(Long orderNum) 
+    public void setOrderNum(Long orderNum)
     {
         this.orderNum = orderNum;
     }
 
-    public Long getOrderNum() 
+    public Long getOrderNum()
     {
         return orderNum;
     }
-    public void setPrintNum(Long printNum) 
+    public void setPrintNum(Long printNum)
     {
         this.printNum = printNum;
     }
 
-    public Long getPrintNum() 
+    public Long getPrintNum()
     {
         return printNum;
     }
-    public void setSaleLiters(BigDecimal saleLiters) 
+    public void setSaleLiters(BigDecimal saleLiters)
     {
         this.saleLiters = saleLiters;
     }
 
-    public BigDecimal getSaleLiters() 
+    public BigDecimal getSaleLiters()
     {
         return saleLiters;
     }
-    public void setSaleAmt(BigDecimal saleAmt) 
+    public void setSaleAmt(BigDecimal saleAmt)
     {
         this.saleAmt = saleAmt;
     }
 
-    public BigDecimal getSaleAmt() 
+    public BigDecimal getSaleAmt()
     {
         return saleAmt;
     }
-    public void setAmt(BigDecimal amt) 
+    public void setAmt(BigDecimal amt)
     {
         this.amt = amt;
     }
 
-    public BigDecimal getAmt() 
+    public BigDecimal getAmt()
     {
         return amt;
     }
-    public void setDiscountAmt(BigDecimal discountAmt) 
+    public void setDiscountAmt(BigDecimal discountAmt)
     {
         this.discountAmt = discountAmt;
     }
 
-    public BigDecimal getDiscountAmt() 
+    public BigDecimal getDiscountAmt()
     {
         return discountAmt;
     }
-    public void setWxAmt(BigDecimal wxAmt) 
+    public void setWxAmt(BigDecimal wxAmt)
     {
         this.wxAmt = wxAmt;
     }
 
-    public BigDecimal getWxAmt() 
+    public BigDecimal getWxAmt()
     {
         return wxAmt;
     }
-    public void setZfbAmt(BigDecimal zfbAmt) 
+    public void setZfbAmt(BigDecimal zfbAmt)
     {
         this.zfbAmt = zfbAmt;
     }
 
-    public BigDecimal getZfbAmt() 
+    public BigDecimal getZfbAmt()
     {
         return zfbAmt;
     }
-    public void setDzkAmt(BigDecimal dzkAmt) 
+    public void setDzkAmt(BigDecimal dzkAmt)
     {
         this.dzkAmt = dzkAmt;
     }
 
-    public BigDecimal getDzkAmt() 
+    public BigDecimal getDzkAmt()
     {
         return dzkAmt;
     }
-    public void setClassesMan(String classesMan) 
+    public void setClassesMan(String classesMan)
     {
         this.classesMan = classesMan;
     }
 
-    public String getClassesMan() 
+    public String getClassesMan()
     {
         return classesMan;
     }
@@ -243,22 +265,22 @@ public class StationClassesSummary extends BaseEntity
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("classesNo", getClassesNo())
-            .append("startDate", getStartDate())
-            .append("endDate", getEndDate())
-            .append("stationId", getStationId())
-            .append("stationName", getStationName())
-            .append("orderNum", getOrderNum())
-            .append("printNum", getPrintNum())
-            .append("saleLiters", getSaleLiters())
-            .append("saleAmt", getSaleAmt())
-            .append("amt", getAmt())
-            .append("discountAmt", getDiscountAmt())
-            .append("wxAmt", getWxAmt())
-            .append("zfbAmt", getZfbAmt())
-            .append("dzkAmt", getDzkAmt())
-            .append("classesMan", getClassesMan())
-            .toString();
+                .append("id", getId())
+                .append("classesNo", getClassesNo())
+                .append("startDate", getStartDate())
+                .append("endDate", getEndDate())
+                .append("stationId", getStationId())
+                .append("stationName", getStationName())
+                .append("orderNum", getOrderNum())
+                .append("printNum", getPrintNum())
+                .append("saleLiters", getSaleLiters())
+                .append("saleAmt", getSaleAmt())
+                .append("amt", getAmt())
+                .append("discountAmt", getDiscountAmt())
+                .append("wxAmt", getWxAmt())
+                .append("zfbAmt", getZfbAmt())
+                .append("dzkAmt", getDzkAmt())
+                .append("classesMan", getClassesMan())
+                .toString();
     }
 }

+ 73 - 65
yijia-station/src/main/resources/mapper/station/StationClassStructureMapper.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yijia.station.mapper.StationClassStructureMapper">
-    
+
     <resultMap type="StationClassStructure" id="StationClassStructureResult">
         <result property="id"    column="id"    />
         <result property="orderNo"    column="order_no"    />
@@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectStationClassStructureList" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
         <include refid="selectStationClassStructureVo"/>
-        <where>  
+        <where>
             <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
             <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
@@ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="listOilStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-       	SELECT a.station_id, a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(a.receivable_amt),2) as receivable_amt,ROUND(SUM(a.received_amt),2) as received_amt,ROUND(SUM(order_liters),2) as order_liters,ROUND(SUM(a.discount_amt),2) as discount_amt ,COUNT(order_no) as order_no,a.class_start_date,a.class_structure_date,a.class_structure_man,sum(a.print_num) print_num
+        SELECT a.station_id, a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(a.receivable_amt),2) as receivable_amt,ROUND(SUM(a.received_amt),2) as received_amt,ROUND(SUM(order_liters),2) as order_liters,ROUND(SUM(a.discount_amt),2) as discount_amt ,COUNT(order_no) as order_no,a.class_start_date,a.class_structure_date,a.class_structure_man,sum(a.print_num) print_num
         from station_class_structure a
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
@@ -127,14 +127,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="selectStationClassStructureMax" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
         select id, station_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_name, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, oil_type, print_num, class_structure_no, class_structure_date, class_structure_man, oils
-         from station_class_structure
-       	 where id = (
-            SELECT MAX(id) from station_class_structure
-            <where>
-                <if test="stationId != null "> and station_id = #{stationId}</if>
-                <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
-            </where>
-		)
+        from station_class_structure
+        where id = (
+        SELECT MAX(id) from station_class_structure
+        <where>
+            <if test="stationId != null "> and station_id = #{stationId}</if>
+            <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
+        </where>
+        )
     </select>
 
     <select id="selectStationClassStructureById" parameterType="Long" resultMap="StationClassStructureResult">
@@ -142,8 +142,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
     <select id="selectDistnctClassStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-      select count(DISTINCT class_structure_no) as num
-            from station_class_structure
+        select count(DISTINCT class_structure_no) as num
+        from station_class_structure
         <where>
             <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
             <if test="likeClassStructureNo != null  and likeClassStructureNo != ''">  and class_structure_no like concat( #{likeClassStructureNo}, '%') </if>
@@ -165,89 +165,97 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         GROUP BY class_structure_no,class_start_date,station_id,station_name,class_structure_date,class_structure_man
     </select>
     <!--按员工/支付方式汇总数据-->
-<!--    SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt-->
-<!--    from  station_class_structure-->
-<!--    <where>-->
-<!--        <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>-->
-<!--        <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>-->
-<!--        <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>-->
-<!--    </where>-->
-<!--    GROUP BY oil_personnel-->
+    <!--    SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt-->
+    <!--    from  station_class_structure-->
+    <!--    <where>-->
+    <!--        <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>-->
+    <!--        <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>-->
+    <!--        <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>-->
+    <!--    </where>-->
+    <!--    GROUP BY oil_personnel-->
     <select id="listPersonnelPayStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-        SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
+        SELECT   oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
         sum(discount_amt) discount_amt,
         SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,
         SUM(xj_amt) xj_amt,sum(member_amt) member_amt,
-        (SELECT COUNT(b.order_no) from station_class_structure b
-            <where>
-                 and b.pay_type="xj"
-                <if test="classStructureNo != null and classStructureNo != ''"> and b.class_structure_no = #{classStructureNo}</if>
-            </where>
-         ) xj_num,
-        (SELECT COUNT(c.order_no) from station_class_structure c
-            <where>
-                and c.pay_type="zfb"
-                <if test="classStructureNo != null and classStructureNo != ''"> and c.class_structure_no = #{classStructureNo}</if>
-            </where>
-        ) zfb_num,
-        (SELECT COUNT(d.order_no) from station_class_structure d
-            <where>
-                and d.pay_type="wx"
-                <if test="classStructureNo != null and classStructureNo != ''"> and d.class_structure_no = #{classStructureNo}</if>
-            </where>
-        ) wx_num
-        from  station_class_structure a
+        sum(e.xj_num)	xj_num,sum(e.zfb_num)	zfb_num,sum(e.wx_num)	wx_num
+        from (
+        SELECT station_id,class_structure_no, order_type,oil_personnel,oil_gun,discount_amt,discount_coupon_amt,wx_amt,zfb_amt,xj_amt,member_amt,
+        (SELECT COUNT(b.order_no) from station_class_structure b where 1=1 and a.id = b.id and b.pay_type="xj" ) xj_num,
+        (SELECT COUNT(c.order_no) from station_class_structure c where 1=1 and a.id = c.id and c.pay_type="zfb" ) zfb_num,
+        (SELECT COUNT(d.order_no) from station_class_structure d where 1=1 and a.id = d.id and d.pay_type="wx" ) wx_num
+        from station_class_structure  a
         <where>
+            <if test="stationId != null and stationId != ''"> and a.station_id = #{stationId}</if>
             <if test="classStructureNo != null and classStructureNo != ''"> and a.class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and a.order_type = #{orderType}</if>
         </where>
-        GROUP BY a.oil_personnel
+        ) e
+        <where>
+            <if test="stationId != null and stationId != ''"> and e.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and e.class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and e.order_type = #{orderType}</if>
+        </where>
+        GROUP BY e.oil_personnel
     </select>
 
     <select id="listClass" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
         SELECT *  from
         station_class_structure
         where id =(SELECT max(id) from station_class_structure
-            <where>
-                <if test="classStructureMan != null and classStructureMan != ''"> and class_structure_man = #{classStructureMan}</if>
-                <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
-                <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
-            </where>
+        <where>
+            <if test="classStructureMan != null and classStructureMan != ''"> and class_structure_man = #{classStructureMan}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
+        </where>
         )
     </select>
     <!--根据支付方式汇总数据-->
     <select id="listPayStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-      	SELECT dict_label as pay_type,sum(order_liters) as order_liters,sum(discount_amt) as discount_amt,count(order_no) order_no,sum(amt) as amt,sum(receivable_amt) as receivable_amt,sum(received_amt) as received_amt
-		from   station_class_structure left JOIN sys_dict_data on dict_value = pay_type and dict_type ='pay_type'
+        SELECT dict_label as pay_type,sum(order_liters) as order_liters,sum(discount_amt) as discount_amt,count(order_no) order_no,sum(amt) as amt,sum(receivable_amt) as receivable_amt,sum(received_amt) as received_amt
+        from   station_class_structure left JOIN sys_dict_data on dict_value = pay_type and dict_type ='pay_type'
         <where>
             <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
             <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
             <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
         </where>
-		GROUP BY pay_type,dict_label
+        GROUP BY pay_type,dict_label
     </select>
-<!--  根据支付方式汇总数据-->
+    <!--  根据支付方式汇总数据-->
     <select id="listOilStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
         SELECT SUM(amt) as amt,SUM(amt) as amt,SUM(order_liters)  as order_liters,sum(order_no) as order_no
         from (SELECT a.station_id, a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(a.receivable_amt),2) as receivable_amt,ROUND(SUM(a.received_amt),2) as received_amt,ROUND(SUM(order_liters),2) as order_liters,ROUND(SUM(a.discount_amt),2) as discount_amt ,COUNT(order_no) as order_no,a.class_start_date,a.class_structure_date,a.class_structure_man,sum(a.print_num) print_num
         from station_class_structure a
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
-            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and a.class_structure_no = #{classStructureNo}</if>
         </where>
         GROUP BY a.oil_name,a.station_id,a.class_start_date,a.class_structure_date,a.class_structure_man) c
     </select>
 
     <!--按员工/支付方式汇总数据-->
     <select id="listPersonnelPayStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
-        SELECT sum(wx_num) wx_num,sum(zfb_num) zfb_num,sum(xj_num) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt
-        from (SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt
-        from  station_class_structure
+        SELECT GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
+        sum(discount_amt) discount_amt,
+        SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,
+        SUM(xj_amt) xj_amt,sum(member_amt) member_amt,
+        sum(e.xj_num)	xj_num,sum(e.zfb_num)	zfb_num,sum(e.wx_num)	wx_num
+        from (SELECT  station_id,class_structure_no, order_type,oil_personnel,oil_gun,discount_amt,discount_coupon_amt,wx_amt,zfb_amt,xj_amt,member_amt,
+        (SELECT COUNT(b.order_no) from station_class_structure b where 1=1 and a.id = b.id and b.pay_type="xj" ) xj_num,
+        (SELECT COUNT(c.order_no) from station_class_structure c where 1=1 and a.id = c.id and c.pay_type="zfb" ) zfb_num,
+        (SELECT COUNT(d.order_no) from station_class_structure d where 1=1 and a.id = d.id and d.pay_type="wx" ) wx_num
+        from station_class_structure  a
         <where>
-            <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
-            <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
-            <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
+            <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and a.class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and a.order_type = #{orderType}</if>
+        </where>
+        ) e
+        <where>
+            <if test="stationId != null "> and e.station_id = #{stationId}</if>
+            <if test="classStructureNo != null and classStructureNo != ''"> and e.class_structure_no = #{classStructureNo}</if>
+            <if test="orderType != null  and orderType != ''"> and e.order_type = #{orderType}</if>
         </where>
-        GROUP BY oil_personnel) a
     </select>
 
     <select id="listPersonnelStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
@@ -352,7 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="carNo != null">car_no,</if>
             <if test="customerPhone != null">customer_phone,</if>
             <if test="customerGrade != null">customer_grade,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderNo != null">#{orderNo},</if>
             <if test="stationId != null">#{stationId},</if>
@@ -395,7 +403,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="carNo != null">#{carNo},</if>
             <if test="customerPhone != null">#{customerPhone},</if>
             <if test="customerGrade != null">#{customerGrade},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateStationClassStructure" parameterType="StationClassStructure">
@@ -451,10 +459,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteStationClassStructureByIds" parameterType="String">
-        delete from station_class_structure where id in 
+        delete from station_class_structure where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-    
+
 </mapper>

+ 33 - 9
yijia-station/src/main/resources/mapper/station/StationClassesSummaryMapper.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yijia.station.mapper.StationClassesSummaryMapper">
-    
+
     <resultMap type="StationClassesSummary" id="StationClassesSummaryResult">
         <result property="id"    column="id"    />
         <result property="classesNo"    column="classes_no"    />
@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectStationClassesSummaryList" parameterType="StationClassesSummary" resultMap="StationClassesSummaryResult">
         <include refid="selectStationClassesSummaryVo"/>
-        <where>  
+        <where>
             <if test="classesNo != null  and classesNo != ''"> and classes_no = #{classesNo}</if>
             <if test="startDate != null "> and start_date = #{startDate}</if>
             <if test="endDate != null "> and end_date = #{endDate}</if>
@@ -52,6 +52,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="likeClassesMan != null  and likeClassesMan != ''">
+                and classes_man like concat('%', #{likeClassesMan}, '%')
+            </if>
+            <if test="likeClassesNo != null  and likeClassesNo != ''">
+                and classes_no like concat('%', #{likeClassesNo}, '%')
+            </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 查询班结开始时间检索 -->
+                AND date_format(end_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="endTime != null and endTime != ''"><!--  查询班结结束时间检索 -->
+                AND date_format(end_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
         </where>
         order by id desc
     </select>
@@ -80,6 +92,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="likeClassesMan != null  and likeClassesMan != ''">
+                and classes_man like concat('%', #{likeClassesMan}, '%')
+            </if>
+            <if test="likeClassesNo != null  and likeClassesNo != ''">
+                and classes_no like concat('%', #{likeClassesNo}, '%')
+            </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 查询班结开始时间检索 -->
+                AND date_format(end_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="endTime != null and endTime != ''"><!--  查询班结结束时间检索 -->
+                AND date_format(end_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
         </where>
         order by id desc
         limit 1;
@@ -89,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectStationClassesSummaryVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertStationClassesSummary" parameterType="StationClassesSummary" useGeneratedKeys="true" keyProperty="id">
         insert into station_classes_summary
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -108,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="zfbAmt != null">zfb_amt,</if>
             <if test="dzkAmt != null">dzk_amt,</if>
             <if test="classesMan != null">classes_man,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="classesNo != null">#{classesNo},</if>
             <if test="startDate != null">#{startDate},</if>
@@ -125,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="zfbAmt != null">#{zfbAmt},</if>
             <if test="dzkAmt != null">#{dzkAmt},</if>
             <if test="classesMan != null">#{classesMan},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateStationClassesSummary" parameterType="StationClassesSummary">
@@ -155,10 +179,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteStationClassesSummaryByIds" parameterType="String">
-        delete from station_classes_summary where id in 
+        delete from station_classes_summary where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-    
+
 </mapper>