Compare commits

...

4 Commits

@ -0,0 +1,124 @@
package com.ruoyi.water.config.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.config.domain.WaterConfig;
import com.ruoyi.water.config.service.IWaterConfigService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/系统配置")
public class WaterConfigController extends BaseController
{
@Autowired
private IWaterConfigService waterConfigService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:list')")
@GetMapping("/list")
public TableDataInfo list(WaterConfig waterConfig)
{
startPage();
List<WaterConfig> list = waterConfigService.selectWaterConfigList(waterConfig);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:export')")
@Log(title = "系统配置管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterConfig waterConfig)
{
List<WaterConfig> list = waterConfigService.selectWaterConfigList(waterConfig);
ExcelUtil<WaterConfig> util = new ExcelUtil<WaterConfig>(WaterConfig.class);
util.exportExcel(response, list, "系统配置管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:query')")
@GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable("configId") Long configId)
{
return success(waterConfigService.selectWaterConfigByConfigId(configId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:add')")
@Log(title = "系统配置管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterConfig waterConfig)
{
return toAjax(waterConfigService.insertWaterConfig(waterConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:edit')")
@Log(title = "系统配置管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterConfig waterConfig)
{
return toAjax(waterConfigService.updateWaterConfig(waterConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:remove')")
@Log(title = "系统配置管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configId}")
public AjaxResult remove(@PathVariable String configId)
{
Long[] configIds = convertToLongArray(configId);
return toAjax(waterConfigService.deleteWaterConfigByConfigIds(configIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.device.domain.WaterDevice;
import com.ruoyi.water.device.service.IWaterDeviceService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/设备")
public class WaterDeviceController extends BaseController
{
@Autowired
private IWaterDeviceService waterDeviceService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:list')")
@GetMapping("/list")
public TableDataInfo list(WaterDevice waterDevice)
{
startPage();
List<WaterDevice> list = waterDeviceService.selectWaterDeviceList(waterDevice);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:export')")
@Log(title = "设备管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterDevice waterDevice)
{
List<WaterDevice> list = waterDeviceService.selectWaterDeviceList(waterDevice);
ExcelUtil<WaterDevice> util = new ExcelUtil<WaterDevice>(WaterDevice.class);
util.exportExcel(response, list, "设备管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:query')")
@GetMapping(value = "/{deviceId}")
public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
{
return success(waterDeviceService.selectWaterDeviceByDeviceId(deviceId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:add')")
@Log(title = "设备管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterDevice waterDevice)
{
return toAjax(waterDeviceService.insertWaterDevice(waterDevice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:edit')")
@Log(title = "设备管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterDevice waterDevice)
{
return toAjax(waterDeviceService.updateWaterDevice(waterDevice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:remove')")
@Log(title = "设备管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deviceId}")
public AjaxResult remove(@PathVariable String deviceId)
{
Long[] deviceIds = convertToLongArray(deviceId);
return toAjax(waterDeviceService.deleteWaterDeviceByDeviceIds(deviceIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,124 @@
package com.ruoyi.water.evaluation.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.evaluation.domain.WaterEvaluation;
import com.ruoyi.water.evaluation.service.IWaterEvaluationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/订单评价")
public class WaterEvaluationController extends BaseController
{
@Autowired
private IWaterEvaluationService waterEvaluationService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:list')")
@GetMapping("/list")
public TableDataInfo list(WaterEvaluation waterEvaluation)
{
startPage();
List<WaterEvaluation> list = waterEvaluationService.selectWaterEvaluationList(waterEvaluation);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:export')")
@Log(title = "订单评价管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterEvaluation waterEvaluation)
{
List<WaterEvaluation> list = waterEvaluationService.selectWaterEvaluationList(waterEvaluation);
ExcelUtil<WaterEvaluation> util = new ExcelUtil<WaterEvaluation>(WaterEvaluation.class);
util.exportExcel(response, list, "订单评价管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:query')")
@GetMapping(value = "/{evaluationId}")
public AjaxResult getInfo(@PathVariable("evaluationId") Long evaluationId)
{
return success(waterEvaluationService.selectWaterEvaluationByEvaluationId(evaluationId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:add')")
@Log(title = "订单评价管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterEvaluation waterEvaluation)
{
return toAjax(waterEvaluationService.insertWaterEvaluation(waterEvaluation));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:edit')")
@Log(title = "订单评价管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterEvaluation waterEvaluation)
{
return toAjax(waterEvaluationService.updateWaterEvaluation(waterEvaluation));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:remove')")
@Log(title = "订单评价管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{evaluationId}")
public AjaxResult remove(@PathVariable String evaluationId)
{
Long[] evaluationIds = convertToLongArray(evaluationId);
return toAjax(waterEvaluationService.deleteWaterEvaluationByEvaluationIds(evaluationIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,123 @@
package com.ruoyi.water.filter.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.filter.domain.WaterFilter;
import com.ruoyi.water.filter.service.IWaterFilterService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/滤芯")
public class WaterFilterController extends BaseController
{
@Autowired
private IWaterFilterService waterFilterService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:list')")
@GetMapping("/list")
public TableDataInfo list(WaterFilter waterFilter)
{
startPage();
List<WaterFilter> list = waterFilterService.selectWaterFilterList(waterFilter);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:export')")
@Log(title = "滤芯管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterFilter waterFilter)
{
List<WaterFilter> list = waterFilterService.selectWaterFilterList(waterFilter);
ExcelUtil<WaterFilter> util = new ExcelUtil<WaterFilter>(WaterFilter.class);
util.exportExcel(response, list, "滤芯管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:query')")
@GetMapping(value = "/{filterId}")
public AjaxResult getInfo(@PathVariable("filterId") Long filterId)
{
return success(waterFilterService.selectWaterFilterByFilterId(filterId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:add')")
@Log(title = "滤芯管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterFilter waterFilter)
{
return toAjax(waterFilterService.insertWaterFilter(waterFilter));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:edit')")
@Log(title = "滤芯管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterFilter waterFilter)
{
return toAjax(waterFilterService.updateWaterFilter(waterFilter));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:remove')")
@Log(title = "滤芯管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{filterId}")
public AjaxResult remove(@PathVariable String filterId)
{
Long[] filterIds = convertToLongArray(filterId);
return toAjax(waterFilterService.deleteWaterFilterByFilterIds(filterIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,124 @@
package com.ruoyi.water.message.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.message.domain.WaterMessage;
import com.ruoyi.water.message.service.IWaterMessageService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/系统消息")
public class WaterMessageController extends BaseController
{
@Autowired
private IWaterMessageService waterMessageService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:list')")
@GetMapping("/list")
public TableDataInfo list(WaterMessage waterMessage)
{
startPage();
List<WaterMessage> list = waterMessageService.selectWaterMessageList(waterMessage);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:export')")
@Log(title = "系统消息管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterMessage waterMessage)
{
List<WaterMessage> list = waterMessageService.selectWaterMessageList(waterMessage);
ExcelUtil<WaterMessage> util = new ExcelUtil<WaterMessage>(WaterMessage.class);
util.exportExcel(response, list, "系统消息管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:query')")
@GetMapping(value = "/{messageId}")
public AjaxResult getInfo(@PathVariable("messageId") Long messageId)
{
return success(waterMessageService.selectWaterMessageByMessageId(messageId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:add')")
@Log(title = "系统消息管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterMessage waterMessage)
{
return toAjax(waterMessageService.insertWaterMessage(waterMessage));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:edit')")
@Log(title = "系统消息管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterMessage waterMessage)
{
return toAjax(waterMessageService.updateWaterMessage(waterMessage));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:remove')")
@Log(title = "系统消息管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{messageId}")
public AjaxResult remove(@PathVariable String messageId)
{
Long[] messageIds = convertToLongArray(messageId);
return toAjax(waterMessageService.deleteWaterMessageByMessageIds(messageIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.notice.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.notice.domain.WaterNotice;
import com.ruoyi.water.notice.service.IWaterNoticeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/通知公告")
public class WaterNoticeController extends BaseController
{
@Autowired
private IWaterNoticeService waterNoticeService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:list')")
@GetMapping("/list")
public TableDataInfo list(WaterNotice waterNotice)
{
startPage();
List<WaterNotice> list = waterNoticeService.selectWaterNoticeList(waterNotice);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:export')")
@Log(title = "通知公告管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterNotice waterNotice)
{
List<WaterNotice> list = waterNoticeService.selectWaterNoticeList(waterNotice);
ExcelUtil<WaterNotice> util = new ExcelUtil<WaterNotice>(WaterNotice.class);
util.exportExcel(response, list, "通知公告管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable("noticeId") Long noticeId)
{
return success(waterNoticeService.selectWaterNoticeByNoticeId(noticeId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:add')")
@Log(title = "通知公告管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterNotice waterNotice)
{
return toAjax(waterNoticeService.insertWaterNotice(waterNotice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:edit')")
@Log(title = "通知公告管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterNotice waterNotice)
{
return toAjax(waterNoticeService.updateWaterNotice(waterNotice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:remove')")
@Log(title = "通知公告管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeId}")
public AjaxResult remove(@PathVariable String noticeId)
{
Long[] noticeIds = convertToLongArray(noticeId);
return toAjax(waterNoticeService.deleteWaterNoticeByNoticeIds(noticeIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.order.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.order.domain.WaterOrderProduct;
import com.ruoyi.water.order.service.IWaterOrderProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/订单商品")
public class WaterOrderProductController extends BaseController
{
@Autowired
private IWaterOrderProductService waterOrderProductService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:list')")
@GetMapping("/list")
public TableDataInfo list(WaterOrderProduct waterOrderProduct)
{
startPage();
List<WaterOrderProduct> list = waterOrderProductService.selectWaterOrderProductList(waterOrderProduct);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:export')")
@Log(title = "订单商品管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterOrderProduct waterOrderProduct)
{
List<WaterOrderProduct> list = waterOrderProductService.selectWaterOrderProductList(waterOrderProduct);
ExcelUtil<WaterOrderProduct> util = new ExcelUtil<WaterOrderProduct>(WaterOrderProduct.class);
util.exportExcel(response, list, "订单商品管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(waterOrderProductService.selectWaterOrderProductById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:add')")
@Log(title = "订单商品管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterOrderProduct waterOrderProduct)
{
return toAjax(waterOrderProductService.insertWaterOrderProduct(waterOrderProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:edit')")
@Log(title = "订单商品管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterOrderProduct waterOrderProduct)
{
return toAjax(waterOrderProductService.updateWaterOrderProduct(waterOrderProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:remove')")
@Log(title = "订单商品管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable String id)
{
Long[] ids = convertToLongArray(id);
return toAjax(waterOrderProductService.deleteWaterOrderProductByIds(ids));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.order.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.order.domain.WaterServiceOrder;
import com.ruoyi.water.order.service.IWaterServiceOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/服务订单")
public class WaterServiceOrderController extends BaseController
{
@Autowired
private IWaterServiceOrderService waterServiceOrderService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:list')")
@GetMapping("/list")
public TableDataInfo list(WaterServiceOrder waterServiceOrder)
{
startPage();
List<WaterServiceOrder> list = waterServiceOrderService.selectWaterServiceOrderList(waterServiceOrder);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:export')")
@Log(title = "服务订单管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterServiceOrder waterServiceOrder)
{
List<WaterServiceOrder> list = waterServiceOrderService.selectWaterServiceOrderList(waterServiceOrder);
ExcelUtil<WaterServiceOrder> util = new ExcelUtil<WaterServiceOrder>(WaterServiceOrder.class);
util.exportExcel(response, list, "服务订单管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:query')")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
{
return success(waterServiceOrderService.selectWaterServiceOrderByOrderId(orderId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:add')")
@Log(title = "服务订单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterServiceOrder waterServiceOrder)
{
return toAjax(waterServiceOrderService.insertWaterServiceOrder(waterServiceOrder));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:edit')")
@Log(title = "服务订单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterServiceOrder waterServiceOrder)
{
return toAjax(waterServiceOrderService.updateWaterServiceOrder(waterServiceOrder));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:remove')")
@Log(title = "服务订单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderId}")
public AjaxResult remove(@PathVariable String orderId)
{
Long[] orderIds = convertToLongArray(orderId);
return toAjax(waterServiceOrderService.deleteWaterServiceOrderByOrderIds(orderIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.product.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.product.domain.WaterProduct;
import com.ruoyi.water.product.service.IWaterProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/商品")
public class WaterProductController extends BaseController
{
@Autowired
private IWaterProductService waterProductService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:list')")
@GetMapping("/list")
public TableDataInfo list(WaterProduct waterProduct)
{
startPage();
List<WaterProduct> list = waterProductService.selectWaterProductList(waterProduct);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:export')")
@Log(title = "商品管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterProduct waterProduct)
{
List<WaterProduct> list = waterProductService.selectWaterProductList(waterProduct);
ExcelUtil<WaterProduct> util = new ExcelUtil<WaterProduct>(WaterProduct.class);
util.exportExcel(response, list, "商品管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:query')")
@GetMapping(value = "/{productId}")
public AjaxResult getInfo(@PathVariable("productId") Long productId)
{
return success(waterProductService.selectWaterProductByProductId(productId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:add')")
@Log(title = "商品管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterProduct waterProduct)
{
return toAjax(waterProductService.insertWaterProduct(waterProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:edit')")
@Log(title = "商品管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterProduct waterProduct)
{
return toAjax(waterProductService.updateWaterProduct(waterProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:remove')")
@Log(title = "商品管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{productId}")
public AjaxResult remove(@PathVariable String productId)
{
Long[] productIds = convertToLongArray(productId);
return toAjax(waterProductService.deleteWaterProductByProductIds(productIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.quality.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.quality.domain.WaterQuality;
import com.ruoyi.water.quality.service.IWaterQualityService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/水质检测")
public class WaterQualityController extends BaseController
{
@Autowired
private IWaterQualityService waterQualityService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:list')")
@GetMapping("/list")
public TableDataInfo list(WaterQuality waterQuality)
{
startPage();
List<WaterQuality> list = waterQualityService.selectWaterQualityList(waterQuality);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:export')")
@Log(title = "水质检测管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterQuality waterQuality)
{
List<WaterQuality> list = waterQualityService.selectWaterQualityList(waterQuality);
ExcelUtil<WaterQuality> util = new ExcelUtil<WaterQuality>(WaterQuality.class);
util.exportExcel(response, list, "水质检测管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:query')")
@GetMapping(value = "/{qualityId}")
public AjaxResult getInfo(@PathVariable("qualityId") Long qualityId)
{
return success(waterQualityService.selectWaterQualityByQualityId(qualityId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:add')")
@Log(title = "水质检测管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterQuality waterQuality)
{
return toAjax(waterQualityService.insertWaterQuality(waterQuality));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:edit')")
@Log(title = "水质检测管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterQuality waterQuality)
{
return toAjax(waterQualityService.updateWaterQuality(waterQuality));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:remove')")
@Log(title = "水质检测管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{qualityId}")
public AjaxResult remove(@PathVariable String qualityId)
{
Long[] qualityIds = convertToLongArray(qualityId);
return toAjax(waterQualityService.deleteWaterQualityByQualityIds(qualityIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.staff.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.staff.domain.WaterStaff;
import com.ruoyi.water.staff.service.IWaterStaffService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/员工")
public class WaterStaffController extends BaseController
{
@Autowired
private IWaterStaffService waterStaffService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:list')")
@GetMapping("/list")
public TableDataInfo list(WaterStaff waterStaff)
{
startPage();
List<WaterStaff> list = waterStaffService.selectWaterStaffList(waterStaff);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:export')")
@Log(title = "员工管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterStaff waterStaff)
{
List<WaterStaff> list = waterStaffService.selectWaterStaffList(waterStaff);
ExcelUtil<WaterStaff> util = new ExcelUtil<WaterStaff>(WaterStaff.class);
util.exportExcel(response, list, "员工管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:query')")
@GetMapping(value = "/{staffId}")
public AjaxResult getInfo(@PathVariable("staffId") Long staffId)
{
return success(waterStaffService.selectWaterStaffByStaffId(staffId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:add')")
@Log(title = "员工管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterStaff waterStaff)
{
return toAjax(waterStaffService.insertWaterStaff(waterStaff));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:edit')")
@Log(title = "员工管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterStaff waterStaff)
{
return toAjax(waterStaffService.updateWaterStaff(waterStaff));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:remove')")
@Log(title = "员工管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{staffId}")
public AjaxResult remove(@PathVariable String staffId)
{
Long[] staffIds = convertToLongArray(staffId);
return toAjax(waterStaffService.deleteWaterStaffByStaffIds(staffIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,125 @@
package com.ruoyi.water.user.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.user.domain.WaterUser;
import com.ruoyi.water.user.service.IWaterUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/用户")
public class WaterUserController extends BaseController
{
@Autowired
private IWaterUserService waterUserService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:list')")
@GetMapping("/list")
public TableDataInfo list(WaterUser waterUser)
{
startPage();
List<WaterUser> list = waterUserService.selectWaterUserList(waterUser);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:export')")
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterUser waterUser)
{
List<WaterUser> list = waterUserService.selectWaterUserList(waterUser);
ExcelUtil<WaterUser> util = new ExcelUtil<WaterUser>(WaterUser.class);
util.exportExcel(response, list, "用户管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return success(waterUserService.selectWaterUserByUserId(userId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:add')")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterUser waterUser)
{
return toAjax(waterUserService.insertWaterUser(waterUser));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterUser waterUser)
{
return toAjax(waterUserService.updateWaterUser(waterUser));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:remove')")
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userId}")
public AjaxResult remove(@PathVariable String userId)
{
Long[] userIds = convertToLongArray(userId);
return toAjax(waterUserService.deleteWaterUserByUserIds(userIds));
}
/**
* IDLongIDID
*/
private Long[] convertToLongArray(String ids)
{
if (ids == null || ids.isEmpty())
{
return new Long[0];
}
String[] idArray = ids.split(",");
Long[] longArray = new Long[idArray.length];
for (int i = 0; i < idArray.length; i++)
{
longArray[i] = Long.parseLong(idArray[i].trim());
}
return longArray;
}
}

@ -0,0 +1,663 @@
-- MySQL dump 10.13 Distrib 8.0.44, for Win64 (x86_64)
--
-- Host: localhost Database: water_management_system
-- ------------------------------------------------------
-- Server version 8.0.44
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `water_management_system`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `water_management_system` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `water_management_system`;
--
-- Table structure for table `alert_rules`
--
DROP TABLE IF EXISTS `alert_rules`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `alert_rules` (
`id` int NOT NULL AUTO_INCREMENT,
`rule_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鐟欏嫬鍨崥宥囆<EFBFBD>',
`rule_type` enum('water_quality','device_status','filter_life','water_usage') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鐟欏嫬鍨猾璇茬€<EFBFBD>',
`condition_json` json NOT NULL COMMENT '閸涘﹨顒熼弶鈥叉(JSON閺嶇厧绱<E58EA7>)',
`severity` enum('low','medium','high','critical') COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '娑撱儵鍣哥粙瀣',
`is_active` tinyint(1) DEFAULT '1' COMMENT '閺勵垰鎯侀崥顖滄暏',
`description` text COLLATE utf8mb4_unicode_ci COMMENT '鐟欏嫬鍨幓蹇氬牚',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `alert_rules`
--
LOCK TABLES `alert_rules` WRITE;
/*!40000 ALTER TABLE `alert_rules` DISABLE KEYS */;
INSERT INTO `alert_rules` VALUES (1,'濮樼宸漈DS鐡掑懏鐖<EFBFBD>','water_quality','{\"operator\": \">\", \"parameter\": \"tds_value\", \"threshold\": 500}','high',1,'TDS閸婅壈绉存潻?00閿涘本鎸夌拹銊ョ磽鐢<E7A3BD>?,'2025-11-03 21:28:08'),(2,'娿','filter_life','{\"operator\": \"<\", \"parameter\": \"remaining_life_percent\", \"threshold\": 10}','medium',1,'娿10%','2025-11-03 21:28:08'),(3,'','device_status','{\"operator\": \"=\", \"parameter\": \"status\", \"threshold\": \"offline\"}','medium',1,'<EFBFBD>','2025-11-03 21:28:08');
/*!40000 ALTER TABLE `alert_rules` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `alerts`
--
DROP TABLE IF EXISTS `alerts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `alerts` (
`id` bigint NOT NULL AUTO_INCREMENT,
`device_id` bigint NOT NULL,
`alert_rule_id` int NOT NULL,
`alert_title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '閸涘﹨顒熼弽鍥暯',
`alert_description` text COLLATE utf8mb4_unicode_ci COMMENT '閸涘﹨顒熼幓蹇氬牚',
`severity` enum('low','medium','high','critical') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '娑撱儵鍣哥粙瀣',
`status` enum('active','acknowledged','resolved','closed') COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '閸涘﹨顒熼悩鑸碘偓?,
`triggered_value` json DEFAULT NULL COMMENT '鐟欙箑褰傞崐?,
`triggered_time` datetime NOT NULL COMMENT '鐟欙箑褰傞弮鍫曟?',
`acknowledged_time` datetime DEFAULT NULL COMMENT '绾喛顓婚弮鍫曟?',
`acknowledged_by` bigint DEFAULT NULL COMMENT '绾喛顓绘禍?,
`resolved_time` datetime DEFAULT NULL COMMENT '鐟欙絽鍠呴弮鍫曟?',
`resolved_by` bigint DEFAULT NULL COMMENT '鐟欙絽鍠呮禍?,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `alert_rule_id` (`alert_rule_id`),
KEY `acknowledged_by` (`acknowledged_by`),
KEY `resolved_by` (`resolved_by`),
KEY `idx_device_status` (`device_id`,`status`),
KEY `idx_severity` (`severity`),
KEY `idx_triggered_time` (`triggered_time`),
CONSTRAINT `alerts_ibfk_1` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE,
CONSTRAINT `alerts_ibfk_2` FOREIGN KEY (`alert_rule_id`) REFERENCES `alert_rules` (`id`),
CONSTRAINT `alerts_ibfk_3` FOREIGN KEY (`acknowledged_by`) REFERENCES `users` (`id`),
CONSTRAINT `alerts_ibfk_4` FOREIGN KEY (`resolved_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `alerts`
--
LOCK TABLES `alerts` WRITE;
/*!40000 ALTER TABLE `alerts` DISABLE KEYS */;
/*!40000 ALTER TABLE `alerts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `device_filters`
--
DROP TABLE IF EXISTS `device_filters`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device_filters` (
`id` bigint NOT NULL AUTO_INCREMENT,
`device_id` bigint NOT NULL,
`filter_type_id` int NOT NULL,
`installation_date` date NOT NULL COMMENT '鐎瑰顥婇弮銉︽埂',
`current_usage_days` int DEFAULT '0' COMMENT '瀹歌弓濞囬悽銊ャ亯閺<EFBFBD>?,
`current_throughput_liters` int DEFAULT '0' COMMENT '瀹告彃顦╅悶鍡樻寜闁<EFBFBD>?閸<>?',
`remaining_life_percent` int DEFAULT '100' COMMENT '閸撯晙缍戠€靛灝鎳¢惂鎯у瀻濮<EFBFBD>?,
`status` enum('normal','warning','replace_soon','need_replace') COLLATE utf8mb4_unicode_ci DEFAULT 'normal' COMMENT '濠娿倛濮遍悩鑸碘偓?,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `filter_type_id` (`filter_type_id`),
KEY `idx_device_id` (`device_id`),
KEY `idx_status` (`status`),
CONSTRAINT `device_filters_ibfk_1` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE,
CONSTRAINT `device_filters_ibfk_2` FOREIGN KEY (`filter_type_id`) REFERENCES `filter_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `device_filters`
--
LOCK TABLES `device_filters` WRITE;
/*!40000 ALTER TABLE `device_filters` DISABLE KEYS */;
INSERT INTO `device_filters` VALUES (1,1,1,'2024-01-15',0,0,65,'normal','2025-11-03 21:27:22','2025-11-03 21:27:22'),(2,1,2,'2024-01-15',0,0,80,'normal','2025-11-03 21:27:22','2025-11-03 21:27:22'),(3,1,3,'2024-01-15',0,0,90,'normal','2025-11-03 21:27:22','2025-11-03 21:27:22'),(4,2,1,'2024-02-20',0,0,30,'normal','2025-11-03 21:27:22','2025-11-03 21:27:22'),(5,2,2,'2024-02-20',0,0,85,'normal','2025-11-03 21:27:22','2025-11-03 21:27:22');
/*!40000 ALTER TABLE `device_filters` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `device_types`
--
DROP TABLE IF EXISTS `device_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device_types` (
`id` int NOT NULL AUTO_INCREMENT,
`type_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鐠佹儳顦猾璇茬€烽崥宥囆<EFBFBD>',
`description` text COLLATE utf8mb4_unicode_ci COMMENT '缁鐎烽幓蹇氬牚',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `device_types`
--
LOCK TABLES `device_types` WRITE;
/*!40000 ALTER TABLE `device_types` DISABLE KEYS */;
INSERT INTO `device_types` VALUES (1,'閺呴缚鍏橀崙鈧鏉戞珤','鐎瑰墎鏁ら弲楦垮厴閸戔偓濮樼顔曟径?,'2025-11-02 22:25:22'),(2,'<EFBFBD>?,'閸熷棔绗熼崷鐑樺娴h法鏁ら惃鍕櫍濮樼顔曟径?,'2025-11-02 22:25:22'),(3,'<EFBFBD>?,'閸忋儲鍩涘鏉戝缂冾喛绻冨⿰銈堫啎婢<EFBFBD>?,'2025-11-02 22:25:22'),(4,'','?,'2025-11-03 21:24:20'),(5,'閸熷棛鏁ら崙鈧纾嬵啎婢<EFBFBD>?,'?,'2025-11-03 21:24:20'),(6,'閸撳秶鐤嗘潻鍥ㄦ姢閸<EFBFBD>?,'<EFBFBD>?,'2025-11-03 21:24:20');
/*!40000 ALTER TABLE `device_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `devices`
--
DROP TABLE IF EXISTS `devices`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `devices` (
`id` bigint NOT NULL AUTO_INCREMENT,
`device_sn` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鐠佹儳顦惔蹇撳灙閸<EFBFBD>?,
`device_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鐠佹儳顦崥宥囆<EFBFBD>',
`type_id` int NOT NULL COMMENT '鐠佹儳顦猾璇茬€<EFBFBD>',
`installation_address` text COLLATE utf8mb4_unicode_ci COMMENT '鐎瑰顥婇崷鏉挎絻',
`latitude` decimal(10,6) DEFAULT NULL COMMENT '缁绢剙瀹<EFBFBD>',
`longitude` decimal(10,6) DEFAULT NULL COMMENT '缂佸繐瀹<EFBFBD>',
`installation_date` date DEFAULT NULL COMMENT '鐎瑰顥婇弮銉︽埂',
`expected_lifespan_months` int DEFAULT NULL COMMENT '妫板嫯顓告担璺ㄦ暏鐎靛灝鎳<EFBFBD>(閺<>?',
`status` enum('online','offline','maintenance','fault') COLLATE utf8mb4_unicode_ci DEFAULT 'online' COMMENT '鐠佹儳顦悩鑸碘偓?,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `device_sn` (`device_sn`),
KEY `type_id` (`type_id`),
KEY `idx_sn` (`device_sn`),
KEY `idx_status` (`status`),
KEY `idx_location` (`latitude`,`longitude`),
CONSTRAINT `devices_ibfk_1` FOREIGN KEY (`type_id`) REFERENCES `device_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `devices`
--
LOCK TABLES `devices` WRITE;
/*!40000 ALTER TABLE `devices` DISABLE KEYS */;
INSERT INTO `devices` VALUES (1,'SN001','鐎广垹宸洪崙鈧鏉戞珤',1,'閸栨ぞ鍚敮鍌涙篂闂冨啿灏痻xx鐏忓繐灏<EFBFBD>1閸欓攱銈<EFBFBD>101',NULL,NULL,'2024-01-15',NULL,'online','2025-11-03 21:27:16','2025-11-03 21:27:16'),(2,'SN002','閸樸劍鍩ч崙鈧鏉戞珤',1,'閸栨ぞ鍚敮鍌涙崳濞偓閸栫皰xx鐏忓繐灏<EFBFBD>2閸欓攱銈<EFBFBD>202',NULL,NULL,'2024-02-20',NULL,'online','2025-11-03 21:27:16','2025-11-03 21:27:16'),(3,'SN003','閸旂偛鍙曠€广倕鍣e鏉戞珤',2,'閸栨ぞ鍚敮鍌涙篂闂冨啿灏痻xx婢堆冨傅5鐏<EFBFBD>?,NULL,NULL,'2024-03-10',NULL,'offline','2025-11-03 21:27:16','2025-11-03 21:27:16');
/*!40000 ALTER TABLE `devices` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `filter_types`
--
DROP TABLE IF EXISTS `filter_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `filter_types` (
`id` int NOT NULL AUTO_INCREMENT,
`type_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '濠娿倛濮遍崹瀣娇閸氬秶袨',
`expected_lifespan_days` int NOT NULL COMMENT '妫板嫭婀℃担璺ㄦ暏鐎靛灝鎳<EFBFBD>(婢<>?',
`expected_throughput_liters` int DEFAULT NULL COMMENT '妫板嫭婀℃径鍕倞濮樻挳鍣<EFBFBD>(閸<>?',
`description` text COLLATE utf8mb4_unicode_ci COMMENT '濠娿倛濮遍幓蹇氬牚',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `filter_types`
--
LOCK TABLES `filter_types` WRITE;
/*!40000 ALTER TABLE `filter_types` DISABLE KEYS */;
INSERT INTO `filter_types` VALUES (1,'PP濡鎶ら懞?,180,10000,'','2025-11-02 22:25:22'),(2,'娿<EFBFBD>',365,20000,'?,'2025-11-02 22:25:22'),(3,'RO閸欏秵绗氶柅蹇氬晿',730,50000,'閺嶇ǹ绺炬潻鍥ㄦ姢閿涘苯骞撻梽銈呬簳鐏忓繑钖勯弻鎾跺⒖','2025-11-02 22:25:22'),(4,'閸氬海鐤嗗ú缁樷偓褏鍋<EFBFBD>',365,20000,'閺€鐟版澖閸欙絾鍔<EFBFBD>','2025-11-02 22:25:22'),(5,'PP濡鎶ら懞?,180,10000,'','2025-11-03 21:24:26'),(6,'娿<EFBFBD>',365,20000,'?,'2025-11-03 21:24:26'),(7,'RO閸欏秵绗氶柅蹇氬晿',730,50000,'閺嶇ǹ绺炬潻鍥ㄦ姢閿涘苯骞撻梽銈呬簳鐏忓繑钖勯弻鎾跺⒖','2025-11-03 21:24:26'),(8,'閸氬海鐤嗗ú缁樷偓褏鍋<EFBFBD>',365,20000,'閺€鐟版澖閸欙絾鍔<EFBFBD>','2025-11-03 21:24:26');
/*!40000 ALTER TABLE `filter_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `notifications`
--
DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `notifications` (
`id` bigint NOT NULL AUTO_INCREMENT,
`user_id` bigint NOT NULL,
`title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '闁氨鐓¢弽鍥暯',
`content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '闁氨鐓¢崘鍛啇',
`type` enum('system','order','alert','promotion') COLLATE utf8mb4_unicode_ci DEFAULT 'system' COMMENT '闁氨鐓猾璇茬€<EFBFBD>',
`related_id` bigint DEFAULT NULL COMMENT '閸忓疇浠圛D(鐠併垹宕烮D閵嗕礁鎲拃顨疍缁<E7968D>?',
`is_read` tinyint(1) DEFAULT '0' COMMENT '閺勵垰鎯佸鑼额嚢',
`sent_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '閸欐垿鈧焦妞傞梻?,
`read_time` datetime DEFAULT NULL COMMENT '闂冨懓顕伴弮鍫曟?',
PRIMARY KEY (`id`),
KEY `idx_user_read` (`user_id`,`is_read`),
KEY `idx_sent_time` (`sent_time`),
CONSTRAINT `notifications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `notifications`
--
LOCK TABLES `notifications` WRITE;
/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
/*!40000 ALTER TABLE `notifications` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `orders`
--
DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `orders` (
`id` bigint NOT NULL AUTO_INCREMENT,
`order_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鐠併垹宕熼崣?,
`user_id` bigint NOT NULL,
`service_type_id` int NOT NULL,
`device_id` bigint NOT NULL COMMENT '閺堝秴濮熺拋鎯ь槵',
`scheduled_time` datetime DEFAULT NULL COMMENT '妫板嫮瀹抽弮鍫曟?',
`actual_service_time` datetime DEFAULT NULL COMMENT '鐎圭偤妾張宥呭閺冨爼妫<EFBFBD>',
`total_amount` decimal(10,2) NOT NULL COMMENT '鐠併垹宕熼幀濠氬櫨妫<EFBFBD>?,
`discount_amount` decimal(10,2) DEFAULT '0.00' COMMENT '娴兼ɑ鍎柌鎴︻杺',
`final_amount` decimal(10,2) NOT NULL COMMENT '鐎圭偘绮柌鎴︻杺',
`status` enum('pending_payment','paid','assigned','in_progress','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'pending_payment' COMMENT '鐠併垹宕熼悩鑸碘偓?,
`user_notes` text COLLATE utf8mb4_unicode_ci COMMENT '閻€劍鍩涙径鍥ㄦ暈',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`assigned_staff_id` bigint DEFAULT NULL COMMENT '閸掑棝鍘ら惃鍕紣娴f粈姹夐崨?,
`assignment_time` datetime DEFAULT NULL COMMENT '閸掑棝鍘ら弮鍫曟?',
`acceptance_time` datetime DEFAULT NULL COMMENT '閹恒儱宕熼弮鍫曟?',
`completion_time` datetime DEFAULT NULL COMMENT '鐎瑰本鍨氶弮鍫曟?',
PRIMARY KEY (`id`),
UNIQUE KEY `order_number` (`order_number`),
KEY `service_type_id` (`service_type_id`),
KEY `device_id` (`device_id`),
KEY `idx_order_number` (`order_number`),
KEY `idx_user_id` (`user_id`),
KEY `idx_status` (`status`),
KEY `idx_created_at` (`created_at`),
KEY `assigned_staff_id` (`assigned_staff_id`),
CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`service_type_id`) REFERENCES `service_types` (`id`),
CONSTRAINT `orders_ibfk_3` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`),
CONSTRAINT `orders_ibfk_4` FOREIGN KEY (`assigned_staff_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `orders`
--
LOCK TABLES `orders` WRITE;
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `service_reviews`
--
DROP TABLE IF EXISTS `service_reviews`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `service_reviews` (
`id` bigint NOT NULL AUTO_INCREMENT,
`order_id` bigint NOT NULL,
`user_id` bigint NOT NULL,
`staff_id` bigint NOT NULL COMMENT '鐞氼偉鐦庢禒椋庢畱瀹搞儰缍旀禍鍝勬喅',
`rating` tinyint NOT NULL COMMENT '鐠囧嫬鍨<EFBFBD>(1-5)',
`review_text` text COLLATE utf8mb4_unicode_ci COMMENT '鐠囧嫪鐜崘鍛啇',
`review_images` json DEFAULT NULL COMMENT '鐠囧嫪鐜崶鍓уURL閺佹壆绮<EFBFBD>',
`is_anonymous` tinyint(1) DEFAULT '0' COMMENT '閺勵垰鎯侀崠鍨倳',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_order_review` (`order_id`),
KEY `user_id` (`user_id`),
KEY `idx_staff_rating` (`staff_id`,`rating`),
KEY `idx_created_at` (`created_at`),
CONSTRAINT `service_reviews_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`),
CONSTRAINT `service_reviews_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `service_reviews_ibfk_3` FOREIGN KEY (`staff_id`) REFERENCES `users` (`id`),
CONSTRAINT `service_reviews_chk_1` CHECK (((`rating` >= 1) and (`rating` <= 5)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `service_reviews`
--
LOCK TABLES `service_reviews` WRITE;
/*!40000 ALTER TABLE `service_reviews` DISABLE KEYS */;
/*!40000 ALTER TABLE `service_reviews` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `service_types`
--
DROP TABLE IF EXISTS `service_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `service_types` (
`id` int NOT NULL AUTO_INCREMENT,
`type_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '閺堝秴濮熺猾璇茬€烽崥宥囆<EFBFBD>',
`description` text COLLATE utf8mb4_unicode_ci COMMENT '閺堝秴濮熼幓蹇氬牚',
`base_price` decimal(10,2) DEFAULT NULL COMMENT '閸╄櫣顢呮禒閿嬬壐',
`estimated_duration_minutes` int DEFAULT NULL COMMENT '妫板嫯顓搁懓妤佹(閸掑棝鎸<E6A39D>)',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `service_types`
--
LOCK TABLES `service_types` WRITE;
/*!40000 ALTER TABLE `service_types` DISABLE KEYS */;
INSERT INTO `service_types` VALUES (1,'濠娿倛濮遍弴瀛樺床','娑撴挷绗熷⿰銈堝П閺囧瓨宕查張宥呭',150.00,30,'2025-11-02 22:25:22'),(2,'鐠佹儳顦€瑰顥<EFBFBD>','閺傛媽顔曟径鍥х暔鐟佸懓鐨熺拠?,200.00,60,'2025-11-02 22:25:22'),(3,'','<EFBFBD>',100.00,45,'2025-11-02 22:25:22'),(4,'Λù?,'娑撴挷绗熷纾嬪窛濡偓濞村婀囬崝?,80.00,20,'2025-11-02 22:25:22'),(5,'娿','П',150.00,30,'2025-11-03 21:24:23'),(6,'<EFBFBD>','х?,200.00,60,'2025-11-03 21:24:23'),(7,'鐠佹儳顦紒缈犳叏','鐠佹儳顦弫鍛存缂佺繝鎱<EFBFBD>',100.00,45,'2025-11-03 21:24:23'),(8,'濮樼宸濆Λ鈧ù?,'?,80.00,20,'2025-11-03 21:24:23');
/*!40000 ALTER TABLE `service_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Temporary view structure for view `staff_performance`
--
DROP TABLE IF EXISTS `staff_performance`;
/*!50001 DROP VIEW IF EXISTS `staff_performance`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `staff_performance` AS SELECT
1 AS `staff_id`,
1 AS `staff_name`,
1 AS `total_orders`,
1 AS `completed_orders`,
1 AS `completion_rate`,
1 AS `average_rating`*/;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `user_devices`
--
DROP TABLE IF EXISTS `user_devices`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_devices` (
`id` bigint NOT NULL AUTO_INCREMENT,
`user_id` bigint NOT NULL,
`device_id` bigint NOT NULL,
`binding_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '缂佹垵鐣鹃弮鍫曟?',
`is_primary` tinyint(1) DEFAULT '0' COMMENT '閺勵垰鎯佹稉鏄忣啎婢<EFBFBD>?,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_user_device` (`user_id`,`device_id`),
KEY `device_id` (`device_id`),
KEY `idx_user_id` (`user_id`),
CONSTRAINT `user_devices_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
CONSTRAINT `user_devices_ibfk_2` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_devices`
--
LOCK TABLES `user_devices` WRITE;
/*!40000 ALTER TABLE `user_devices` DISABLE KEYS */;
INSERT INTO `user_devices` VALUES (1,4,1,'2025-11-03 21:27:19',1,'2025-11-03 21:27:19'),(2,5,2,'2025-11-03 21:27:19',1,'2025-11-03 21:27:19'),(3,4,3,'2025-11-03 21:27:19',0,'2025-11-03 21:27:19');
/*!40000 ALTER TABLE `user_devices` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`id` bigint NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '閻€劍鍩涢崥?,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鐎靛棛鐖<EFBFBD>',
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '閹靛婧€閸<EFBFBD>?,
`email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '闁喚顔<EFBFBD>',
`real_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '閻喎鐤勬慨鎾虫倳',
`role` enum('user','staff','admin') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '閻€劍鍩涚憴鎺曞',
`avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '婢舵潙鍎歎RL',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`wechat_openid` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '瀵邦喕淇妎penid',
`wechat_unionid` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '瀵邦喕淇妘nionid',
`wechat_nickname` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '瀵邦喕淇婇弰鐢敌<EFBFBD>',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
KEY `idx_phone` (`phone`),
KEY `idx_role` (`role`),
KEY `idx_wechat_openid` (`wechat_openid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (2,'admin','123456','13800138000',NULL,'缁崵绮虹粻锛勬倞閸<EFBFBD>?,'admin',NULL,'2025-11-03 21:26:17','2025-11-03 21:26:17',NULL,NULL,NULL),(3,'staff01','123456','13800138001',NULL,'<EFBFBD>?,'staff',NULL,'2025-11-03 21:26:20','2025-11-03 21:26:20',NULL,NULL,NULL),(4,'staff02','123456','13800138002',NULL,'閺夊骸绗€閸<EFBFBD>?,'staff',NULL,'2025-11-03 21:26:20','2025-11-03 21:26:20',NULL,NULL,NULL),(5,'user01','123456','13800138003',NULL,'','user',NULL,'2025-11-03 21:26:22','2025-11-03 21:26:22',NULL,NULL,NULL),(6,'user02','123456','13800138004',NULL,'<EFBFBD>?,'user',NULL,'2025-11-03 21:26:22','2025-11-03 21:26:22',NULL,NULL,NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `water_quality_data`
--
DROP TABLE IF EXISTS `water_quality_data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `water_quality_data` (
`id` bigint NOT NULL AUTO_INCREMENT,
`device_id` bigint NOT NULL,
`tds_value` int DEFAULT NULL COMMENT 'TDS閸<EFBFBD>?,
`ph_value` decimal(3,1) DEFAULT NULL COMMENT 'PH閸<EFBFBD>?,
`turbidity` decimal(5,2) DEFAULT NULL COMMENT '濞村﹤瀹<EFBFBD>',
`temperature` decimal(4,1) DEFAULT NULL COMMENT '濞撯晛瀹<EFBFBD>',
`orp_value` int DEFAULT NULL COMMENT 'ORP閸<EFBFBD>?,
`residual_chlorine` decimal(4,2) DEFAULT NULL COMMENT '瑦闅<EFBFBD>',
`conductivity` int DEFAULT NULL COMMENT '閻㈤潧顕遍悳?,
`collected_at` datetime NOT NULL COMMENT '閺佺増宓侀柌鍥肠閺冨爼妫<EFBFBD>',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_device_time` (`device_id`,`collected_at`),
KEY `idx_collected_at` (`collected_at`),
CONSTRAINT `water_quality_data_ibfk_1` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `water_quality_data`
--
LOCK TABLES `water_quality_data` WRITE;
/*!40000 ALTER TABLE `water_quality_data` DISABLE KEYS */;
/*!40000 ALTER TABLE `water_quality_data` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Temporary view structure for view `water_quality_reports_view`
--
DROP TABLE IF EXISTS `water_quality_reports_view`;
/*!50001 DROP VIEW IF EXISTS `water_quality_reports_view`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `water_quality_reports_view` AS SELECT
1 AS `device_sn`,
1 AS `device_name`,
1 AS `id`,
1 AS `device_id`,
1 AS `tds_value`,
1 AS `ph_value`,
1 AS `turbidity`,
1 AS `temperature`,
1 AS `orp_value`,
1 AS `residual_chlorine`,
1 AS `conductivity`,
1 AS `collected_at`,
1 AS `created_at`,
1 AS `overall_quality`*/;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `water_usage_records`
--
DROP TABLE IF EXISTS `water_usage_records`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `water_usage_records` (
`id` bigint NOT NULL AUTO_INCREMENT,
`device_id` bigint NOT NULL,
`usage_liters` decimal(10,2) NOT NULL COMMENT '閻€劍鎸夐柌?閸<>?',
`record_date` date NOT NULL COMMENT '鐠佹澘缍嶉弮銉︽埂',
`record_hour` tinyint DEFAULT NULL COMMENT '鐠佹澘缍嶇亸蹇旀(0-23)',
`flow_rate` decimal(8,2) DEFAULT NULL COMMENT '濞翠線鈧<EFBFBD>?,
`pressure` decimal(6,2) DEFAULT NULL COMMENT '濮樻潙甯<EFBFBD>',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_device_date_hour` (`device_id`,`record_date`,`record_hour`),
KEY `idx_record_date` (`record_date`),
KEY `idx_device_date` (`device_id`,`record_date`),
CONSTRAINT `water_usage_records_ibfk_1` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `water_usage_records`
--
LOCK TABLES `water_usage_records` WRITE;
/*!40000 ALTER TABLE `water_usage_records` DISABLE KEYS */;
/*!40000 ALTER TABLE `water_usage_records` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `work_orders`
--
DROP TABLE IF EXISTS `work_orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_orders` (
`id` bigint NOT NULL AUTO_INCREMENT,
`work_order_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '瀹搞儱宕熺紓鏍у娇',
`order_id` bigint DEFAULT NULL COMMENT '閸忓疇浠堥惃鍕吂閸<EFBFBD>?,
`device_id` bigint NOT NULL,
`assigned_staff_id` bigint DEFAULT NULL COMMENT '閹稿洦娣抽惃鍕紣娴f粈姹夐崨?,
`task_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '娴犺濮熺猾璇茬€<EFBFBD>',
`priority` enum('low','medium','high','urgent') COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '娴兼ê鍘涚痪?,
`status` enum('pending','assigned','in_progress','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '瀹搞儱宕熼悩鑸碘偓?,
`description` text COLLATE utf8mb4_unicode_ci COMMENT '娴犺濮熼幓蹇氬牚',
`scheduled_start_time` datetime DEFAULT NULL COMMENT '鐠佲€冲灊瀵偓婵妞傞梻?,
`actual_start_time` datetime DEFAULT NULL COMMENT '鐎圭偤妾鈧慨瀣闂<EFBFBD>?,
`actual_completion_time` datetime DEFAULT NULL COMMENT '鐎圭偤妾€瑰本鍨氶弮鍫曟?',
`customer_feedback` text COLLATE utf8mb4_unicode_ci COMMENT '鐎广垺鍩涢崣宥夘洯',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`delivery_address` text COLLATE utf8mb4_unicode_ci COMMENT '闁板秹鈧礁婀撮崸鈧<EFBFBD>',
`recipient_info` json DEFAULT NULL COMMENT '閺€鏈垫娴滆桨淇婇幁?婵挸鎮曢妴浣烘暩鐠囨繄鐡<E7B984>)',
`delivery_status` enum('pending','in_progress','delivered') COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '闁板秹鈧胶濮搁幀?,
PRIMARY KEY (`id`),
UNIQUE KEY `work_order_number` (`work_order_number`),
KEY `order_id` (`order_id`),
KEY `device_id` (`device_id`),
KEY `idx_work_order_number` (`work_order_number`),
KEY `idx_status` (`status`),
KEY `idx_assigned_staff` (`assigned_staff_id`),
CONSTRAINT `work_orders_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`),
CONSTRAINT `work_orders_ibfk_2` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`),
CONSTRAINT `work_orders_ibfk_3` FOREIGN KEY (`assigned_staff_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `work_orders`
--
LOCK TABLES `work_orders` WRITE;
/*!40000 ALTER TABLE `work_orders` DISABLE KEYS */;
/*!40000 ALTER TABLE `work_orders` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Current Database: `water_management_system`
--
USE `water_management_system`;
--
-- Final view structure for view `staff_performance`
--
/*!50001 DROP VIEW IF EXISTS `staff_performance`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_performance` AS select `u`.`id` AS `staff_id`,`u`.`real_name` AS `staff_name`,count(distinct `o`.`id`) AS `total_orders`,count(distinct (case when (`o`.`status` = 'completed') then `o`.`id` end)) AS `completed_orders`,round(((count(distinct (case when (`o`.`status` = 'completed') then `o`.`id` end)) * 100.0) / count(distinct `o`.`id`)),2) AS `completion_rate`,coalesce(avg(`sr`.`rating`),0) AS `average_rating` from ((`users` `u` left join `orders` `o` on((`u`.`id` = `o`.`assigned_staff_id`))) left join `service_reviews` `sr` on((`o`.`id` = `sr`.`order_id`))) where (`u`.`role` = 'staff') group by `u`.`id`,`u`.`real_name` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `water_quality_reports_view`
--
/*!50001 DROP VIEW IF EXISTS `water_quality_reports_view`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `water_quality_reports_view` AS select `d`.`device_sn` AS `device_sn`,`d`.`device_name` AS `device_name`,`wq`.`id` AS `id`,`wq`.`device_id` AS `device_id`,`wq`.`tds_value` AS `tds_value`,`wq`.`ph_value` AS `ph_value`,`wq`.`turbidity` AS `turbidity`,`wq`.`temperature` AS `temperature`,`wq`.`orp_value` AS `orp_value`,`wq`.`residual_chlorine` AS `residual_chlorine`,`wq`.`conductivity` AS `conductivity`,`wq`.`collected_at` AS `collected_at`,`wq`.`created_at` AS `created_at`,(case when (`wq`.`tds_value` > 500) then 'poor' when (`wq`.`tds_value` > 300) then 'fair' when (`wq`.`tds_value` > 100) then 'good' else 'excellent' end) AS `overall_quality` from (`water_quality_data` `wq` join `devices` `d` on((`wq`.`device_id` = `d`.`id`))) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-12-09 19:12:36

@ -0,0 +1 @@
custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="ruoyi-common" />
<module name="ruoyi-framework" />
<module name="ruoyi-generator" />
<module name="ruoyi-system" />
<module name="ruoyi-quartz" />
<module name="ruoyi-admin" />
</profile>
</annotationProcessing>
</component>
</project>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="IU-251.25410.129">
<data-source name="mysql" uuid="a3f16a15-5714-4707-98b9-2af66d3608c6">
<database-info product="MySQL" version="8.0.43" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="8.0.43" exact-driver-version="8.2">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>
<case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" />
<user-name>root</user-name>
<schema-mapping>
<introspection-scope>
<node kind="schema" qname="@" />
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="mysql" uuid="a3f16a15-5714-4707-98b9-2af66d3608c6">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<imported>true</imported>
<remarks>$PROJECT_DIR$/ruoyi-admin/src/main/resources/application-druid.yml</remarks>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-framework/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-framework/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-generator/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-generator/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-quartz/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-quartz/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-system/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-system/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="public" />
<option name="name" value="aliyun nexus" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="21" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="805cfc33-0de9-4a8e-a569-f2a6eed19b31" name="更改" comment="">
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/config/controller/WaterConfigController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/config/domain/WaterConfig.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/config/mapper/WaterConfigMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/config/service/IWaterConfigService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/config/service/impl/WaterConfigServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/device/controller/WaterDeviceController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/device/domain/WaterDevice.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/device/mapper/WaterDeviceMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/device/service/IWaterDeviceService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/device/service/impl/WaterDeviceServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/evaluation/controller/WaterEvaluationController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/evaluation/domain/WaterEvaluation.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/evaluation/mapper/WaterEvaluationMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/evaluation/service/IWaterEvaluationService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/evaluation/service/impl/WaterEvaluationServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/filter/controller/WaterFilterController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/filter/domain/WaterFilter.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/filter/mapper/WaterFilterMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/filter/service/IWaterFilterService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/filter/service/impl/WaterFilterServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/message/controller/WaterMessageController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/message/domain/WaterMessage.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/message/mapper/WaterMessageMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/message/service/IWaterMessageService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/message/service/impl/WaterMessageServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/notice/controller/WaterNoticeController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/notice/domain/WaterNotice.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/notice/mapper/WaterNoticeMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/notice/service/IWaterNoticeService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/notice/service/impl/WaterNoticeServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/controller/WaterOrderProductController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/controller/WaterServiceOrderController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/domain/WaterOrderProduct.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/domain/WaterServiceOrder.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/mapper/WaterOrderProductMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/mapper/WaterServiceOrderMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/service/IWaterOrderProductService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/service/IWaterServiceOrderService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/service/impl/WaterOrderProductServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/order/service/impl/WaterServiceOrderServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/product/controller/WaterProductController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/product/domain/WaterProduct.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/product/mapper/WaterProductMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/product/service/IWaterProductService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/product/service/impl/WaterProductServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/quality/controller/WaterQualityController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/quality/domain/WaterQuality.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/quality/mapper/WaterQualityMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/quality/service/IWaterQualityService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/quality/service/impl/WaterQualityServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/staff/controller/WaterStaffController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/staff/domain/WaterStaff.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/staff/mapper/WaterStaffMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/staff/service/IWaterStaffService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/staff/service/impl/WaterStaffServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/user/controller/WaterUserController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/user/domain/WaterUser.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/user/mapper/WaterUserMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/user/service/IWaterUserService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/water/user/service/impl/WaterUserServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterConfigMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterDeviceMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterEvaluationMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterFilterMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterMessageMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterNoticeMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterOrderProductMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterProductMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterQualityMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterServiceOrderMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterStaffMapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/mapper/water/WaterUserMapper.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application-druid.yml" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application-druid.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-admin/src/main/resources/application.yml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="KubernetesApiPersistence">{}</component>
<component name="KubernetesApiProvider">{
&quot;isMigrated&quot;: true
}</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 6
}</component>
<component name="ProjectId" id="3565TC1wR7shWAdIBLkDUqmB5UB" />
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ModuleVcsDetector.initialDetectionPerformed": "true",
"RequestMappingsPanelOrder0": "0",
"RequestMappingsPanelOrder1": "1",
"RequestMappingsPanelWidth0": "75",
"RequestMappingsPanelWidth1": "75",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.git.unshallow": "true",
"Spring Boot.RuoYiApplication.executor": "Debug",
"git-widget-placeholder": "master",
"ignore.virus.scanning.warn.message": "true",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "E:/ideaproject/RuoYi-Vue/ruoyi-admin/src/main/resources/mapper/water",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="ReactorSettings">
<option name="notificationShown" value="true" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="E:\ideaproject\RuoYi-Vue\ruoyi-admin\src\main\resources\mapper\water" />
<recent name="E:\ideaproject\RuoYi-Vue\ruoyi-admin\src\main\java\com\ruoyi\water" />
<recent name="E:\ideaproject\RuoYi-Vue\ruoyi-admin\src\main\java\com\ruoyi" />
<recent name="E:\ideaproject\RuoYi-Vue\ruoyi-admin\src\main\java\com\ruoyi\water\user" />
<recent name="E:\ideaproject\RuoYi-Vue\ruoyi-admin\src\main\resources\mapper" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="E:\ideaproject\RuoYi-Vue\ruoyi-admin\src\main\resources\mapper" />
<recent name="E:\ideaproject\RuoYi-Vue\ruoyi-admin\src\main\resources\mapper\" />
</key>
</component>
<component name="RunManager">
<configuration default="true" type="JetRunConfigurationType">
<module name="RuoYi-Vue" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
<module name="RuoYi-Vue" />
<option name="filePath" />
<method v="2" />
</configuration>
<configuration name="RuoYiApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
<module name="ruoyi-admin" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.ruoyi.RuoYiApplication" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-fbdcb00ec9e3-intellij.indexing.shared.core-IU-251.25410.129" />
<option value="bundled-js-predefined-d6986cc7102b-6a121458b545-JavaScript-IU-251.25410.129" />
</set>
</attachedChunks>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="805cfc33-0de9-4a8e-a569-f2a6eed19b31" name="更改" comment="" />
<created>1762417685290</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1762417685290</updated>
<workItem from="1762417686745" duration="3196000" />
<workItem from="1762478022514" duration="220000" />
<workItem from="1762482955707" duration="81000" />
<workItem from="1763177181551" duration="976000" />
<workItem from="1763511301571" duration="10000" />
<workItem from="1763882911474" duration="1302000" />
<workItem from="1763922264313" duration="2234000" />
<workItem from="1763968765599" duration="2190000" />
<workItem from="1764042160578" duration="7236000" />
<workItem from="1764071798075" duration="56000" />
<workItem from="1764071927420" duration="694000" />
<workItem from="1764682324256" duration="7948000" />
<workItem from="1764720612648" duration="21000" />
<workItem from="1764863923954" duration="752000" />
<workItem from="1764900930124" duration="2391000" />
<workItem from="1764916641832" duration="1261000" />
<workItem from="1765089223439" duration="920000" />
<workItem from="1766232960864" duration="6474000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnknownFeatures">
<option featureType="dependencySupport" implementationName="java:org.springframework:spring-core" />
<option featureType="dependencySupport" implementationName="java:org.springframework.security:spring-security-core" />
<option featureType="dependencySupport" implementationName="executable:docker" />
<option featureType="dependencySupport" implementationName="java:jakarta.validation:jakarta.validation-api" />
<option featureType="dependencySupport" implementationName="java:io.projectreactor:reactor-core" />
<option featureType="dependencySupport" implementationName="executable:kubectl" />
<option featureType="dependencySupport" implementationName="java:org.springframework.data:spring-data-commons" />
<option featureType="dependencySupport" implementationName="java:org.hibernate.validator:hibernate-validator" />
<option featureType="dependencySupport" implementationName="javascript:npm:vue" />
<option featureType="dependencySupport" implementationName="java:org.springframework.boot:spring-boot" />
<option featureType="dependencySupport" implementationName="java:org.springframework:spring-webmvc" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/RuoYi_Vue$RuoYiApplication.ic" NAME="RuoYiApplication 覆盖结果" MODIFIED="1762419768398" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="true" />
</component>
</project>

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 RuoYi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -0,0 +1,95 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.9.0</h1>
<h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.9.0-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前端采用Vue、Element UI。
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3),保持同步更新。
* 提供了单应用版本[RuoYi-Vue-fast](https://gitcode.com/yangzongzhuan/RuoYi-Vue-fast)Oracle版本[RuoYi-Vue-Oracle](https://gitcode.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 缓存监控:对系统的缓存信息查询,命令统计等。
17. 在线构建器拖动表单元素生成相应的HTML代码。
18. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
## 在线体验
- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
演示地址http://vue.ruoyi.vip
文档地址http://doc.ruoyi.vip
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依前后端分离交流群
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/已满-101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [![加入QQ群](https://img.shields.io/badge/已满-101539465-blue.svg)](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) [![加入QQ群](https://img.shields.io/badge/已满-264312783-blue.svg)](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [![加入QQ群](https://img.shields.io/badge/已满-167385320-blue.svg)](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) [![加入QQ群](https://img.shields.io/badge/已满-104748341-blue.svg)](https://jq.qq.com/?_wv=1027&k=96Dkdq0k) [![加入QQ群](https://img.shields.io/badge/已满-160110482-blue.svg)](https://jq.qq.com/?_wv=1027&k=0fsNiYZt) [![加入QQ群](https://img.shields.io/badge/已满-170801498-blue.svg)](https://jq.qq.com/?_wv=1027&k=7xw4xUG1) [![加入QQ群](https://img.shields.io/badge/已满-108482800-blue.svg)](https://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [![加入QQ群](https://img.shields.io/badge/已满-101046199-blue.svg)](https://jq.qq.com/?_wv=1027&k=SpyH2875) [![加入QQ群](https://img.shields.io/badge/已满-136919097-blue.svg)](https://jq.qq.com/?_wv=1027&k=tKEt51dz) [![加入QQ群](https://img.shields.io/badge/已满-143961921-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [![加入QQ群](https://img.shields.io/badge/已满-174951577-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) [![加入QQ群](https://img.shields.io/badge/已满-161281055-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Fn2aF5IHpwsy8j6VlalNJK6qbwFLFHat&authKey=uyIT%2B97x2AXj3odyXpsSpVaPMC%2Bidw0LxG5MAtEqlrcBcWJUA%2FeS43rsF1Tg7IRJ&noverify=0&group_code=161281055) [![加入QQ群](https://img.shields.io/badge/已满-138988063-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XIzkm_mV2xTsUtFxo63bmicYoDBA6Ifm&authKey=dDW%2F4qsmw3x9govoZY9w%2FoWAoC4wbHqGal%2BbqLzoS6VBarU8EBptIgPKN%2FviyC8j&noverify=0&group_code=138988063) [![加入QQ群](https://img.shields.io/badge/已满-151450850-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DkugnCg68PevlycJSKSwjhFqfIgrWWwR&authKey=pR1Pa5lPIeGF%2FFtIk6d%2FGB5qFi0EdvyErtpQXULzo03zbhopBHLWcuqdpwY241R%2F&noverify=0&group_code=151450850) [![加入QQ群](https://img.shields.io/badge/已满-224622315-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=F58bgRa-Dp-rsQJThiJqIYv8t4-lWfXh&authKey=UmUs4CVG5OPA1whvsa4uSespOvyd8%2FAr9olEGaWAfdLmfKQk%2FVBp2YU3u2xXXt76&noverify=0&group_code=224622315) [![加入QQ群](https://img.shields.io/badge/已满-287842588-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Nxb2EQ5qozWa218Wbs7zgBnjLSNk_tVT&authKey=obBKXj6SBKgrFTJZx0AqQnIYbNOvBB2kmgwWvGhzxR67RoRr84%2Bus5OadzMcdJl5&noverify=0&group_code=287842588) [![加入QQ群](https://img.shields.io/badge/已满-187944233-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=numtK1M_I4eVd2Gvg8qtbuL8JgX42qNh&authKey=giV9XWMaFZTY%2FqPlmWbkB9g3fi0Ev5CwEtT9Tgei0oUlFFCQLDp4ozWRiVIzubIm&noverify=0&group_code=187944233) [![加入QQ群](https://img.shields.io/badge/已满-228578329-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=G6r5KGCaa3pqdbUSXNIgYloyb8e0_L0D&authKey=4w8tF1eGW7%2FedWn%2FHAypQksdrML%2BDHolQSx7094Agm7Luakj9EbfPnSTxSi2T1LQ&noverify=0&group_code=228578329) [![加入QQ群](https://img.shields.io/badge/已满-191164766-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=GsOo-OLz53J8y_9TPoO6XXSGNRTgbFxA&authKey=R7Uy%2Feq%2BZsoKNqHvRKhiXpypW7DAogoWapOawUGHokJSBIBIre2%2FoiAZeZBSLuBc&noverify=0&group_code=191164766) [![加入QQ群](https://img.shields.io/badge/174569686-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=PmYavuzsOthVqfdAPbo4uAeIbu7Ttjgc&authKey=p52l8%2FXa4PS1JcEmS3VccKSwOPJUZ1ZfQ69MEKzbrooNUljRtlKjvsXf04bxNp3G&noverify=0&group_code=174569686) 点击按钮入群。

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 清理工程target生成路径。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean
pause

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 打包Web工程生成war/jar包文件。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean package -Dmaven.test.skip=true
pause

@ -0,0 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Web工程。
echo.
cd %~dp0
cd ../ruoyi-admin/target
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -jar %JAVA_OPTS% ruoyi-admin.jar
cd bin
pause

@ -0,0 +1,274 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.9.0</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.9.0</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<spring-boot.version>2.5.15</spring-boot.version>
<druid.version>1.2.23</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
<fastjson.version>2.0.58</fastjson.version>
<oshi.version>6.8.3</oshi.version>
<commons.io.version>2.19.0</commons.io.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<!-- override dependency version -->
<tomcat.version>9.0.108</tomcat.version>
<logback.version>1.2.13</logback.version>
<spring-security.version>5.7.14</spring-security.version>
<spring-framework.version>5.3.39</spring-framework.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- 覆盖SpringFramework的依赖配置-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring-framework.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 覆盖SpringSecurity的依赖配置-->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>${spring-security.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 覆盖logback的依赖配置-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- 覆盖tomcat的依赖配置-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>${velocity.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 验证码 -->
<dependency>
<groupId>pro.fessional</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-admin</module>
<module>ruoyi-framework</module>
<module>ruoyi-system</module>
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
</modules>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.15</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>

@ -0,0 +1,30 @@
package com.ruoyi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
*
*
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

@ -0,0 +1,18 @@
package com.ruoyi;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web
*
* @author ruoyi
*/
public class RuoYiServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(RuoYiApplication.class);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.config.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.config.domain.WaterConfig;
import com.ruoyi.water.config.service.IWaterConfigService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/系统配置")
public class WaterConfigController extends BaseController
{
@Autowired
private IWaterConfigService waterConfigService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:list')")
@GetMapping("/list")
public TableDataInfo list(WaterConfig waterConfig)
{
startPage();
List<WaterConfig> list = waterConfigService.selectWaterConfigList(waterConfig);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:export')")
@Log(title = "系统配置管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterConfig waterConfig)
{
List<WaterConfig> list = waterConfigService.selectWaterConfigList(waterConfig);
ExcelUtil<WaterConfig> util = new ExcelUtil<WaterConfig>(WaterConfig.class);
util.exportExcel(response, list, "系统配置管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:query')")
@GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable("configId") Long configId)
{
return success(waterConfigService.selectWaterConfigByConfigId(configId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:add')")
@Log(title = "系统配置管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterConfig waterConfig)
{
return toAjax(waterConfigService.insertWaterConfig(waterConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:edit')")
@Log(title = "系统配置管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterConfig waterConfig)
{
return toAjax(waterConfigService.updateWaterConfig(waterConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统配置:remove')")
@Log(title = "系统配置管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public AjaxResult remove(@PathVariable Long[] configIds)
{
return toAjax(waterConfigService.deleteWaterConfigByConfigIds(configIds));
}
}

@ -0,0 +1,103 @@
package com.ruoyi.water.config.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_config
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterConfig extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 配置ID */
@Excel(name = "配置ID")
private Long configId;
/** 配置键 */
@Excel(name = "配置键")
private String configKey;
/** 配置值 */
@Excel(name = "配置值")
private String configValue;
/** 配置类型string/number/boolean/json */
@Excel(name = "配置类型", readConverterExp = "s=tring/number/boolean/json")
private String configType;
/** 配置描述 */
@Excel(name = "配置描述")
private String configDesc;
public void setConfigId(Long configId)
{
this.configId = configId;
}
public Long getConfigId()
{
return configId;
}
public void setConfigKey(String configKey)
{
this.configKey = configKey;
}
public String getConfigKey()
{
return configKey;
}
public void setConfigValue(String configValue)
{
this.configValue = configValue;
}
public String getConfigValue()
{
return configValue;
}
public void setConfigType(String configType)
{
this.configType = configType;
}
public String getConfigType()
{
return configType;
}
public void setConfigDesc(String configDesc)
{
this.configDesc = configDesc;
}
public String getConfigDesc()
{
return configDesc;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("configId", getConfigId())
.append("configKey", getConfigKey())
.append("configValue", getConfigValue())
.append("configType", getConfigType())
.append("configDesc", getConfigDesc())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,65 @@
package com.ruoyi.water.config.mapper;
import java.util.List;
import com.ruoyi.water.config.domain.WaterConfig;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterConfigMapper
{
/**
*
*
* @param configId
* @return
*/
public WaterConfig selectWaterConfigByConfigId(Long configId);
/**
*
*
* @param waterConfig
* @return
*/
public List<WaterConfig> selectWaterConfigList(WaterConfig waterConfig);
/**
*
*
* @param waterConfig
* @return
*/
public int insertWaterConfig(WaterConfig waterConfig);
/**
*
*
* @param waterConfig
* @return
*/
public int updateWaterConfig(WaterConfig waterConfig);
/**
*
*
* @param configId
* @return
*/
public int deleteWaterConfigByConfigId(Long configId);
/**
*
*
* @param configIds
* @return
*/
public int deleteWaterConfigByConfigIds(Long[] configIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.config.service;
import java.util.List;
import com.ruoyi.water.config.domain.WaterConfig;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterConfigService
{
/**
*
*
* @param configId
* @return
*/
public WaterConfig selectWaterConfigByConfigId(Long configId);
/**
*
*
* @param waterConfig
* @return
*/
public List<WaterConfig> selectWaterConfigList(WaterConfig waterConfig);
/**
*
*
* @param waterConfig
* @return
*/
public int insertWaterConfig(WaterConfig waterConfig);
/**
*
*
* @param waterConfig
* @return
*/
public int updateWaterConfig(WaterConfig waterConfig);
/**
*
*
* @param configIds
* @return
*/
public int deleteWaterConfigByConfigIds(Long[] configIds);
/**
*
*
* @param configId
* @return
*/
public int deleteWaterConfigByConfigId(Long configId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.config.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.config.mapper.WaterConfigMapper;
import com.ruoyi.water.config.domain.WaterConfig;
import com.ruoyi.water.config.service.IWaterConfigService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterConfigServiceImpl implements IWaterConfigService
{
@Autowired
private WaterConfigMapper waterConfigMapper;
/**
*
*
* @param configId
* @return
*/
@Override
public WaterConfig selectWaterConfigByConfigId(Long configId)
{
return waterConfigMapper.selectWaterConfigByConfigId(configId);
}
/**
*
*
* @param waterConfig
* @return
*/
@Override
public List<WaterConfig> selectWaterConfigList(WaterConfig waterConfig)
{
return waterConfigMapper.selectWaterConfigList(waterConfig);
}
/**
*
*
* @param waterConfig
* @return
*/
@Override
public int insertWaterConfig(WaterConfig waterConfig)
{
waterConfig.setCreateTime(DateUtils.getNowDate());
return waterConfigMapper.insertWaterConfig(waterConfig);
}
/**
*
*
* @param waterConfig
* @return
*/
@Override
public int updateWaterConfig(WaterConfig waterConfig)
{
waterConfig.setUpdateTime(DateUtils.getNowDate());
return waterConfigMapper.updateWaterConfig(waterConfig);
}
/**
*
*
* @param configIds
* @return
*/
@Override
public int deleteWaterConfigByConfigIds(Long[] configIds)
{
return waterConfigMapper.deleteWaterConfigByConfigIds(configIds);
}
/**
*
*
* @param configId
* @return
*/
@Override
public int deleteWaterConfigByConfigId(Long configId)
{
return waterConfigMapper.deleteWaterConfigByConfigId(configId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.device.domain.WaterDevice;
import com.ruoyi.water.device.service.IWaterDeviceService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/设备")
public class WaterDeviceController extends BaseController
{
@Autowired
private IWaterDeviceService waterDeviceService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:list')")
@GetMapping("/list")
public TableDataInfo list(WaterDevice waterDevice)
{
startPage();
List<WaterDevice> list = waterDeviceService.selectWaterDeviceList(waterDevice);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:export')")
@Log(title = "设备管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterDevice waterDevice)
{
List<WaterDevice> list = waterDeviceService.selectWaterDeviceList(waterDevice);
ExcelUtil<WaterDevice> util = new ExcelUtil<WaterDevice>(WaterDevice.class);
util.exportExcel(response, list, "设备管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:query')")
@GetMapping(value = "/{deviceId}")
public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
{
return success(waterDeviceService.selectWaterDeviceByDeviceId(deviceId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:add')")
@Log(title = "设备管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterDevice waterDevice)
{
return toAjax(waterDeviceService.insertWaterDevice(waterDevice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:edit')")
@Log(title = "设备管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterDevice waterDevice)
{
return toAjax(waterDeviceService.updateWaterDevice(waterDevice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:设备:remove')")
@Log(title = "设备管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deviceIds}")
public AjaxResult remove(@PathVariable Long[] deviceIds)
{
return toAjax(waterDeviceService.deleteWaterDeviceByDeviceIds(deviceIds));
}
}

@ -0,0 +1,223 @@
package com.ruoyi.water.device.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_device
*
* @author ruoyi
* @date 2025-11-24
*/
public class WaterDevice extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 设备ID */
@Excel(name = "设备ID")
private Long deviceId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 设备编号(唯一) */
@Excel(name = "设备编号", readConverterExp = "唯=一")
private String sn;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备类型 */
@Excel(name = "设备类型")
private String deviceType;
/** 设备型号 */
@Excel(name = "设备型号")
private String model;
/** 状态0离线 1在线 2故障 */
@Excel(name = "状态", readConverterExp = "0=离线,1=在线,2=故障")
private String status;
/** 安装地址 */
@Excel(name = "安装地址")
private String installAddress;
/** 纬度 */
private BigDecimal locationLat;
/** 经度 */
private BigDecimal locationLng;
/** 绑定时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bindTime;
/** 最后在线时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后在线时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastOnlineTime;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setSn(String sn)
{
this.sn = sn;
}
public String getSn()
{
return sn;
}
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
}
public String getDeviceName()
{
return deviceName;
}
public void setDeviceType(String deviceType)
{
this.deviceType = deviceType;
}
public String getDeviceType()
{
return deviceType;
}
public void setModel(String model)
{
this.model = model;
}
public String getModel()
{
return model;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setInstallAddress(String installAddress)
{
this.installAddress = installAddress;
}
public String getInstallAddress()
{
return installAddress;
}
public void setLocationLat(BigDecimal locationLat)
{
this.locationLat = locationLat;
}
public BigDecimal getLocationLat()
{
return locationLat;
}
public void setLocationLng(BigDecimal locationLng)
{
this.locationLng = locationLng;
}
public BigDecimal getLocationLng()
{
return locationLng;
}
public void setBindTime(Date bindTime)
{
this.bindTime = bindTime;
}
public Date getBindTime()
{
return bindTime;
}
public void setLastOnlineTime(Date lastOnlineTime)
{
this.lastOnlineTime = lastOnlineTime;
}
public Date getLastOnlineTime()
{
return lastOnlineTime;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("deviceId", getDeviceId())
.append("userId", getUserId())
.append("sn", getSn())
.append("deviceName", getDeviceName())
.append("deviceType", getDeviceType())
.append("model", getModel())
.append("status", getStatus())
.append("installAddress", getInstallAddress())
.append("locationLat", getLocationLat())
.append("locationLng", getLocationLng())
.append("bindTime", getBindTime())
.append("lastOnlineTime", getLastOnlineTime())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,65 @@
package com.ruoyi.water.device.mapper;
import java.util.List;
import com.ruoyi.water.device.domain.WaterDevice;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-24
*/
@Mapper
public interface WaterDeviceMapper
{
/**
*
*
* @param deviceId
* @return
*/
public WaterDevice selectWaterDeviceByDeviceId(Long deviceId);
/**
*
*
* @param waterDevice
* @return
*/
public List<WaterDevice> selectWaterDeviceList(WaterDevice waterDevice);
/**
*
*
* @param waterDevice
* @return
*/
public int insertWaterDevice(WaterDevice waterDevice);
/**
*
*
* @param waterDevice
* @return
*/
public int updateWaterDevice(WaterDevice waterDevice);
/**
*
*
* @param deviceId
* @return
*/
public int deleteWaterDeviceByDeviceId(Long deviceId);
/**
*
*
* @param deviceIds
* @return
*/
public int deleteWaterDeviceByDeviceIds(Long[] deviceIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.device.service;
import java.util.List;
import com.ruoyi.water.device.domain.WaterDevice;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
public interface IWaterDeviceService
{
/**
*
*
* @param deviceId
* @return
*/
public WaterDevice selectWaterDeviceByDeviceId(Long deviceId);
/**
*
*
* @param waterDevice
* @return
*/
public List<WaterDevice> selectWaterDeviceList(WaterDevice waterDevice);
/**
*
*
* @param waterDevice
* @return
*/
public int insertWaterDevice(WaterDevice waterDevice);
/**
*
*
* @param waterDevice
* @return
*/
public int updateWaterDevice(WaterDevice waterDevice);
/**
*
*
* @param deviceIds
* @return
*/
public int deleteWaterDeviceByDeviceIds(Long[] deviceIds);
/**
*
*
* @param deviceId
* @return
*/
public int deleteWaterDeviceByDeviceId(Long deviceId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.device.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.device.mapper.WaterDeviceMapper;
import com.ruoyi.water.device.domain.WaterDevice;
import com.ruoyi.water.device.service.IWaterDeviceService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
@Service
public class WaterDeviceServiceImpl implements IWaterDeviceService
{
@Autowired
private WaterDeviceMapper waterDeviceMapper;
/**
*
*
* @param deviceId
* @return
*/
@Override
public WaterDevice selectWaterDeviceByDeviceId(Long deviceId)
{
return waterDeviceMapper.selectWaterDeviceByDeviceId(deviceId);
}
/**
*
*
* @param waterDevice
* @return
*/
@Override
public List<WaterDevice> selectWaterDeviceList(WaterDevice waterDevice)
{
return waterDeviceMapper.selectWaterDeviceList(waterDevice);
}
/**
*
*
* @param waterDevice
* @return
*/
@Override
public int insertWaterDevice(WaterDevice waterDevice)
{
waterDevice.setCreateTime(DateUtils.getNowDate());
return waterDeviceMapper.insertWaterDevice(waterDevice);
}
/**
*
*
* @param waterDevice
* @return
*/
@Override
public int updateWaterDevice(WaterDevice waterDevice)
{
waterDevice.setUpdateTime(DateUtils.getNowDate());
return waterDeviceMapper.updateWaterDevice(waterDevice);
}
/**
*
*
* @param deviceIds
* @return
*/
@Override
public int deleteWaterDeviceByDeviceIds(Long[] deviceIds)
{
return waterDeviceMapper.deleteWaterDeviceByDeviceIds(deviceIds);
}
/**
*
*
* @param deviceId
* @return
*/
@Override
public int deleteWaterDeviceByDeviceId(Long deviceId)
{
return waterDeviceMapper.deleteWaterDeviceByDeviceId(deviceId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.evaluation.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.evaluation.domain.WaterEvaluation;
import com.ruoyi.water.evaluation.service.IWaterEvaluationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/订单评价")
public class WaterEvaluationController extends BaseController
{
@Autowired
private IWaterEvaluationService waterEvaluationService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:list')")
@GetMapping("/list")
public TableDataInfo list(WaterEvaluation waterEvaluation)
{
startPage();
List<WaterEvaluation> list = waterEvaluationService.selectWaterEvaluationList(waterEvaluation);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:export')")
@Log(title = "订单评价管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterEvaluation waterEvaluation)
{
List<WaterEvaluation> list = waterEvaluationService.selectWaterEvaluationList(waterEvaluation);
ExcelUtil<WaterEvaluation> util = new ExcelUtil<WaterEvaluation>(WaterEvaluation.class);
util.exportExcel(response, list, "订单评价管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:query')")
@GetMapping(value = "/{evaluationId}")
public AjaxResult getInfo(@PathVariable("evaluationId") Long evaluationId)
{
return success(waterEvaluationService.selectWaterEvaluationByEvaluationId(evaluationId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:add')")
@Log(title = "订单评价管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterEvaluation waterEvaluation)
{
return toAjax(waterEvaluationService.insertWaterEvaluation(waterEvaluation));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:edit')")
@Log(title = "订单评价管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterEvaluation waterEvaluation)
{
return toAjax(waterEvaluationService.updateWaterEvaluation(waterEvaluation));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单评价:remove')")
@Log(title = "订单评价管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{evaluationIds}")
public AjaxResult remove(@PathVariable Long[] evaluationIds)
{
return toAjax(waterEvaluationService.deleteWaterEvaluationByEvaluationIds(evaluationIds));
}
}

@ -0,0 +1,204 @@
package com.ruoyi.water.evaluation.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_evaluation
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterEvaluation extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 评价ID */
@Excel(name = "评价ID")
private Long evaluationId;
/** 订单ID */
@Excel(name = "订单ID")
private Long orderId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 员工ID */
@Excel(name = "员工ID")
private Long staffId;
/** 综合评分1-5星 */
@Excel(name = "综合评分", readConverterExp = "1=-5星")
private BigDecimal rating;
/** 服务态度评分 */
@Excel(name = "服务态度评分")
private BigDecimal serviceRating;
/** 服务质量评分 */
@Excel(name = "服务质量评分")
private BigDecimal qualityRating;
/** 服务速度评分 */
@Excel(name = "服务速度评分")
private BigDecimal speedRating;
/** 评价内容 */
@Excel(name = "评价内容")
private String content;
/** 评价图片JSON数组 */
@Excel(name = "评价图片", readConverterExp = "J=SON数组")
private String images;
/** 是否匿名0否 1是 */
@Excel(name = "是否匿名", readConverterExp = "0=否,1=是")
private String isAnonymous;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setEvaluationId(Long evaluationId)
{
this.evaluationId = evaluationId;
}
public Long getEvaluationId()
{
return evaluationId;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setStaffId(Long staffId)
{
this.staffId = staffId;
}
public Long getStaffId()
{
return staffId;
}
public void setRating(BigDecimal rating)
{
this.rating = rating;
}
public BigDecimal getRating()
{
return rating;
}
public void setServiceRating(BigDecimal serviceRating)
{
this.serviceRating = serviceRating;
}
public BigDecimal getServiceRating()
{
return serviceRating;
}
public void setQualityRating(BigDecimal qualityRating)
{
this.qualityRating = qualityRating;
}
public BigDecimal getQualityRating()
{
return qualityRating;
}
public void setSpeedRating(BigDecimal speedRating)
{
this.speedRating = speedRating;
}
public BigDecimal getSpeedRating()
{
return speedRating;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
public void setImages(String images)
{
this.images = images;
}
public String getImages()
{
return images;
}
public void setIsAnonymous(String isAnonymous)
{
this.isAnonymous = isAnonymous;
}
public String getIsAnonymous()
{
return isAnonymous;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("evaluationId", getEvaluationId())
.append("orderId", getOrderId())
.append("userId", getUserId())
.append("staffId", getStaffId())
.append("rating", getRating())
.append("serviceRating", getServiceRating())
.append("qualityRating", getQualityRating())
.append("speedRating", getSpeedRating())
.append("content", getContent())
.append("images", getImages())
.append("isAnonymous", getIsAnonymous())
.append("createTime", getCreateTime())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,66 @@
package com.ruoyi.water.evaluation.mapper;
import java.util.List;
import com.ruoyi.water.evaluation.domain.WaterEvaluation;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterEvaluationMapper
{
/**
*
*
* @param evaluationId
* @return
*/
public WaterEvaluation selectWaterEvaluationByEvaluationId(Long evaluationId);
/**
*
*
* @param waterEvaluation
* @return
*/
public List<WaterEvaluation> selectWaterEvaluationList(WaterEvaluation waterEvaluation);
/**
*
*
* @param waterEvaluation
* @return
*/
public int insertWaterEvaluation(WaterEvaluation waterEvaluation);
/**
*
*
* @param waterEvaluation
* @return
*/
public int updateWaterEvaluation(WaterEvaluation waterEvaluation);
/**
*
*
* @param evaluationId
* @return
*/
public int deleteWaterEvaluationByEvaluationId(Long evaluationId);
/**
*
*
* @param evaluationIds
* @return
*/
public int deleteWaterEvaluationByEvaluationIds(Long[] evaluationIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.evaluation.service;
import java.util.List;
import com.ruoyi.water.evaluation.domain.WaterEvaluation;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterEvaluationService
{
/**
*
*
* @param evaluationId
* @return
*/
public WaterEvaluation selectWaterEvaluationByEvaluationId(Long evaluationId);
/**
*
*
* @param waterEvaluation
* @return
*/
public List<WaterEvaluation> selectWaterEvaluationList(WaterEvaluation waterEvaluation);
/**
*
*
* @param waterEvaluation
* @return
*/
public int insertWaterEvaluation(WaterEvaluation waterEvaluation);
/**
*
*
* @param waterEvaluation
* @return
*/
public int updateWaterEvaluation(WaterEvaluation waterEvaluation);
/**
*
*
* @param evaluationIds
* @return
*/
public int deleteWaterEvaluationByEvaluationIds(Long[] evaluationIds);
/**
*
*
* @param evaluationId
* @return
*/
public int deleteWaterEvaluationByEvaluationId(Long evaluationId);
}

@ -0,0 +1,95 @@
package com.ruoyi.water.evaluation.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.evaluation.mapper.WaterEvaluationMapper;
import com.ruoyi.water.evaluation.domain.WaterEvaluation;
import com.ruoyi.water.evaluation.service.IWaterEvaluationService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterEvaluationServiceImpl implements IWaterEvaluationService
{
@Autowired
private WaterEvaluationMapper waterEvaluationMapper;
/**
*
*
* @param evaluationId
* @return
*/
@Override
public WaterEvaluation selectWaterEvaluationByEvaluationId(Long evaluationId)
{
return waterEvaluationMapper.selectWaterEvaluationByEvaluationId(evaluationId);
}
/**
*
*
* @param waterEvaluation
* @return
*/
@Override
public List<WaterEvaluation> selectWaterEvaluationList(WaterEvaluation waterEvaluation)
{
return waterEvaluationMapper.selectWaterEvaluationList(waterEvaluation);
}
/**
*
*
* @param waterEvaluation
* @return
*/
@Override
public int insertWaterEvaluation(WaterEvaluation waterEvaluation)
{
waterEvaluation.setCreateTime(DateUtils.getNowDate());
return waterEvaluationMapper.insertWaterEvaluation(waterEvaluation);
}
/**
*
*
* @param waterEvaluation
* @return
*/
@Override
public int updateWaterEvaluation(WaterEvaluation waterEvaluation)
{
return waterEvaluationMapper.updateWaterEvaluation(waterEvaluation);
}
/**
*
*
* @param evaluationIds
* @return
*/
@Override
public int deleteWaterEvaluationByEvaluationIds(Long[] evaluationIds)
{
return waterEvaluationMapper.deleteWaterEvaluationByEvaluationIds(evaluationIds);
}
/**
*
*
* @param evaluationId
* @return
*/
@Override
public int deleteWaterEvaluationByEvaluationId(Long evaluationId)
{
return waterEvaluationMapper.deleteWaterEvaluationByEvaluationId(evaluationId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.filter.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.filter.domain.WaterFilter;
import com.ruoyi.water.filter.service.IWaterFilterService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/滤芯")
public class WaterFilterController extends BaseController
{
@Autowired
private IWaterFilterService waterFilterService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:list')")
@GetMapping("/list")
public TableDataInfo list(WaterFilter waterFilter)
{
startPage();
List<WaterFilter> list = waterFilterService.selectWaterFilterList(waterFilter);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:export')")
@Log(title = "滤芯管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterFilter waterFilter)
{
List<WaterFilter> list = waterFilterService.selectWaterFilterList(waterFilter);
ExcelUtil<WaterFilter> util = new ExcelUtil<WaterFilter>(WaterFilter.class);
util.exportExcel(response, list, "滤芯管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:query')")
@GetMapping(value = "/{filterId}")
public AjaxResult getInfo(@PathVariable("filterId") Long filterId)
{
return success(waterFilterService.selectWaterFilterByFilterId(filterId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:add')")
@Log(title = "滤芯管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterFilter waterFilter)
{
return toAjax(waterFilterService.insertWaterFilter(waterFilter));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:edit')")
@Log(title = "滤芯管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterFilter waterFilter)
{
return toAjax(waterFilterService.updateWaterFilter(waterFilter));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:滤芯:remove')")
@Log(title = "滤芯管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{filterIds}")
public AjaxResult remove(@PathVariable Long[] filterIds)
{
return toAjax(waterFilterService.deleteWaterFilterByFilterIds(filterIds));
}
}

@ -0,0 +1,209 @@
package com.ruoyi.water.filter.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_filter
*
* @author ruoyi
* @date 2025-11-24
*/
public class WaterFilter extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 滤芯ID */
@Excel(name = "滤芯ID")
private Long filterId;
/** 设备ID */
@Excel(name = "设备ID")
private Long deviceId;
/** 滤芯名称PP棉滤芯 */
@Excel(name = "滤芯名称", readConverterExp = "如=PP棉滤芯")
private String filterName;
/** 滤芯类型 */
@Excel(name = "滤芯类型")
private String filterType;
/** 滤芯型号 */
@Excel(name = "滤芯型号")
private String model;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date installTime;
/** 总使用天数默认180天 */
@Excel(name = "总使用天数", readConverterExp = "默=认180天")
private Long totalDays;
/** 已使用天数 */
@Excel(name = "已使用天数")
private Long usedDays;
/** 剩余寿命百分比 */
@Excel(name = "剩余寿命百分比")
private Long lifePercentage;
/** 预计更换时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "预计更换时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date nextReplaceTime;
/** 状态0正常 1需更换 */
@Excel(name = "状态", readConverterExp = "0=正常,1=需更换")
private String status;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setFilterId(Long filterId)
{
this.filterId = filterId;
}
public Long getFilterId()
{
return filterId;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setFilterName(String filterName)
{
this.filterName = filterName;
}
public String getFilterName()
{
return filterName;
}
public void setFilterType(String filterType)
{
this.filterType = filterType;
}
public String getFilterType()
{
return filterType;
}
public void setModel(String model)
{
this.model = model;
}
public String getModel()
{
return model;
}
public void setInstallTime(Date installTime)
{
this.installTime = installTime;
}
public Date getInstallTime()
{
return installTime;
}
public void setTotalDays(Long totalDays)
{
this.totalDays = totalDays;
}
public Long getTotalDays()
{
return totalDays;
}
public void setUsedDays(Long usedDays)
{
this.usedDays = usedDays;
}
public Long getUsedDays()
{
return usedDays;
}
public void setLifePercentage(Long lifePercentage)
{
this.lifePercentage = lifePercentage;
}
public Long getLifePercentage()
{
return lifePercentage;
}
public void setNextReplaceTime(Date nextReplaceTime)
{
this.nextReplaceTime = nextReplaceTime;
}
public Date getNextReplaceTime()
{
return nextReplaceTime;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("filterId", getFilterId())
.append("deviceId", getDeviceId())
.append("filterName", getFilterName())
.append("filterType", getFilterType())
.append("model", getModel())
.append("installTime", getInstallTime())
.append("totalDays", getTotalDays())
.append("usedDays", getUsedDays())
.append("lifePercentage", getLifePercentage())
.append("nextReplaceTime", getNextReplaceTime())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,65 @@
package com.ruoyi.water.filter.mapper;
import java.util.List;
import com.ruoyi.water.filter.domain.WaterFilter;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-24
*/
@Mapper
public interface WaterFilterMapper
{
/**
*
*
* @param filterId
* @return
*/
public WaterFilter selectWaterFilterByFilterId(Long filterId);
/**
*
*
* @param waterFilter
* @return
*/
public List<WaterFilter> selectWaterFilterList(WaterFilter waterFilter);
/**
*
*
* @param waterFilter
* @return
*/
public int insertWaterFilter(WaterFilter waterFilter);
/**
*
*
* @param waterFilter
* @return
*/
public int updateWaterFilter(WaterFilter waterFilter);
/**
*
*
* @param filterId
* @return
*/
public int deleteWaterFilterByFilterId(Long filterId);
/**
*
*
* @param filterIds
* @return
*/
public int deleteWaterFilterByFilterIds(Long[] filterIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.filter.service;
import java.util.List;
import com.ruoyi.water.filter.domain.WaterFilter;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
public interface IWaterFilterService
{
/**
*
*
* @param filterId
* @return
*/
public WaterFilter selectWaterFilterByFilterId(Long filterId);
/**
*
*
* @param waterFilter
* @return
*/
public List<WaterFilter> selectWaterFilterList(WaterFilter waterFilter);
/**
*
*
* @param waterFilter
* @return
*/
public int insertWaterFilter(WaterFilter waterFilter);
/**
*
*
* @param waterFilter
* @return
*/
public int updateWaterFilter(WaterFilter waterFilter);
/**
*
*
* @param filterIds
* @return
*/
public int deleteWaterFilterByFilterIds(Long[] filterIds);
/**
*
*
* @param filterId
* @return
*/
public int deleteWaterFilterByFilterId(Long filterId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.filter.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.filter.mapper.WaterFilterMapper;
import com.ruoyi.water.filter.domain.WaterFilter;
import com.ruoyi.water.filter.service.IWaterFilterService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
@Service
public class WaterFilterServiceImpl implements IWaterFilterService
{
@Autowired
private WaterFilterMapper waterFilterMapper;
/**
*
*
* @param filterId
* @return
*/
@Override
public WaterFilter selectWaterFilterByFilterId(Long filterId)
{
return waterFilterMapper.selectWaterFilterByFilterId(filterId);
}
/**
*
*
* @param waterFilter
* @return
*/
@Override
public List<WaterFilter> selectWaterFilterList(WaterFilter waterFilter)
{
return waterFilterMapper.selectWaterFilterList(waterFilter);
}
/**
*
*
* @param waterFilter
* @return
*/
@Override
public int insertWaterFilter(WaterFilter waterFilter)
{
waterFilter.setCreateTime(DateUtils.getNowDate());
return waterFilterMapper.insertWaterFilter(waterFilter);
}
/**
*
*
* @param waterFilter
* @return
*/
@Override
public int updateWaterFilter(WaterFilter waterFilter)
{
waterFilter.setUpdateTime(DateUtils.getNowDate());
return waterFilterMapper.updateWaterFilter(waterFilter);
}
/**
*
*
* @param filterIds
* @return
*/
@Override
public int deleteWaterFilterByFilterIds(Long[] filterIds)
{
return waterFilterMapper.deleteWaterFilterByFilterIds(filterIds);
}
/**
*
*
* @param filterId
* @return
*/
@Override
public int deleteWaterFilterByFilterId(Long filterId)
{
return waterFilterMapper.deleteWaterFilterByFilterId(filterId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.message.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.message.domain.WaterMessage;
import com.ruoyi.water.message.service.IWaterMessageService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/系统消息")
public class WaterMessageController extends BaseController
{
@Autowired
private IWaterMessageService waterMessageService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:list')")
@GetMapping("/list")
public TableDataInfo list(WaterMessage waterMessage)
{
startPage();
List<WaterMessage> list = waterMessageService.selectWaterMessageList(waterMessage);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:export')")
@Log(title = "系统消息管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterMessage waterMessage)
{
List<WaterMessage> list = waterMessageService.selectWaterMessageList(waterMessage);
ExcelUtil<WaterMessage> util = new ExcelUtil<WaterMessage>(WaterMessage.class);
util.exportExcel(response, list, "系统消息管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:query')")
@GetMapping(value = "/{messageId}")
public AjaxResult getInfo(@PathVariable("messageId") Long messageId)
{
return success(waterMessageService.selectWaterMessageByMessageId(messageId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:add')")
@Log(title = "系统消息管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterMessage waterMessage)
{
return toAjax(waterMessageService.insertWaterMessage(waterMessage));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:edit')")
@Log(title = "系统消息管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterMessage waterMessage)
{
return toAjax(waterMessageService.updateWaterMessage(waterMessage));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:系统消息:remove')")
@Log(title = "系统消息管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{messageIds}")
public AjaxResult remove(@PathVariable Long[] messageIds)
{
return toAjax(waterMessageService.deleteWaterMessageByMessageIds(messageIds));
}
}

@ -0,0 +1,190 @@
package com.ruoyi.water.message.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_message
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterMessage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 消息ID */
@Excel(name = "消息ID")
private Long messageId;
/** 用户ID用户消息 */
@Excel(name = "用户ID", readConverterExp = "用=户消息")
private Long userId;
/** 员工ID员工消息 */
@Excel(name = "员工ID", readConverterExp = "员=工消息")
private Long staffId;
/** 消息类型order订单/device设备/system系统/service服务 */
@Excel(name = "消息类型", readConverterExp = "o=rder订单/device设备/system系统/service服务")
private String messageType;
/** 消息标题 */
@Excel(name = "消息标题")
private String title;
/** 消息内容 */
private String content;
/** 关联ID如订单ID、设备ID */
@Excel(name = "关联ID", readConverterExp = "如=订单ID、设备ID")
private Long relatedId;
/** 是否已读0未读 1已读 */
@Excel(name = "是否已读", readConverterExp = "0=未读,1=已读")
private String isRead;
/** 发送时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date sendTime;
/** 阅读时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "阅读时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date readTime;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setMessageId(Long messageId)
{
this.messageId = messageId;
}
public Long getMessageId()
{
return messageId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setStaffId(Long staffId)
{
this.staffId = staffId;
}
public Long getStaffId()
{
return staffId;
}
public void setMessageType(String messageType)
{
this.messageType = messageType;
}
public String getMessageType()
{
return messageType;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
public void setRelatedId(Long relatedId)
{
this.relatedId = relatedId;
}
public Long getRelatedId()
{
return relatedId;
}
public void setIsRead(String isRead)
{
this.isRead = isRead;
}
public String getIsRead()
{
return isRead;
}
public void setSendTime(Date sendTime)
{
this.sendTime = sendTime;
}
public Date getSendTime()
{
return sendTime;
}
public void setReadTime(Date readTime)
{
this.readTime = readTime;
}
public Date getReadTime()
{
return readTime;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("messageId", getMessageId())
.append("userId", getUserId())
.append("staffId", getStaffId())
.append("messageType", getMessageType())
.append("title", getTitle())
.append("content", getContent())
.append("relatedId", getRelatedId())
.append("isRead", getIsRead())
.append("sendTime", getSendTime())
.append("readTime", getReadTime())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,65 @@
package com.ruoyi.water.message.mapper;
import java.util.List;
import com.ruoyi.water.message.domain.WaterMessage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterMessageMapper
{
/**
*
*
* @param messageId
* @return
*/
public WaterMessage selectWaterMessageByMessageId(Long messageId);
/**
*
*
* @param waterMessage
* @return
*/
public List<WaterMessage> selectWaterMessageList(WaterMessage waterMessage);
/**
*
*
* @param waterMessage
* @return
*/
public int insertWaterMessage(WaterMessage waterMessage);
/**
*
*
* @param waterMessage
* @return
*/
public int updateWaterMessage(WaterMessage waterMessage);
/**
*
*
* @param messageId
* @return
*/
public int deleteWaterMessageByMessageId(Long messageId);
/**
*
*
* @param messageIds
* @return
*/
public int deleteWaterMessageByMessageIds(Long[] messageIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.message.service;
import java.util.List;
import com.ruoyi.water.message.domain.WaterMessage;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterMessageService
{
/**
*
*
* @param messageId
* @return
*/
public WaterMessage selectWaterMessageByMessageId(Long messageId);
/**
*
*
* @param waterMessage
* @return
*/
public List<WaterMessage> selectWaterMessageList(WaterMessage waterMessage);
/**
*
*
* @param waterMessage
* @return
*/
public int insertWaterMessage(WaterMessage waterMessage);
/**
*
*
* @param waterMessage
* @return
*/
public int updateWaterMessage(WaterMessage waterMessage);
/**
*
*
* @param messageIds
* @return
*/
public int deleteWaterMessageByMessageIds(Long[] messageIds);
/**
*
*
* @param messageId
* @return
*/
public int deleteWaterMessageByMessageId(Long messageId);
}

@ -0,0 +1,93 @@
package com.ruoyi.water.message.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.message.mapper.WaterMessageMapper;
import com.ruoyi.water.message.domain.WaterMessage;
import com.ruoyi.water.message.service.IWaterMessageService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterMessageServiceImpl implements IWaterMessageService
{
@Autowired
private WaterMessageMapper waterMessageMapper;
/**
*
*
* @param messageId
* @return
*/
@Override
public WaterMessage selectWaterMessageByMessageId(Long messageId)
{
return waterMessageMapper.selectWaterMessageByMessageId(messageId);
}
/**
*
*
* @param waterMessage
* @return
*/
@Override
public List<WaterMessage> selectWaterMessageList(WaterMessage waterMessage)
{
return waterMessageMapper.selectWaterMessageList(waterMessage);
}
/**
*
*
* @param waterMessage
* @return
*/
@Override
public int insertWaterMessage(WaterMessage waterMessage)
{
return waterMessageMapper.insertWaterMessage(waterMessage);
}
/**
*
*
* @param waterMessage
* @return
*/
@Override
public int updateWaterMessage(WaterMessage waterMessage)
{
return waterMessageMapper.updateWaterMessage(waterMessage);
}
/**
*
*
* @param messageIds
* @return
*/
@Override
public int deleteWaterMessageByMessageIds(Long[] messageIds)
{
return waterMessageMapper.deleteWaterMessageByMessageIds(messageIds);
}
/**
*
*
* @param messageId
* @return
*/
@Override
public int deleteWaterMessageByMessageId(Long messageId)
{
return waterMessageMapper.deleteWaterMessageByMessageId(messageId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.notice.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.notice.domain.WaterNotice;
import com.ruoyi.water.notice.service.IWaterNoticeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/通知公告")
public class WaterNoticeController extends BaseController
{
@Autowired
private IWaterNoticeService waterNoticeService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:list')")
@GetMapping("/list")
public TableDataInfo list(WaterNotice waterNotice)
{
startPage();
List<WaterNotice> list = waterNoticeService.selectWaterNoticeList(waterNotice);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:export')")
@Log(title = "通知公告管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterNotice waterNotice)
{
List<WaterNotice> list = waterNoticeService.selectWaterNoticeList(waterNotice);
ExcelUtil<WaterNotice> util = new ExcelUtil<WaterNotice>(WaterNotice.class);
util.exportExcel(response, list, "通知公告管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable("noticeId") Long noticeId)
{
return success(waterNoticeService.selectWaterNoticeByNoticeId(noticeId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:add')")
@Log(title = "通知公告管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterNotice waterNotice)
{
return toAjax(waterNoticeService.insertWaterNotice(waterNotice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:edit')")
@Log(title = "通知公告管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterNotice waterNotice)
{
return toAjax(waterNoticeService.updateWaterNotice(waterNotice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:通知公告:remove')")
@Log(title = "通知公告管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public AjaxResult remove(@PathVariable Long[] noticeIds)
{
return toAjax(waterNoticeService.deleteWaterNoticeByNoticeIds(noticeIds));
}
}

@ -0,0 +1,165 @@
package com.ruoyi.water.notice.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_notice
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterNotice extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 公告ID */
@Excel(name = "公告ID")
private Long noticeId;
/** 公告标题 */
@Excel(name = "公告标题")
private String noticeTitle;
/** 公告内容 */
private String noticeContent;
/** 公告类型info通知/warning警告/urgent紧急 */
@Excel(name = "公告类型", readConverterExp = "i=nfo通知/warning警告/urgent紧急")
private String noticeType;
/** 目标对象all全部/user用户/staff员工 */
@Excel(name = "目标对象", readConverterExp = "a=ll全部/user用户/staff员工")
private String targetType;
/** 状态0发布 1草稿 2下架 */
@Excel(name = "状态", readConverterExp = "0=发布,1=草稿,2=下架")
private String status;
/** 发布时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date publishTime;
/** 过期时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date expireTime;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setNoticeId(Long noticeId)
{
this.noticeId = noticeId;
}
public Long getNoticeId()
{
return noticeId;
}
public void setNoticeTitle(String noticeTitle)
{
this.noticeTitle = noticeTitle;
}
public String getNoticeTitle()
{
return noticeTitle;
}
public void setNoticeContent(String noticeContent)
{
this.noticeContent = noticeContent;
}
public String getNoticeContent()
{
return noticeContent;
}
public void setNoticeType(String noticeType)
{
this.noticeType = noticeType;
}
public String getNoticeType()
{
return noticeType;
}
public void setTargetType(String targetType)
{
this.targetType = targetType;
}
public String getTargetType()
{
return targetType;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setPublishTime(Date publishTime)
{
this.publishTime = publishTime;
}
public Date getPublishTime()
{
return publishTime;
}
public void setExpireTime(Date expireTime)
{
this.expireTime = expireTime;
}
public Date getExpireTime()
{
return expireTime;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeContent", getNoticeContent())
.append("noticeType", getNoticeType())
.append("targetType", getTargetType())
.append("status", getStatus())
.append("publishTime", getPublishTime())
.append("expireTime", getExpireTime())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,64 @@
package com.ruoyi.water.notice.mapper;
import java.util.List;
import com.ruoyi.water.notice.domain.WaterNotice;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterNoticeMapper
{
/**
*
*
* @param noticeId
* @return
*/
public WaterNotice selectWaterNoticeByNoticeId(Long noticeId);
/**
*
*
* @param waterNotice
* @return
*/
public List<WaterNotice> selectWaterNoticeList(WaterNotice waterNotice);
/**
*
*
* @param waterNotice
* @return
*/
public int insertWaterNotice(WaterNotice waterNotice);
/**
*
*
* @param waterNotice
* @return
*/
public int updateWaterNotice(WaterNotice waterNotice);
/**
*
*
* @param noticeId
* @return
*/
public int deleteWaterNoticeByNoticeId(Long noticeId);
/**
*
*
* @param noticeIds
* @return
*/
public int deleteWaterNoticeByNoticeIds(Long[] noticeIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.notice.service;
import java.util.List;
import com.ruoyi.water.notice.domain.WaterNotice;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterNoticeService
{
/**
*
*
* @param noticeId
* @return
*/
public WaterNotice selectWaterNoticeByNoticeId(Long noticeId);
/**
*
*
* @param waterNotice
* @return
*/
public List<WaterNotice> selectWaterNoticeList(WaterNotice waterNotice);
/**
*
*
* @param waterNotice
* @return
*/
public int insertWaterNotice(WaterNotice waterNotice);
/**
*
*
* @param waterNotice
* @return
*/
public int updateWaterNotice(WaterNotice waterNotice);
/**
*
*
* @param noticeIds
* @return
*/
public int deleteWaterNoticeByNoticeIds(Long[] noticeIds);
/**
*
*
* @param noticeId
* @return
*/
public int deleteWaterNoticeByNoticeId(Long noticeId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.notice.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.notice.mapper.WaterNoticeMapper;
import com.ruoyi.water.notice.domain.WaterNotice;
import com.ruoyi.water.notice.service.IWaterNoticeService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterNoticeServiceImpl implements IWaterNoticeService
{
@Autowired
private WaterNoticeMapper waterNoticeMapper;
/**
*
*
* @param noticeId
* @return
*/
@Override
public WaterNotice selectWaterNoticeByNoticeId(Long noticeId)
{
return waterNoticeMapper.selectWaterNoticeByNoticeId(noticeId);
}
/**
*
*
* @param waterNotice
* @return
*/
@Override
public List<WaterNotice> selectWaterNoticeList(WaterNotice waterNotice)
{
return waterNoticeMapper.selectWaterNoticeList(waterNotice);
}
/**
*
*
* @param waterNotice
* @return
*/
@Override
public int insertWaterNotice(WaterNotice waterNotice)
{
waterNotice.setCreateTime(DateUtils.getNowDate());
return waterNoticeMapper.insertWaterNotice(waterNotice);
}
/**
*
*
* @param waterNotice
* @return
*/
@Override
public int updateWaterNotice(WaterNotice waterNotice)
{
waterNotice.setUpdateTime(DateUtils.getNowDate());
return waterNoticeMapper.updateWaterNotice(waterNotice);
}
/**
*
*
* @param noticeIds
* @return
*/
@Override
public int deleteWaterNoticeByNoticeIds(Long[] noticeIds)
{
return waterNoticeMapper.deleteWaterNoticeByNoticeIds(noticeIds);
}
/**
*
*
* @param noticeId
* @return
*/
@Override
public int deleteWaterNoticeByNoticeId(Long noticeId)
{
return waterNoticeMapper.deleteWaterNoticeByNoticeId(noticeId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.order.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.order.domain.WaterOrderProduct;
import com.ruoyi.water.order.service.IWaterOrderProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/订单商品")
public class WaterOrderProductController extends BaseController
{
@Autowired
private IWaterOrderProductService waterOrderProductService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:list')")
@GetMapping("/list")
public TableDataInfo list(WaterOrderProduct waterOrderProduct)
{
startPage();
List<WaterOrderProduct> list = waterOrderProductService.selectWaterOrderProductList(waterOrderProduct);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:export')")
@Log(title = "订单商品管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterOrderProduct waterOrderProduct)
{
List<WaterOrderProduct> list = waterOrderProductService.selectWaterOrderProductList(waterOrderProduct);
ExcelUtil<WaterOrderProduct> util = new ExcelUtil<WaterOrderProduct>(WaterOrderProduct.class);
util.exportExcel(response, list, "订单商品管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(waterOrderProductService.selectWaterOrderProductById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:add')")
@Log(title = "订单商品管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterOrderProduct waterOrderProduct)
{
return toAjax(waterOrderProductService.insertWaterOrderProduct(waterOrderProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:edit')")
@Log(title = "订单商品管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterOrderProduct waterOrderProduct)
{
return toAjax(waterOrderProductService.updateWaterOrderProduct(waterOrderProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:订单商品:remove')")
@Log(title = "订单商品管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(waterOrderProductService.deleteWaterOrderProductByIds(ids));
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.order.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.order.domain.WaterServiceOrder;
import com.ruoyi.water.order.service.IWaterServiceOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/服务订单")
public class WaterServiceOrderController extends BaseController
{
@Autowired
private IWaterServiceOrderService waterServiceOrderService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:list')")
@GetMapping("/list")
public TableDataInfo list(WaterServiceOrder waterServiceOrder)
{
startPage();
List<WaterServiceOrder> list = waterServiceOrderService.selectWaterServiceOrderList(waterServiceOrder);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:export')")
@Log(title = "服务订单管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterServiceOrder waterServiceOrder)
{
List<WaterServiceOrder> list = waterServiceOrderService.selectWaterServiceOrderList(waterServiceOrder);
ExcelUtil<WaterServiceOrder> util = new ExcelUtil<WaterServiceOrder>(WaterServiceOrder.class);
util.exportExcel(response, list, "服务订单管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:query')")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
{
return success(waterServiceOrderService.selectWaterServiceOrderByOrderId(orderId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:add')")
@Log(title = "服务订单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterServiceOrder waterServiceOrder)
{
return toAjax(waterServiceOrderService.insertWaterServiceOrder(waterServiceOrder));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:edit')")
@Log(title = "服务订单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterServiceOrder waterServiceOrder)
{
return toAjax(waterServiceOrderService.updateWaterServiceOrder(waterServiceOrder));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:服务订单:remove')")
@Log(title = "服务订单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderIds}")
public AjaxResult remove(@PathVariable Long[] orderIds)
{
return toAjax(waterServiceOrderService.deleteWaterServiceOrderByOrderIds(orderIds));
}
}

@ -0,0 +1,130 @@
package com.ruoyi.water.order.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_order_product
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterOrderProduct extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
@Excel(name = "主键ID")
private Long id;
/** 订单ID */
@Excel(name = "订单ID")
private Long orderId;
/** 商品ID */
@Excel(name = "商品ID")
private Long productId;
/** 商品名称(冗余) */
@Excel(name = "商品名称", readConverterExp = "冗=余")
private String productName;
/** 商品单价(冗余) */
@Excel(name = "商品单价", readConverterExp = "冗=余")
private BigDecimal productPrice;
/** 购买数量 */
@Excel(name = "购买数量")
private Long quantity;
/** 小计金额 */
@Excel(name = "小计金额")
private BigDecimal totalPrice;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setProductId(Long productId)
{
this.productId = productId;
}
public Long getProductId()
{
return productId;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setProductPrice(BigDecimal productPrice)
{
this.productPrice = productPrice;
}
public BigDecimal getProductPrice()
{
return productPrice;
}
public void setQuantity(Long quantity)
{
this.quantity = quantity;
}
public Long getQuantity()
{
return quantity;
}
public void setTotalPrice(BigDecimal totalPrice)
{
this.totalPrice = totalPrice;
}
public BigDecimal getTotalPrice()
{
return totalPrice;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderId", getOrderId())
.append("productId", getProductId())
.append("productName", getProductName())
.append("productPrice", getProductPrice())
.append("quantity", getQuantity())
.append("totalPrice", getTotalPrice())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,471 @@
package com.ruoyi.water.order.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_service_order
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterServiceOrder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 订单ID */
@Excel(name = "订单ID")
private Long orderId;
/** 订单号(唯一) */
@Excel(name = "订单号", readConverterExp = "唯=一")
private String orderNo;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 负责员工ID */
@Excel(name = "负责员工ID")
private Long staffId;
/** 服务类型(设备安装/滤芯更换/维修/订购/水质检测) */
@Excel(name = "服务类型", readConverterExp = "设=备安装/滤芯更换/维修/订购/水质检测")
private String serviceType;
/** 订单来源user用户下单/admin后台派单 */
@Excel(name = "订单来源", readConverterExp = "u=ser用户下单/admin后台派单")
private String orderSource;
/** 订单状态pending待支付/paid已支付/accepted已接单/processing处理中/completed已完成/cancelled已取消 */
@Excel(name = "订单状态", readConverterExp = "p=ending待支付/paid已支付/accepted已接单/processing处理中/completed已完成/cancelled已取消")
private String orderStatus;
/** 支付状态unpaid未支付/paid已支付/refunded已退款 */
@Excel(name = "支付状态", readConverterExp = "u=npaid未支付/paid已支付/refunded已退款")
private String paymentStatus;
/** 订单金额 */
@Excel(name = "订单金额")
private BigDecimal amount;
/** 实付金额 */
@Excel(name = "实付金额")
private BigDecimal actualAmount;
/** 优惠金额 */
@Excel(name = "优惠金额")
private BigDecimal discountAmount;
/** 支付方式wechat微信/balance余额/alipay支付宝 */
@Excel(name = "支付方式", readConverterExp = "w=echat微信/balance余额/alipay支付宝")
private String paymentMethod;
/** 联系人 */
@Excel(name = "联系人")
private String contactName;
/** 联系电话 */
@Excel(name = "联系电话")
private String contactPhone;
/** 服务地址 */
@Excel(name = "服务地址")
private String serviceAddress;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal locationLat;
/** 经度 */
@Excel(name = "经度")
private BigDecimal locationLng;
/** 服务描述/问题描述 */
@Excel(name = "服务描述/问题描述")
private String description;
/** 优先级normal普通/high紧急 */
@Excel(name = "优先级", readConverterExp = "n=ormal普通/high紧急")
private String priority;
/** 配送距离(公里) */
@Excel(name = "配送距离", readConverterExp = "公=里")
private BigDecimal deliveryDistance;
/** 预计时长(分钟) */
@Excel(name = "预计时长", readConverterExp = "分=钟")
private Long estimatedDuration;
/** 实际时长(分钟) */
@Excel(name = "实际时长", readConverterExp = "分=钟")
private Long actualDuration;
/** 提交时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date submitTime;
/** 支付时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date paymentTime;
/** 接单时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "接单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date acceptTime;
/** 开始配送时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始配送时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completeTime;
/** 取消时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "取消时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date cancelTime;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setOrderNo(String orderNo)
{
this.orderNo = orderNo;
}
public String getOrderNo()
{
return orderNo;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setStaffId(Long staffId)
{
this.staffId = staffId;
}
public Long getStaffId()
{
return staffId;
}
public void setServiceType(String serviceType)
{
this.serviceType = serviceType;
}
public String getServiceType()
{
return serviceType;
}
public void setOrderSource(String orderSource)
{
this.orderSource = orderSource;
}
public String getOrderSource()
{
return orderSource;
}
public void setOrderStatus(String orderStatus)
{
this.orderStatus = orderStatus;
}
public String getOrderStatus()
{
return orderStatus;
}
public void setPaymentStatus(String paymentStatus)
{
this.paymentStatus = paymentStatus;
}
public String getPaymentStatus()
{
return paymentStatus;
}
public void setAmount(BigDecimal amount)
{
this.amount = amount;
}
public BigDecimal getAmount()
{
return amount;
}
public void setActualAmount(BigDecimal actualAmount)
{
this.actualAmount = actualAmount;
}
public BigDecimal getActualAmount()
{
return actualAmount;
}
public void setDiscountAmount(BigDecimal discountAmount)
{
this.discountAmount = discountAmount;
}
public BigDecimal getDiscountAmount()
{
return discountAmount;
}
public void setPaymentMethod(String paymentMethod)
{
this.paymentMethod = paymentMethod;
}
public String getPaymentMethod()
{
return paymentMethod;
}
public void setContactName(String contactName)
{
this.contactName = contactName;
}
public String getContactName()
{
return contactName;
}
public void setContactPhone(String contactPhone)
{
this.contactPhone = contactPhone;
}
public String getContactPhone()
{
return contactPhone;
}
public void setServiceAddress(String serviceAddress)
{
this.serviceAddress = serviceAddress;
}
public String getServiceAddress()
{
return serviceAddress;
}
public void setLocationLat(BigDecimal locationLat)
{
this.locationLat = locationLat;
}
public BigDecimal getLocationLat()
{
return locationLat;
}
public void setLocationLng(BigDecimal locationLng)
{
this.locationLng = locationLng;
}
public BigDecimal getLocationLng()
{
return locationLng;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setPriority(String priority)
{
this.priority = priority;
}
public String getPriority()
{
return priority;
}
public void setDeliveryDistance(BigDecimal deliveryDistance)
{
this.deliveryDistance = deliveryDistance;
}
public BigDecimal getDeliveryDistance()
{
return deliveryDistance;
}
public void setEstimatedDuration(Long estimatedDuration)
{
this.estimatedDuration = estimatedDuration;
}
public Long getEstimatedDuration()
{
return estimatedDuration;
}
public void setActualDuration(Long actualDuration)
{
this.actualDuration = actualDuration;
}
public Long getActualDuration()
{
return actualDuration;
}
public void setSubmitTime(Date submitTime)
{
this.submitTime = submitTime;
}
public Date getSubmitTime()
{
return submitTime;
}
public void setPaymentTime(Date paymentTime)
{
this.paymentTime = paymentTime;
}
public Date getPaymentTime()
{
return paymentTime;
}
public void setAcceptTime(Date acceptTime)
{
this.acceptTime = acceptTime;
}
public Date getAcceptTime()
{
return acceptTime;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setCompleteTime(Date completeTime)
{
this.completeTime = completeTime;
}
public Date getCompleteTime()
{
return completeTime;
}
public void setCancelTime(Date cancelTime)
{
this.cancelTime = cancelTime;
}
public Date getCancelTime()
{
return cancelTime;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("orderId", getOrderId())
.append("orderNo", getOrderNo())
.append("userId", getUserId())
.append("staffId", getStaffId())
.append("serviceType", getServiceType())
.append("orderSource", getOrderSource())
.append("orderStatus", getOrderStatus())
.append("paymentStatus", getPaymentStatus())
.append("amount", getAmount())
.append("actualAmount", getActualAmount())
.append("discountAmount", getDiscountAmount())
.append("paymentMethod", getPaymentMethod())
.append("contactName", getContactName())
.append("contactPhone", getContactPhone())
.append("serviceAddress", getServiceAddress())
.append("locationLat", getLocationLat())
.append("locationLng", getLocationLng())
.append("description", getDescription())
.append("priority", getPriority())
.append("deliveryDistance", getDeliveryDistance())
.append("estimatedDuration", getEstimatedDuration())
.append("actualDuration", getActualDuration())
.append("submitTime", getSubmitTime())
.append("paymentTime", getPaymentTime())
.append("acceptTime", getAcceptTime())
.append("startTime", getStartTime())
.append("completeTime", getCompleteTime())
.append("cancelTime", getCancelTime())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,63 @@
package com.ruoyi.water.order.mapper;
import java.util.List;
import com.ruoyi.water.order.domain.WaterOrderProduct;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterOrderProductMapper
{
/**
*
*
* @param id
* @return
*/
public WaterOrderProduct selectWaterOrderProductById(Long id);
/**
*
*
* @param waterOrderProduct
* @return
*/
public List<WaterOrderProduct> selectWaterOrderProductList(WaterOrderProduct waterOrderProduct);
/**
*
*
* @param waterOrderProduct
* @return
*/
public int insertWaterOrderProduct(WaterOrderProduct waterOrderProduct);
/**
*
*
* @param waterOrderProduct
* @return
*/
public int updateWaterOrderProduct(WaterOrderProduct waterOrderProduct);
/**
*
*
* @param id
* @return
*/
public int deleteWaterOrderProductById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWaterOrderProductByIds(Long[] ids);
}

@ -0,0 +1,63 @@
package com.ruoyi.water.order.mapper;
import java.util.List;
import com.ruoyi.water.order.domain.WaterServiceOrder;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterServiceOrderMapper
{
/**
*
*
* @param orderId
* @return
*/
public WaterServiceOrder selectWaterServiceOrderByOrderId(Long orderId);
/**
*
*
* @param waterServiceOrder
* @return
*/
public List<WaterServiceOrder> selectWaterServiceOrderList(WaterServiceOrder waterServiceOrder);
/**
*
*
* @param waterServiceOrder
* @return
*/
public int insertWaterServiceOrder(WaterServiceOrder waterServiceOrder);
/**
*
*
* @param waterServiceOrder
* @return
*/
public int updateWaterServiceOrder(WaterServiceOrder waterServiceOrder);
/**
*
*
* @param orderId
* @return
*/
public int deleteWaterServiceOrderByOrderId(Long orderId);
/**
*
*
* @param orderIds
* @return
*/
public int deleteWaterServiceOrderByOrderIds(Long[] orderIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.order.service;
import java.util.List;
import com.ruoyi.water.order.domain.WaterOrderProduct;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterOrderProductService
{
/**
*
*
* @param id
* @return
*/
public WaterOrderProduct selectWaterOrderProductById(Long id);
/**
*
*
* @param waterOrderProduct
* @return
*/
public List<WaterOrderProduct> selectWaterOrderProductList(WaterOrderProduct waterOrderProduct);
/**
*
*
* @param waterOrderProduct
* @return
*/
public int insertWaterOrderProduct(WaterOrderProduct waterOrderProduct);
/**
*
*
* @param waterOrderProduct
* @return
*/
public int updateWaterOrderProduct(WaterOrderProduct waterOrderProduct);
/**
*
*
* @param ids
* @return
*/
public int deleteWaterOrderProductByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWaterOrderProductById(Long id);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.order.service;
import java.util.List;
import com.ruoyi.water.order.domain.WaterServiceOrder;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterServiceOrderService
{
/**
*
*
* @param orderId
* @return
*/
public WaterServiceOrder selectWaterServiceOrderByOrderId(Long orderId);
/**
*
*
* @param waterServiceOrder
* @return
*/
public List<WaterServiceOrder> selectWaterServiceOrderList(WaterServiceOrder waterServiceOrder);
/**
*
*
* @param waterServiceOrder
* @return
*/
public int insertWaterServiceOrder(WaterServiceOrder waterServiceOrder);
/**
*
*
* @param waterServiceOrder
* @return
*/
public int updateWaterServiceOrder(WaterServiceOrder waterServiceOrder);
/**
*
*
* @param orderIds
* @return
*/
public int deleteWaterServiceOrderByOrderIds(Long[] orderIds);
/**
*
*
* @param orderId
* @return
*/
public int deleteWaterServiceOrderByOrderId(Long orderId);
}

@ -0,0 +1,95 @@
package com.ruoyi.water.order.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.order.mapper.WaterOrderProductMapper;
import com.ruoyi.water.order.domain.WaterOrderProduct;
import com.ruoyi.water.order.service.IWaterOrderProductService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterOrderProductServiceImpl implements IWaterOrderProductService
{
@Autowired
private WaterOrderProductMapper waterOrderProductMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WaterOrderProduct selectWaterOrderProductById(Long id)
{
return waterOrderProductMapper.selectWaterOrderProductById(id);
}
/**
*
*
* @param waterOrderProduct
* @return
*/
@Override
public List<WaterOrderProduct> selectWaterOrderProductList(WaterOrderProduct waterOrderProduct)
{
return waterOrderProductMapper.selectWaterOrderProductList(waterOrderProduct);
}
/**
*
*
* @param waterOrderProduct
* @return
*/
@Override
public int insertWaterOrderProduct(WaterOrderProduct waterOrderProduct)
{
waterOrderProduct.setCreateTime(DateUtils.getNowDate());
return waterOrderProductMapper.insertWaterOrderProduct(waterOrderProduct);
}
/**
*
*
* @param waterOrderProduct
* @return
*/
@Override
public int updateWaterOrderProduct(WaterOrderProduct waterOrderProduct)
{
return waterOrderProductMapper.updateWaterOrderProduct(waterOrderProduct);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWaterOrderProductByIds(Long[] ids)
{
return waterOrderProductMapper.deleteWaterOrderProductByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWaterOrderProductById(Long id)
{
return waterOrderProductMapper.deleteWaterOrderProductById(id);
}
}

@ -0,0 +1,96 @@
package com.ruoyi.water.order.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.order.mapper.WaterServiceOrderMapper;
import com.ruoyi.water.order.domain.WaterServiceOrder;
import com.ruoyi.water.order.service.IWaterServiceOrderService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterServiceOrderServiceImpl implements IWaterServiceOrderService
{
@Autowired
private WaterServiceOrderMapper waterServiceOrderMapper;
/**
*
*
* @param orderId
* @return
*/
@Override
public WaterServiceOrder selectWaterServiceOrderByOrderId(Long orderId)
{
return waterServiceOrderMapper.selectWaterServiceOrderByOrderId(orderId);
}
/**
*
*
* @param waterServiceOrder
* @return
*/
@Override
public List<WaterServiceOrder> selectWaterServiceOrderList(WaterServiceOrder waterServiceOrder)
{
return waterServiceOrderMapper.selectWaterServiceOrderList(waterServiceOrder);
}
/**
*
*
* @param waterServiceOrder
* @return
*/
@Override
public int insertWaterServiceOrder(WaterServiceOrder waterServiceOrder)
{
waterServiceOrder.setCreateTime(DateUtils.getNowDate());
return waterServiceOrderMapper.insertWaterServiceOrder(waterServiceOrder);
}
/**
*
*
* @param waterServiceOrder
* @return
*/
@Override
public int updateWaterServiceOrder(WaterServiceOrder waterServiceOrder)
{
waterServiceOrder.setUpdateTime(DateUtils.getNowDate());
return waterServiceOrderMapper.updateWaterServiceOrder(waterServiceOrder);
}
/**
*
*
* @param orderIds
* @return
*/
@Override
public int deleteWaterServiceOrderByOrderIds(Long[] orderIds)
{
return waterServiceOrderMapper.deleteWaterServiceOrderByOrderIds(orderIds);
}
/**
*
*
* @param orderId
* @return
*/
@Override
public int deleteWaterServiceOrderByOrderId(Long orderId)
{
return waterServiceOrderMapper.deleteWaterServiceOrderByOrderId(orderId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.product.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.product.domain.WaterProduct;
import com.ruoyi.water.product.service.IWaterProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/商品")
public class WaterProductController extends BaseController
{
@Autowired
private IWaterProductService waterProductService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:list')")
@GetMapping("/list")
public TableDataInfo list(WaterProduct waterProduct)
{
startPage();
List<WaterProduct> list = waterProductService.selectWaterProductList(waterProduct);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:export')")
@Log(title = "商品管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterProduct waterProduct)
{
List<WaterProduct> list = waterProductService.selectWaterProductList(waterProduct);
ExcelUtil<WaterProduct> util = new ExcelUtil<WaterProduct>(WaterProduct.class);
util.exportExcel(response, list, "商品管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:query')")
@GetMapping(value = "/{productId}")
public AjaxResult getInfo(@PathVariable("productId") Long productId)
{
return success(waterProductService.selectWaterProductByProductId(productId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:add')")
@Log(title = "商品管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterProduct waterProduct)
{
return toAjax(waterProductService.insertWaterProduct(waterProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:edit')")
@Log(title = "商品管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterProduct waterProduct)
{
return toAjax(waterProductService.updateWaterProduct(waterProduct));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:商品:remove')")
@Log(title = "商品管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{productIds}")
public AjaxResult remove(@PathVariable Long[] productIds)
{
return toAjax(waterProductService.deleteWaterProductByProductIds(productIds));
}
}

@ -0,0 +1,192 @@
package com.ruoyi.water.product.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_product
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterProduct extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 商品ID */
@Excel(name = "商品ID")
private Long productId;
/** 商品名称 */
@Excel(name = "商品名称")
private String productName;
/** 商品描述 */
private String productDesc;
/** 商品分类purifier净水器/meter水表/parts配件/service服务 */
@Excel(name = "商品分类", readConverterExp = "p=urifier净水器/meter水表/parts配件/service服务")
private String category;
/** 商品价格 */
@Excel(name = "商品价格")
private BigDecimal price;
/** 库存数量 */
@Excel(name = "库存数量")
private Long stock;
/** 商品图片URL */
@Excel(name = "商品图片URL")
private String imageUrl;
/** 图标Emoji */
@Excel(name = "图标Emoji")
private String icon;
/** 状态0上架 1下架 */
@Excel(name = "状态", readConverterExp = "0=上架,1=下架")
private String status;
/** 排序 */
@Excel(name = "排序")
private Long sortOrder;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setProductId(Long productId)
{
this.productId = productId;
}
public Long getProductId()
{
return productId;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setProductDesc(String productDesc)
{
this.productDesc = productDesc;
}
public String getProductDesc()
{
return productDesc;
}
public void setCategory(String category)
{
this.category = category;
}
public String getCategory()
{
return category;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setStock(Long stock)
{
this.stock = stock;
}
public Long getStock()
{
return stock;
}
public void setImageUrl(String imageUrl)
{
this.imageUrl = imageUrl;
}
public String getImageUrl()
{
return imageUrl;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return icon;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setSortOrder(Long sortOrder)
{
this.sortOrder = sortOrder;
}
public Long getSortOrder()
{
return sortOrder;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("productId", getProductId())
.append("productName", getProductName())
.append("productDesc", getProductDesc())
.append("category", getCategory())
.append("price", getPrice())
.append("stock", getStock())
.append("imageUrl", getImageUrl())
.append("icon", getIcon())
.append("status", getStatus())
.append("sortOrder", getSortOrder())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,63 @@
package com.ruoyi.water.product.mapper;
import java.util.List;
import com.ruoyi.water.product.domain.WaterProduct;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterProductMapper
{
/**
*
*
* @param productId
* @return
*/
public WaterProduct selectWaterProductByProductId(Long productId);
/**
*
*
* @param waterProduct
* @return
*/
public List<WaterProduct> selectWaterProductList(WaterProduct waterProduct);
/**
*
*
* @param waterProduct
* @return
*/
public int insertWaterProduct(WaterProduct waterProduct);
/**
*
*
* @param waterProduct
* @return
*/
public int updateWaterProduct(WaterProduct waterProduct);
/**
*
*
* @param productId
* @return
*/
public int deleteWaterProductByProductId(Long productId);
/**
*
*
* @param productIds
* @return
*/
public int deleteWaterProductByProductIds(Long[] productIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.product.service;
import java.util.List;
import com.ruoyi.water.product.domain.WaterProduct;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterProductService
{
/**
*
*
* @param productId
* @return
*/
public WaterProduct selectWaterProductByProductId(Long productId);
/**
*
*
* @param waterProduct
* @return
*/
public List<WaterProduct> selectWaterProductList(WaterProduct waterProduct);
/**
*
*
* @param waterProduct
* @return
*/
public int insertWaterProduct(WaterProduct waterProduct);
/**
*
*
* @param waterProduct
* @return
*/
public int updateWaterProduct(WaterProduct waterProduct);
/**
*
*
* @param productIds
* @return
*/
public int deleteWaterProductByProductIds(Long[] productIds);
/**
*
*
* @param productId
* @return
*/
public int deleteWaterProductByProductId(Long productId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.product.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.product.mapper.WaterProductMapper;
import com.ruoyi.water.product.domain.WaterProduct;
import com.ruoyi.water.product.service.IWaterProductService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterProductServiceImpl implements IWaterProductService
{
@Autowired
private WaterProductMapper waterProductMapper;
/**
*
*
* @param productId
* @return
*/
@Override
public WaterProduct selectWaterProductByProductId(Long productId)
{
return waterProductMapper.selectWaterProductByProductId(productId);
}
/**
*
*
* @param waterProduct
* @return
*/
@Override
public List<WaterProduct> selectWaterProductList(WaterProduct waterProduct)
{
return waterProductMapper.selectWaterProductList(waterProduct);
}
/**
*
*
* @param waterProduct
* @return
*/
@Override
public int insertWaterProduct(WaterProduct waterProduct)
{
waterProduct.setCreateTime(DateUtils.getNowDate());
return waterProductMapper.insertWaterProduct(waterProduct);
}
/**
*
*
* @param waterProduct
* @return
*/
@Override
public int updateWaterProduct(WaterProduct waterProduct)
{
waterProduct.setUpdateTime(DateUtils.getNowDate());
return waterProductMapper.updateWaterProduct(waterProduct);
}
/**
*
*
* @param productIds
* @return
*/
@Override
public int deleteWaterProductByProductIds(Long[] productIds)
{
return waterProductMapper.deleteWaterProductByProductIds(productIds);
}
/**
*
*
* @param productId
* @return
*/
@Override
public int deleteWaterProductByProductId(Long productId)
{
return waterProductMapper.deleteWaterProductByProductId(productId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.quality.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.quality.domain.WaterQuality;
import com.ruoyi.water.quality.service.IWaterQualityService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-25
*/
@RestController
@RequestMapping("/water/水质检测")
public class WaterQualityController extends BaseController
{
@Autowired
private IWaterQualityService waterQualityService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:list')")
@GetMapping("/list")
public TableDataInfo list(WaterQuality waterQuality)
{
startPage();
List<WaterQuality> list = waterQualityService.selectWaterQualityList(waterQuality);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:export')")
@Log(title = "水质检测管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterQuality waterQuality)
{
List<WaterQuality> list = waterQualityService.selectWaterQualityList(waterQuality);
ExcelUtil<WaterQuality> util = new ExcelUtil<WaterQuality>(WaterQuality.class);
util.exportExcel(response, list, "水质检测管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:query')")
@GetMapping(value = "/{qualityId}")
public AjaxResult getInfo(@PathVariable("qualityId") Long qualityId)
{
return success(waterQualityService.selectWaterQualityByQualityId(qualityId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:add')")
@Log(title = "水质检测管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterQuality waterQuality)
{
return toAjax(waterQualityService.insertWaterQuality(waterQuality));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:edit')")
@Log(title = "水质检测管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterQuality waterQuality)
{
return toAjax(waterQualityService.updateWaterQuality(waterQuality));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:水质检测:remove')")
@Log(title = "水质检测管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{qualityIds}")
public AjaxResult remove(@PathVariable Long[] qualityIds)
{
return toAjax(waterQualityService.deleteWaterQualityByQualityIds(qualityIds));
}
}

@ -0,0 +1,298 @@
package com.ruoyi.water.quality.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_quality
*
* @author ruoyi
* @date 2025-11-25
*/
public class WaterQuality extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 检测ID */
@Excel(name = "检测ID")
private Long qualityId;
/** 设备ID */
@Excel(name = "设备ID")
private Long deviceId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 关联订单ID如果是服务订单 */
@Excel(name = "关联订单ID", readConverterExp = "如=果是服务订单")
private Long orderId;
/** 检测时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "检测时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date testTime;
/** 检测地址 */
@Excel(name = "检测地址")
private String testAddress;
/** 水质等级(优质/良好/一般/较差) */
@Excel(name = "水质等级", readConverterExp = "优=质/良好/一般/较差")
private String qualityLevel;
/** 水质描述 */
private String qualityDesc;
/** pH值6.5-8.5 */
@Excel(name = "pH值", readConverterExp = "6=.5-8.5")
private BigDecimal phValue;
/** 浊度 NTU≤1 */
@Excel(name = "浊度 NTU", readConverterExp = "≤=1")
private BigDecimal turbidity;
/** 余氯 mg/L0.05-4 */
@Excel(name = "余氯 mg/L", readConverterExp = "0=.05-4")
private BigDecimal residualChlorine;
/** 总硬度 mg/L≤450 */
@Excel(name = "总硬度 mg/L", readConverterExp = "≤=450")
private BigDecimal totalHardness;
/** TDS溶解性固体 mg/L≤1000 */
@Excel(name = "TDS溶解性固体 mg/L", readConverterExp = "≤=1000")
private BigDecimal tds;
/** COD化学需氧量 mg/L */
@Excel(name = "COD化学需氧量 mg/L")
private BigDecimal cod;
/** 氨氮 mg/L */
@Excel(name = "氨氮 mg/L")
private BigDecimal ammoniaNitrogen;
/** 检测报告URL */
@Excel(name = "检测报告URL")
private String reportUrl;
/** 状态0检测中 1已完成 */
@Excel(name = "状态", readConverterExp = "0=检测中,1=已完成")
private String status;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setQualityId(Long qualityId)
{
this.qualityId = qualityId;
}
public Long getQualityId()
{
return qualityId;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setTestTime(Date testTime)
{
this.testTime = testTime;
}
public Date getTestTime()
{
return testTime;
}
public void setTestAddress(String testAddress)
{
this.testAddress = testAddress;
}
public String getTestAddress()
{
return testAddress;
}
public void setQualityLevel(String qualityLevel)
{
this.qualityLevel = qualityLevel;
}
public String getQualityLevel()
{
return qualityLevel;
}
public void setQualityDesc(String qualityDesc)
{
this.qualityDesc = qualityDesc;
}
public String getQualityDesc()
{
return qualityDesc;
}
public void setPhValue(BigDecimal phValue)
{
this.phValue = phValue;
}
public BigDecimal getPhValue()
{
return phValue;
}
public void setTurbidity(BigDecimal turbidity)
{
this.turbidity = turbidity;
}
public BigDecimal getTurbidity()
{
return turbidity;
}
public void setResidualChlorine(BigDecimal residualChlorine)
{
this.residualChlorine = residualChlorine;
}
public BigDecimal getResidualChlorine()
{
return residualChlorine;
}
public void setTotalHardness(BigDecimal totalHardness)
{
this.totalHardness = totalHardness;
}
public BigDecimal getTotalHardness()
{
return totalHardness;
}
public void setTds(BigDecimal tds)
{
this.tds = tds;
}
public BigDecimal getTds()
{
return tds;
}
public void setCod(BigDecimal cod)
{
this.cod = cod;
}
public BigDecimal getCod()
{
return cod;
}
public void setAmmoniaNitrogen(BigDecimal ammoniaNitrogen)
{
this.ammoniaNitrogen = ammoniaNitrogen;
}
public BigDecimal getAmmoniaNitrogen()
{
return ammoniaNitrogen;
}
public void setReportUrl(String reportUrl)
{
this.reportUrl = reportUrl;
}
public String getReportUrl()
{
return reportUrl;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("qualityId", getQualityId())
.append("deviceId", getDeviceId())
.append("userId", getUserId())
.append("orderId", getOrderId())
.append("testTime", getTestTime())
.append("testAddress", getTestAddress())
.append("qualityLevel", getQualityLevel())
.append("qualityDesc", getQualityDesc())
.append("phValue", getPhValue())
.append("turbidity", getTurbidity())
.append("residualChlorine", getResidualChlorine())
.append("totalHardness", getTotalHardness())
.append("tds", getTds())
.append("cod", getCod())
.append("ammoniaNitrogen", getAmmoniaNitrogen())
.append("reportUrl", getReportUrl())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,63 @@
package com.ruoyi.water.quality.mapper;
import java.util.List;
import com.ruoyi.water.quality.domain.WaterQuality;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-25
*/
@Mapper
public interface WaterQualityMapper
{
/**
*
*
* @param qualityId
* @return
*/
public WaterQuality selectWaterQualityByQualityId(Long qualityId);
/**
*
*
* @param waterQuality
* @return
*/
public List<WaterQuality> selectWaterQualityList(WaterQuality waterQuality);
/**
*
*
* @param waterQuality
* @return
*/
public int insertWaterQuality(WaterQuality waterQuality);
/**
*
*
* @param waterQuality
* @return
*/
public int updateWaterQuality(WaterQuality waterQuality);
/**
*
*
* @param qualityId
* @return
*/
public int deleteWaterQualityByQualityId(Long qualityId);
/**
*
*
* @param qualityIds
* @return
*/
public int deleteWaterQualityByQualityIds(Long[] qualityIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.quality.service;
import java.util.List;
import com.ruoyi.water.quality.domain.WaterQuality;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
public interface IWaterQualityService
{
/**
*
*
* @param qualityId
* @return
*/
public WaterQuality selectWaterQualityByQualityId(Long qualityId);
/**
*
*
* @param waterQuality
* @return
*/
public List<WaterQuality> selectWaterQualityList(WaterQuality waterQuality);
/**
*
*
* @param waterQuality
* @return
*/
public int insertWaterQuality(WaterQuality waterQuality);
/**
*
*
* @param waterQuality
* @return
*/
public int updateWaterQuality(WaterQuality waterQuality);
/**
*
*
* @param qualityIds
* @return
*/
public int deleteWaterQualityByQualityIds(Long[] qualityIds);
/**
*
*
* @param qualityId
* @return
*/
public int deleteWaterQualityByQualityId(Long qualityId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.quality.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.quality.mapper.WaterQualityMapper;
import com.ruoyi.water.quality.domain.WaterQuality;
import com.ruoyi.water.quality.service.IWaterQualityService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-25
*/
@Service
public class WaterQualityServiceImpl implements IWaterQualityService
{
@Autowired
private WaterQualityMapper waterQualityMapper;
/**
*
*
* @param qualityId
* @return
*/
@Override
public WaterQuality selectWaterQualityByQualityId(Long qualityId)
{
return waterQualityMapper.selectWaterQualityByQualityId(qualityId);
}
/**
*
*
* @param waterQuality
* @return
*/
@Override
public List<WaterQuality> selectWaterQualityList(WaterQuality waterQuality)
{
return waterQualityMapper.selectWaterQualityList(waterQuality);
}
/**
*
*
* @param waterQuality
* @return
*/
@Override
public int insertWaterQuality(WaterQuality waterQuality)
{
waterQuality.setCreateTime(DateUtils.getNowDate());
return waterQualityMapper.insertWaterQuality(waterQuality);
}
/**
*
*
* @param waterQuality
* @return
*/
@Override
public int updateWaterQuality(WaterQuality waterQuality)
{
waterQuality.setUpdateTime(DateUtils.getNowDate());
return waterQualityMapper.updateWaterQuality(waterQuality);
}
/**
*
*
* @param qualityIds
* @return
*/
@Override
public int deleteWaterQualityByQualityIds(Long[] qualityIds)
{
return waterQualityMapper.deleteWaterQualityByQualityIds(qualityIds);
}
/**
*
*
* @param qualityId
* @return
*/
@Override
public int deleteWaterQualityByQualityId(Long qualityId)
{
return waterQualityMapper.deleteWaterQualityByQualityId(qualityId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.staff.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.staff.domain.WaterStaff;
import com.ruoyi.water.staff.service.IWaterStaffService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/员工")
public class WaterStaffController extends BaseController
{
@Autowired
private IWaterStaffService waterStaffService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:list')")
@GetMapping("/list")
public TableDataInfo list(WaterStaff waterStaff)
{
startPage();
List<WaterStaff> list = waterStaffService.selectWaterStaffList(waterStaff);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:export')")
@Log(title = "员工管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterStaff waterStaff)
{
List<WaterStaff> list = waterStaffService.selectWaterStaffList(waterStaff);
ExcelUtil<WaterStaff> util = new ExcelUtil<WaterStaff>(WaterStaff.class);
util.exportExcel(response, list, "员工管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:query')")
@GetMapping(value = "/{staffId}")
public AjaxResult getInfo(@PathVariable("staffId") Long staffId)
{
return success(waterStaffService.selectWaterStaffByStaffId(staffId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:add')")
@Log(title = "员工管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterStaff waterStaff)
{
return toAjax(waterStaffService.insertWaterStaff(waterStaff));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:edit')")
@Log(title = "员工管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterStaff waterStaff)
{
return toAjax(waterStaffService.updateWaterStaff(waterStaff));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:员工:remove')")
@Log(title = "员工管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{staffIds}")
public AjaxResult remove(@PathVariable Long[] staffIds)
{
return toAjax(waterStaffService.deleteWaterStaffByStaffIds(staffIds));
}
}

@ -0,0 +1,223 @@
package com.ruoyi.water.staff.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_staff
*
* @author ruoyi
* @date 2025-11-24
*/
public class WaterStaff extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 员工ID */
@Excel(name = "员工ID")
private Long staffId;
/** 关联sys_user的user_id */
@Excel(name = "关联sys_user的user_id")
private Long userId;
/** 工号 */
@Excel(name = "工号")
private String employeeNo;
/** 姓名 */
@Excel(name = "姓名")
private String staffName;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 部门ID关联sys_dept */
@Excel(name = "部门ID", readConverterExp = "关=联sys_dept")
private Long deptId;
/** 职位 */
@Excel(name = "职位")
private String position;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 工单总数(冗余) */
@Excel(name = "工单总数", readConverterExp = "冗=余")
private Long totalOrders;
/** 完成工单数(冗余) */
@Excel(name = "完成工单数", readConverterExp = "冗=余")
private Long completedOrders;
/** 平均评分(冗余) */
@Excel(name = "平均评分", readConverterExp = "冗=余")
private BigDecimal avgRating;
/** 平均服务时长-分钟(冗余) */
@Excel(name = "平均服务时长-分钟", readConverterExp = "冗=余")
private Long avgDuration;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setStaffId(Long staffId)
{
this.staffId = staffId;
}
public Long getStaffId()
{
return staffId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setEmployeeNo(String employeeNo)
{
this.employeeNo = employeeNo;
}
public String getEmployeeNo()
{
return employeeNo;
}
public void setStaffName(String staffName)
{
this.staffName = staffName;
}
public String getStaffName()
{
return staffName;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setPosition(String position)
{
this.position = position;
}
public String getPosition()
{
return position;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setTotalOrders(Long totalOrders)
{
this.totalOrders = totalOrders;
}
public Long getTotalOrders()
{
return totalOrders;
}
public void setCompletedOrders(Long completedOrders)
{
this.completedOrders = completedOrders;
}
public Long getCompletedOrders()
{
return completedOrders;
}
public void setAvgRating(BigDecimal avgRating)
{
this.avgRating = avgRating;
}
public BigDecimal getAvgRating()
{
return avgRating;
}
public void setAvgDuration(Long avgDuration)
{
this.avgDuration = avgDuration;
}
public Long getAvgDuration()
{
return avgDuration;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("staffId", getStaffId())
.append("userId", getUserId())
.append("employeeNo", getEmployeeNo())
.append("staffName", getStaffName())
.append("phone", getPhone())
.append("deptId", getDeptId())
.append("position", getPosition())
.append("status", getStatus())
.append("totalOrders", getTotalOrders())
.append("completedOrders", getCompletedOrders())
.append("avgRating", getAvgRating())
.append("avgDuration", getAvgDuration())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,63 @@
package com.ruoyi.water.staff.mapper;
import java.util.List;
import com.ruoyi.water.staff.domain.WaterStaff;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-24
*/
@Mapper
public interface WaterStaffMapper
{
/**
*
*
* @param staffId
* @return
*/
public WaterStaff selectWaterStaffByStaffId(Long staffId);
/**
*
*
* @param waterStaff
* @return
*/
public List<WaterStaff> selectWaterStaffList(WaterStaff waterStaff);
/**
*
*
* @param waterStaff
* @return
*/
public int insertWaterStaff(WaterStaff waterStaff);
/**
*
*
* @param waterStaff
* @return
*/
public int updateWaterStaff(WaterStaff waterStaff);
/**
*
*
* @param staffId
* @return
*/
public int deleteWaterStaffByStaffId(Long staffId);
/**
*
*
* @param staffIds
* @return
*/
public int deleteWaterStaffByStaffIds(Long[] staffIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.staff.service;
import java.util.List;
import com.ruoyi.water.staff.domain.WaterStaff;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
public interface IWaterStaffService
{
/**
*
*
* @param staffId
* @return
*/
public WaterStaff selectWaterStaffByStaffId(Long staffId);
/**
*
*
* @param waterStaff
* @return
*/
public List<WaterStaff> selectWaterStaffList(WaterStaff waterStaff);
/**
*
*
* @param waterStaff
* @return
*/
public int insertWaterStaff(WaterStaff waterStaff);
/**
*
*
* @param waterStaff
* @return
*/
public int updateWaterStaff(WaterStaff waterStaff);
/**
*
*
* @param staffIds
* @return
*/
public int deleteWaterStaffByStaffIds(Long[] staffIds);
/**
*
*
* @param staffId
* @return
*/
public int deleteWaterStaffByStaffId(Long staffId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.staff.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.staff.mapper.WaterStaffMapper;
import com.ruoyi.water.staff.domain.WaterStaff;
import com.ruoyi.water.staff.service.IWaterStaffService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
@Service
public class WaterStaffServiceImpl implements IWaterStaffService
{
@Autowired
private WaterStaffMapper waterStaffMapper;
/**
*
*
* @param staffId
* @return
*/
@Override
public WaterStaff selectWaterStaffByStaffId(Long staffId)
{
return waterStaffMapper.selectWaterStaffByStaffId(staffId);
}
/**
*
*
* @param waterStaff
* @return
*/
@Override
public List<WaterStaff> selectWaterStaffList(WaterStaff waterStaff)
{
return waterStaffMapper.selectWaterStaffList(waterStaff);
}
/**
*
*
* @param waterStaff
* @return
*/
@Override
public int insertWaterStaff(WaterStaff waterStaff)
{
waterStaff.setCreateTime(DateUtils.getNowDate());
return waterStaffMapper.insertWaterStaff(waterStaff);
}
/**
*
*
* @param waterStaff
* @return
*/
@Override
public int updateWaterStaff(WaterStaff waterStaff)
{
waterStaff.setUpdateTime(DateUtils.getNowDate());
return waterStaffMapper.updateWaterStaff(waterStaff);
}
/**
*
*
* @param staffIds
* @return
*/
@Override
public int deleteWaterStaffByStaffIds(Long[] staffIds)
{
return waterStaffMapper.deleteWaterStaffByStaffIds(staffIds);
}
/**
*
*
* @param staffId
* @return
*/
@Override
public int deleteWaterStaffByStaffId(Long staffId)
{
return waterStaffMapper.deleteWaterStaffByStaffId(staffId);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.water.user.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.water.user.domain.WaterUser;
import com.ruoyi.water.user.service.IWaterUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-11-24
*/
@RestController
@RequestMapping("/water/用户")
public class WaterUserController extends BaseController
{
@Autowired
private IWaterUserService waterUserService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:list')")
@GetMapping("/list")
public TableDataInfo list(WaterUser waterUser)
{
startPage();
List<WaterUser> list = waterUserService.selectWaterUserList(waterUser);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:export')")
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WaterUser waterUser)
{
List<WaterUser> list = waterUserService.selectWaterUserList(waterUser);
ExcelUtil<WaterUser> util = new ExcelUtil<WaterUser>(WaterUser.class);
util.exportExcel(response, list, "用户管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return success(waterUserService.selectWaterUserByUserId(userId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:add')")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WaterUser waterUser)
{
return toAjax(waterUserService.insertWaterUser(waterUser));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WaterUser waterUser)
{
return toAjax(waterUserService.updateWaterUser(waterUser));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('water:用户:remove')")
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(waterUserService.deleteWaterUserByUserIds(userIds));
}
}

@ -0,0 +1,204 @@
package com.ruoyi.water.user.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* water_user
*
* @author ruoyi
* @date 2025-11-24
*/
public class WaterUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 密码BCrypt加密 */
private String password;
/** 昵称 */
@Excel(name = "昵称")
private String nickName;
/** 头像URL */
@Excel(name = "头像URL")
private String avatar;
/** 性别0未知 1男 2女 */
@Excel(name = "性别", readConverterExp = "0=未知,1=男,2=女")
private String gender;
/** 微信openid */
@Excel(name = "微信openid")
private String openid;
/** 微信unionid */
private String unionid;
/** 账户余额 */
@Excel(name = "账户余额")
private BigDecimal balance;
/** 订单总数(冗余) */
@Excel(name = "订单总数", readConverterExp = "冗=余")
private Long totalOrders;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志0存在 2删除 */
private String delFlag;
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setPassword(String password)
{
this.password = password;
}
public String getPassword()
{
return password;
}
public void setNickName(String nickName)
{
this.nickName = nickName;
}
public String getNickName()
{
return nickName;
}
public void setAvatar(String avatar)
{
this.avatar = avatar;
}
public String getAvatar()
{
return avatar;
}
public void setGender(String gender)
{
this.gender = gender;
}
public String getGender()
{
return gender;
}
public void setOpenid(String openid)
{
this.openid = openid;
}
public String getOpenid()
{
return openid;
}
public void setUnionid(String unionid)
{
this.unionid = unionid;
}
public String getUnionid()
{
return unionid;
}
public void setBalance(BigDecimal balance)
{
this.balance = balance;
}
public BigDecimal getBalance()
{
return balance;
}
public void setTotalOrders(Long totalOrders)
{
this.totalOrders = totalOrders;
}
public Long getTotalOrders()
{
return totalOrders;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("phone", getPhone())
.append("password", getPassword())
.append("nickName", getNickName())
.append("avatar", getAvatar())
.append("gender", getGender())
.append("openid", getOpenid())
.append("unionid", getUnionid())
.append("balance", getBalance())
.append("totalOrders", getTotalOrders())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,63 @@
package com.ruoyi.water.user.mapper;
import java.util.List;
import com.ruoyi.water.user.domain.WaterUser;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2025-11-24
*/
@Mapper
public interface WaterUserMapper
{
/**
*
*
* @param userId
* @return
*/
public WaterUser selectWaterUserByUserId(Long userId);
/**
*
*
* @param waterUser
* @return
*/
public List<WaterUser> selectWaterUserList(WaterUser waterUser);
/**
*
*
* @param waterUser
* @return
*/
public int insertWaterUser(WaterUser waterUser);
/**
*
*
* @param waterUser
* @return
*/
public int updateWaterUser(WaterUser waterUser);
/**
*
*
* @param userId
* @return
*/
public int deleteWaterUserByUserId(Long userId);
/**
*
*
* @param userIds
* @return
*/
public int deleteWaterUserByUserIds(Long[] userIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.water.user.service;
import java.util.List;
import com.ruoyi.water.user.domain.WaterUser;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
public interface IWaterUserService
{
/**
*
*
* @param userId
* @return
*/
public WaterUser selectWaterUserByUserId(Long userId);
/**
*
*
* @param waterUser
* @return
*/
public List<WaterUser> selectWaterUserList(WaterUser waterUser);
/**
*
*
* @param waterUser
* @return
*/
public int insertWaterUser(WaterUser waterUser);
/**
*
*
* @param waterUser
* @return
*/
public int updateWaterUser(WaterUser waterUser);
/**
*
*
* @param userIds
* @return
*/
public int deleteWaterUserByUserIds(Long[] userIds);
/**
*
*
* @param userId
* @return
*/
public int deleteWaterUserByUserId(Long userId);
}

@ -0,0 +1,96 @@
package com.ruoyi.water.user.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.water.user.mapper.WaterUserMapper;
import com.ruoyi.water.user.domain.WaterUser;
import com.ruoyi.water.user.service.IWaterUserService;
/**
* Service
*
* @author ruoyi
* @date 2025-11-24
*/
@Service
public class WaterUserServiceImpl implements IWaterUserService
{
@Autowired
private WaterUserMapper waterUserMapper;
/**
*
*
* @param userId
* @return
*/
@Override
public WaterUser selectWaterUserByUserId(Long userId)
{
return waterUserMapper.selectWaterUserByUserId(userId);
}
/**
*
*
* @param waterUser
* @return
*/
@Override
public List<WaterUser> selectWaterUserList(WaterUser waterUser)
{
return waterUserMapper.selectWaterUserList(waterUser);
}
/**
*
*
* @param waterUser
* @return
*/
@Override
public int insertWaterUser(WaterUser waterUser)
{
waterUser.setCreateTime(DateUtils.getNowDate());
return waterUserMapper.insertWaterUser(waterUser);
}
/**
*
*
* @param waterUser
* @return
*/
@Override
public int updateWaterUser(WaterUser waterUser)
{
waterUser.setUpdateTime(DateUtils.getNowDate());
return waterUserMapper.updateWaterUser(waterUser);
}
/**
*
*
* @param userIds
* @return
*/
@Override
public int deleteWaterUserByUserIds(Long[] userIds)
{
return waterUserMapper.deleteWaterUserByUserIds(userIds);
}
/**
*
*
* @param userId
* @return
*/
@Override
public int deleteWaterUserByUserId(Long userId)
{
return waterUserMapper.deleteWaterUserByUserId(userId);
}
}

@ -0,0 +1,94 @@
package com.ruoyi.web.controller.common;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.google.code.kaptcha.Producer;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService;
/**
*
*
* @author ruoyi
*/
@RestController
public class CaptchaController
{
@Resource(name = "captchaProducer")
private Producer captchaProducer;
@Resource(name = "captchaProducerMath")
private Producer captchaProducerMath;
@Autowired
private RedisCache redisCache;
@Autowired
private ISysConfigService configService;
/**
*
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = configService.selectCaptchaEnabled();
ajax.put("captchaEnabled", captchaEnabled);
if (!captchaEnabled)
{
return ajax;
}
// 保存验证码信息
String uuid = IdUtils.simpleUUID();
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
String capStr = null, code = null;
BufferedImage image = null;
// 生成验证码
String captchaType = RuoYiConfig.getCaptchaType();
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(captchaType))
{
capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr);
}
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
// 转换流信息写出
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
try
{
ImageIO.write(image, "jpg", os);
}
catch (IOException e)
{
return AjaxResult.error(e.getMessage());
}
ajax.put("uuid", uuid);
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;
}
}

@ -0,0 +1,162 @@
package com.ruoyi.web.controller.common;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/common")
public class CommonController
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@Autowired
private ServerConfig serverConfig;
private static final String FILE_DELIMETER = ",";
/**
*
*
* @param fileName
* @param delete
*/
@GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
{
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
FileUtils.deleteFile(filePath);
}
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
/**
*
*/
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
*
*/
@PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files)
{
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
urls.add(url);
fileNames.add(fileName);
newFileNames.add(FileUtils.getName(fileName));
originalFilenames.add(file.getOriginalFilename());
}
AjaxResult ajax = AjaxResult.success();
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
*
*/
@GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + FileUtils.stripPrefix(resource);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
}

@ -0,0 +1,121 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysCache;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/cache")
public class CacheController
{
@Autowired
private RedisTemplate<String, String> redisTemplate;
private final static List<SysCache> caches = new ArrayList<SysCache>();
{
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getNames")
public AjaxResult cache()
{
return AjaxResult.success(caches);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getKeys/{cacheName}")
public AjaxResult getCacheKeys(@PathVariable String cacheName)
{
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(new TreeSet<>(cacheKeys));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getValue/{cacheName}/{cacheKey}")
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
{
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
return AjaxResult.success(sysCache);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheName/{cacheName}")
public AjaxResult clearCacheName(@PathVariable String cacheName)
{
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheKey/{cacheKey}")
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
{
redisTemplate.delete(cacheKey);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheAll")
public AjaxResult clearCacheAll()
{
Collection<String> cacheKeys = redisTemplate.keys("*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save