|
@@ -1,33 +1,22 @@
|
|
|
package com.yijia.station.controller;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-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.station.domain.StationPic;
|
|
|
-import com.yijia.station.service.IStationPicService;
|
|
|
-import com.yijia.system.service.ISysDeptService;
|
|
|
-import com.yijia.system.service.ISysUserService;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.yijia.common.annotation.Log;
|
|
|
import com.yijia.common.core.controller.BaseController;
|
|
|
import com.yijia.common.core.domain.AjaxResult;
|
|
|
+import com.yijia.common.core.domain.entity.SysDept;
|
|
|
+import com.yijia.common.core.domain.model.LoginUser;
|
|
|
+import com.yijia.common.core.page.TableDataInfo;
|
|
|
import com.yijia.common.enums.BusinessType;
|
|
|
+import com.yijia.common.utils.SecurityUtils;
|
|
|
+import com.yijia.common.utils.poi.ExcelUtil;
|
|
|
import com.yijia.station.domain.StationPay;
|
|
|
import com.yijia.station.service.IStationPayService;
|
|
|
-import com.yijia.common.utils.poi.ExcelUtil;
|
|
|
-import com.yijia.common.core.page.TableDataInfo;
|
|
|
+import com.yijia.system.service.ISysDeptService;
|
|
|
+import com.yijia.system.service.ISysUserService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 油站支付设置Controller
|
|
@@ -40,57 +29,15 @@ import com.yijia.common.core.page.TableDataInfo;
|
|
|
public class StationPayController extends BaseController
|
|
|
{
|
|
|
@Autowired
|
|
|
- private IStationPayService stationPayService;
|
|
|
- @Autowired
|
|
|
- private ISysUserService sysUserService;
|
|
|
- @Autowired
|
|
|
private ISysDeptService sysDeptService;
|
|
|
- /**
|
|
|
- * 查询油站支付设置列表
|
|
|
- */
|
|
|
- @GetMapping("/list")
|
|
|
- public TableDataInfo list(StationPay stationPay)
|
|
|
- {
|
|
|
- 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> stationPayList = stationPayService.selectStationPayList(stationPay);
|
|
|
- return getDataTable(stationPayList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 导出油站支付设置列表
|
|
|
- */
|
|
|
- @Log(title = "油站支付设置", businessType = BusinessType.EXPORT)
|
|
|
- @GetMapping("/export")
|
|
|
- public AjaxResult export(StationPay stationPay)
|
|
|
- {
|
|
|
- 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> stationPayList = stationPayService.selectStationPayList(stationPay);
|
|
|
- ExcelUtil<StationPay> util = new ExcelUtil<StationPay>(StationPay.class);
|
|
|
- return util.exportExcel(stationPayList, "pay");
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
- * 获取油站支付设置详细信息
|
|
|
+ * 获取油站设置详细信息
|
|
|
*/
|
|
|
@GetMapping(value = "/{payId}")
|
|
|
public AjaxResult getInfo(@PathVariable("payId") Long payId)
|
|
|
{
|
|
|
- return AjaxResult.success(stationPayService.selectStationPayById(payId));
|
|
|
+ return AjaxResult.success(sysDeptService.selectDeptById(payId));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -99,93 +46,28 @@ public class StationPayController extends BaseController
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/queryOne")
|
|
|
- public AjaxResult queryOne(StationPay stationPay)
|
|
|
+ public AjaxResult queryOne(SysDept sysDept)
|
|
|
{
|
|
|
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);
|
|
|
- }
|
|
|
- return AjaxResult.success(stationPayService.selectStationPayOne(stationPay));
|
|
|
+ return AjaxResult.success(sysDeptService.selectDeptById(currentUser.getUser().getDeptId()));
|
|
|
}
|
|
|
-
|
|
|
/***
|
|
|
- * 根据油站id 查询出pay信息
|
|
|
+ * 根据油站id 查询出油站信息
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/{stationId}")
|
|
|
public AjaxResult getPayInfo(@PathVariable("stationId") Long stationId)
|
|
|
{
|
|
|
- StationPay stationPay=new StationPay();
|
|
|
- stationPay.setStationId(stationId);
|
|
|
- int i=0;
|
|
|
- List<StationPay> list=stationPayService.selectStationPayList(stationPay);
|
|
|
- StationPay pay=new StationPay();
|
|
|
- if(list!=null&&list.size()==1){
|
|
|
- pay.setPayId(list.get(0).getPayId());
|
|
|
- pay.setStationId(list.get(0).getStationId());
|
|
|
- pay.setStationName(list.get(0).getStationName());
|
|
|
- pay.setCardEnabledFlag(list.get(0).getCardEnabledFlag());
|
|
|
- pay.setWsPrintFlag(list.get(0).getWsPrintFlag());
|
|
|
- pay.setPrintSetting(list.get(0).getPrintSetting());
|
|
|
- pay.setIntegralFlag(list.get(0).getIntegralFlag());
|
|
|
- pay.setIntegralPrintFlag(list.get(0).getIntegralPrintFlag());
|
|
|
- pay.setNotice(list.get(0).getNotice());
|
|
|
- }
|
|
|
- return AjaxResult.success(pay);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增油站支付设置
|
|
|
- */
|
|
|
- @Log(title = "油站支付设置", businessType = BusinessType.INSERT)
|
|
|
- @PostMapping
|
|
|
- public AjaxResult add(@RequestBody StationPay stationPay)
|
|
|
- {
|
|
|
- LoginUser currentUser = SecurityUtils.getLoginUser();
|
|
|
- stationPay.setStationId(currentUser.getUser().getDeptId());
|
|
|
- if(stationPay.getIntegralFlag()==null ||stationPay.getIntegralFlag()==""){
|
|
|
- stationPay.setIntegralFlag("0");//默认积分功能关闭 1是开启0是关闭
|
|
|
- }
|
|
|
- if(stationPay.getIntegralPrintFlag()==null ||stationPay.getIntegralPrintFlag()==""){
|
|
|
- stationPay.setIntegralPrintFlag("0");//默认积分小票是否打印 1是开启0是关闭
|
|
|
- }
|
|
|
- if(stationPay.getCardEnabledFlag()==null ||stationPay.getCardEnabledFlag()==""){
|
|
|
- stationPay.setCardEnabledFlag("0");//默认电子卡功能关闭 1是开启0是关闭
|
|
|
- }
|
|
|
- if(stationPay.getWsPrintFlag()==null ||stationPay.getWsPrintFlag()==""){
|
|
|
- stationPay.setWsPrintFlag("0");//班结是否打印1是开启0是关闭
|
|
|
- }
|
|
|
- if(stationPay.getDiscountSetting()==null ||stationPay.getDiscountSetting()==""){
|
|
|
- stationPay.setDiscountSetting("0");//默认电子卡功能关闭 1是开启0是关闭
|
|
|
- }
|
|
|
- return toAjax(stationPayService.insertStationPay(stationPay));
|
|
|
+ return AjaxResult.success(sysDeptService.selectDeptById(stationId));
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 修改油站支付设置
|
|
|
*/
|
|
|
- @Log(title = "油站支付设置", businessType = BusinessType.UPDATE)
|
|
|
+ @Log(title = "油站设置", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody StationPay stationPay)
|
|
|
- {
|
|
|
- LoginUser currentUser = SecurityUtils.getLoginUser();
|
|
|
- stationPay.setStationId(currentUser.getUser().getDeptId());
|
|
|
- return toAjax(stationPayService.updateStationPay(stationPay));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除油站支付设置
|
|
|
- */
|
|
|
- @Log(title = "油站支付设置", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{payIds}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] payIds)
|
|
|
+ public AjaxResult edit(@RequestBody SysDept sysDept)
|
|
|
{
|
|
|
- return toAjax(stationPayService.deleteStationPayByIds(payIds));
|
|
|
+ return toAjax(sysDeptService.updateDept(sysDept));
|
|
|
}
|
|
|
-
|
|
|
}
|