diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtHardwareVersionController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtHardwareVersionController.java new file mode 100644 index 0000000..ccd56eb --- /dev/null +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtHardwareVersionController.java @@ -0,0 +1,104 @@ +package com.ruoyi.web.controller.system; + +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.system.domain.EtHardwareVersion; +import com.ruoyi.system.service.IEtHardwareVersionService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 硬件版本Controller + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +@RestController +@RequestMapping("/system/hardwareVersion") +public class EtHardwareVersionController extends BaseController +{ + @Autowired + private IEtHardwareVersionService etHardwareVersionService; + + /** + * 查询硬件版本列表 + */ + @PreAuthorize("@ss.hasPermi('system:hardwareVersion:list')") + @GetMapping("/list") + public TableDataInfo list(EtHardwareVersion etHardwareVersion) + { + startPage(); + List list = etHardwareVersionService.selectEtHardwareVersionList(etHardwareVersion); + return getDataTable(list); + } + + /** + * 导出硬件版本列表 + */ + @PreAuthorize("@ss.hasPermi('system:hardwareVersion:export')") + @Log(title = "硬件版本", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EtHardwareVersion etHardwareVersion) + { + List list = etHardwareVersionService.selectEtHardwareVersionList(etHardwareVersion); + ExcelUtil util = new ExcelUtil(EtHardwareVersion.class); + util.exportExcel(response, list, "硬件版本数据"); + } + + /** + * 获取硬件版本详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:hardwareVersion:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(etHardwareVersionService.selectEtHardwareVersionById(id)); + } + + /** + * 新增硬件版本 + */ + @PreAuthorize("@ss.hasPermi('system:hardwareVersion:add')") + @Log(title = "硬件版本", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EtHardwareVersion etHardwareVersion) + { + return toAjax(etHardwareVersionService.insertEtHardwareVersion(etHardwareVersion)); + } + + /** + * 修改硬件版本 + */ + @PreAuthorize("@ss.hasPermi('system:hardwareVersion:edit')") + @Log(title = "硬件版本", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EtHardwareVersion etHardwareVersion) + { + return toAjax(etHardwareVersionService.updateEtHardwareVersion(etHardwareVersion)); + } + + /** + * 删除硬件版本 + */ + @PreAuthorize("@ss.hasPermi('system:hardwareVersion:remove')") + @Log(title = "硬件版本", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(etHardwareVersionService.deleteEtHardwareVersionByIds(ids)); + } +} diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOperatingAreaController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOperatingAreaController.java index 657781e..f99f742 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOperatingAreaController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOperatingAreaController.java @@ -9,7 +9,9 @@ import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.EtModel; import com.ruoyi.system.domain.EtOperatingArea; +import com.ruoyi.system.mapper.EtModelMapper; import com.ruoyi.system.service.IEtFeeRuleService; import com.ruoyi.system.service.IEtOperatingAreaService; import com.ruoyi.system.service.IWxPayService; @@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -39,6 +42,9 @@ public class EtOperatingAreaController extends BaseController @Autowired private IWxPayService wxPayService; + @Resource + private EtModelMapper etModelMapper; + /** * 查询运营区列表 @@ -136,4 +142,34 @@ public class EtOperatingAreaController extends BaseController List etOperatingAreas = etOperatingAreaService.selectAreaAll(); return success(etOperatingAreas); } + + /** + * 根据运营商id获取运营商列表 + */ + @GetMapping("/selectAreaListByDeptId/{deptId}") + public AjaxResult selectAreaListByDeptId(@PathVariable("deptId") Long deptId) + { + AjaxResult ajax = AjaxResult.success(); + ajax.put("areaList", etOperatingAreaService.selectAreaListByDeptId2(deptId)); + EtModel model = new EtModel(); + model.setOperator(deptId); + ajax.put("modelList", etModelMapper.selectEtModelList(model)); + return success(ajax); + } + + /** + * 根据运营区id获取运营商 + */ + @GetMapping("/selectDeptByAreaId/{areaId}") + public AjaxResult selectDeptByAreaId(@PathVariable("areaId") Long areaId) + { + AjaxResult ajax = AjaxResult.success(); + SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId); + ajax.put("sysDept",sysDept); + EtModel model = new EtModel(); + model.setOperator(sysDept.getDeptId()); + ajax.put("modelList", etModelMapper.selectEtModelList(model)); + return success(ajax); + } + } diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtSoftwareVersionController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtSoftwareVersionController.java new file mode 100644 index 0000000..418d8b3 --- /dev/null +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtSoftwareVersionController.java @@ -0,0 +1,104 @@ +package com.ruoyi.web.controller.system; + +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.system.domain.EtSoftwareVersion; +import com.ruoyi.system.service.IEtSoftwareVersionService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 软件版本Controller + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +@RestController +@RequestMapping("/system/softwareVersion") +public class EtSoftwareVersionController extends BaseController +{ + @Autowired + private IEtSoftwareVersionService etSoftwareVersionService; + + /** + * 查询软件版本列表 + */ + @PreAuthorize("@ss.hasPermi('system:softwareVersion:list')") + @GetMapping("/list") + public TableDataInfo list(EtSoftwareVersion etSoftwareVersion) + { + startPage(); + List list = etSoftwareVersionService.selectEtSoftwareVersionList(etSoftwareVersion); + return getDataTable(list); + } + + /** + * 导出软件版本列表 + */ + @PreAuthorize("@ss.hasPermi('system:softwareVersion:export')") + @Log(title = "软件版本", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EtSoftwareVersion etSoftwareVersion) + { + List list = etSoftwareVersionService.selectEtSoftwareVersionList(etSoftwareVersion); + ExcelUtil util = new ExcelUtil(EtSoftwareVersion.class); + util.exportExcel(response, list, "软件版本数据"); + } + + /** + * 获取软件版本详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:softwareVersion:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(etSoftwareVersionService.selectEtSoftwareVersionById(id)); + } + + /** + * 新增软件版本 + */ + @PreAuthorize("@ss.hasPermi('system:softwareVersion:add')") + @Log(title = "软件版本", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EtSoftwareVersion etSoftwareVersion) + { + return toAjax(etSoftwareVersionService.insertEtSoftwareVersion(etSoftwareVersion)); + } + + /** + * 修改软件版本 + */ + @PreAuthorize("@ss.hasPermi('system:softwareVersion:edit')") + @Log(title = "软件版本", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EtSoftwareVersion etSoftwareVersion) + { + return toAjax(etSoftwareVersionService.updateEtSoftwareVersion(etSoftwareVersion)); + } + + /** + * 删除软件版本 + */ + @PreAuthorize("@ss.hasPermi('system:softwareVersion:remove')") + @Log(title = "软件版本", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(etSoftwareVersionService.deleteEtSoftwareVersionByIds(ids)); + } +} diff --git a/electripper-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/electripper-generator/src/main/resources/mapper/generator/GenTableMapper.xml index 253212e..31a27bf 100644 --- a/electripper-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ b/electripper-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -53,11 +53,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table - + - + - + - + - + - + - + insert into gen_table ( table_name, @@ -170,11 +171,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sysdate() ) - + ${sql} - + update gen_table @@ -199,12 +200,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where table_id = #{tableId} - + - delete from gen_table where table_id in + delete from gen_table where table_id in #{tableId} - \ No newline at end of file + diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java b/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java index 2bddb13..4f27401 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java @@ -154,6 +154,10 @@ public class AsDevice extends BaseEntityPlus implements Serializable { @Excel(name = "车辆型号") private Long modelId; + /** 硬件版本id */ + @Excel(name = "硬件版本id") + private Long hardwareVersionId; + /** 型号 */ @Excel(name = "型号") @TableField(exist = false) diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtHardwareVersion.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtHardwareVersion.java new file mode 100644 index 0000000..9f638e6 --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtHardwareVersion.java @@ -0,0 +1,39 @@ +package com.ruoyi.system.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 硬件版本对象 et_hardware_version + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +@Data +public class EtHardwareVersion extends BaseEntity{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 版本号 */ + @Excel(name = "版本号") + private String version; + + /** 生产时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date productionTime; + + /** 数量 */ + @Excel(name = "数量") + private Integer quantity; + + /** 版本说明 */ + @Excel(name = "版本说明") + private String instructions; +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtSoftwareVersion.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtSoftwareVersion.java new file mode 100644 index 0000000..7fb79ba --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtSoftwareVersion.java @@ -0,0 +1,27 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * 软件版本对象 et_software_version + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +@Data +public class EtSoftwareVersion extends BaseEntity{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 版本号 */ + @Excel(name = "版本号") + private String version; + + /** 更新内容 */ + @Excel(name = "更新内容") + private String content; +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtHardwareVersionMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtHardwareVersionMapper.java new file mode 100644 index 0000000..b296006 --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtHardwareVersionMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.EtHardwareVersion; + +/** + * 硬件版本Mapper接口 + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +public interface EtHardwareVersionMapper +{ + /** + * 查询硬件版本 + * + * @param id 硬件版本主键 + * @return 硬件版本 + */ + public EtHardwareVersion selectEtHardwareVersionById(Long id); + + /** + * 查询硬件版本列表 + * + * @param etHardwareVersion 硬件版本 + * @return 硬件版本集合 + */ + public List selectEtHardwareVersionList(EtHardwareVersion etHardwareVersion); + + /** + * 新增硬件版本 + * + * @param etHardwareVersion 硬件版本 + * @return 结果 + */ + public int insertEtHardwareVersion(EtHardwareVersion etHardwareVersion); + + /** + * 修改硬件版本 + * + * @param etHardwareVersion 硬件版本 + * @return 结果 + */ + public int updateEtHardwareVersion(EtHardwareVersion etHardwareVersion); + + /** + * 删除硬件版本 + * + * @param id 硬件版本主键 + * @return 结果 + */ + public int deleteEtHardwareVersionById(Long id); + + /** + * 批量删除硬件版本 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEtHardwareVersionByIds(Long[] ids); +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtSoftwareVersionMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtSoftwareVersionMapper.java new file mode 100644 index 0000000..518e351 --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtSoftwareVersionMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.EtSoftwareVersion; + +/** + * 软件版本Mapper接口 + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +public interface EtSoftwareVersionMapper +{ + /** + * 查询软件版本 + * + * @param id 软件版本主键 + * @return 软件版本 + */ + public EtSoftwareVersion selectEtSoftwareVersionById(Long id); + + /** + * 查询软件版本列表 + * + * @param etSoftwareVersion 软件版本 + * @return 软件版本集合 + */ + public List selectEtSoftwareVersionList(EtSoftwareVersion etSoftwareVersion); + + /** + * 新增软件版本 + * + * @param etSoftwareVersion 软件版本 + * @return 结果 + */ + public int insertEtSoftwareVersion(EtSoftwareVersion etSoftwareVersion); + + /** + * 修改软件版本 + * + * @param etSoftwareVersion 软件版本 + * @return 结果 + */ + public int updateEtSoftwareVersion(EtSoftwareVersion etSoftwareVersion); + + /** + * 删除软件版本 + * + * @param id 软件版本主键 + * @return 结果 + */ + public int deleteEtSoftwareVersionById(Long id); + + /** + * 批量删除软件版本 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEtSoftwareVersionByIds(Long[] ids); +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtHardwareVersionService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtHardwareVersionService.java new file mode 100644 index 0000000..4052ac0 --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtHardwareVersionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.EtHardwareVersion; + +/** + * 硬件版本Service接口 + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +public interface IEtHardwareVersionService +{ + /** + * 查询硬件版本 + * + * @param id 硬件版本主键 + * @return 硬件版本 + */ + public EtHardwareVersion selectEtHardwareVersionById(Long id); + + /** + * 查询硬件版本列表 + * + * @param etHardwareVersion 硬件版本 + * @return 硬件版本集合 + */ + public List selectEtHardwareVersionList(EtHardwareVersion etHardwareVersion); + + /** + * 新增硬件版本 + * + * @param etHardwareVersion 硬件版本 + * @return 结果 + */ + public int insertEtHardwareVersion(EtHardwareVersion etHardwareVersion); + + /** + * 修改硬件版本 + * + * @param etHardwareVersion 硬件版本 + * @return 结果 + */ + public int updateEtHardwareVersion(EtHardwareVersion etHardwareVersion); + + /** + * 批量删除硬件版本 + * + * @param ids 需要删除的硬件版本主键集合 + * @return 结果 + */ + public int deleteEtHardwareVersionByIds(Long[] ids); + + /** + * 删除硬件版本信息 + * + * @param id 硬件版本主键 + * @return 结果 + */ + public int deleteEtHardwareVersionById(Long id); +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtSoftwareVersionService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtSoftwareVersionService.java new file mode 100644 index 0000000..516ca98 --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtSoftwareVersionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.EtSoftwareVersion; + +/** + * 软件版本Service接口 + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +public interface IEtSoftwareVersionService +{ + /** + * 查询软件版本 + * + * @param id 软件版本主键 + * @return 软件版本 + */ + public EtSoftwareVersion selectEtSoftwareVersionById(Long id); + + /** + * 查询软件版本列表 + * + * @param etSoftwareVersion 软件版本 + * @return 软件版本集合 + */ + public List selectEtSoftwareVersionList(EtSoftwareVersion etSoftwareVersion); + + /** + * 新增软件版本 + * + * @param etSoftwareVersion 软件版本 + * @return 结果 + */ + public int insertEtSoftwareVersion(EtSoftwareVersion etSoftwareVersion); + + /** + * 修改软件版本 + * + * @param etSoftwareVersion 软件版本 + * @return 结果 + */ + public int updateEtSoftwareVersion(EtSoftwareVersion etSoftwareVersion); + + /** + * 批量删除软件版本 + * + * @param ids 需要删除的软件版本主键集合 + * @return 结果 + */ + public int deleteEtSoftwareVersionByIds(Long[] ids); + + /** + * 删除软件版本信息 + * + * @param id 软件版本主键 + * @return 结果 + */ + public int deleteEtSoftwareVersionById(Long id); +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtHardwareVersionServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtHardwareVersionServiceImpl.java new file mode 100644 index 0000000..a23ce1e --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtHardwareVersionServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.system.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.system.mapper.EtHardwareVersionMapper; +import com.ruoyi.system.domain.EtHardwareVersion; +import com.ruoyi.system.service.IEtHardwareVersionService; + +/** + * 硬件版本Service业务层处理 + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +@Service +public class EtHardwareVersionServiceImpl implements IEtHardwareVersionService +{ + @Autowired + private EtHardwareVersionMapper etHardwareVersionMapper; + + /** + * 查询硬件版本 + * + * @param id 硬件版本主键 + * @return 硬件版本 + */ + @Override + public EtHardwareVersion selectEtHardwareVersionById(Long id) + { + return etHardwareVersionMapper.selectEtHardwareVersionById(id); + } + + /** + * 查询硬件版本列表 + * + * @param etHardwareVersion 硬件版本 + * @return 硬件版本 + */ + @Override + public List selectEtHardwareVersionList(EtHardwareVersion etHardwareVersion) + { + return etHardwareVersionMapper.selectEtHardwareVersionList(etHardwareVersion); + } + + /** + * 新增硬件版本 + * + * @param etHardwareVersion 硬件版本 + * @return 结果 + */ + @Override + public int insertEtHardwareVersion(EtHardwareVersion etHardwareVersion) + { + etHardwareVersion.setCreateTime(DateUtils.getNowDate()); + return etHardwareVersionMapper.insertEtHardwareVersion(etHardwareVersion); + } + + /** + * 修改硬件版本 + * + * @param etHardwareVersion 硬件版本 + * @return 结果 + */ + @Override + public int updateEtHardwareVersion(EtHardwareVersion etHardwareVersion) + { + return etHardwareVersionMapper.updateEtHardwareVersion(etHardwareVersion); + } + + /** + * 批量删除硬件版本 + * + * @param ids 需要删除的硬件版本主键 + * @return 结果 + */ + @Override + public int deleteEtHardwareVersionByIds(Long[] ids) + { + return etHardwareVersionMapper.deleteEtHardwareVersionByIds(ids); + } + + /** + * 删除硬件版本信息 + * + * @param id 硬件版本主键 + * @return 结果 + */ + @Override + public int deleteEtHardwareVersionById(Long id) + { + return etHardwareVersionMapper.deleteEtHardwareVersionById(id); + } +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java index f2cf0c1..43e3d73 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java @@ -1416,7 +1416,7 @@ public class EtOrderServiceImpl implements IEtOrderService } SysDept sysDept = wxPayService.getDeptObjByAreaId(etOrder1.getAreaId()); BigDecimal subtract = sysDept.getBalance().subtract(etOrder1.getTotalFee()); - if(subtract.compareTo(BigDecimal.ZERO) <= 0){ + if(subtract.compareTo(BigDecimal.ZERO) <= 0 && sysDept.getSeparateAccount().equals("N")){ throw new ServiceException("余额不足,不能退款"); } /** 1.退款*/ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtSoftwareVersionServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtSoftwareVersionServiceImpl.java new file mode 100644 index 0000000..01c8078 --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtSoftwareVersionServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.system.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.system.mapper.EtSoftwareVersionMapper; +import com.ruoyi.system.domain.EtSoftwareVersion; +import com.ruoyi.system.service.IEtSoftwareVersionService; + +/** + * 软件版本Service业务层处理 + * + * @author qiuzhenzhao + * @date 2024-07-22 + */ +@Service +public class EtSoftwareVersionServiceImpl implements IEtSoftwareVersionService +{ + @Autowired + private EtSoftwareVersionMapper etSoftwareVersionMapper; + + /** + * 查询软件版本 + * + * @param id 软件版本主键 + * @return 软件版本 + */ + @Override + public EtSoftwareVersion selectEtSoftwareVersionById(Long id) + { + return etSoftwareVersionMapper.selectEtSoftwareVersionById(id); + } + + /** + * 查询软件版本列表 + * + * @param etSoftwareVersion 软件版本 + * @return 软件版本 + */ + @Override + public List selectEtSoftwareVersionList(EtSoftwareVersion etSoftwareVersion) + { + return etSoftwareVersionMapper.selectEtSoftwareVersionList(etSoftwareVersion); + } + + /** + * 新增软件版本 + * + * @param etSoftwareVersion 软件版本 + * @return 结果 + */ + @Override + public int insertEtSoftwareVersion(EtSoftwareVersion etSoftwareVersion) + { + etSoftwareVersion.setCreateTime(DateUtils.getNowDate()); + return etSoftwareVersionMapper.insertEtSoftwareVersion(etSoftwareVersion); + } + + /** + * 修改软件版本 + * + * @param etSoftwareVersion 软件版本 + * @return 结果 + */ + @Override + public int updateEtSoftwareVersion(EtSoftwareVersion etSoftwareVersion) + { + etSoftwareVersion.setUpdateTime(DateUtils.getNowDate()); + return etSoftwareVersionMapper.updateEtSoftwareVersion(etSoftwareVersion); + } + + /** + * 批量删除软件版本 + * + * @param ids 需要删除的软件版本主键 + * @return 结果 + */ + @Override + public int deleteEtSoftwareVersionByIds(Long[] ids) + { + return etSoftwareVersionMapper.deleteEtSoftwareVersionByIds(ids); + } + + /** + * 删除软件版本信息 + * + * @param id 软件版本主键 + * @return 结果 + */ + @Override + public int deleteEtSoftwareVersionById(Long id) + { + return etSoftwareVersionMapper.deleteEtSoftwareVersionById(id); + } +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index bb8a77d..f7f5059 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -169,7 +169,12 @@ public class SysDeptServiceImpl implements ISysDeptService @Override public SysDept selectDeptById(Long deptId) { - return deptMapper.selectDeptById(deptId); + SysDept sysDept = deptMapper.selectDeptById(deptId); + if(ObjectUtil.isNotNull(sysDept.getAppUserId())){ + AsUser asUser = asUserService.selectUserById(sysDept.getAppUserId()); + sysDept.setUserName(asUser.getUserName()); + } + return sysDept; } /** diff --git a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml index 12557a0..0045059 100644 --- a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml @@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -37,11 +38,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select device_id, picture, device_name, mac, sn, model_id, vehicle_num, area_id, activation_time, online_status, create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark, status, lock_status, location, remaining_power, voltage, qrcode, longitude, latitude, is_area_out_outage, is_admin_unlocking from et_device + select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, area_id, activation_time, online_status, create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark, status, lock_status, location, remaining_power, voltage, qrcode, longitude, latitude, is_area_out_outage, is_admin_unlocking from et_device + + + and version = #{version} + and production_time = #{productionTime} + and instructions = #{instructions} + + + + + + + insert into et_hardware_version + + id, + version, + production_time, + quantity, + instructions, + create_time, + + + #{id}, + #{version}, + #{productionTime}, + #{quantity}, + #{instructions}, + #{createTime}, + + + + + update et_hardware_version + + version = #{version}, + production_time = #{productionTime}, + quantity = #{quantity}, + instructions = #{instructions}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from et_hardware_version where id = #{id} + + + + delete from et_hardware_version where id in + + #{id} + + + \ No newline at end of file diff --git a/electripper-system/src/main/resources/mapper/system/EtModelMapper.xml b/electripper-system/src/main/resources/mapper/system/EtModelMapper.xml index a82aa14..e95a8da 100644 --- a/electripper-system/src/main/resources/mapper/system/EtModelMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtModelMapper.xml @@ -38,8 +38,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + and version = #{version} + and content = #{content} + + + + + + + insert into et_software_version + + id, + version, + create_time, + update_time, + content, + + + #{id}, + #{version}, + #{createTime}, + #{updateTime}, + #{content}, + + + + + update et_software_version + + version = #{version}, + create_time = #{createTime}, + update_time = #{updateTime}, + content = #{content}, + + where id = #{id} + + + + delete from et_software_version where id = #{id} + + + + delete from et_software_version where id in + + #{id} + + + \ No newline at end of file