充值机信息和用户充值记录的逻辑实现以及用户充值卡账单明细和用户充值卡接口修改

This commit is contained in:
ALEI_ALEI 2024-12-19 15:07:12 +08:00
parent 6680df8ef0
commit c05bd421dc
20 changed files with 1118 additions and 24 deletions

View File

@ -0,0 +1,110 @@
package com.fastbee.data.controller.userRecharge;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.fastbee.common.annotation.Log;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.enums.BusinessType;
import com.fastbee.rechargecard.domain.NgRechargeMachines;
import com.fastbee.rechargecard.service.INgRechargeMachinesService;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo;
/**
* 充值机信息Controller
*
* @author kerwincui
* @date 2024-12-19
*/
@RestController
@RequestMapping("/rechargecard/machines")
@Api(tags = "充值机信息")
public class NgRechargeMachinesController extends BaseController
{
@Autowired
private INgRechargeMachinesService ngRechargeMachinesService;
/**
* 查询充值机信息列表
*/
@PreAuthorize("@ss.hasPermi('rechargecard:machines:list')")
@GetMapping("/list")
@ApiOperation("查询充值机信息列表")
public TableDataInfo list(NgRechargeMachines ngRechargeMachines)
{
startPage();
List<NgRechargeMachines> list = ngRechargeMachinesService.selectNgRechargeMachinesList(ngRechargeMachines);
return getDataTable(list);
}
/**
* 导出充值机信息列表
*/
@ApiOperation("导出充值机信息列表")
@PreAuthorize("@ss.hasPermi('rechargecard:machines:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, NgRechargeMachines ngRechargeMachines)
{
List<NgRechargeMachines> list = ngRechargeMachinesService.selectNgRechargeMachinesList(ngRechargeMachines);
ExcelUtil<NgRechargeMachines> util = new ExcelUtil<NgRechargeMachines>(NgRechargeMachines.class);
util.exportExcel(response, list, "充值机信息数据");
}
/**
* 获取充值机信息详细信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:machines:query')")
@GetMapping(value = "/{id}")
@ApiOperation("获取充值机信息详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(ngRechargeMachinesService.selectNgRechargeMachinesById(id));
}
/**
* 新增充值机信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:machines:add')")
@PostMapping
@ApiOperation("新增充值机信息")
public AjaxResult add(@RequestBody NgRechargeMachines ngRechargeMachines)
{
return toAjax(ngRechargeMachinesService.insertNgRechargeMachines(ngRechargeMachines));
}
/**
* 修改充值机信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:machines:edit')")
@PutMapping
@ApiOperation("修改充值机信息")
public AjaxResult edit(@RequestBody NgRechargeMachines ngRechargeMachines)
{
return toAjax(ngRechargeMachinesService.updateNgRechargeMachines(ngRechargeMachines));
}
/**
* 删除充值机信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:machines:remove')")
@DeleteMapping("/{ids}")
@ApiOperation("删除充值机信息")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(ngRechargeMachinesService.deleteNgRechargeMachinesByIds(ids));
}
}

View File

@ -0,0 +1,110 @@
package com.fastbee.data.controller.userRecharge;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.fastbee.common.annotation.Log;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.enums.BusinessType;
import com.fastbee.rechargecard.domain.NgUserRechargeRecords;
import com.fastbee.rechargecard.service.INgUserRechargeRecordsService;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo;
/**
* 用户充值记录Controller
*
* @author kerwincui
* @date 2024-12-19
*/
@RestController
@RequestMapping("/rechargecard/records")
@Api(tags = "用户充值记录")
public class NgUserRechargeRecordsController extends BaseController
{
@Autowired
private INgUserRechargeRecordsService ngUserRechargeRecordsService;
/**
* 查询用户充值记录列表
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:list')")
@GetMapping("/list")
@ApiOperation("查询用户充值记录列表")
public TableDataInfo list(NgUserRechargeRecords ngUserRechargeRecords)
{
startPage();
List<NgUserRechargeRecords> list = ngUserRechargeRecordsService.selectNgUserRechargeRecordsList(ngUserRechargeRecords);
return getDataTable(list);
}
/**
* 导出用户充值记录列表
*/
@ApiOperation("导出用户充值记录列表")
@PreAuthorize("@ss.hasPermi('rechargecard:records:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, NgUserRechargeRecords ngUserRechargeRecords)
{
List<NgUserRechargeRecords> list = ngUserRechargeRecordsService.selectNgUserRechargeRecordsList(ngUserRechargeRecords);
ExcelUtil<NgUserRechargeRecords> util = new ExcelUtil<NgUserRechargeRecords>(NgUserRechargeRecords.class);
util.exportExcel(response, list, "用户充值记录数据");
}
/**
* 获取用户充值记录详细信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:query')")
@GetMapping(value = "/{userId}")
@ApiOperation("获取用户充值记录详细信息")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return success(ngUserRechargeRecordsService.selectNgUserRechargeRecordsById(userId));
}
/**
* 新增用户充值记录
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:add')")
@PostMapping
@ApiOperation("新增用户充值记录")
public AjaxResult add(@RequestBody NgUserRechargeRecords ngUserRechargeRecords)
{
return toAjax(ngUserRechargeRecordsService.insertNgUserRechargeRecords(ngUserRechargeRecords));
}
/**
* 修改用户充值记录
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:edit')")
@PutMapping
@ApiOperation("修改用户充值记录")
public AjaxResult edit(@RequestBody NgUserRechargeRecords ngUserRechargeRecords)
{
return toAjax(ngUserRechargeRecordsService.updateNgUserRechargeRecords(ngUserRechargeRecords));
}
/**
* 删除用户充值记录
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:remove')")
@DeleteMapping("/{ids}")
@ApiOperation("删除用户充值记录")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(ngUserRechargeRecordsService.deleteNgUserRechargeRecordsByIds(ids));
}
}

View File

@ -65,13 +65,13 @@ public class UserIrrigationRecordController extends BaseController
/**
* 获取用户灌溉记录展示详细信息列表
*/
@PreAuthorize("@ss.hasPermi('rechargecard:record:query')")
/*@PreAuthorize("@ss.hasPermi('rechargecard:record:query')")
@GetMapping(value = "/list/show/{cardNumber}")
@ApiOperation("获取灌溉记录详细信息")
public AjaxResult getShowInfo(@PathVariable("cardNumber") String cardNumber)
{
return success(userIrrigationRecordService.selectUserIrrigationRecordListShowBycardNumber(cardNumber));
}
}*/
/**
* 导出灌溉记录列表

View File

@ -0,0 +1,76 @@
package com.fastbee.rechargecard.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
/**
* 充值机信息对象 ng_recharge_machines
*
* @author kerwincui
* @date 2024-12-19
*/
@ApiModel(value = "NgRechargeMachines",description = "充值机信息 ng_recharge_machines")
@Data
@EqualsAndHashCode(callSuper = true)
public class NgRechargeMachines extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 充值机id自增主键 */
private Long id;
/** 位置 */
@Excel(name = "位置")
@ApiModelProperty("位置")
private String location;
/** 设备型号 */
@Excel(name = "设备型号")
@ApiModelProperty("设备型号")
private String deviceModel;
/** 序列号 */
@Excel(name = "序列号")
@ApiModelProperty("序列号")
private String serialNumber;
/** 区域号 */
@Excel(name = "区域号")
@ApiModelProperty("区域号")
private String areaCode;
/** 安装日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("安装日期")
private Date installationDate;
/** 状态,0=正常1=维护中 */
@Excel(name = "状态,0=正常1=维护中")
@ApiModelProperty("状态,0=正常1=维护中")
private Integer status;
/** 联系人 */
@Excel(name = "联系人")
@ApiModelProperty("联系人")
private String contactPerson;
/** 联系电话 */
@Excel(name = "联系电话")
@ApiModelProperty("联系电话")
private String contactPhone;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty("备注")
private String remark;
}

View File

@ -0,0 +1,92 @@
package com.fastbee.rechargecard.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
/**
* 用户充值记录对象 ng_user_recharge_records
*
* @author kerwincui
* @date 2024-12-19
*/
@ApiModel(value = "NgUserRechargeRecords",description = "用户充值记录 ng_user_recharge_records")
@Data
@EqualsAndHashCode(callSuper = true)
public class NgUserRechargeRecords extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 用户id与用户表连接 */
@Excel(name = "用户id与用户表连接")
@ApiModelProperty("用户id与用户表连接")
private Long userId;
/** 用户名 */
@Excel(name = "用户名")
@ApiModelProperty("用户名")
private String userName;
/** 充值卡号 */
@Excel(name = "充值卡号")
@ApiModelProperty("充值卡号")
private String cardNumber;
/** 区域号 */
@Excel(name = "区域号")
@ApiModelProperty("区域号")
private String areaCode;
/** 充值类型0=充值机1=微信2=支付宝 */
@Excel(name = "充值类型0=充值机1=微信2=支付宝")
@ApiModelProperty("充值类型0=充值机1=微信2=支付宝")
private Integer type;
/** 充值金额 */
@Excel(name = "充值金额")
@ApiModelProperty("充值金额")
private BigDecimal amount;
/** 卡内余额(充值后余额) */
@Excel(name = "卡内余额", readConverterExp = "充=值后余额")
@ApiModelProperty("卡内余额")
private BigDecimal balance;
/** 充值时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "充值时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("充值时间")
private Date rechargeTime;
/** 充值编码 */
@Excel(name = "充值编码")
@ApiModelProperty("充值编码")
private String rechargeCode;
/** 充值状态,0=成功1=失败 */
@Excel(name = "充值状态,0=成功1=失败")
@ApiModelProperty("充值状态,0=成功1=失败")
private Integer status;
/** 充值机id */
@Excel(name = "充值机id")
@ApiModelProperty("充值机id")
private Long deviceId;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty("备注")
private String remark;
}

View File

@ -93,4 +93,9 @@ public class UserRechargeCards extends BaseEntity
@ApiModelProperty("终端用户id")
private Long userId;
/** 区域码 */
@Excel(name = "区域码")
@ApiModelProperty("区域码")
private String areaCode;
}

View File

@ -8,6 +8,7 @@ import java.util.Date;
public class UserIrrigationRecordDto
{
public Long id;
public String userName;
public String deviceName;
public String cardNumber;

View File

@ -0,0 +1,63 @@
package com.fastbee.rechargecard.mapper;
import java.util.List;
import com.fastbee.rechargecard.domain.NgRechargeMachines;
import org.apache.ibatis.annotations.Mapper;
/**
* 充值机信息Mapper接口
*
* @author kerwincui
* @date 2024-12-19
*/
@Mapper
public interface NgRechargeMachinesMapper
{
/**
* 查询充值机信息
*
* @param id 充值机信息主键
* @return 充值机信息
*/
public NgRechargeMachines selectNgRechargeMachinesById(Long id);
/**
* 查询充值机信息列表
*
* @param ngRechargeMachines 充值机信息
* @return 充值机信息集合
*/
public List<NgRechargeMachines> selectNgRechargeMachinesList(NgRechargeMachines ngRechargeMachines);
/**
* 新增充值机信息
*
* @param ngRechargeMachines 充值机信息
* @return 结果
*/
public int insertNgRechargeMachines(NgRechargeMachines ngRechargeMachines);
/**
* 修改充值机信息
*
* @param ngRechargeMachines 充值机信息
* @return 结果
*/
public int updateNgRechargeMachines(NgRechargeMachines ngRechargeMachines);
/**
* 删除充值机信息
*
* @param id 充值机信息主键
* @return 结果
*/
public int deleteNgRechargeMachinesById(Long id);
/**
* 批量删除充值机信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteNgRechargeMachinesByIds(Long[] ids);
}

View File

@ -0,0 +1,63 @@
package com.fastbee.rechargecard.mapper;
import java.util.List;
import com.fastbee.rechargecard.domain.NgUserRechargeRecords;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户充值记录Mapper接口
*
* @author kerwincui
* @date 2024-12-19
*/
@Mapper
public interface NgUserRechargeRecordsMapper
{
/**
* 查询用户充值记录
*
* @param userId 用户id
* @return 用户充值记录
*/
public NgUserRechargeRecords selectNgUserRechargeRecordsById(Long userId);
/**
* 查询用户充值记录列表
*
* @param ngUserRechargeRecords 用户充值记录
* @return 用户充值记录集合
*/
public List<NgUserRechargeRecords> selectNgUserRechargeRecordsList(NgUserRechargeRecords ngUserRechargeRecords);
/**
* 新增用户充值记录
*
* @param ngUserRechargeRecords 用户充值记录
* @return 结果
*/
public int insertNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords);
/**
* 修改用户充值记录
*
* @param ngUserRechargeRecords 用户充值记录
* @return 结果
*/
public int updateNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords);
/**
* 删除用户充值记录
*
* @param id 用户充值记录主键
* @return 结果
*/
public int deleteNgUserRechargeRecordsById(Long id);
/**
* 批量删除用户充值记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteNgUserRechargeRecordsByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.fastbee.rechargecard.service;
import java.util.List;
import com.fastbee.rechargecard.domain.NgRechargeMachines;
/**
* 充值机信息Service接口
*
* @author kerwincui
* @date 2024-12-19
*/
public interface INgRechargeMachinesService
{
/**
* 查询充值机信息
*
* @param id 充值机信息主键
* @return 充值机信息
*/
public NgRechargeMachines selectNgRechargeMachinesById(Long id);
/**
* 查询充值机信息列表
*
* @param ngRechargeMachines 充值机信息
* @return 充值机信息集合
*/
public List<NgRechargeMachines> selectNgRechargeMachinesList(NgRechargeMachines ngRechargeMachines);
/**
* 新增充值机信息
*
* @param ngRechargeMachines 充值机信息
* @return 结果
*/
public int insertNgRechargeMachines(NgRechargeMachines ngRechargeMachines);
/**
* 修改充值机信息
*
* @param ngRechargeMachines 充值机信息
* @return 结果
*/
public int updateNgRechargeMachines(NgRechargeMachines ngRechargeMachines);
/**
* 批量删除充值机信息
*
* @param ids 需要删除的充值机信息主键集合
* @return 结果
*/
public int deleteNgRechargeMachinesByIds(Long[] ids);
/**
* 删除充值机信息信息
*
* @param id 充值机信息主键
* @return 结果
*/
public int deleteNgRechargeMachinesById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.fastbee.rechargecard.service;
import java.util.List;
import com.fastbee.rechargecard.domain.NgUserRechargeRecords;
/**
* 用户充值记录Service接口
*
* @author kerwincui
* @date 2024-12-19
*/
public interface INgUserRechargeRecordsService
{
/**
* 查询用户充值记录
*
* @param userId 用户id
* @return 用户充值记录
*/
public NgUserRechargeRecords selectNgUserRechargeRecordsById(Long userId);
/**
* 查询用户充值记录列表
*
* @param ngUserRechargeRecords 用户充值记录
* @return 用户充值记录集合
*/
public List<NgUserRechargeRecords> selectNgUserRechargeRecordsList(NgUserRechargeRecords ngUserRechargeRecords);
/**
* 新增用户充值记录
*
* @param ngUserRechargeRecords 用户充值记录
* @return 结果
*/
public int insertNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords);
/**
* 修改用户充值记录
*
* @param ngUserRechargeRecords 用户充值记录
* @return 结果
*/
public int updateNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords);
/**
* 批量删除用户充值记录
*
* @param ids 需要删除的用户充值记录主键集合
* @return 结果
*/
public int deleteNgUserRechargeRecordsByIds(Long[] ids);
/**
* 删除用户充值记录信息
*
* @param id 用户充值记录主键
* @return 结果
*/
public int deleteNgUserRechargeRecordsById(Long id);
}

View File

@ -18,7 +18,7 @@ public interface IUserIrrigationRecordService
* @param cardNumber 卡号
* @return 灌溉记录
*/
public List<UserIrrigationRecordDto> selectUserIrrigationRecordListShowBycardNumber(String cardNumber);
//public List<UserIrrigationRecordDto> selectUserIrrigationRecordListShowBycardNumber(String cardNumber);
/**
* 查询用户灌溉记录列表
@ -26,7 +26,7 @@ public interface IUserIrrigationRecordService
* @param cardNumber 卡号
* @return 灌溉记录
*/
public List<UserIrrigationRecord> selectUserIrrigationRecordListBycardNumber(String cardNumber);
public List<UserIrrigationRecordDto> selectUserIrrigationRecordListBycardNumber(String cardNumber);
/**
* 查询灌溉记录

View File

@ -0,0 +1,96 @@
package com.fastbee.rechargecard.service.impl;
import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.rechargecard.mapper.NgRechargeMachinesMapper;
import com.fastbee.rechargecard.domain.NgRechargeMachines;
import com.fastbee.rechargecard.service.INgRechargeMachinesService;
/**
* 充值机信息Service业务层处理
*
* @author kerwincui
* @date 2024-12-19
*/
@Service
public class NgRechargeMachinesServiceImpl implements INgRechargeMachinesService
{
@Autowired
private NgRechargeMachinesMapper ngRechargeMachinesMapper;
/**
* 查询充值机信息
*
* @param id 充值机信息主键
* @return 充值机信息
*/
@Override
public NgRechargeMachines selectNgRechargeMachinesById(Long id)
{
return ngRechargeMachinesMapper.selectNgRechargeMachinesById(id);
}
/**
* 查询充值机信息列表
*
* @param ngRechargeMachines 充值机信息
* @return 充值机信息
*/
@Override
public List<NgRechargeMachines> selectNgRechargeMachinesList(NgRechargeMachines ngRechargeMachines)
{
return ngRechargeMachinesMapper.selectNgRechargeMachinesList(ngRechargeMachines);
}
/**
* 新增充值机信息
*
* @param ngRechargeMachines 充值机信息
* @return 结果
*/
@Override
public int insertNgRechargeMachines(NgRechargeMachines ngRechargeMachines)
{
ngRechargeMachines.setCreateTime(DateUtils.getNowDate());
return ngRechargeMachinesMapper.insertNgRechargeMachines(ngRechargeMachines);
}
/**
* 修改充值机信息
*
* @param ngRechargeMachines 充值机信息
* @return 结果
*/
@Override
public int updateNgRechargeMachines(NgRechargeMachines ngRechargeMachines)
{
ngRechargeMachines.setUpdateTime(DateUtils.getNowDate());
return ngRechargeMachinesMapper.updateNgRechargeMachines(ngRechargeMachines);
}
/**
* 批量删除充值机信息
*
* @param ids 需要删除的充值机信息主键
* @return 结果
*/
@Override
public int deleteNgRechargeMachinesByIds(Long[] ids)
{
return ngRechargeMachinesMapper.deleteNgRechargeMachinesByIds(ids);
}
/**
* 删除充值机信息信息
*
* @param id 充值机信息主键
* @return 结果
*/
@Override
public int deleteNgRechargeMachinesById(Long id)
{
return ngRechargeMachinesMapper.deleteNgRechargeMachinesById(id);
}
}

View File

@ -0,0 +1,96 @@
package com.fastbee.rechargecard.service.impl;
import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.rechargecard.mapper.NgUserRechargeRecordsMapper;
import com.fastbee.rechargecard.domain.NgUserRechargeRecords;
import com.fastbee.rechargecard.service.INgUserRechargeRecordsService;
/**
* 用户充值记录Service业务层处理
*
* @author kerwincui
* @date 2024-12-19
*/
@Service
public class NgUserRechargeRecordsServiceImpl implements INgUserRechargeRecordsService
{
@Autowired
private NgUserRechargeRecordsMapper ngUserRechargeRecordsMapper;
/**
* 查询用户充值记录
*
* @param userId 用户id
* @return 用户充值记录
*/
@Override
public NgUserRechargeRecords selectNgUserRechargeRecordsById(Long userId)
{
return ngUserRechargeRecordsMapper.selectNgUserRechargeRecordsById(userId);
}
/**
* 查询用户充值记录列表
*
* @param ngUserRechargeRecords 用户充值记录
* @return 用户充值记录
*/
@Override
public List<NgUserRechargeRecords> selectNgUserRechargeRecordsList(NgUserRechargeRecords ngUserRechargeRecords)
{
return ngUserRechargeRecordsMapper.selectNgUserRechargeRecordsList(ngUserRechargeRecords);
}
/**
* 新增用户充值记录
*
* @param ngUserRechargeRecords 用户充值记录
* @return 结果
*/
@Override
public int insertNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords)
{
ngUserRechargeRecords.setCreateTime(DateUtils.getNowDate());
return ngUserRechargeRecordsMapper.insertNgUserRechargeRecords(ngUserRechargeRecords);
}
/**
* 修改用户充值记录
*
* @param ngUserRechargeRecords 用户充值记录
* @return 结果
*/
@Override
public int updateNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords)
{
ngUserRechargeRecords.setUpdateTime(DateUtils.getNowDate());
return ngUserRechargeRecordsMapper.updateNgUserRechargeRecords(ngUserRechargeRecords);
}
/**
* 批量删除用户充值记录
*
* @param ids 需要删除的用户充值记录主键
* @return 结果
*/
@Override
public int deleteNgUserRechargeRecordsByIds(Long[] ids)
{
return ngUserRechargeRecordsMapper.deleteNgUserRechargeRecordsByIds(ids);
}
/**
* 删除用户充值记录信息
*
* @param id 用户充值记录主键
* @return 结果
*/
@Override
public int deleteNgUserRechargeRecordsById(Long id)
{
return ngUserRechargeRecordsMapper.deleteNgUserRechargeRecordsById(id);
}
}

View File

@ -34,24 +34,15 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
* @return
*/
@Override
public List<UserIrrigationRecord> selectUserIrrigationRecordListBycardNumber(String cardNumber)
{
return userIrrigationRecordMapper.selectUserIrrigationRecordListBycardNumber(cardNumber);
}
/**
* 获取用户灌溉记录展示数据列表
* @param cardNumber 卡号
* @return
*/
@Override
public List<UserIrrigationRecordDto> selectUserIrrigationRecordListShowBycardNumber(String cardNumber)
public List<UserIrrigationRecordDto> selectUserIrrigationRecordListBycardNumber(String cardNumber)
{
//return userIrrigationRecordMapper.selectUserIrrigationRecordListBycardNumber(cardNumber);
List<UserIrrigationRecordDto> result=new ArrayList<>();
List<UserIrrigationRecord> list=userIrrigationRecordMapper.selectUserIrrigationRecordListBycardNumber(cardNumber);
for(int i=0;i<list.size();i++)
{
UserIrrigationRecordDto temp=new UserIrrigationRecordDto();
temp.id=list.get(i).getId();
temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName();
temp.deviceName=deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName();
temp.cardNumber=list.get(i).getCardNumber();
@ -64,6 +55,32 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
return result;
}
/**
* 获取用户灌溉记录展示数据列表
* @param cardNumber 卡号
* @return
*/
/*@Override
public List<UserIrrigationRecordDto> selectUserIrrigationRecordListShowBycardNumber(String cardNumber)
{
List<UserIrrigationRecordDto> result=new ArrayList<>();
List<UserIrrigationRecord> list=userIrrigationRecordMapper.selectUserIrrigationRecordListBycardNumber(cardNumber);
for(int i=0;i<list.size();i++)
{
UserIrrigationRecordDto temp=new UserIrrigationRecordDto();
temp.id=list.get(i).getId();
temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName();
temp.deviceName=deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName();
temp.cardNumber=list.get(i).getCardNumber();
temp.flow=list.get(i).getCurFlow();
temp.startTime=list.get(i).getStartTime();
temp.endTime=list.get(i).getEndTime();
result.add(temp);
}
return result;
}*/
/**
* 查询灌溉记录
*

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fastbee.rechargecard.mapper.NgRechargeMachinesMapper">
<resultMap type="NgRechargeMachines" id="NgRechargeMachinesResult">
<result property="id" column="id" />
<result property="location" column="location" />
<result property="deviceModel" column="device_model" />
<result property="serialNumber" column="serial_number" />
<result property="areaCode" column="area_code" />
<result property="installationDate" column="installation_date" />
<result property="status" column="status" />
<result property="contactPerson" column="contact_person" />
<result property="contactPhone" column="contact_phone" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectNgRechargeMachinesVo">
select id, location, device_model, serial_number, area_code, installation_date, status, contact_person, contact_phone, remark, create_time, update_time, create_by, update_by from ng_recharge_machines
</sql>
<select id="selectNgRechargeMachinesList" parameterType="NgRechargeMachines" resultMap="NgRechargeMachinesResult">
<include refid="selectNgRechargeMachinesVo"/>
<where>
<if test="location != null and location != ''"> and location = #{location}</if>
<if test="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
<if test="installationDate != null "> and installation_date = #{installationDate}</if>
<if test="status != null "> and status = #{status}</if>
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
</where>
</select>
<select id="selectNgRechargeMachinesById" parameterType="Long" resultMap="NgRechargeMachinesResult">
<include refid="selectNgRechargeMachinesVo"/>
where id = #{id}
</select>
<insert id="insertNgRechargeMachines" parameterType="NgRechargeMachines" useGeneratedKeys="true" keyProperty="id">
insert into ng_recharge_machines
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="location != null">location,</if>
<if test="deviceModel != null">device_model,</if>
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
<if test="areaCode != null">area_code,</if>
<if test="installationDate != null">installation_date,</if>
<if test="status != null">status,</if>
<if test="contactPerson != null">contact_person,</if>
<if test="contactPhone != null">contact_phone,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="location != null">#{location},</if>
<if test="deviceModel != null">#{deviceModel},</if>
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="installationDate != null">#{installationDate},</if>
<if test="status != null">#{status},</if>
<if test="contactPerson != null">#{contactPerson},</if>
<if test="contactPhone != null">#{contactPhone},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateNgRechargeMachines" parameterType="NgRechargeMachines">
update ng_recharge_machines
<trim prefix="SET" suffixOverrides=",">
<if test="location != null">location = #{location},</if>
<if test="deviceModel != null">device_model = #{deviceModel},</if>
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="installationDate != null">installation_date = #{installationDate},</if>
<if test="status != null">status = #{status},</if>
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNgRechargeMachinesById" parameterType="Long">
delete from ng_recharge_machines where id = #{id}
</delete>
<delete id="deleteNgRechargeMachinesByIds" parameterType="String">
delete from ng_recharge_machines where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fastbee.rechargecard.mapper.NgUserRechargeRecordsMapper">
<resultMap type="NgUserRechargeRecords" id="NgUserRechargeRecordsResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="cardNumber" column="card_number" />
<result property="areaCode" column="area_code" />
<result property="type" column="type" />
<result property="amount" column="amount" />
<result property="balance" column="balance" />
<result property="rechargeTime" column="recharge_time" />
<result property="rechargeCode" column="recharge_code" />
<result property="status" column="status" />
<result property="deviceId" column="device_id" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectNgUserRechargeRecordsVo">
select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, device_id, remark, create_time, update_time, create_by, update_by from ng_user_recharge_records
</sql>
<select id="selectNgUserRechargeRecordsList" parameterType="NgUserRechargeRecords" resultMap="NgUserRechargeRecordsResult">
<include refid="selectNgUserRechargeRecordsVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="cardNumber != null and cardNumber != ''"> and card_number = #{cardNumber}</if>
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
<if test="type != null "> and type = #{type}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="balance != null "> and balance = #{balance}</if>
<if test="rechargeTime != null "> and recharge_time = #{rechargeTime}</if>
<if test="rechargeCode != null and rechargeCode != ''"> and recharge_code = #{rechargeCode}</if>
<if test="status != null "> and status = #{status}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
</where>
</select>
<select id="selectNgUserRechargeRecordsById" parameterType="Long" resultMap="NgUserRechargeRecordsResult">
<include refid="selectNgUserRechargeRecordsVo"/>
where user_id = #{userId}
</select>
<insert id="insertNgUserRechargeRecords" parameterType="NgUserRechargeRecords" useGeneratedKeys="true" keyProperty="id">
insert into ng_user_recharge_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="userName != null">user_name,</if>
<if test="cardNumber != null and cardNumber != ''">card_number,</if>
<if test="areaCode != null">area_code,</if>
<if test="type != null">type,</if>
<if test="amount != null">amount,</if>
<if test="balance != null">balance,</if>
<if test="rechargeTime != null">recharge_time,</if>
<if test="rechargeCode != null">recharge_code,</if>
<if test="status != null">status,</if>
<if test="deviceId != null">device_id,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="userName != null">#{userName},</if>
<if test="cardNumber != null and cardNumber != ''">#{cardNumber},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="type != null">#{type},</if>
<if test="amount != null">#{amount},</if>
<if test="balance != null">#{balance},</if>
<if test="rechargeTime != null">#{rechargeTime},</if>
<if test="rechargeCode != null">#{rechargeCode},</if>
<if test="status != null">#{status},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateNgUserRechargeRecords" parameterType="NgUserRechargeRecords">
update ng_user_recharge_records
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="cardNumber != null and cardNumber != ''">card_number = #{cardNumber},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="type != null">type = #{type},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="balance != null">balance = #{balance},</if>
<if test="rechargeTime != null">recharge_time = #{rechargeTime},</if>
<if test="rechargeCode != null">recharge_code = #{rechargeCode},</if>
<if test="status != null">status = #{status},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNgUserRechargeRecordsById" parameterType="Long">
delete from ng_user_recharge_records where id = #{id}
</delete>
<delete id="deleteNgUserRechargeRecordsByIds" parameterType="String">
delete from ng_user_recharge_records where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -27,7 +27,7 @@
<result property="paymentMethod" column="payment_method" />
<result property="paymentTime" column="payment_time" />
<result property="status" column="status" />
<result property="remarks" column="remarks" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
@ -35,7 +35,7 @@
</resultMap>
<sql id="selectUserConsumptionDetailsVo">
select id, user_id, device_number, card_number, project_id, dept_id, billing_type, pump_time, unit_price, total_price, discount, tax_amount, amount_due, billing_period_unit, billing_period_duration, billing_date, start_time, end_time, payment_status, payment_method, payment_time, status, remarks, create_time, update_time, create_by, update_by from user_consumption_details
select id, user_id, device_number, card_number, project_id, dept_id, billing_type, pump_time, unit_price, total_price, discount, tax_amount, amount_due, billing_period_unit, billing_period_duration, billing_date, start_time, end_time, payment_status, payment_method, payment_time, status, remark, create_time, update_time, create_by, update_by from user_consumption_details
</sql>
<select id="selectUserConsumptionDetailsList" parameterType="UserConsumptionDetails" resultMap="UserConsumptionDetailsResult">
@ -62,7 +62,7 @@
<if test="paymentMethod != null "> and payment_method = #{paymentMethod}</if>
<if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
<if test="status != null "> and status = #{status}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
</where>
</select>
@ -102,7 +102,7 @@
<if test="paymentMethod != null">payment_method,</if>
<if test="paymentTime != null">payment_time,</if>
<if test="status != null">status,</if>
<if test="remarks != null">remarks,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
@ -130,7 +130,7 @@
<if test="paymentMethod != null">#{paymentMethod},</if>
<if test="paymentTime != null">#{paymentTime},</if>
<if test="status != null">#{status},</if>
<if test="remarks != null">#{remarks},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
@ -162,7 +162,7 @@
<if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
<if test="paymentTime != null">payment_time = #{paymentTime},</if>
<if test="status != null">status = #{status},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>

View File

@ -57,10 +57,11 @@
<select id="selectUserIrrigationRecordListBycardNumber" parameterType="String" resultMap="UserIrrigationRecordResult">
<include refid="selectUserIrrigationRecordVo"/>
<where>
card_number=#{cardNumber}
<if test="cardNumber != null and cardNumber != ''"> card_number = #{cardNumber}</if>
</where>
</select>
<select id="selectUserIrrigationRecordById" parameterType="Long" resultMap="UserIrrigationRecordResult">
<include refid="selectUserIrrigationRecordVo"/>
where id = #{id}

View File

@ -23,10 +23,11 @@
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
<result property="userId" column="user_id" />
<result property="areaCode" column="area_code" />
</resultMap>
<sql id="selectUserRechargeCardsVo">
select id, user_name, name, phone, project_id, dept_id, balance, card_number, card_password, issue_date, expiration_date, status, create_time, update_time, create_by, update_by, del_flag, user_id from user_recharge_cards
select id, user_name, name, phone, project_id, dept_id, balance, card_number, card_password, issue_date, expiration_date, status, create_time, update_time, create_by, update_by, del_flag, user_id, area_code from user_recharge_cards
</sql>
<select id="selectUserRechargeCardsList" parameterType="UserRechargeCards" resultMap="UserRechargeCardsResult">
@ -44,6 +45,7 @@
<if test="expirationDate != null "> and expiration_date = #{expirationDate}</if>
<if test="status != null "> and status = #{status}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="areaCode != null "> and area_code = #{areaCode}</if>
</where>
</select>
@ -72,6 +74,7 @@
<if test="updateBy != null">update_by,</if>
<if test="delFlag != null">del_flag,</if>
<if test="userId != null">user_id,</if>
<if test="areaCode != null ">area_code </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userName != null">#{userName},</if>
@ -91,6 +94,7 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="userId != null">#{userId},</if>
<if test="areaCode != null ">#{areaCode}</if>
</trim>
</insert>
@ -114,6 +118,7 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="areaCode != null "> area_code = #{areaCode}</if>
</trim>
where id = #{id}
</update>