Commit 77e10cd3 authored by zhangjianqian's avatar zhangjianqian

合并代码,删除class文件,新功能添加

parent 4a0726b8
package com.zehong.web.controller.gasBottleTrack;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.*;
import com.zehong.system.domain.vo.AirChargeStatisticsVo;
import com.zehong.system.service.ITAirChargeRecordService;
import com.zehong.system.service.ITGasBottleInfoService;
import com.zehong.system.service.ITGasBottleTrackRecordService;
import com.zehong.system.service.ITTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
/**
* 充装记录Controller
*
* @author zehong
* @date 2023-08-21
*/
@RestController
@RequestMapping("/charge/record")
public class TAirChargeRecordController extends BaseController
{
@Autowired
private ITAirChargeRecordService tAirChargeRecordService;
@Autowired
private ITGasBottleInfoService tGasBottleInfoService;
@Autowired
private ITGasBottleTrackRecordService tGasBottleTrackRecordService;
@Autowired
private ITTaskRecordService tTaskRecordService;
/**
* 查询充装记录列表
*/
// @PreAuthorize("@ss.hasPermi('charge:record:list')")
@GetMapping("/list")
public TableDataInfo list(TAirChargeRecord tAirChargeRecord)
{
startPage();
List<TAirChargeRecord> list = tAirChargeRecordService.selectTAirChargeRecordList(tAirChargeRecord);
return getDataTable(list);
}
/**
* 导出充装记录列表
*/
@PreAuthorize("@ss.hasPermi('charge:record:export')")
@Log(title = "充装记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TAirChargeRecord tAirChargeRecord)
{
List<TAirChargeRecord> list = tAirChargeRecordService.selectTAirChargeRecordList(tAirChargeRecord);
ExcelUtil<TAirChargeRecord> util = new ExcelUtil<TAirChargeRecord>(TAirChargeRecord.class);
return util.exportExcel(list, "充装记录数据");
}
/**
* 获取充装记录详细信息
*/
@PreAuthorize("@ss.hasPermi('charge:record:query')")
@GetMapping(value = "/{chargeRecordId}")
public AjaxResult getInfo(@PathVariable("chargeRecordId") Long chargeRecordId)
{
return AjaxResult.success(tAirChargeRecordService.selectTAirChargeRecordById(chargeRecordId));
}
/**
* 微信小程序 首页列表查询接口
* @param chargeRecordId
* @return
*/
@GetMapping("/selectGetInfo")
public AjaxResult selectGetInfo(Long chargeRecordId){
TAirChargeRecord tAirChargeRecord = tAirChargeRecordService.selectTAirChargeRecordById(chargeRecordId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tAirChargeRecord", tAirChargeRecord);
return ajax;
}
/**
* 新增充装记录
*/
@PreAuthorize("@ss.hasPermi('system:record:add')")
@Log(title = "充装记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAirChargeRecord tAirChargeRecord)
{
return toAjax(tAirChargeRecordService.insertTAirChargeRecord(tAirChargeRecord));
}
/**
* 小程序充装记录
* @param tAirChargeRecord
* @return
*/
@PostMapping("/addAirChargeRecord")
public AjaxResult addAirChargeRecord(@RequestBody TAirChargeRecord tAirChargeRecord) throws ParseException {
TGasBottleInfo tGasBottleInfo=new TGasBottleInfo();
tGasBottleInfo.setBottleId(tAirChargeRecord.getBottleId());
//修改气瓶状态为满瓶
tGasBottleInfo.setEmptyType("1");
//修改气瓶信息
tGasBottleInfoService.updateTGasBottleInfo(tGasBottleInfo);
// DateFormat fmt =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date date = fmt.parse(tAirChargeRecord.getChargeDates());
tAirChargeRecord.setChargeDate(new Date());
//气瓶追溯信息添加
TGasBottleTrackRecord tGasBottleTrackRecord=new TGasBottleTrackRecord();
//储配站主键
tGasBottleTrackRecord.setStationId(tAirChargeRecord.getStationId());
//储配站
tGasBottleTrackRecord.setStationName(tAirChargeRecord.getStationName());
//气瓶主键
tGasBottleTrackRecord.setBottleId(tAirChargeRecord.getBottleId());
//气瓶条码
tGasBottleTrackRecord.setBottleCode(tAirChargeRecord.getBottleCode());
//工序 气瓶充装
tGasBottleTrackRecord.setProcessesName("0");
//充装人员
tGasBottleTrackRecord.setOperator(tAirChargeRecord.getChargeOperator());
tGasBottleTrackRecord.setOperateDate(new Date());
//充装表信息添加
tAirChargeRecordService.insertTAirChargeRecord(tAirChargeRecord);
//气瓶追溯表信息添加
tGasBottleTrackRecord.setProcessesRelationId(tAirChargeRecord.getChargeRecordId());
//设置任务记录信息
TTaskRecord tTaskRecord=new TTaskRecord();
//操作人id
tTaskRecord.setOperator(tAirChargeRecord.getChargeOperator());
//工序
tTaskRecord.setProcessesName("0");
tTaskRecord.setCreateTime(new Date());
tTaskRecord.setProcessesRelationId(tAirChargeRecord.getChargeRecordId());
//任务记录表信息添加
tTaskRecordService.insertTTaskRecord(tTaskRecord);
return toAjax( tGasBottleTrackRecordService.insertTGasBottleTrackRecord(tGasBottleTrackRecord));
}
/**
* 修改充装记录
*/
@PreAuthorize("@ss.hasPermi('charge:record:edit')")
@Log(title = "充装记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAirChargeRecord tAirChargeRecord)
{
return toAjax(tAirChargeRecordService.updateTAirChargeRecord(tAirChargeRecord));
}
/**
* 删除充装记录
*/
@PreAuthorize("@ss.hasPermi('charge:record:remove')")
@Log(title = "充装记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{chargeRecordIds}")
public AjaxResult remove(@PathVariable Long[] chargeRecordIds)
{
return toAjax(tAirChargeRecordService.deleteTAirChargeRecordByIds(chargeRecordIds));
}
/**
* 充装记录导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('charge:record:import')")
@Log(title = "充装记录导入", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<TAirChargeRecord> util = new ExcelUtil<>(TAirChargeRecord.class);
List<TAirChargeRecord> airChargeRecordList = util.importExcel(file.getInputStream());
String message = tAirChargeRecordService.importAirChargeRecordInfo(airChargeRecordList, updateSupport);
return AjaxResult.success(message);
}
@GetMapping("/importTemplate")
public AjaxResult importTemplate(){
ExcelUtil<TAirChargeRecord> util = new ExcelUtil<>(TAirChargeRecord.class);
return util.importTemplateExcel("充装记录数据");
}
/**
* 储配站充装统计
* @param airChargeStatisticsVo 统计实体
* @return
*/
@GetMapping("/airChargeStationStatistics")
public TableDataInfo airChargeStationStatistics(AirChargeStatisticsVo airChargeStatisticsVo){
startPage();
return getDataTable(tAirChargeRecordService.airChargeStationStatistics(airChargeStatisticsVo));
}
@GetMapping("/airChargeStationStatisticExport")
public AjaxResult airChargeStationStatisticExport(AirChargeStatisticsVo airChargeStatisticsVo){
List<AirChargeStationStatistics> list = tAirChargeRecordService.airChargeStationStatistics(airChargeStatisticsVo);
ExcelUtil<AirChargeStationStatistics> util = new ExcelUtil<>(AirChargeStationStatistics.class);
return util.exportExcel(list, "充装统计数据");
}
/**
* 充装人员统计
* @param airChargeStatisticsVo 统计
* @return
*/
@GetMapping("/airChargeOperatorStatistics")
public TableDataInfo airChargeOperatorStatistics(AirChargeStatisticsVo airChargeStatisticsVo){
startPage();
return getDataTable(tAirChargeRecordService.airChargeOperatorStatistics(airChargeStatisticsVo));
}
@GetMapping("/airChargeOperatorStatisticsExport")
public AjaxResult airChargeOperatorStatisticsExport(AirChargeStatisticsVo airChargeStatisticsVo){
List<AirChargeOperatorStatistics> list = tAirChargeRecordService.airChargeOperatorStatistics(airChargeStatisticsVo);
ExcelUtil<AirChargeOperatorStatistics> util = new ExcelUtil<>(AirChargeOperatorStatistics.class);
return util.exportExcel(list, "充装统计数据");
}
}
package com.zehong.web.controller.gasBottleTrack;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.BottleStatistics;
import com.zehong.system.domain.TGasBottleInfo;
import com.zehong.system.service.ITGasBottleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 气瓶信息Controller
*
* @author zehong
* @date 2023-08-15
*/
@RestController
@RequestMapping("/gasBottle/info")
public class TGasBottleInfoController extends BaseController
{
@Autowired
private ITGasBottleInfoService tGasBottleInfoService;
/**
* 查询气瓶信息列表
*/
// @PreAuthorize("@ss.hasPermi('gasBottle:info:list')")
@GetMapping("/list")
public TableDataInfo list(TGasBottleInfo tGasBottleInfo)
{
startPage();
List<TGasBottleInfo> list = tGasBottleInfoService.selectTGasBottleInfoList(tGasBottleInfo);
return getDataTable(list);
}
@GetMapping("/bottleInfoList")
public AjaxResult bottleInfoList(TGasBottleInfo tGasBottleInfo)
{
List<TGasBottleInfo> list = tGasBottleInfoService.selectTGasBottleInfoList(tGasBottleInfo);
return AjaxResult.success(list);
}
/**
* 导出气瓶信息列表
*/
@PreAuthorize("@ss.hasPermi('gasBottle:info:export')")
@Log(title = "气瓶信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TGasBottleInfo tGasBottleInfo)
{
List<TGasBottleInfo> list = tGasBottleInfoService.selectTGasBottleInfoList(tGasBottleInfo);
ExcelUtil<TGasBottleInfo> util = new ExcelUtil<TGasBottleInfo>(TGasBottleInfo.class);
return util.exportExcel(list, "气瓶信息数据");
}
/**
* 获取气瓶信息详细信息
*/
// @PreAuthorize("@ss.hasPermi('gasBottle:info:query')")
@GetMapping(value = "/{bottleId}")
public AjaxResult getInfo(@PathVariable("bottleId") Long bottleId)
{
return AjaxResult.success(tGasBottleInfoService.selectTGasBottleInfoById(bottleId));
}
@GetMapping("/getInf")
public AjaxResult getInf(String bottleId)
{
/**
* 查询气瓶详细信息
*/
TGasBottleInfo inf = tGasBottleInfoService.getInf(bottleId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasBottleInfo", inf);
return ajax;
}
@GetMapping("/getInfn")
public AjaxResult getInfn(String bottleId)
{
/**
* 查询气瓶详细信息
*/
TGasBottleInfo inf = tGasBottleInfoService.getInfn(bottleId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasBottleInfo", inf);
return ajax;
}
/**
* 新增气瓶信息
*/
// @PreAuthorize("@ss.hasPermi('gasBottle:info:add')")
@Log(title = "气瓶信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TGasBottleInfo tGasBottleInfo)
{
TGasBottleInfo tGasBottleInfo1=new TGasBottleInfo();
tGasBottleInfo1.setBottleCode(tGasBottleInfo.getBottleCode());
/**
* 查询气瓶详细信息
*/
List<TGasBottleInfo> list = tGasBottleInfoService.selectTGasBottleInfoList(tGasBottleInfo1);
if (list.size()>=1){
return null;
}
return toAjax(tGasBottleInfoService.insertTGasBottleInfo(tGasBottleInfo));
}
/**
* 修改气瓶信息
*/
// @PreAuthorize("@ss.hasPermi('gasBottle:info:edit')")
@Log(title = "气瓶信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TGasBottleInfo tGasBottleInfo)
{
return toAjax(tGasBottleInfoService.updateTGasBottleInfo(tGasBottleInfo));
}
/**
* 删除气瓶信息
*/
// @PreAuthorize("@ss.hasPermi('gasBottle:info:remove')")
@Log(title = "气瓶信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{bottleIds}")
public AjaxResult remove(@PathVariable Long[] bottleIds)
{
return toAjax(tGasBottleInfoService.deleteTGasBottleInfoByIds(bottleIds));
}
/**
* 气瓶导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('gasBottle:info:import')")
@Log(title = "气瓶导入", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<TGasBottleInfo> util = new ExcelUtil<>(TGasBottleInfo.class);
List<TGasBottleInfo> tGasBottleInfoList = util.importExcel(file.getInputStream());
String message = tGasBottleInfoService.importTGasBottleInfo(tGasBottleInfoList, updateSupport);
return AjaxResult.success(message);
}
@GetMapping("/importTemplate")
public AjaxResult importTemplate(){
ExcelUtil<TGasBottleInfo> util = new ExcelUtil<>(TGasBottleInfo.class);
return util.importTemplateExcel("气瓶数据");
}
@GetMapping("/bottleStatistics")
public TableDataInfo bottleStatistics(@RequestParam(value="stationId",required = false) Long stationId){
startPage();
return getDataTable(tGasBottleInfoService.bottleStatistics(stationId));
}
@GetMapping("/bottleStatisticsExport")
public AjaxResult bottleStatisticsExport(@RequestParam(value = "stationId",required = false) Long stationId)
{
List<BottleStatistics> statistics = tGasBottleInfoService.bottleStatistics(stationId);
ExcelUtil<BottleStatistics> util = new ExcelUtil<>(BottleStatistics.class);
return util.exportExcel(statistics, "气瓶信息数据");
}
}
package com.zehong.web.controller.gasBottleTrack;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TGasBottleInfo;
import com.zehong.system.domain.TGasBottleTrackRecord;
import com.zehong.system.domain.TTaskRecord;
import com.zehong.system.service.ITGasBottleInfoService;
import com.zehong.system.service.ITGasBottleTrackRecordService;
import com.zehong.system.service.ITTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
/**
* 气瓶追溯Controller
*
* @author zehong
* @date 2023-08-18
*/
@RestController
@RequestMapping("/track/record")
public class TGasBottleTrackRecordController extends BaseController
{
@Autowired
private ITGasBottleTrackRecordService tGasBottleTrackRecordService;
@Autowired
private ITGasBottleInfoService tGasBottleInfoService;
@Autowired
private ITTaskRecordService tTaskRecordService;
/**
* 查询气瓶追溯列表
*/
@RequestMapping("/list")
public TableDataInfo list(TGasBottleTrackRecord tGasBottleTrackRecord)
{
startPage();
List<TGasBottleTrackRecord> list = tGasBottleTrackRecordService.selectTGasBottleTrackRecordList(tGasBottleTrackRecord);
return getDataTable(list);
}
/**
* 微信小程序 获取回收记录详细信息
* @param trackRecordId
* @return
*/
@GetMapping("/selectGet")
public AjaxResult selectGetInfo(Long trackRecordId){
TGasBottleTrackRecord tGasBottleTrackRecord = tGasBottleTrackRecordService.selectTGasBottleTrackRecordById(trackRecordId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasBottleTrackRecord", tGasBottleTrackRecord);
return ajax;
}
/**
* 微信小程序 气瓶追溯信息查询
* @param tGasBottleTrackRecord
* @return
*/
@GetMapping("/gasCylinderTraceability")
public TableDataInfo gasCylinderTraceability(TGasBottleTrackRecord tGasBottleTrackRecord)
{
startPage();
List<TGasBottleTrackRecord> list = tGasBottleTrackRecordService.selectTGasBottleTrackRecordList(tGasBottleTrackRecord);
return getDataTable(list);
}
@PostMapping("/bottleTrackRecordList")
public AjaxResult bottleTrackRecordList(@RequestBody TGasBottleTrackRecord tGasBottleTrackRecord)
{
List<TGasBottleTrackRecord> list = tGasBottleTrackRecordService.selectTGasBottleTrackRecordList(tGasBottleTrackRecord);
return AjaxResult.success(list);
}
/**
* 导出气瓶追溯列表
*/
@PreAuthorize("@ss.hasPermi('track:record:export')")
@Log(title = "气瓶追溯", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public AjaxResult export(@RequestBody TGasBottleTrackRecord tGasBottleTrackRecord)
{
List<TGasBottleTrackRecord> list = tGasBottleTrackRecordService.selectTGasBottleTrackRecordList(tGasBottleTrackRecord);
ExcelUtil<TGasBottleTrackRecord> util = new ExcelUtil<TGasBottleTrackRecord>(TGasBottleTrackRecord.class);
return util.exportExcel(list, "气瓶追溯数据");
}
/**
* 获取气瓶追溯详细信息
*/
@PreAuthorize("@ss.hasPermi('track:record:query')")
@GetMapping(value = "/{trackRecordId}")
public AjaxResult getInfo(@PathVariable("trackRecordId") Long trackRecordId)
{
return AjaxResult.success(tGasBottleTrackRecordService.selectTGasBottleTrackRecordById(trackRecordId));
}
/**
* 新增气瓶追溯
*/
@PreAuthorize("@ss.hasPermi('track:record:add')")
@Log(title = "气瓶追溯", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TGasBottleTrackRecord tGasBottleTrackRecord)
{
return toAjax(tGasBottleTrackRecordService.insertTGasBottleTrackRecord(tGasBottleTrackRecord));
}
/**
* 气瓶回收信息添加
* @param tGasBottleTrackRecord
* @return
*/
@PostMapping("/addTGasBottleTrackRecord")
public int addTGasBottleTrackRecord(@RequestBody TGasBottleTrackRecord tGasBottleTrackRecord) throws ParseException {
TGasBottleInfo tGasBottleInfo1 = tGasBottleInfoService.selectTGasBottleInfoById(tGasBottleTrackRecord.getBottleId());
if ("0".equals(tGasBottleInfo1.getCurrentStatus())){
return 0;
}
//修改气瓶状态
TGasBottleInfo tGasBottleInfo=new TGasBottleInfo();
tGasBottleInfo.setBottleId(tGasBottleTrackRecord.getBottleId());
//设置气瓶为在站状态
tGasBottleInfo.setCurrentStatus("0");
//设置气瓶为空瓶状态
tGasBottleInfo.setEmptyType("0");
tGasBottleInfoService.updateTGasBottleInfo(tGasBottleInfo);
// DateFormat fmt =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date date = fmt.parse(tGasBottleTrackRecord.getOperateDates());
//气瓶追溯信息添加
tGasBottleTrackRecord.setOperateDate(new Date());
tGasBottleTrackRecordService.insertTGasBottleTrackRecord(tGasBottleTrackRecord);
//设置任务记录信息
TTaskRecord tTaskRecord=new TTaskRecord();
//操作人id
tTaskRecord.setOperator(Long.valueOf(tGasBottleTrackRecord.getOperator()));
//工序
tTaskRecord.setProcessesName("3");
tTaskRecord.setCreateTime(new Date());
tTaskRecord.setProcessesRelationId(tGasBottleTrackRecord.getTrackRecordId());
//任务记录表信息添加
tTaskRecordService.insertTTaskRecord(tTaskRecord);
return 1;
}
/**
* 修改气瓶追溯
*/
@PreAuthorize("@ss.hasPermi('track:record:edit')")
@Log(title = "气瓶追溯", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TGasBottleTrackRecord tGasBottleTrackRecord)
{
return toAjax(tGasBottleTrackRecordService.updateTGasBottleTrackRecord(tGasBottleTrackRecord));
}
/**
* 删除气瓶追溯
*/
@PreAuthorize("@ss.hasPermi('track:record:remove')")
@Log(title = "气瓶追溯", businessType = BusinessType.DELETE)
@DeleteMapping("/{trackRecordIds}")
public AjaxResult remove(@PathVariable Long[] trackRecordIds)
{
return toAjax(tGasBottleTrackRecordService.deleteTGasBottleTrackRecordByIds(trackRecordIds));
}
}
package com.zehong.web.controller.gasBottleTrack;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.BaseInfoStatistics;
import com.zehong.system.domain.TGasStorageStationInfo;
import com.zehong.system.domain.TGasUserInfolins;
import com.zehong.system.service.ITGasStorageStationInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 储配站信息Controller
*
* @author zehong
* @date 2023-08-14
*/
@RestController
@RequestMapping("/gasBottleTrack/storageStationManage")
public class TGasStorageStationInfoController extends BaseController
{
@Autowired
private ITGasStorageStationInfoService tGasStorageStationInfoService;
/**
* 查询储配站信息列表
*/
@GetMapping("/list")
public TableDataInfo list(TGasStorageStationInfo tGasStorageStationInfo)
{
startPage();
List<TGasStorageStationInfo> list = tGasStorageStationInfoService.selectTGasStorageStationInfoList(tGasStorageStationInfo);
return getDataTable(list);
}
@GetMapping("/gasStorageStationList")
public AjaxResult gasStorageStationList(TGasStorageStationInfo tGasStorageStationInfo){
List<TGasStorageStationInfo> list = tGasStorageStationInfoService.selectTGasStorageStationInfoList(tGasStorageStationInfo);
return AjaxResult.success(list);
}
/**
* 微信小程序储配站搜索接口
* @param tGasStorageStationInfo
* @return
*/
@GetMapping("/storageStationlist")
public AjaxResult StorageStationList(TGasStorageStationInfo tGasStorageStationInfo){
List<TGasStorageStationInfo> tGasStorageStationInfos = tGasStorageStationInfoService.selectTGasStorageStationInfoList(tGasStorageStationInfo);
List list=new ArrayList();
for (int i=0;i<tGasStorageStationInfos.size();i++){
TGasUserInfolins tGasUserInfolins=new TGasUserInfolins();
tGasUserInfolins.setLabel(tGasStorageStationInfos.get(i).getStationName());
tGasUserInfolins.setValue(String.valueOf(tGasStorageStationInfos.get(i).getStationId()));
list.add(tGasUserInfolins);
}
AjaxResult ajax = AjaxResult.success();
ajax.put("list", list);
return ajax;
}
/**
* 导出储配站信息列表
*/
@PreAuthorize("@ss.hasPermi('gasBottleTrack:storageStationManage::export')")
@Log(title = "储配站信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TGasStorageStationInfo tGasStorageStationInfo)
{
List<TGasStorageStationInfo> list = tGasStorageStationInfoService.selectTGasStorageStationInfoList(tGasStorageStationInfo);
ExcelUtil<TGasStorageStationInfo> util = new ExcelUtil<TGasStorageStationInfo>(TGasStorageStationInfo.class);
return util.exportExcel(list, "储配站信息数据");
}
/**
* 获取储配站信息详细信息
*/
@PreAuthorize("@ss.hasPermi('gasBottleTrack:storageStationManage:query')")
@GetMapping(value = "/{stationId}")
public AjaxResult getInfo(@PathVariable("stationId") Long stationId)
{
return AjaxResult.success(tGasStorageStationInfoService.selectTGasStorageStationInfoById(stationId));
}
/**
* 新增储配站信息
*/
@PreAuthorize("@ss.hasPermi('gasBottleTrack:storageStationManage:add')")
@Log(title = "储配站信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TGasStorageStationInfo tGasStorageStationInfo)
{
return toAjax(tGasStorageStationInfoService.insertTGasStorageStationInfo(tGasStorageStationInfo));
}
/**
* 修改储配站信息
*/
@PreAuthorize("@ss.hasPermi('gasBottleTrack:storageStationManage:edit')")
@Log(title = "储配站信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TGasStorageStationInfo tGasStorageStationInfo)
{
return toAjax(tGasStorageStationInfoService.updateTGasStorageStationInfo(tGasStorageStationInfo));
}
/**
* 删除储配站信息
*/
@PreAuthorize("@ss.hasPermi('gasBottleTrack:storageStationManage:remove')")
@Log(title = "储配站信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stationIds}")
public AjaxResult remove(@PathVariable Long[] stationIds)
{
return toAjax(tGasStorageStationInfoService.deleteTGasStorageStationInfoByIds(stationIds));
}
/**
* 储配站导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('gasBottleTrack:storageStationManage:import')")
@Log(title = "储配站维护", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<TGasStorageStationInfo> util = new ExcelUtil<>(TGasStorageStationInfo.class);
List<TGasStorageStationInfo> tGasStorageStationInfoList = util.importExcel(file.getInputStream());
String message = tGasStorageStationInfoService.importTGasStorageStationInfo(tGasStorageStationInfoList, updateSupport);
return AjaxResult.success(message);
}
@GetMapping("/importTemplate")
public AjaxResult importTemplate(){
ExcelUtil<TGasStorageStationInfo> util = new ExcelUtil<>(TGasStorageStationInfo.class);
return util.importTemplateExcel("储配站数据");
}
/**
* 基础信息统计
* @param stationId 储配站id
* @return
*/
@GetMapping("/baseInfoStatistics")
public TableDataInfo baseInfoStatistics(@RequestParam(value = "stationId",required = false) Long stationId){
startPage();
return getDataTable(tGasStorageStationInfoService.baseInfoStatistics(stationId));
}
@GetMapping("/baseInfoStatisticsExport")
public AjaxResult baseInfoStatisticsExport(@RequestParam(value = "stationId",required = false) Long stationId)
{
List<BaseInfoStatistics> statistics = tGasStorageStationInfoService.baseInfoStatistics(stationId);
ExcelUtil<BaseInfoStatistics> util = new ExcelUtil<>(BaseInfoStatistics.class);
return util.exportExcel(statistics, "基础信息数据");
}
}
package com.zehong.web.controller.gasBottleTrack;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TGasUserInfo;
import com.zehong.system.domain.TGasUserInfolins;
import com.zehong.system.domain.TTaskRecord;
import com.zehong.system.service.ITGasUserInfoService;
import com.zehong.system.service.ITTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 燃气用户Controller
*
* @author zehong
* @date 2023-08-17
*/
@RestController
@RequestMapping("/gasUser/info")
public class TGasUserInfoController extends BaseController
{
@Autowired
private ITGasUserInfoService tGasUserInfoService;
@Autowired
private ITTaskRecordService tTaskRecordService;
/**
* 查询燃气用户列表
*/
@PreAuthorize("@ss.hasPermi('gasUser:info:list')")
@GetMapping("/list")
public TableDataInfo list(TGasUserInfo tGasUserInfo)
{
startPage();
List<TGasUserInfo> list = tGasUserInfoService.selectTGasUserInfoList(tGasUserInfo);
return getDataTable(list);
}
/**
* 微信小程序 获取燃气用户详细信息
* @param gasUserId
* @return
*/
@GetMapping("/selectGet")
public AjaxResult selectGetInfo(Long gasUserId){
TGasUserInfo tGasUserInfo = tGasUserInfoService.selectTGasUserInfoById(gasUserId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasUserInfo", tGasUserInfo);
return ajax;
}
@GetMapping("/gasUserInfoList")
public AjaxResult gasUserInfoList(TGasUserInfo tGasUserInfo){
List<TGasUserInfo> list = tGasUserInfoService.selectTGasUserInfoList(tGasUserInfo);
return AjaxResult.success(list);
}
/**
* 导出燃气用户列表
*/
@PreAuthorize("@ss.hasPermi('gasUser:info:export')")
@Log(title = "燃气用户", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TGasUserInfo tGasUserInfo)
{
List<TGasUserInfo> list = tGasUserInfoService.selectTGasUserInfoList(tGasUserInfo);
ExcelUtil<TGasUserInfo> util = new ExcelUtil<TGasUserInfo>(TGasUserInfo.class);
return util.exportExcel(list, "燃气用户数据");
}
/**
* 获取燃气用户详细信息
*/
@PreAuthorize("@ss.hasPermi('gasUser:info:query')")
@GetMapping(value = "/{gasUserId}")
public AjaxResult getInfo(@PathVariable("gasUserId") Long gasUserId)
{
return AjaxResult.success(tGasUserInfoService.selectTGasUserInfoById(gasUserId));
}
@PostMapping("/getUser")
public AjaxResult getUser(@RequestBody TGasUserInfo tGasUserInfo)
{
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasUserInfon", tGasUserInfoService.selectTGasUserInfoById(tGasUserInfo.getGasUserId()));
return ajax;
}
/**
* 微信小程序下拉信息查询
* @param tGasUserInfo
* @return
*/
@PostMapping("/gasUserId")
public AjaxResult gasUserId(@RequestBody TGasUserInfo tGasUserInfo)
{
TGasUserInfo tGasUserInfo1 = tGasUserInfoService.selectTGasUserInfoById(tGasUserInfo.getGasUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasUserInfon", tGasUserInfo1);
return ajax;
}
/**
* 小程序 查询燃气用户信息
* @param tGasUserInfo
* @return
*/
@PostMapping("/gasUser")
public AjaxResult gasUser(@RequestBody TGasUserInfo tGasUserInfo)
{
List<TGasUserInfo> tGasUserInfos = tGasUserInfoService.gasUser(tGasUserInfo);
List list=new ArrayList();
for (int i=0;i<tGasUserInfos.size();i++){
TGasUserInfolins tGasUserInfolins=new TGasUserInfolins();
tGasUserInfolins.setLabel(tGasUserInfos.get(i).getGasUserName());
tGasUserInfolins.setValue(String.valueOf(tGasUserInfos.get(i).getGasUserId()));
list.add(tGasUserInfolins);
}
AjaxResult ajax = AjaxResult.success();
ajax.put("list", list);
ajax.put("tGasBottleInfo", tGasUserInfos);
return ajax;
}
/**
* 新增燃气用户
*/
@PreAuthorize("@ss.hasPermi('gasUser:info:add')")
@Log(title = "燃气用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TGasUserInfo tGasUserInfo)
{
return toAjax(tGasUserInfoService.insertTGasUserInfo(tGasUserInfo));
}
/**
* 微信小程序新增燃气用户
* @param tGasUserInfo
* @return
*/
@PostMapping("/addUserInfo")
public AjaxResult addUserInfo(@RequestBody TGasUserInfo tGasUserInfo){
tGasUserInfoService.insertTGasUserInfo(tGasUserInfo);
//设置任务记录信息
TTaskRecord tTaskRecord=new TTaskRecord();
//操作人id
tTaskRecord.setOperator(Long.valueOf(tGasUserInfo.getOperator()));
//工序
tTaskRecord.setProcessesName("5");
tTaskRecord.setCreateTime(new Date());
tTaskRecord.setProcessesRelationId(tGasUserInfo.getGasUserId());
//任务记录表信息添加
return toAjax(tTaskRecordService.insertTTaskRecord(tTaskRecord));
}
/**
* 微信小程序修改燃气用户
* @param tGasUserInfo
* @return
*/
@PostMapping("/updateUserInfo")
public AjaxResult updateUserInfo(@RequestBody TGasUserInfo tGasUserInfo)
{
return toAjax(tGasUserInfoService.updateTGasUserInfo(tGasUserInfo));
}
/**
* 修改燃气用户
*/
@PreAuthorize("@ss.hasPermi('gasUser:info:edit')")
@Log(title = "燃气用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TGasUserInfo tGasUserInfo)
{
return toAjax(tGasUserInfoService.updateTGasUserInfo(tGasUserInfo));
}
/**
* 删除燃气用户
*/
@PreAuthorize("@ss.hasPermi('gasUser:info:remove')")
@Log(title = "燃气用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{gasUserIds}")
public AjaxResult remove(@PathVariable Long[] gasUserIds)
{
return toAjax(tGasUserInfoService.deleteTGasUserInfoByIds(gasUserIds));
}
/**
* 燃气用户导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('gasUser:info:import')")
@Log(title = "燃气用户导入", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<TGasUserInfo> util = new ExcelUtil<>(TGasUserInfo.class);
List<TGasUserInfo> tGasUserInfoList = util.importExcel(file.getInputStream());
String message = tGasUserInfoService.importTGasUserInfo(tGasUserInfoList, updateSupport);
return AjaxResult.success(message);
}
@GetMapping("/importTemplate")
public AjaxResult importTemplate(){
ExcelUtil<TGasUserInfo> util = new ExcelUtil<>(TGasUserInfo.class);
return util.importTemplateExcel("燃气用户数据");
}
}
package com.zehong.web.controller.gasBottleTrack;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TPractitionerInfo;
import com.zehong.system.service.ITPractitionerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 从业人员信息Controller
*
* @author zehong
* @date 2023-08-16
*/
@RestController
@RequestMapping("/practitioner/info")
public class TPractitionerInfoController extends BaseController
{
@Autowired
private ITPractitionerInfoService tPractitionerInfoService;
/**
* 查询从业人员信息列表
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:list')")
@GetMapping("/list")
public TableDataInfo list(TPractitionerInfo tPractitionerInfo)
{
startPage();
List<TPractitionerInfo> list = tPractitionerInfoService.selectTPractitionerInfoList(tPractitionerInfo);
return getDataTable(list);
}
@GetMapping("/practitionerInfoList")
public AjaxResult practitionerInfoList(TPractitionerInfo tPractitionerInfo)
{
List<TPractitionerInfo> list = tPractitionerInfoService.selectTPractitionerInfoList(tPractitionerInfo);
return AjaxResult.success(list);
}
/**
* 导出从业人员信息列表
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:export')")
@Log(title = "从业人员信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TPractitionerInfo tPractitionerInfo)
{
List<TPractitionerInfo> list = tPractitionerInfoService.selectTPractitionerInfoList(tPractitionerInfo);
ExcelUtil<TPractitionerInfo> util = new ExcelUtil<TPractitionerInfo>(TPractitionerInfo.class);
return util.exportExcel(list, "从业人员信息数据");
}
/**
* 获取从业人员信息详细信息
*/
@GetMapping(value = "/{practitionerId}")
public AjaxResult getInfo(@PathVariable("practitionerId") Long practitionerId)
{
return AjaxResult.success(tPractitionerInfoService.selectTPractitionerInfoById(practitionerId));
}
@GetMapping(value = "/getInfo")
public AjaxResult getInfos(TPractitionerInfo tPractitionerInfo)
{
return AjaxResult.success(tPractitionerInfoService.selectTPractitionerInfoById(tPractitionerInfo.getPractitionerId()));
}
/**
* 新增从业人员信息
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:add')")
@Log(title = "从业人员信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TPractitionerInfo tPractitionerInfo)
{
//设置密码加密
tPractitionerInfo.setPassword(SecurityUtils.encryptPassword(tPractitionerInfo.getPassword()));
return toAjax(tPractitionerInfoService.insertTPractitionerInfo(tPractitionerInfo));
}
/**
* 修改从业人员信息
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:edit')")
@Log(title = "从业人员信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TPractitionerInfo tPractitionerInfo)
{
//设置密码加密
tPractitionerInfo.setPassword(SecurityUtils.encryptPassword(tPractitionerInfo.getPassword()));
return toAjax(tPractitionerInfoService.updateTPractitionerInfo(tPractitionerInfo));
}
@RequestMapping("/updatePractitionerInfo")
public AjaxResult updatePractitionerInfo(TPractitionerInfo tPractitionerInfo){
String pass = SecurityUtils.encryptPassword(tPractitionerInfo.getPassword());
tPractitionerInfo.setPassword(pass);
return toAjax(tPractitionerInfoService.updateTPractitionerInfo(tPractitionerInfo));
}
/**
* 删除从业人员信息
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:remove')")
@Log(title = "从业人员信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{practitionerIds}")
public AjaxResult remove(@PathVariable Long[] practitionerIds)
{
return toAjax(tPractitionerInfoService.deleteTPractitionerInfoByIds(practitionerIds));
}
/**
* 从业人员导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:import')")
@Log(title = "从业人员导入", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<TPractitionerInfo> util = new ExcelUtil<>(TPractitionerInfo.class);
List<TPractitionerInfo> tPractitionerInfo = util.importExcel(file.getInputStream());
String message = tPractitionerInfoService.importTPractitionerInfo(tPractitionerInfo, updateSupport);
return AjaxResult.success(message);
}
@GetMapping("/importTemplate")
public AjaxResult importTemplate(){
ExcelUtil<TPractitionerInfo> util = new ExcelUtil<>(TPractitionerInfo.class);
return util.importTemplateExcel("从业人员数据");
}
}
package com.zehong.web.controller.gasBottleTrack;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TGasUserInfo;
import com.zehong.system.domain.TSafeCheckRecord;
import com.zehong.system.domain.TTaskRecord;
import com.zehong.system.service.ITGasUserInfoService;
import com.zehong.system.service.ITSafeCheckRecordService;
import com.zehong.system.service.ITTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
/**
* 安检记录Controller
*
* @author zehong
* @date 2023-08-21
*/
@RestController
@RequestMapping("/safe/record")
public class TSafeCheckRecordController extends BaseController
{
@Autowired
private ITSafeCheckRecordService tSafeCheckRecordService;
@Autowired
private ITGasUserInfoService tGasUserInfoService;
@Autowired
private ITTaskRecordService tTaskRecordService;
/**
* 查询安检记录列表
*/
@PreAuthorize("@ss.hasPermi('safe:record:list')")
@GetMapping("/list")
public TableDataInfo list(TSafeCheckRecord tSafeCheckRecord)
{
startPage();
List<TSafeCheckRecord> list = tSafeCheckRecordService.selectTSafeCheckRecordList(tSafeCheckRecord);
return getDataTable(list);
}
/**
* 导出安检记录列表
*/
@PreAuthorize("@ss.hasPermi('safe:record:export')")
@Log(title = "安检记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TSafeCheckRecord tSafeCheckRecord)
{
List<TSafeCheckRecord> list = tSafeCheckRecordService.selectTSafeCheckRecordList(tSafeCheckRecord);
ExcelUtil<TSafeCheckRecord> util = new ExcelUtil<TSafeCheckRecord>(TSafeCheckRecord.class);
return util.exportExcel(list, "安检记录数据");
}
/**
* 获取安检记录详细信息
*/
@PreAuthorize("@ss.hasPermi('safe:record:query')")
@GetMapping(value = "/{safeCheckId}")
public AjaxResult getInfo(@PathVariable("safeCheckId") Long safeCheckId)
{
return AjaxResult.success(tSafeCheckRecordService.selectTSafeCheckRecordById(safeCheckId));
}
/**
* 微信小程序 获取安检记录详细信息
* @param safeCheckId
* @return
*/
@GetMapping("/selectGet")
public AjaxResult selectGetInfo(Long safeCheckId){
TSafeCheckRecord tSafeCheckRecord = tSafeCheckRecordService.selectTSafeCheckRecordById(safeCheckId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tAirChargeRecord", tSafeCheckRecord);
return ajax;
}
/**
* 新增安检记录
*/
@Log(title = "安检记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSafeCheckRecord tSafeCheckRecord)
{
return toAjax(tSafeCheckRecordService.insertTSafeCheckRecord(tSafeCheckRecord));
}
/**
* 安检记录添加 微信小程序调用接口
*/
@PostMapping("/addInfo")
public AjaxResult addInfo(@RequestBody TSafeCheckRecord tSafeCheckRecord) throws ParseException {
// DateFormat fmt =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date date = fmt.parse(tSafeCheckRecord.getSafeCheckDates());
//设置安检时间
tSafeCheckRecord.setSafeCheckDate(new Date());
//查询用户信息
TGasUserInfo tGasUserInfo1 = tGasUserInfoService.selectTGasUserInfoById(tSafeCheckRecord.getGasUserId());
//设置燃气用户末次配送时间
TGasUserInfo tGasUserInfo=new TGasUserInfo();
tGasUserInfo.setGasUserId(tSafeCheckRecord.getGasUserId());
tGasUserInfo.setLastDeliveryDate(new Date());
//累计次数+1
tGasUserInfo.setTotalCheckNum(tGasUserInfo1.getTotalCheckNum()+1);
tGasUserInfoService.updateTGasUserInfo(tGasUserInfo);
//设置任务记录信息
TTaskRecord tTaskRecord=new TTaskRecord();
//操作人id
tTaskRecord.setOperator(Long.valueOf(tSafeCheckRecord.getSafeCheckPerson()));
//安检记录添加
tSafeCheckRecordService.insertTSafeCheckRecord(tSafeCheckRecord);
//工序
tTaskRecord.setProcessesName("2");
tTaskRecord.setCreateTime(new Date());
tTaskRecord.setProcessesRelationId(tSafeCheckRecord.getSafeCheckId());
//任务记录表信息添加
// tTaskRecordService.insertTTaskRecord(tTaskRecord);
return toAjax( tTaskRecordService.insertTTaskRecord(tTaskRecord));
}
/**
* 修改安检记录
*/
@PreAuthorize("@ss.hasPermi('safe:record:edit')")
@Log(title = "安检记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSafeCheckRecord tSafeCheckRecord)
{
return toAjax(tSafeCheckRecordService.updateTSafeCheckRecord(tSafeCheckRecord));
}
/**
* 删除安检记录
*/
@PreAuthorize("@ss.hasPermi('safe:record:remove')")
@Log(title = "安检记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{safeCheckIds}")
public AjaxResult remove(@PathVariable Long[] safeCheckIds)
{
return toAjax(tSafeCheckRecordService.deleteTSafeCheckRecordByIds(safeCheckIds));
}
}
package com.zehong.web.controller.system;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.*;
import com.zehong.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* 配送记录Controller
*
* @author zehong
* @date 2023-08-22
*/
@RestController
@RequestMapping("/system/recordn")
public class TDeliveryRecordController extends BaseController
{
@Autowired
private ITDeliveryRecordService tDeliveryRecordService;
@Autowired
private ITGasBottleInfoService tGasBottleInfoService;
@Autowired
private ITGasUserInfoService tGasUserInfoService;
@Autowired
private ITGasBottleTrackRecordService tGasBottleTrackRecordService;
@Autowired
private ITTaskRecordService tTaskRecordService;
/**
* 查询配送记录列表
*/
@PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list")
public TableDataInfo list(TDeliveryRecord tDeliveryRecord)
{
startPage();
List<TDeliveryRecord> list = tDeliveryRecordService.selectTDeliveryRecordList(tDeliveryRecord);
return getDataTable(list);
}
/**
* 导出配送记录列表
*/
@PreAuthorize("@ss.hasPermi('system:record:export')")
@Log(title = "配送记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TDeliveryRecord tDeliveryRecord)
{
List<TDeliveryRecord> list = tDeliveryRecordService.selectTDeliveryRecordList(tDeliveryRecord);
ExcelUtil<TDeliveryRecord> util = new ExcelUtil<TDeliveryRecord>(TDeliveryRecord.class);
return util.exportExcel(list, "配送记录数据");
}
/**
* 获取配送记录详细信息
*/
@PreAuthorize("@ss.hasPermi('system:record:query')")
@GetMapping(value = "/{deliveryRecordId}")
public AjaxResult getInfo(@PathVariable("deliveryRecordId") Long deliveryRecordId)
{
return AjaxResult.success(tDeliveryRecordService.selectTDeliveryRecordById(deliveryRecordId));
}
/**
* 微信小程序获取配送记录详细信息
* @param deliveryRecordId
* @return
*/
@GetMapping("/getInfos")
public AjaxResult getInfos(Long deliveryRecordId)
{
TDeliveryRecord tDeliveryRecord = tDeliveryRecordService.selectTDeliveryRecordById(deliveryRecordId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tAirChargeRecord", tDeliveryRecord);
return ajax;
}
/**
* 新增配送记录
*/
@PreAuthorize("@ss.hasPermi('system:record:add')")
@Log(title = "配送记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TDeliveryRecord tDeliveryRecord)
{
return toAjax(tDeliveryRecordService.insertTDeliveryRecord(tDeliveryRecord));
}
/**
* 新增配送记录
* @param tDeliveryRecord
* @return
*/
@PostMapping("/addRecord")
public int addRecord(@RequestBody TDeliveryRecord tDeliveryRecord)
{
TGasBottleInfo tGasBottleInfo1 = tGasBottleInfoService.selectTGasBottleInfoById(tDeliveryRecord.getBottleId());
if ("1".equals(tGasBottleInfo1.getCurrentStatus())){
return 1;
}
if ("0".equals(tGasBottleInfo1.getEmptyType())){
return 2;
}
TGasBottleInfo tGasBottleInfo=new TGasBottleInfo();
tGasBottleInfo.setBottleId(tDeliveryRecord.getBottleId());
//修改气瓶状态为离站状态
tGasBottleInfo.setCurrentStatus("1");
//修改气瓶信息
tGasBottleInfoService.updateTGasBottleInfo(tGasBottleInfo);
//设置配送时间
tDeliveryRecord.setDeliveryDate(new Date());
//设置燃气用户末次配送时间
TGasUserInfo tGasUserInfo=new TGasUserInfo();
tGasUserInfo.setGasUserId(tDeliveryRecord.getGasUserId());
tGasUserInfo.setLastDeliveryDate(new Date());
tGasUserInfoService.updateTGasUserInfo(tGasUserInfo);
//气瓶追溯信息添加
TGasBottleTrackRecord tGasBottleTrackRecord=new TGasBottleTrackRecord();
//储配站主键
tGasBottleTrackRecord.setStationId(tDeliveryRecord.getStationId());
//储配站
tGasBottleTrackRecord.setStationName(tDeliveryRecord.getStationName());
//气瓶主键
tGasBottleTrackRecord.setBottleId(tDeliveryRecord.getBottleId());
//气瓶条码
tGasBottleTrackRecord.setBottleCode(tDeliveryRecord.getBottleCode());
//工序 气瓶配送
tGasBottleTrackRecord.setProcessesName("1");
//配送人员
tGasBottleTrackRecord.setSender(tDeliveryRecord.getDeliveryPerson());
tGasBottleTrackRecord.setOperator(Long.valueOf(tDeliveryRecord.getDeliveryPerson()));
//接收人员
tGasBottleTrackRecord.setRecipient(String.valueOf(tDeliveryRecord.getGasUserId()));
tGasBottleTrackRecord.setOperateDate(new Date());
tDeliveryRecordService.insertTDeliveryRecord(tDeliveryRecord);
tGasBottleTrackRecord.setOperatorName(tDeliveryRecord.getDeliveryPersonName());
//气瓶追溯表信息添加
tGasBottleTrackRecord.setProcessesRelationId(tDeliveryRecord.getDeliveryRecordId());
tGasBottleTrackRecordService.insertTGasBottleTrackRecord(tGasBottleTrackRecord);
//设置任务记录信息
TTaskRecord tTaskRecord=new TTaskRecord();
//操作人id
tTaskRecord.setOperator(Long.valueOf(tDeliveryRecord.getDeliveryPerson()));
//工序
tTaskRecord.setProcessesName("1");
tTaskRecord.setCreateTime(new Date());
tTaskRecord.setProcessesRelationId(tDeliveryRecord.getDeliveryRecordId());
//任务记录表信息添加
tTaskRecordService.insertTTaskRecord(tTaskRecord);
return 0;
}
/**
* 修改配送记录
*/
@PreAuthorize("@ss.hasPermi('system:record:edit')")
@Log(title = "配送记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TDeliveryRecord tDeliveryRecord)
{
return toAjax(tDeliveryRecordService.updateTDeliveryRecord(tDeliveryRecord));
}
/**
* 删除配送记录
*/
@PreAuthorize("@ss.hasPermi('system:record:remove')")
@Log(title = "配送记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{deliveryRecordIds}")
public AjaxResult remove(@PathVariable Long[] deliveryRecordIds)
{
return toAjax(tDeliveryRecordService.deleteTDeliveryRecordByIds(deliveryRecordIds));
}
}
package com.zehong.web.controller.system;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TTaskRecord;
import com.zehong.system.service.ITTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 任务记录Controller
*
* @author zehong
* @date 2023-11-06
*/
@RestController
@RequestMapping("/system/records")
public class TTaskRecordController extends BaseController
{
@Autowired
private ITTaskRecordService tTaskRecordService;
/**
* 查询任务记录列表
*/
@GetMapping("/list")
public TableDataInfo list(TTaskRecord tTaskRecord)
{
startPage();
List<TTaskRecord> list = tTaskRecordService.selectTTaskRecordList(tTaskRecord);
return getDataTable(list);
}
/**
* 导出任务记录列表
*/
@Log(title = "任务记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TTaskRecord tTaskRecord)
{
List<TTaskRecord> list = tTaskRecordService.selectTTaskRecordList(tTaskRecord);
ExcelUtil<TTaskRecord> util = new ExcelUtil<TTaskRecord>(TTaskRecord.class);
return util.exportExcel(list, "任务记录数据");
}
/**
* 获取任务记录详细信息
*/
@GetMapping(value = "/{taskRecordId}")
public AjaxResult getInfo(@PathVariable("taskRecordId") Long taskRecordId)
{
return AjaxResult.success(tTaskRecordService.selectTTaskRecordById(taskRecordId));
}
/**
* 新增任务记录
*/
@Log(title = "任务记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TTaskRecord tTaskRecord)
{
return toAjax(tTaskRecordService.insertTTaskRecord(tTaskRecord));
}
/**
* 修改任务记录
*/
@Log(title = "任务记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TTaskRecord tTaskRecord)
{
return toAjax(tTaskRecordService.updateTTaskRecord(tTaskRecord));
}
/**
* 删除任务记录
*/
@Log(title = "任务记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{taskRecordIds}")
public AjaxResult remove(@PathVariable Long[] taskRecordIds)
{
return toAjax(tTaskRecordService.deleteTTaskRecordByIds(taskRecordIds));
}
}
package com.zehong.web.controller.system;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TVehicleInfo;
import com.zehong.system.domain.TVehicleLocationInfo;
import com.zehong.system.service.ITVehicleInfoService;
import com.zehong.system.service.ITVehicleLocationInfoService;
import io.jsonwebtoken.lang.Collections;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 燃气车辆信息Controller
*
* @author zehong
* @date 2023-08-16
*/
@RestController
@RequestMapping("/system/infos")
public class TVehicleInfosController extends BaseController
{
@Autowired
private ITVehicleInfoService tVehicleInfoService;
@Autowired
private ITVehicleLocationInfoService itVehicleLocationInfoService;
/**
* 查询燃气车辆信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:list')")
@GetMapping("/list")
public TableDataInfo list(TVehicleInfo tVehicleInfo)
{
startPage();
List<TVehicleInfo> list = tVehicleInfoService.selectTVehicleInfoList(tVehicleInfo);
for (int i=0;i<list.size();i++){
//获取最后位置信息
TVehicleLocationInfo tVehicleLocationInfo = new TVehicleLocationInfo();
tVehicleLocationInfo.setCarNum(list.get(i).getCarNum());
tVehicleLocationInfo.setLast(true);
List<TVehicleLocationInfo> tVehicleLocationInfoList=itVehicleLocationInfoService.selectTVehicleLocationInfoList(tVehicleLocationInfo);
//车辆最后位置
if(!Collections.isEmpty(tVehicleLocationInfoList) && tVehicleLocationInfoList.size() > 0){
list.get(i).setLongitude(tVehicleLocationInfoList.get(0).getLongitude());
list.get(i).setLatitude(tVehicleLocationInfoList.get(0).getLatitude());
}
}
return getDataTable(list);
}
/**
* 导出燃气车辆信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@Log(title = "燃气车辆信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TVehicleInfo tVehicleInfo)
{
List<TVehicleInfo> list = tVehicleInfoService.selectTVehicleInfoList(tVehicleInfo);
ExcelUtil<TVehicleInfo> util = new ExcelUtil<TVehicleInfo>(TVehicleInfo.class);
return util.exportExcel(list, "燃气车辆信息数据");
}
/**
* 获取燃气车辆信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:info:query')")
@GetMapping(value = "/{vehicleId}")
public AjaxResult getInfo(@PathVariable("vehicleId") Long vehicleId)
{
return AjaxResult.success(tVehicleInfoService.selectTVehicleInfoById(vehicleId));
}
/**
* 微信小程序 车辆详细信息查询接口
* @param tVehicleInfo
* @return
*/
@PostMapping("/getTVehicleInfo")
public AjaxResult getTVehicleInfo(@RequestBody TVehicleInfo tVehicleInfo)
{
TVehicleInfo tVehicleInfo1 = tVehicleInfoService.getTVehicleInfo(tVehicleInfo);
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasBottleInfo", tVehicleInfo1);
return ajax;
}
/**
* 新增燃气车辆信息
*/
@PreAuthorize("@ss.hasPermi('system:info:add')")
@Log(title = "燃气车辆信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TVehicleInfo tVehicleInfo)
{
return toAjax(tVehicleInfoService.insertTVehicleInfo(tVehicleInfo));
}
/**
* 修改燃气车辆信息
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@Log(title = "燃气车辆信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TVehicleInfo tVehicleInfo)
{
return toAjax(tVehicleInfoService.updateTVehicleInfo(tVehicleInfo));
}
/**
* 删除燃气车辆信息
*/
@PreAuthorize("@ss.hasPermi('system:info:remove')")
@Log(title = "燃气车辆信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{vehicleIds}")
public AjaxResult remove(@PathVariable Long[] vehicleIds)
{
return toAjax(tVehicleInfoService.deleteTVehicleInfoByIds(vehicleIds));
}
}
package com.zehong.web.controller.system;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.ServletUtils;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.framework.web.service.TokenService;
import com.zehong.system.domain.TTaskRecord;
import com.zehong.system.domain.TVehicleInfo;
import com.zehong.system.domain.TVehicleUseRecord;
import com.zehong.system.service.ITTaskRecordService;
import com.zehong.system.service.ITVehicleInfoService;
import com.zehong.system.service.ITVehicleUseRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
/**
* 车辆使用记录Controller
*
* @author zehong
* @date 2023-08-19
*/
@RestController
@RequestMapping("/system/record")
public class TVehicleUseRecordController extends BaseController
{
@Autowired
private ITVehicleUseRecordService tVehicleUseRecordService;
@Autowired
private TokenService tokenService;
@Autowired
private ITVehicleInfoService tVehicleInfoService;
@Autowired
private ITTaskRecordService tTaskRecordService;
/**
* 查询车辆使用记录列表
*/
@PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list")
public TableDataInfo list(TVehicleUseRecord tVehicleUseRecord)
{
startPage();
List<TVehicleUseRecord> list = tVehicleUseRecordService.selectTVehicleUseRecordList(tVehicleUseRecord);
return getDataTable(list);
}
/**
* 微信小程序 获车辆使用记录详细信息
* @param vehicleUseRecordId
* @return
*/
@GetMapping("/selectGet")
public AjaxResult selectGetInfo(Long vehicleUseRecordId){
TVehicleUseRecord tVehicleUseRecord = tVehicleUseRecordService.selectTVehicleUseRecordById(vehicleUseRecordId);
AjaxResult ajax = AjaxResult.success();
ajax.put("tGasBottleTrackRecord", tVehicleUseRecord);
return ajax;
}
/**
* 导出车辆使用记录列表
*/
@PreAuthorize("@ss.hasPermi('system:record:export')")
@Log(title = "车辆使用记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TVehicleUseRecord tVehicleUseRecord)
{
List<TVehicleUseRecord> list = tVehicleUseRecordService.selectTVehicleUseRecordList(tVehicleUseRecord);
ExcelUtil<TVehicleUseRecord> util = new ExcelUtil<TVehicleUseRecord>(TVehicleUseRecord.class);
return util.exportExcel(list, "车辆使用记录数据");
}
/**
* 获取车辆使用记录详细信息
*/
@PreAuthorize("@ss.hasPermi('system:record:query')")
@GetMapping(value = "/{vehicleUseRecordId}")
public AjaxResult getInfo(@PathVariable("vehicleUseRecordId") Long vehicleUseRecordId)
{
return AjaxResult.success(tVehicleUseRecordService.selectTVehicleUseRecordById(vehicleUseRecordId));
}
/**
* 新增车辆使用记录
*/
@PreAuthorize("@ss.hasPermi('system:record:add')")
@Log(title = "车辆使用记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TVehicleUseRecord tVehicleUseRecord)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
Long userId = loginUser.getUser().getUserId();
tVehicleUseRecord.setVehicleUserId(userId);
return toAjax(tVehicleUseRecordService.insertTVehicleUseRecord(tVehicleUseRecord));
}
/**
* 微信小程序 车辆使用信息提交
* @param tVehicleUseRecord
* @return
*/
@PostMapping("/addtVehicleUseRecord")
public AjaxResult addtVehicleUseRecord(@RequestBody TVehicleUseRecord tVehicleUseRecord) throws ParseException {
//修改车辆信息 使用状态和使用人
TVehicleInfo tVehicleInfo=new TVehicleInfo();
tVehicleInfo.setVehicleId(tVehicleUseRecord.getVehicleId());
//设置使用人id
tVehicleInfo.setVehicleUserId(tVehicleUseRecord.getVehicleUserId());
//设置使用人姓名
tVehicleInfo.setName(tVehicleUseRecord.getName());
//设置使用状态
tVehicleInfo.setOnState(tVehicleUseRecord.getOnState());
//修改车辆管理信息表
tVehicleInfoService.updateTVehicleInfo(tVehicleInfo);
tVehicleUseRecordService.insertTVehicleUseRecord(tVehicleUseRecord);
//设置任务记录信息
TTaskRecord tTaskRecord=new TTaskRecord();
//操作人id
tTaskRecord.setOperator(Long.valueOf(tVehicleUseRecord.getVehicleUserId()));
//工序
tTaskRecord.setProcessesName("4");
tTaskRecord.setCreateTime(new Date());
tTaskRecord.setProcessesRelationId(tVehicleUseRecord.getVehicleUseRecordId());
//任务记录表信息添加
return toAjax(tTaskRecordService.insertTTaskRecord(tTaskRecord));
}
/**
* 微信小程序 归还车辆接口
*/
@PostMapping("/returningVehicle")
public AjaxResult returningVehicle(@RequestBody TVehicleUseRecord tVehicleUseRecord) throws ParseException {
//修改车辆信息 使用状态和使用人
TVehicleInfo tVehicleInfo=new TVehicleInfo();
tVehicleInfo.setVehicleId(tVehicleUseRecord.getVehicleId());
//设置使用人id
tVehicleInfo.setVehicleUserId(tVehicleUseRecord.getVehicleUserId());
//设置使用人姓名
tVehicleInfo.setName(tVehicleUseRecord.getName());
//设置使用状态
tVehicleInfo.setOnState(tVehicleUseRecord.getOnState());
//修改车辆管理信息表
return toAjax(tVehicleInfoService.updateTVehicleInfo(tVehicleInfo));
}
/**
* 修改车辆使用记录
*/
@PreAuthorize("@ss.hasPermi('system:record:edit')")
@Log(title = "车辆使用记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TVehicleUseRecord tVehicleUseRecord)
{
return toAjax(tVehicleUseRecordService.updateTVehicleUseRecord(tVehicleUseRecord));
}
/**
* 删除车辆使用记录
*/
@PreAuthorize("@ss.hasPermi('system:record:remove')")
@Log(title = "车辆使用记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{vehicleUseRecordIds}")
public AjaxResult remove(@PathVariable Long[] vehicleUseRecordIds)
{
return toAjax(tVehicleUseRecordService.deleteTVehicleUseRecordByIds(vehicleUseRecordIds));
}
}
restart.include.json=/com.alibaba.fastjson.*.jar
\ No newline at end of file
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://27.128.233.145:33060/gas_progress_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: gas_progress_db
password: RMtiC6YCzdLxeJJL
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 27.128.233.145
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: 1qaz2wsx3edc
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# 项目相关配置
zehong:
# 名称
name: Zehong
# 版本
version: 3.5.0
# 版权年份
copyrightYear: 2021
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: D:/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
captchaType: math
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/gas_progress_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 27.128.233.145
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: 1qaz2wsx3edc
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# 项目相关配置
zehong:
# 名称
name: Zehong
# 版本
version: 3.5.0
# 版权年份
copyrightYear: 2021
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: D:/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
captchaType: math
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://27.128.239.197:8902/gas_progress_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: gas_progress_db
password: RMtiC6YCzdLxeJL
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
# host: 36.139.41.10
host: 27.128.239.197
# host: 36.139.125.48
# host: 36.139.41.83
#host: 121.29.1.158
# 端口,默认为6379
# port: 6379
port: 8903
# port: 6380
# 数据库索引
database: 0
# 密码
password: 1qaz2wsx3edc
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# 项目相关配置
zehong:
# 名称
name: Zehong
# 版本
version: 3.5.0
# 版权年份
copyrightYear: 2021
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: /home/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
captchaType: math
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 8905
servlet:
# 应用的访问路径
context-path: /gassafety
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# tomcat最大线程数,默认为200
max-threads: 800
# Tomcat启动初始化的线程数,默认值25
min-spare-threads: 30
# 日志配置
logging:
level:
com.zehong: debug
org.springframework: warn
# Spring配置
spring:
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: test
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# 服务模块
devtools:
restart:
# 热部署开关
enabled: true
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 30
# MyBatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.zehong.**.domain
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /dev-api
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice/*
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
Application Version: ${zehong.version}
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment