Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | |
| | | public R<SiteNameVO> getAllInfoById(Integer id) { |
| | | return R.fail("通过枪id获取站点、桩、枪的名称失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TChargingGun> getChargingGunByCode(String code) { |
| | | return R.fail("根据枪编号获取充电枪失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> updateChargingGunById(TChargingGun chargingGun) { |
| | | return R.fail("编辑充电枪失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.factory; |
| | | |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.FaultMessageClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 充电桩服务降级处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class FaultMessageFallbackFactory implements FallbackFactory<FaultMessageClient> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(FaultMessageFallbackFactory.class); |
| | | |
| | | @Override |
| | | public FaultMessageClient create(Throwable throwable) { |
| | | log.error("充电枪调用失败:{}", throwable.getMessage()); |
| | | return new FaultMessageClient() { |
| | | |
| | | @Override |
| | | public R<String> createFaultMessage(TFaultMessage faultMessage) { |
| | | return R.fail("添加离线故障记录失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> updateFaultMessage(TFaultMessage faultMessage) { |
| | | return R.fail("修改离线故障记录失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TFaultMessage> getFaultMessageByGunId(Integer gunId) { |
| | | return R.fail("查询枪是否有离线或故障记录失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.chargingPile.api.factory.ChargingGunFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | */ |
| | | @PostMapping("/t-charging-gun/getAllInfoById/{id}") |
| | | R<SiteNameVO> getAllInfoById(@PathVariable("id") Integer id); |
| | | /** |
| | | * 根据枪编号获取充电枪 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-charging-gun/getChargingGunByCode/{code}") |
| | | R<TChargingGun> getChargingGunByCode(@PathVariable("code") String code); |
| | | /** |
| | | * 编辑充电枪 |
| | | * @param chargingGun |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-charging-gun/updateChargingGunById") |
| | | R<String> updateChargingGunById(@RequestBody TChargingGun chargingGun); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.feignClient; |
| | | |
| | | import com.ruoyi.chargingPile.api.factory.ChargingGunFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.factory.FaultMessageFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/15 19:36 |
| | | */ |
| | | @FeignClient(contextId = "FaultMessageClient", value = ServiceNameConstants.CHARGINGPILE_SERVICE, fallbackFactory = FaultMessageFallbackFactory.class) |
| | | public interface FaultMessageClient { |
| | | |
| | | /** |
| | | * 添加离线故障记录 |
| | | * @param faultMessage |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-fault-message/createFaultMessage") |
| | | R<String> createFaultMessage(@RequestBody TFaultMessage faultMessage); |
| | | /** |
| | | * 修改离线故障记录 |
| | | * @param faultMessage |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-fault-message/updateFaultMessage") |
| | | R<String> updateFaultMessage(@RequestBody TFaultMessage faultMessage); |
| | | |
| | | /** |
| | | * 查询枪是否有离线或故障记录 |
| | | * @param gunId |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-fault-message/getFaultMessageByGunId/{gunId}") |
| | | R<TFaultMessage> getFaultMessageByGunId(@PathVariable("gunId") Integer gunId); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "充电桩id") |
| | | @TableField("charging_pile_id") |
| | | private Integer chargingPileId; |
| | | |
| | | @ApiModelProperty(value = "充电枪id") |
| | | @TableField("charging_gun_id") |
| | | private Integer chargingGunId; |
| | | |
| | | @TableField(exist = false) |
| | | private String chargingPileName; |
| | | |
| | |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "故障时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("down_time") |
| | | private LocalDateTime downTime; |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("end_time") |
| | | private LocalDateTime endTime; |
| | | |
| | | } |
| | |
| | | com.ruoyi.chargingPile.api.factory.ChargingGunFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.AccountingStrategyDetailFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.AccountingStrategyFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.ParkingRecordFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.ParkingRecordFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.FaultMessageFallbackFactory |
| | |
| | | public R<SettlementTotalVO> settlementTotalR(String time) { |
| | | return R.fail("查询结算汇总表导出列表失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> updateChargingOrder(TChargingOrder chargingOrder) { |
| | | return R.fail("修改充电订单失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | @GetMapping(value = "/financial/settlement/settlementTotalR") |
| | | public R<SettlementTotalVO> settlementTotalR(String time); |
| | | |
| | | /** |
| | | * 修改充电订单 |
| | | * @param chargingOrder |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-charging-order/updateChargingOrder") |
| | | R<String> updateChargingOrder(@RequestBody TChargingOrder chargingOrder); |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("pay_time") |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty(value = "实时需求电流") |
| | | @TableField("need_elec") |
| | | private BigDecimal needElec; |
| | | @ApiModelProperty(value = "站点名称") |
| | | @TableField(exist = false) |
| | | private String siteName; |
| | |
| | | /** |
| | | * 获取参数配置列表 |
| | | */ |
| | | @RequiresPermissions("system:config:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysConfig config) { |
| | | startPage(); |
| | |
| | | } |
| | | |
| | | @Log(title = "参数管理", businessType = BusinessType.EXPORT) |
| | | @RequiresPermissions("system:config:export") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysConfig config) { |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | |
| | | /** |
| | | * 新增参数配置 |
| | | */ |
| | | @RequiresPermissions("system:config:add") |
| | | @Log(title = "参数管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysConfig config) { |
| | |
| | | /** |
| | | * 修改参数配置 |
| | | */ |
| | | @RequiresPermissions("system:config:edit") |
| | | @Log(title = "参数管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config) { |
| | |
| | | /** |
| | | * 删除参数配置 |
| | | */ |
| | | @RequiresPermissions("system:config:remove") |
| | | @Log(title = "参数管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public AjaxResult remove(@PathVariable Long[] configIds) { |
| | |
| | | /** |
| | | * 刷新参数缓存 |
| | | */ |
| | | @RequiresPermissions("system:config:remove") |
| | | @Log(title = "参数管理", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() { |
| | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | | @RequiresPermissions("system:dept:list") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | |
| | | /** |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | | @RequiresPermissions("system:dept:list") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) |
| | | { |
| | |
| | | /** |
| | | * 根据部门编号获取详细信息 |
| | | */ |
| | | @RequiresPermissions("system:dept:query") |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult getInfo(@PathVariable Long deptId) |
| | | { |
| | |
| | | /** |
| | | * 新增部门 |
| | | */ |
| | | @RequiresPermissions("system:dept:add") |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | |
| | | /** |
| | | * 修改部门 |
| | | */ |
| | | @RequiresPermissions("system:dept:edit") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | |
| | | /** |
| | | * 删除部门 |
| | | */ |
| | | @RequiresPermissions("system:dept:remove") |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) |
| | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @RequiresPermissions("system:dict:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | |
| | | } |
| | | |
| | | @Log(title = "字典数据", businessType = BusinessType.EXPORT) |
| | | @RequiresPermissions("system:dict:export") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictData dictData) |
| | | { |
| | |
| | | /** |
| | | * 查询字典数据详细 |
| | | */ |
| | | @RequiresPermissions("system:dict:query") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) |
| | | { |
| | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @RequiresPermissions("system:dict:add") |
| | | @Log(title = "字典数据", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| | |
| | | /** |
| | | * 修改保存字典类型 |
| | | */ |
| | | @RequiresPermissions("system:dict:edit") |
| | | @Log(title = "字典数据", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @RequiresPermissions("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @RequiresPermissions("system:dict:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType) |
| | | { |
| | |
| | | } |
| | | |
| | | @Log(title = "字典类型", businessType = BusinessType.EXPORT) |
| | | @RequiresPermissions("system:dict:export") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictType dictType) |
| | | { |
| | |
| | | /** |
| | | * 查询字典类型详细 |
| | | */ |
| | | @RequiresPermissions("system:dict:query") |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult getInfo(@PathVariable Long dictId) |
| | | { |
| | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @RequiresPermissions("system:dict:add") |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict) |
| | |
| | | /** |
| | | * 修改字典类型 |
| | | */ |
| | | @RequiresPermissions("system:dict:edit") |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict) |
| | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @RequiresPermissions("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dictIds) |
| | |
| | | /** |
| | | * 刷新字典缓存 |
| | | */ |
| | | @RequiresPermissions("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | |
| | | /** |
| | | * 根据菜单编号获取详细信息 |
| | | */ |
| | | @RequiresPermissions("system:menu:query") |
| | | @GetMapping(value = "/{menuId}") |
| | | public AjaxResult getInfo(@PathVariable Long menuId) |
| | | { |
| | |
| | | /** |
| | | * 新增菜单 |
| | | */ |
| | | @RequiresPermissions("system:menu:add") |
| | | @Log(title = "菜单管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu) |
| | |
| | | /** |
| | | * 修改菜单 |
| | | */ |
| | | @RequiresPermissions("system:menu:edit") |
| | | @Log(title = "菜单管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu) |
| | |
| | | /** |
| | | * 删除菜单 |
| | | */ |
| | | @RequiresPermissions("system:menu:remove") |
| | | @Log(title = "菜单管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId) |
| | |
| | | /** |
| | | * 获取通知公告列表 |
| | | */ |
| | | @RequiresPermissions("system:notice:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysNotice notice) |
| | | { |
| | |
| | | /** |
| | | * 根据通知公告编号获取详细信息 |
| | | */ |
| | | @RequiresPermissions("system:notice:query") |
| | | @GetMapping(value = "/{noticeId}") |
| | | public AjaxResult getInfo(@PathVariable Long noticeId) |
| | | { |
| | |
| | | /** |
| | | * 新增通知公告 |
| | | */ |
| | | @RequiresPermissions("system:notice:add") |
| | | @Log(title = "通知公告", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) |
| | |
| | | /** |
| | | * 修改通知公告 |
| | | */ |
| | | @RequiresPermissions("system:notice:edit") |
| | | @Log(title = "通知公告", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) |
| | |
| | | /** |
| | | * 删除通知公告 |
| | | */ |
| | | @RequiresPermissions("system:notice:remove") |
| | | @Log(title = "通知公告", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{noticeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) |
| | |
| | | |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.EXPORT) |
| | | @RequiresPermissions("system:operlog:export") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysOperLog operLog) { |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | |
| | | } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.DELETE) |
| | | @RequiresPermissions("system:operlog:remove") |
| | | @DeleteMapping("/{operIds}") |
| | | public AjaxResult remove(@PathVariable Long[] operIds) { |
| | | return toAjax(operLogService.deleteOperLogByIds(operIds)); |
| | | } |
| | | |
| | | @RequiresPermissions("system:operlog:remove") |
| | | @Log(title = "操作日志", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() { |
| | |
| | | /** |
| | | * 获取岗位列表 |
| | | */ |
| | | @RequiresPermissions("system:post:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) |
| | | { |
| | |
| | | } |
| | | |
| | | @Log(title = "岗位管理", businessType = BusinessType.EXPORT) |
| | | @RequiresPermissions("system:post:export") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysPost post) |
| | | { |
| | |
| | | /** |
| | | * 根据岗位编号获取详细信息 |
| | | */ |
| | | @RequiresPermissions("system:post:query") |
| | | @GetMapping(value = "/{postId}") |
| | | public AjaxResult getInfo(@PathVariable Long postId) |
| | | { |
| | |
| | | /** |
| | | * 新增岗位 |
| | | */ |
| | | @RequiresPermissions("system:post:add") |
| | | @Log(title = "岗位管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysPost post) |
| | |
| | | /** |
| | | * 修改岗位 |
| | | */ |
| | | @RequiresPermissions("system:post:edit") |
| | | @Log(title = "岗位管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysPost post) |
| | |
| | | /** |
| | | * 删除岗位 |
| | | */ |
| | | @RequiresPermissions("system:post:remove") |
| | | @Log(title = "岗位管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public AjaxResult remove(@PathVariable Long[] postIds) |
| | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | @RequiresPermissions("system:role:remove") |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | @ApiOperation(value = "删除角色", tags = {"管理后台-角色管理"}) |
| | |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | @RequiresPermissions("system:role:list") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | @RequiresPermissions("system:role:list") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | @RequiresPermissions("system:role:query") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @RequiresPermissions("system:user:edit") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | @ApiOperation(value = "重置密码", tags = {"管理后台-系统用户管理"}) |
| | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @RequiresPermissions("system:user:edit") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUser user) { |
| | |
| | | /** |
| | | * 根据用户编号获取授权角色 |
| | | */ |
| | | @RequiresPermissions("system:user:query") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | |
| | | /** |
| | | * 用户授权角色 |
| | | */ |
| | | @RequiresPermissions("system:user:edit") |
| | | @Log(title = "用户管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { |
| | |
| | | /** |
| | | * 获取部门树列表 |
| | | */ |
| | | @RequiresPermissions("system:user:list") |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) { |
| | | return success(deptService.selectDeptTreeList(dept)); |
| | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | @RequiresPermissions("monitor:online:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(String ipaddr, String userName) |
| | | { |
| | |
| | | /** |
| | | * 强退用户 |
| | | */ |
| | | @RequiresPermissions("monitor:online:forceLogout") |
| | | @Log(title = "在线用户", businessType = BusinessType.FORCE) |
| | | @DeleteMapping("/{tokenId}") |
| | | public AjaxResult forceLogout(@PathVariable String tokenId) |
| | |
| | | /** |
| | | * 查询用户和角色关联列表 |
| | | */ |
| | | @RequiresPermissions("car:role:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysUserRole sysUserRole) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 导出用户和角色关联列表 |
| | | */ |
| | | @RequiresPermissions("car:role:export") |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysUserRole sysUserRole) { |
| | |
| | | /** |
| | | * 获取用户和角色关联详细信息 |
| | | */ |
| | | @RequiresPermissions("car:role:query") |
| | | @GetMapping(value = "/{userId}") |
| | | public AjaxResult getInfo(@PathVariable("userId") Long userId) { |
| | | return success(sysUserRoleService.selectSysUserRoleByUserId(userId)); |
| | |
| | | /** |
| | | * 新增用户和角色关联 |
| | | */ |
| | | @RequiresPermissions("car:role:add") |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody SysUserRole sysUserRole) { |
| | |
| | | /** |
| | | * 修改用户和角色关联 |
| | | */ |
| | | @RequiresPermissions("car:role:edit") |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody SysUserRole sysUserRole) { |
| | |
| | | /** |
| | | * 删除用户和角色关联 |
| | | */ |
| | | @RequiresPermissions("car:role:remove") |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | public AjaxResult remove(@PathVariable Long[] userIds) { |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.auth.AuthUtil; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | |
| | | private VipClient vipClient; |
| | | @Resource |
| | | private TInviteUserService inviteUserService; |
| | | @Resource |
| | | private GiveVipUtil giveVipUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | public R<List<Long>> getUserIdsByPhone(@RequestParam("phone") String phone) { |
| | | return R.ok(appUserService.list(new QueryWrapper<TAppUser>().like("phone",phone)).stream().map(TAppUser::getId).collect(Collectors.toList())); |
| | | } |
| | | @Resource |
| | | private GiveVipUtil giveVipUtil; |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "单位管理列表", tags = {"用户管理-单位管理"}) |
| | | @PostMapping(value = "/unit/page") |
| | | public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) { |
| | |
| | | |
| | | @ApiOperation(value = "单位管理添加或编辑", tags = {"用户管理-单位管理"}) |
| | | @PostMapping(value = "/unit/addOrUpdate") |
| | | @Log(title = "【单位管理】添加或编辑单位", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public R add(@RequestBody TCompany tCompany) { |
| | | //拿到单位列表 |
| | | otherClient.unitAddorUpadate(tCompany); |
| | |
| | | |
| | | @ApiOperation(value = "单位管理删除", tags = {"用户管理-单位管理"}) |
| | | @DeleteMapping(value = "/unit/delete") |
| | | @Log(title = "【单位管理】删除单位", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public R add(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | for (String s : split) { |
| | |
| | | |
| | | @ApiOperation(value = "用户添加编辑", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/addOrUpdate") |
| | | @Log(title = "【用户列表】添加编辑用户", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public R addOrUpdate(@RequestBody TAppUser tAppUser) { |
| | | if (tAppUser.getId() != null){ |
| | | //为编辑操作,要进行vip的逻辑处理 |
| | |
| | | |
| | | @ApiOperation(value = "冻结解冻用户", tags = {"后台-用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/status/change") |
| | | @Log(title = "【用户列表】冻结解冻用户", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | public R pointsDetail(@RequestBody UserChangeDto userChangeDto) { |
| | | TAppUser appUser = appUserService.getById(userChangeDto.getUserId()); |
| | | appUser.setStatus(userChangeDto.getStatus()); |
| | |
| | | |
| | | @ApiOperation(value = "修改单位", tags = {"后台-用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/unit/change") |
| | | @Log(title = "【用户列表】修改用户单位", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | public R unitChange(@RequestBody UnitChangeDto unitChangeDto) { |
| | | for (String s : unitChangeDto.getIds().split(",")) { |
| | | TAppUser byId = appUserService.getById(s); |
| | |
| | | |
| | | @ApiOperation(value = "删除用户", tags = {"后台-用户管理-用户列表"}) |
| | | @DeleteMapping(value = "/user/delete") |
| | | @Log(title = "【用户列表】删除用户", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public R userDelete(String ids) { |
| | | String[] split = ids.split(","); |
| | | for (String s : split) { |
| | |
| | | |
| | | @ApiOperation(value = "赠送会员", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/give/vip") |
| | | @Log(title = "【用户列表】赠送会员", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | | public R giveVip(@RequestBody GiveVipDto giveVipDto) { |
| | | String[] split = giveVipDto.getUserIds().split(","); |
| | | for (String s : split) { |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.other.api.dto.TagListQueryDto; |
| | | import com.ruoyi.account.api.model.TAppUserTag; |
| | | import com.ruoyi.account.service.TAppUserTagService; |
| | |
| | | |
| | | @ApiOperation(value = "标签添加或修改", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/add") |
| | | @Log(title = "【用户标签管理】标签添加或修改", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public R<Page<TUserTag>> tagAdd(@RequestBody TUserTag tUserTag) { |
| | | //拿到单位列表 |
| | | otherClient.addorUpdateTag(tUserTag); |
| | |
| | | |
| | | @ApiOperation(value = "标签删除", tags = {"用户管理-用户标签管理"}) |
| | | @DeleteMapping(value = "/tags/delete") |
| | | @Log(title = "【用户标签管理】删除标签", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public R delete(String ids) { |
| | | //拿到单位列表 |
| | | String[] split = ids.split(","); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | |
| | | @ResponseBody |
| | | @PostMapping("/addPartner") |
| | | @ApiOperation(value = "添加合作商", tags = {"管理后台-合作商管理"}) |
| | | @Log(title = "【合作商列表】添加合作商", businessType = BusinessType.INSERT) |
| | | public AjaxResult addPartner(@RequestBody Partner partner){ |
| | | return partnerService.addPartner(partner); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/editPartner") |
| | | @ApiOperation(value = "编辑合作商", tags = {"管理后台-合作商管理"}) |
| | | @Log(title = "【合作商列表】编辑合作商", businessType = BusinessType.UPDATE) |
| | | public AjaxResult editPartner(@RequestBody Partner partner){ |
| | | return partnerService.editPartner(partner); |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "合作商id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @Log(title = "【合作商列表】删除合作商", businessType = BusinessType.DELETE) |
| | | public AjaxResult delPartner(@RequestParam("id") List<Integer> id){ |
| | | return partnerService.delPartner(id); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/resetPassword") |
| | | @ApiOperation(value = "合作商重置密码", tags = {"管理后台-合作商管理"}) |
| | | @Log(title = "【合作商列表】重置合作商密码", businessType = BusinessType.UPDATE) |
| | | public AjaxResult resetPassword(@RequestBody ResetPassword resetPassword){ |
| | | return partnerService.resetPassword(resetPassword); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/setPermissionConfiguration/{siteId}") |
| | | @ApiOperation(value = "设置合作商权限", tags = {"管理后台-站点管理"}) |
| | | @Log(title = "【合作商列表】设置合作商权限", businessType = BusinessType.OTHER) |
| | | public AjaxResult setPermissionConfiguration(@RequestBody SetPermissionConfiguration req){ |
| | | partnerService.setPermissionConfiguration(req); |
| | | return AjaxResult.success(); |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Resource |
| | | private ChargingOrderClient chargingOrderClient; |
| | | |
| | | @Resource |
| | | private SysUserRoleClient userRoleClient; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据站点id 查询所有充电桩 |
| | |
| | | @ResponseBody |
| | | @PostMapping("/addSite") |
| | | @ApiOperation(value = "添加站点", tags = {"管理后台-站点管理"}) |
| | | @Log(title = "【站点管理】添加站点", businessType = BusinessType.INSERT) |
| | | public AjaxResult addSite(@RequestBody Site site){ |
| | | return siteService.addSite(site); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/editSite") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | | @Log(title = "【站点管理】编辑站点", businessType = BusinessType.UPDATE) |
| | | public AjaxResult editSite(@RequestBody Site site){ |
| | | return siteService.editSite(site); |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @Log(title = "【站点管理】删除站点", businessType = BusinessType.DELETE) |
| | | public AjaxResult delSite(@RequestParam("id") Integer[] id){ |
| | | return siteService.delSite(id); |
| | | } |
| | |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(value = "计费策略id", name = "accountingStrategyId", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @Log(title = "【站点管理】设置站点计费策略", businessType = BusinessType.OTHER) |
| | | public AjaxResult setAccountingStrategy(@PathVariable("id") Integer id, @RequestParam("accountingStrategyId") Integer accountingStrategyId){ |
| | | siteService.setAccountingStrategy(id, accountingStrategyId); |
| | | return AjaxResult.success(); |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = userRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | Set<Integer> list = new HashSet<>(data); |
| | | wrapper.in(Site::getId, list); |
| | |
| | | /** |
| | | * 添加计费策略管理 |
| | | */ |
| | | @Log(title = "添加计费策略", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "添加计费策略") |
| | | @PostMapping(value = "/add") |
| | | @Log(title = "【计费策略】添加计费策略", businessType = BusinessType.INSERT) |
| | | public AjaxResult<Integer> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | if(null != dto.getSiteId()){ |
| | | dto.setAuditStatus(3); |
| | |
| | | /** |
| | | * 修改计费策略 |
| | | */ |
| | | @Log(title = "修改计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【计费策略】修改计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "修改计费策略") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<String> update(@RequestBody TAccountingStrategyDTO dto) { |
| | |
| | | /** |
| | | * 删除计费策略 |
| | | */ |
| | | @Log(title = "删除计费策略", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【计费策略】删除计费策略", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "删除计费策略") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 批量删除计费策略 |
| | | */ |
| | | @Log(title = "批量删除计费策略", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【计费策略】批量删除计费策略", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "批量删除计费策略") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) { |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核") |
| | | @PostMapping(value = "/auth/pass") |
| | | @Log(title = "【计费模板审核】审核计费模板", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult<PageInfo<TAccountingStrategyVO>> authPass(@RequestBody SteategyPassDto steategyPassDto) { |
| | | TAccountingStrategy byId = accountingStrategyService.getById(steategyPassDto.getId()); |
| | | Long userId = SecurityUtils.getLoginUser().getUserid(); |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "删除") |
| | | @DeleteMapping(value = "/delete") |
| | | @Log(title = "【计费模板审核】删除计费模板审核", businessType = BusinessType.DELETE) |
| | | public R delete(String ids) { |
| | | String[] split = ids.split(","); |
| | | for (String s : split) { |
| | |
| | | /** |
| | | * 建桩申请 |
| | | */ |
| | | @Log(title = "建桩申请", businessType = BusinessType.INSERT,operatorType = OperatorType.MOBILE) |
| | | @ApiOperation(tags = {"小程序-建桩申请"},value = "建桩申请") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TApplyChargingPileDTO dto) { |
| | | // 验证验证码 |
| | | String code = redisService.getCacheObject(dto.getLandlordPhone() + Constants.APPLY_CHARGING); |
| | | String code; |
| | | if(dto.getLandlordHandling().equals(1)){ |
| | | code = redisService.getCacheObject(dto.getLandlordPhone() + Constants.APPLY_CHARGING); |
| | | }else { |
| | | code = redisService.getCacheObject(dto.getAgentPhone() + Constants.APPLY_CHARGING); |
| | | } |
| | | if(StringUtils.isEmpty(code)){ |
| | | return AjaxResult.error("验证码已过期,请重新获取验证码!"); |
| | | } |
| | |
| | | return AjaxResult.ok(applyChargingPileService.save(dto)); |
| | | } |
| | | |
| | | @Log(title = "建桩申请", businessType = BusinessType.INSERT,operatorType = OperatorType.MOBILE) |
| | | @Log(title = "【申请建桩】添加建桩申请", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "建桩申请") |
| | | @PostMapping(value = "/manage/add") |
| | | public AjaxResult<Boolean> manageAdd(@RequestBody TApplyChargingPile dto) { |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "导出") |
| | | @PutMapping(value = "/export") |
| | | @Log(title = "【申请建桩】导出建桩申请列表", businessType = BusinessType.EXPORT) |
| | | public R export(String landlordPhone,HttpServletResponse response) { |
| | | try { |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | |
| | | |
| | | @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/downloadBill") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | | public R downloadBill(@RequestBody ExportUidDto uid, HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | |
| | | } |
| | | @ApiOperation(value = "下载", tags = {"管理后台-账户结算账单"}) |
| | | @PutMapping("/downloadAccount") |
| | | @Log(title = "【账户结算账单】下载账单", businessType = BusinessType.EXPORT) |
| | | public R downloadAccount(@RequestBody ChargingListQuery dto,HttpServletResponse response) |
| | | { dto.setPageCurr(1); |
| | | dto.setPageSize(99999999); |
| | |
| | | |
| | | @ApiOperation(value = "导出", tags = {"管理后台-结算汇总表"}) |
| | | @PutMapping("/downloadSettlementTotal") |
| | | @Log(title = "【结算汇总表】下载汇总表", businessType = BusinessType.EXPORT) |
| | | public R downloadSettlementTotal(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | SettlementTotalVO data = chargingOrderClient.settlementTotalR(uid.getTime()).getData(); |
| | |
| | | } |
| | | @ApiOperation(value = "下载", tags = {"管理后台-结算表记录"}) |
| | | @PutMapping("/downloadSettlement") |
| | | @Log(title = "【结算表记录】下载结算表", businessType = BusinessType.EXPORT) |
| | | public R downloadSettlement(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | TSettlementConfirm data = chargingOrderClient.downloadSettlement(uid.getUid()).getData(); |
| | |
| | | |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/download") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | | public R download(String uid,HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "修改备注") |
| | | @PostMapping(value = "/remark") |
| | | @Log(title = "【申请建桩】修改备注", businessType = BusinessType.UPDATE) |
| | | public AjaxResult<TApplyChargingPile> remark(@RequestBody ApplyChargingRemarkDto applyChargingRemarkDt) { |
| | | TApplyChargingPile byId = applyChargingPileService.getById(applyChargingRemarkDt.getId()); |
| | | byId.setRemark(applyChargingRemarkDt.getRemark()); |
| | |
| | | } |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "删除") |
| | | @DeleteMapping(value = "/remark") |
| | | @Log(title = "【申请建桩】删除建桩申请", businessType = BusinessType.DELETE) |
| | | public AjaxResult remark(String ids) { |
| | | |
| | | String[] split = ids.split(","); |
| | |
| | | /** |
| | | * 添加车库管理 |
| | | */ |
| | | @Log(title = "添加车库", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【车库】添加车库", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-车库"},value = "添加车库") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TCarport dto) { |
| | |
| | | /** |
| | | * 修改车库 |
| | | */ |
| | | @Log(title = "修改车库", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【车库】修改车库", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车库"},value = "修改车库") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TCarport dto) { |
| | |
| | | /** |
| | | * 删除车库 |
| | | */ |
| | | @Log(title = "删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【车库】删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车库"},value = "删除车库") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 批量删除车库 |
| | | */ |
| | | @Log(title = "批量删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【车库】批量删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车库"},value = "批量删除车库") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) { |
| | |
| | | |
| | | import cn.hutool.core.img.ImgUtil; |
| | | import cn.hutool.core.io.FileUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | |
| | | |
| | | @Autowired |
| | | private TChargingGunService chargingGunService; |
| | | @Autowired |
| | | private IntegrationClient integrationClient; |
| | | |
| | | @Resource |
| | | private TChargingPileService chargingPileService; |
| | |
| | | /** |
| | | * 添加充电枪管理 |
| | | */ |
| | | @Log(title = "添加充电枪", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】添加充电枪", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "添加充电枪") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult add(@RequestBody TChargingGunDTO dto) { |
| | |
| | | /** |
| | | * 修改充电枪 |
| | | */ |
| | | @Log(title = "修改充电枪", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】修改充电枪", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "修改充电枪") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult update(@RequestBody TChargingGunDTO dto) { |
| | |
| | | /** |
| | | * 删除充电枪 |
| | | */ |
| | | @Log(title = "删除充电枪", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】删除充电枪", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "删除充电枪") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 批量删除充电枪 |
| | | */ |
| | | @Log(title = "批量删除充电枪", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】批量删除充电枪", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "批量删除充电枪") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) { |
| | |
| | | /** |
| | | * 结束充电 |
| | | */ |
| | | @Log(title = "结束充电", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】结束充电", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "结束充电") |
| | | @PutMapping(value = "/stopCharging") |
| | | public AjaxResult<String> stopCharging(@RequestParam("id") Integer id) { |
| | |
| | | |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "下载二维码") |
| | | @GetMapping(value = "/downloadQRCode/{id}") |
| | | @Log(title = "【充电桩信息】下载二维码", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | | public void downloadQRCode(@PathVariable Integer id, HttpServletResponse response){ |
| | | try { |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | |
| | | siteNameVO.setSiteName(site.getName()); |
| | | return R.ok(siteNameVO); |
| | | } |
| | | /** |
| | | * 根据枪编号获取充电枪 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @PostMapping("/getChargingGunByCode/{code}") |
| | | public R<TChargingGun> getChargingGunByCode(@PathVariable("code") String code){ |
| | | return R.ok(chargingGunService.getOne(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getCode, code) |
| | | .last("LIMIT 1"))); |
| | | } |
| | | /** |
| | | * 根据枪编号获取充电枪 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | /** |
| | | * 编辑充电枪 |
| | | * @param chargingGun |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateChargingGunById") |
| | | public R<String> updateChargingGunById(@RequestBody TChargingGun chargingGun){ |
| | | chargingGunService.updateById(chargingGun); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @Log(title = "添加充电桩数据", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】添加充电桩数据", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/addChargingPile") |
| | | @ApiOperation(value = "添加充电桩数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult addChargingPile(@RequestBody TChargingPile chargingPile){ |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "编辑充电桩数据", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】编辑充电桩数据", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/editChargingPile") |
| | | @ApiOperation(value = "编辑充电桩数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult editChargingPile(@RequestBody TChargingPile chargingPile){ |
| | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPile") |
| | | @Log(title = "删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "删除充电桩", tags = {"管理后台-充电桩信息"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "充电桩id", name = "id", dataTypeClass = Integer.class, required = true) |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "批量设置计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【充电桩信息】批量设置计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/batchSetAccountingStrategy") |
| | | @ApiOperation(value = "批量设置计费策略", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult batchSetAccountingStrategy(@RequestBody BatchSetAccountingStrategy setAccountingStrategy){ |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPileNotification") |
| | | @ApiOperation(value = "删除系统通知", tags = {"管理后台-系统通知"}) |
| | | @Log(title = "【系统通知】删除系统通知", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult delChargingPileNotification(@RequestParam("id") Long id){ |
| | | TChargingPileNotification chargingPileNotification = chargingPileNotificationService.getById(id); |
| | | chargingPileNotificationService.removeById(chargingPileNotification); |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | |
| | | @ResponseBody |
| | | @PostMapping("/addFaultMessage") |
| | | @ApiOperation(value = "添加故障信息", tags = {"管理后台-设备监控"}) |
| | | @Log(title = "【设备监控】添加故障信息", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult addFaultMessage(@RequestBody TFaultMessage faultMessage){ |
| | | faultMessageService.save(faultMessage); |
| | | return AjaxResult.success(); |
| | |
| | | @ResponseBody |
| | | @DeleteMapping("/delFaultMessage/{id}") |
| | | @ApiOperation(value = "删除故障信息", tags = {"管理后台-设备监控"}) |
| | | @Log(title = "【设备监控】删除故障信息", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult delFaultMessage(@PathVariable Integer id){ |
| | | faultMessageService.removeById(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 添加离线故障记录 |
| | | * @param faultMessage |
| | | * @return |
| | | */ |
| | | @PostMapping("/createFaultMessage") |
| | | public R<String> createFaultMessage(@RequestBody TFaultMessage faultMessage){ |
| | | faultMessageService.save(faultMessage); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 修改离线故障记录 |
| | | * @param faultMessage |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateFaultMessage") |
| | | public R<String> updateFaultMessage(@RequestBody TFaultMessage faultMessage){ |
| | | faultMessageService.updateById(faultMessage); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 查询枪是否有离线或故障记录 |
| | | * @param gunId |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-fault-message/getFaultMessageByGunId/{gunId}") |
| | | public R<TFaultMessage> getFaultMessageByGunId(@PathVariable("gunId") Integer gunId){ |
| | | return R.ok(faultMessageService.getOne(Wrappers.lambdaQuery(TFaultMessage.class) |
| | | .eq(TFaultMessage::getChargingGunId,gunId) |
| | | .and(e->e.eq(TFaultMessage::getStatus,1).or().eq(TFaultMessage::getStatus,2)) |
| | | .isNull(TFaultMessage::getEndTime) |
| | | .orderByDesc(TFaultMessage::getDownTime) |
| | | .last("LIMIT 1"))); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 添加监控管理 |
| | | */ |
| | | @Log(title = "添加监控", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【监控管理 】添加监控", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-监控"},value = "添加监控") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TMonitoringEquipmentDTO dto) { |
| | |
| | | /** |
| | | * 修改监控 |
| | | */ |
| | | @Log(title = "修改监控", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【监控管理 】修改监控", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-监控"},value = "修改监控") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TMonitoringEquipmentDTO dto) { |
| | |
| | | /** |
| | | * 删除监控 |
| | | */ |
| | | @Log(title = "删除监控", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【监控管理 】删除监控", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-监控"},value = "删除监控") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 批量删除监控 |
| | | */ |
| | | @Log(title = "批量删除监控", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【监控管理 】批量删除监控", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-监控"},value = "批量删除监控") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) { |
| | |
| | | /** |
| | | * 添加停车场管理 |
| | | */ |
| | | @Log(title = "添加停车场", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场】添加停车场", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "添加停车场") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TParkingLotDTO dto) { |
| | |
| | | /** |
| | | * 修改停车场 |
| | | */ |
| | | @Log(title = "修改停车场", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场】修改停车场", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "修改停车场") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TParkingLotDTO dto) { |
| | |
| | | /** |
| | | * 删除停车场 |
| | | */ |
| | | @Log(title = "删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场】删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "删除停车场") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 批量删除停车场 |
| | | */ |
| | | @Log(title = "批量删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场】批量删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "批量删除停车场") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) { |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.TOrderInvoiceVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | } |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "导出") |
| | | @PutMapping("/export") |
| | | @Log(title = "【停车记录】导出停车记录", businessType = BusinessType.EXPORT,operatorType = OperatorType.MANAGE) |
| | | public void export(@RequestBody ParkingRecordQuery query) |
| | | { |
| | | List<TParkingRecordVO> records = parkingRecordService.pageList(query).getParkingRecordVOS().getRecords(); |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "出场") |
| | | @GetMapping(value = "/out") |
| | | @Log(title = "【停车记录】修改出场状态", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | public R out(Long id) { |
| | | TParkingRecord byId = parkingRecordService.getById(id); |
| | | byId.setStatus(2); |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping("/addRepair") |
| | | @ApiOperation(value = "添加报修记录", tags = {"管理后台-设备监控"}) |
| | | @Log(title = "【设备监控】添加报修记录", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult addRepair(@RequestBody TRepair repair){ |
| | | repairService.save(repair); |
| | | return AjaxResult.success(); |
| | |
| | | @ResponseBody |
| | | @DeleteMapping("/delRepair/{id}") |
| | | @ApiOperation(value = "删除报修记录", tags = {"管理后台-设备监控"}) |
| | | @Log(title = "【设备监控】删除报修记录", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult delRepair(@PathVariable Integer id){ |
| | | repairService.removeById(id); |
| | | return AjaxResult.success(); |
| | |
| | | /** |
| | | * 添加车道管理 |
| | | */ |
| | | @Log(title = "添加车道", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场配置】添加车道", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "添加车道") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TVehicleRamp dto) { |
| | |
| | | /** |
| | | * 修改车道 |
| | | */ |
| | | @Log(title = "修改车道", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场配置】修改车道", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "修改车道") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TVehicleRamp dto) { |
| | |
| | | /** |
| | | * 删除车道 |
| | | */ |
| | | @Log(title = "删除车道", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场配置】删除车道", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "删除车道") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 批量删除车道 |
| | | */ |
| | | @Log(title = "批量删除车道", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场配置】批量删除车道", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "批量删除车道") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) { |
| | |
| | | /** |
| | | * 开关闸车道 |
| | | */ |
| | | @Log(title = "开关闸车道", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @Log(title = "【停车场配置】开关闸车道", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "开关闸车道") |
| | | @PostMapping(value = "/openOrDown") |
| | | public AjaxResult<String> openOrDown(@RequestBody TVehicleRamp dto) { |
| | |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysRoleClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Resource |
| | | private RoleSiteClient roleSiteClient; |
| | | |
| | | @Resource |
| | | private SysUserRoleClient userRoleClient; |
| | | |
| | | |
| | | |
| | |
| | | Partner partner = this.getById(partnerId); |
| | | SysUser sysUser = sysUserClient.queryUserByUserName(partner.getAccount()).getData(); |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = userRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | collect.addAll(data); |
| | | collect.addAll(data1); |
| | | Set<Integer> siteIds = new HashSet<>(collect); |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | ids = new HashSet<>(data); |
| | | } |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | ids = new HashSet<>(data); |
| | | } |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | ids = new HashSet<>(data); |
| | | } |
| | |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @Autowired |
| | | private TChargingPileService chargingPileService; |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private RoleSiteClient roleSiteClient; |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | |
| | | |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private UploadRealTimeMonitoringDataClient uploadRealTimeMonitoringDataClient; |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | |
| | | |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.service.TChargingPileNotificationService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import com.ruoyi.common.core.constant.MsgConstants; |
| | | import com.ruoyi.common.core.utils.HttpUtils; |
| | | import com.ruoyi.common.core.utils.MsgUtil; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | Site site = siteService.getById(dto.getSiteId()); |
| | | TChargingPile chargingPile = chargingPileService.getById(dto.getChargingPileId()); |
| | | String siteName = site.getName(); |
| | | String result = MsgUtil.faultMsg(site.getPhone(), site.getName(), chargingPile.getNumber() + ""); |
| | | String reqStr = MsgUtil.faultMsg(site.getPhone(), site.getName(), chargingPile.getNumber() + ""); |
| | | String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | log.info("故障短信提醒:{}",result); |
| | | if(siteName.length()>10){ |
| | | siteName = siteName.substring(0,10); |
| | |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private RoleSiteClient roleSiteClient; |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<TParkingLotVO> pageList(TParkingLotQuery query) { |
| | | |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(sysUser.getRoleId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | | data.addAll(data1); |
| | | siteIds = new HashSet<>(data); |
| | | } |
| | |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="site_id" property="siteId" /> |
| | | <result column="charging_pile_id" property="chargingPileId" /> |
| | | <result column="charging_gun_id" property="chargingGunId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="down_time" property="downTime" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, site_id, charging_pile_id, status, down_time, create_time, del_flag |
| | | id, app_user_id, site_id, charging_pile_id, status, down_time, create_time, del_flag,charging_gun_id,end_time |
| | | </sql> |
| | | |
| | | |
| | |
| | | AND tpl.site_id = #{query.siteId} |
| | | </if> |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and tcg.site_id in |
| | | and tpl.site_id in |
| | | <foreach collection="siteIds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | |
| | | return IoTDAClient.newBuilder() |
| | | .withCredential(auth) |
| | | // 标准版/企业版:需自行创建Region对象,基础版:请使用IoTDARegion的region对象,如"withRegion(IoTDARegion.CN_NORTH_4)" |
| | | .withRegion(new Region("cn-north-4", IotConstant.URL)) |
| | | .withRegion(new Region("cn-south-1", IotConstant.URL)) |
| | | .build(); |
| | | } |
| | | /** |
| | |
| | | .withSk(config.getSk()); |
| | | return IamClient.newBuilder() |
| | | .withCredential(auth) |
| | | .withRegion(IamRegion.valueOf("cn-north-4")) |
| | | .withRegion(IamRegion.valueOf("cn-south-1")) |
| | | .build(); |
| | | } |
| | | |
| | |
| | | /** |
| | | * URL |
| | | */ |
| | | public static final String URL = "https://iotda.cn-north-4.myhuaweicloud.com"; |
| | | public static final String URL = "https://94cb3eb5f9.st1.iotda-app.cn-south-1.myhuaweicloud.com"; |
| | | /** |
| | | * 创建产品 |
| | | */ |
| | |
| | | */ |
| | | public static final String CHARGING_HANDSHAKE ="charging_handshake"; |
| | | /** |
| | | * 参数配置 |
| | | */ |
| | | public static final String PARAMETER_SETTING ="parameter_setting"; |
| | | /** |
| | | * 充电阶段BMS中止 |
| | | */ |
| | | public static final String BMS_ABORT ="bms_abort"; |
| | |
| | | @PostMapping(value = "/message") |
| | | public AjaxResult<String> message(@RequestBody JSONObject jsonObject) throws IOException { |
| | | log.info("接收到消息中转:{}",jsonObject); |
| | | JSONObject content = jsonObject.getJSONObject("content"); |
| | | JSONObject content = jsonObject.getJSONObject("notify_data").getJSONObject("body").getJSONObject("content"); |
| | | JSONObject header = jsonObject.getJSONObject("notify_data").getJSONObject("header"); |
| | | String deviceId = header.getString("device_id"); // 设备id |
| | | String nodeId = header.getString("node_id"); // 设备编号 |
| | | String productId = header.getString("product_id"); // 产品id |
| | | String service_id = content.getString("service_id"); |
| | | log.info("服务id:{}",service_id); |
| | | SendResult sendResult; |
| | |
| | | OnlineReply onlineReply = new OnlineReply(); |
| | | onlineReply.setCharging_pile_code(onlineMessage.getCharging_pile_code()); |
| | | onlineReply.setOnline_result(0); |
| | | result = iotMessageProduce.sendMessage(onlineReply.getCharging_pile_code(), ServiceIdMenu.ONLINE_REPLY.getKey(), messageUtil.onlineReply(onlineReply)); |
| | | result = iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.ONLINE_REPLY.getKey(), messageUtil.onlineReply(onlineReply)); |
| | | log.info("充电桩登录认证-返回结果:{}",result); |
| | | break; |
| | | case SendTagConstant.PING: |
| | |
| | | pong.setCharging_pile_code(pingMessage.getCharging_pile_code()); |
| | | pong.setCharging_gun_code(pingMessage.getCharging_gun_code()); |
| | | pong.setCharging_gun_status(0); |
| | | result = iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | result = iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | log.info("充电桩心跳包-返回结果:{}",result); |
| | | break; |
| | | case SendTagConstant.END_CHARGE: |
| | |
| | | billingModeVerifyReply.setBilling_model_result(1); |
| | | } |
| | | } |
| | | iotMessageProduce.sendMessage(billingModeVerifyReply.getCharging_pile_code(), ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getKey(),messageUtil.billingModeVerifyReply(billingModeVerifyReply)); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getKey(),messageUtil.billingModeVerifyReply(billingModeVerifyReply)); |
| | | break; |
| | | case SendTagConstant.ACQUISITION_BILLING_MODE: |
| | | AcquisitionBillingModeMessage acquisitionBillingModeMessage = JSON.parseObject(jsonObject.toJSONString(),AcquisitionBillingModeMessage.class); |
| | |
| | | StrategyUtil.setStrategyPrice(strategyPrice,acquisitionBillingModeReply); |
| | | // 时段设置 |
| | | StrategyUtil.setTime(accountingStrategyDetails,acquisitionBillingModeReply); |
| | | iotMessageProduce.sendMessage(acquisitionBillingModeReply.getCharging_pile_code(), ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getKey(),messageUtil.acquisitionBillingModeReply(acquisitionBillingModeReply)); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getKey(),messageUtil.acquisitionBillingModeReply(acquisitionBillingModeReply)); |
| | | break; |
| | | case SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA: |
| | | UploadRealTimeMonitoringDataMessage uploadRealTimeMonitoringDataMessage = JSON.parseObject(jsonObject.toJSONString(),UploadRealTimeMonitoringDataMessage.class); |
| | |
| | | ChargingHandshakeMessage chargingHandshakeMessage = JSON.parseObject(jsonObject.toJSONString(),ChargingHandshakeMessage.class); |
| | | sendResult = enhanceProduce.chargingHandshakeMessage(chargingHandshakeMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.PARAMETER_SETTING: |
| | | ParameterSettingMessage parameterSettingMessage = JSON.parseObject(jsonObject.toJSONString(),ParameterSettingMessage.class); |
| | | sendResult = enhanceProduce.parameterSettingMessage(parameterSettingMessage); |
| | | break; |
| | | case SendTagConstant.BMS_ABORT: |
| | | BmsAbortMessage bmsAbortMessage = JSON.parseObject(jsonObject.toJSONString(),BmsAbortMessage.class); |
| | |
| | | ConfirmTransactionRecord confirmTransactionRecord = new ConfirmTransactionRecord(); |
| | | confirmTransactionRecord.setTransaction_serial_number(transactionRecordMessage.getTransaction_serial_number()); |
| | | confirmTransactionRecord.setConfirm_result(0); |
| | | iotMessageProduce.sendMessage(confirmTransactionRecord.getTransaction_serial_number(), ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | break; |
| | | case SendTagConstant.UPDATE_BALANCE_REPLY: |
| | | UpdateBalanceReplyMessage updateBalanceReplyMessage = JSON.parseObject(jsonObject.toJSONString(),UpdateBalanceReplyMessage.class); |
| | |
| | | TimingSettingReply timingSettingReply = new TimingSettingReply(); |
| | | timingSettingReply.setCharging_pile_code(timingSettingMessage.getCharging_pile_code()); |
| | | timingSettingReply.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(timingSettingReply.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReply)); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReply)); |
| | | break; |
| | | case SendTagConstant.SETUP_BILLING_MODEL_REPLY: |
| | | SetupBillingModelReplyMessage setupBillingModelReplyMessage = JSON.parseObject(jsonObject.toJSONString(),SetupBillingModelReplyMessage.class); |
| | |
| | | import com.ruoyi.integration.mongodb.service.BmsDemandAndChargerExportationService; |
| | | import com.ruoyi.integration.rocket.model.BmsDemandAndChargerExportationMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | | @Component |
| | |
| | | |
| | | @Autowired |
| | | private BmsDemandAndChargerExportationService bmsDemandAndChargerExportationService; |
| | | @Autowired |
| | | private ChargingOrderClient chargingOrderClient; |
| | | @Override |
| | | protected void handleMessage(BmsDemandAndChargerExportationMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | |
| | | BeanUtils.copyProperties(message,bmsDemandAndChargerExportation); |
| | | bmsDemandAndChargerExportationService.create(bmsDemandAndChargerExportation); |
| | | // 业务处理 |
| | | TChargingOrder chargingOrder = chargingOrderClient.getOrderByCode(message.getTransaction_serial_number()).getData(); |
| | | if(Objects.nonNull(chargingOrder)){ |
| | | chargingOrder.setNeedElec(message.getBms_current_requirements()); |
| | | chargingOrderClient.updateChargingOrder(chargingOrder); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.chargingPile.api.feignClient.AccountingStrategyDetailClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.FaultMessageClient; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategyDetail; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.integration.api.model.Online; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.mongodb.service.UploadRealTimeMonitoringDataService; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | |
| | | private ChargingOrderClient chargingOrderClient; |
| | | @Resource |
| | | private AccountingStrategyDetailClient accountingStrategyDetailClient; |
| | | @Resource |
| | | private ChargingGunClient chargingGunClient; |
| | | @Resource |
| | | private FaultMessageClient faultMessageClient; |
| | | |
| | | |
| | | @Override |
| | |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData, query); |
| | | chargingOrderClient.chargeMonitoring(query); |
| | | |
| | | // 存储状态信息 |
| | | |
| | | |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunByCode(message.getCharging_gun_code()).getData(); |
| | | if(Objects.nonNull(chargingGun)){ |
| | | // 存储状态信息 |
| | | TFaultMessage faultMessage = new TFaultMessage(); |
| | | if(message.getCharging_gun_status().equals(0) || message.getCharging_gun_status().equals(1)){ |
| | | faultMessage.setSiteId(chargingGun.getSiteId()); |
| | | faultMessage.setChargingPileId(chargingGun.getChargingPileId()); |
| | | faultMessage.setChargingGunId(chargingGun.getId()); |
| | | switch (message.getCharging_gun_status()){ |
| | | case 0: |
| | | faultMessage.setStatus(1); |
| | | chargingGun.setStatus(1); |
| | | break; |
| | | case 1: |
| | | faultMessage.setStatus(2); |
| | | chargingGun.setStatus(7); |
| | | break; |
| | | } |
| | | faultMessage.setDownTime(LocalDateTime.now()); |
| | | faultMessageClient.createFaultMessage(faultMessage); |
| | | }else { |
| | | switch (message.getCharging_gun_status()){ |
| | | case 2: |
| | | chargingGun.setStatus(2); |
| | | break; |
| | | case 3: |
| | | chargingGun.setStatus(4); |
| | | break; |
| | | } |
| | | // 空闲 充电 查询是否该设备之前存在离线记录或者故障记录 |
| | | faultMessage = faultMessageClient.getFaultMessageByGunId(chargingGun.getId()).getData(); |
| | | if(Objects.nonNull(faultMessage)){ |
| | | faultMessage.setEndTime(LocalDateTime.now()); |
| | | faultMessageClient.updateFaultMessage(faultMessage); |
| | | } |
| | | } |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.integration.api.model.ParameterSetting; |
| | | import com.ruoyi.integration.iotda.constant.SendTagConstant; |
| | | import com.ruoyi.integration.rocket.model.*; |
| | | import com.ruoyi.integration.rocket.util.RocketMQEnhanceTemplate; |
| | |
| | | message.setSource(SendTagConstant.CHARGING_HANDSHAKE); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.CHARGING_HANDSHAKE, SendTagConstant.CHARGING_HANDSHAKE, message); |
| | | } |
| | | /** |
| | | * 参数设置 |
| | | */ |
| | | public SendResult parameterSettingMessage(ParameterSettingMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.PARAMETER_SETTING); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.PARAMETER_SETTING, SendTagConstant.PARAMETER_SETTING, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电阶段BMS中止 |
| | |
| | | TChargingOrder chargingOrder = chargingOrderService.getChargingOrderByLicensePlate(query); |
| | | return R.ok(chargingOrder); |
| | | } |
| | | /** |
| | | * 修改充电订单 |
| | | * @param chargingOrder |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateChargingOrder") |
| | | public R<String> updateChargingOrder(@RequestBody TChargingOrder chargingOrder){ |
| | | chargingOrderService.updateById(chargingOrder); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | this.save(chargingOrder); |
| | | |
| | | //添加订单的计费策略 |
| | | TAccountingStrategy accountingStrategy = accountingStrategyClient.getAccountingStrategyById(tChargingGun.getAccountingStrategyId()).getData(); |
| | | List<TAccountingStrategyDetail> strategyDetailList = accountingStrategyDetailClient.getListByAccountingStrategyId(tChargingGun.getAccountingStrategyId()).getData(); |
| | | Integer accountingStrategyId = tChargingGun.getAccountingStrategyId(); |
| | | if(null == accountingStrategyId){ |
| | | //查询站点上面的计费策略 |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(tChargingGun.getSiteId())).getData().get(0); |
| | | accountingStrategyId = site.getAccountingStrategyId(); |
| | | } |
| | | TAccountingStrategy accountingStrategy = accountingStrategyClient.getAccountingStrategyById(accountingStrategyId).getData(); |
| | | List<TAccountingStrategyDetail> strategyDetailList = accountingStrategyDetailClient.getListByAccountingStrategyId(accountingStrategyId).getData(); |
| | | AccountingStrategyOrder accountingStrategyOrder = new AccountingStrategyOrder(); |
| | | BeanUtils.copyProperties(accountingStrategy, accountingStrategyOrder); |
| | | accountingStrategyOrder.setChargingOrderId(chargingOrder.getId()); |
| | |
| | | wrapper.eq(TExchangeOrder::getStatus, query.getStatus()); |
| | | } |
| | | long count = this.count(wrapper); |
| | | Integer pageCurr = (query.getPageCurr() - 1) * query.getPageSize(); |
| | | List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + pageCurr + "," + query.getPageSize())); |
| | | List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + query.getPageCurr() + "," + query.getPageSize())); |
| | | List<MyExchangeOrderList> pageList = new ArrayList<>(); |
| | | for (TExchangeOrder tExchangeOrder : list) { |
| | | MyExchangeOrderList exchangeOrderList = new MyExchangeOrderList(); |
| | |
| | | wrapper.eq(TShoppingOrder::getStatus, query.getStatus()); |
| | | } |
| | | long count = this.count(wrapper); |
| | | Integer pageCurr = (query.getPageCurr() - 1) * query.getPageSize(); |
| | | List<TShoppingOrder> list = this.list(wrapper.orderByDesc(TShoppingOrder::getCreateTime).last(" limit " + pageCurr + ", " + query.getPageSize())); |
| | | List<TShoppingOrder> list = this.list(wrapper.orderByDesc(TShoppingOrder::getCreateTime).last(" limit " + query.getPageCurr() + ", " + query.getPageSize())); |
| | | List<MyShoppingOrderList> pageList = new ArrayList<>(); |
| | | for (TShoppingOrder tShoppingOrder : list) { |
| | | MyShoppingOrderList myShoppingOrderList = new MyShoppingOrderList(); |
| | |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | | username: nacos |
| | | password: nacos |
| | | ip: 192.168.110.85 |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.110.169:8848 |
| | |
| | | <result column="refund_status" property="refundStatus" /> |
| | | <result column="refund_serial_number" property="refundSerialNumber" /> |
| | | <result column="refund_time" property="refundTime" /> |
| | | <result column="need_elec" property="needElec" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, code, order_type, order_classification, app_user_id, app_user_car_id,site_id, parking_lot_id, charging_pile_id, charging_gun_id, start_time, end_time, status, recharge_amount, recharge_payment_type, recharge_payment_status, recharge_serial_number, order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag |
| | | id, code, order_type, order_classification, app_user_id, app_user_car_id,site_id, parking_lot_id, charging_pile_id, charging_gun_id, |
| | | start_time, end_time, status, recharge_amount, recharge_payment_type, recharge_payment_status, recharge_serial_number, |
| | | order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, refund_code, |
| | | refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag,need_elec |
| | | </sql> |
| | | |
| | | |
| | |
| | | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.other.api.domain.TActivity; |
| | | import com.ruoyi.other.api.domain.TAdvertising; |
| | | import com.ruoyi.other.api.dto.AdvertisingDTO; |
| | |
| | | private TActivityService activityService; |
| | | @PostMapping("/saveActivity") |
| | | @ApiOperation(tags = {"管理后台-活动管理"},value = "活动添加") |
| | | @Log(title = "【活动管理】添加活动", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult saveActivity(@RequestBody TActivity dto) { |
| | | activityService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-活动管理"},value = "活动删除") |
| | | @Log(title = "【活动管理】删除活动", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult delete(String ids) { |
| | | activityService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-活动管理"},value = "活动修改") |
| | | @Log(title = "【活动管理】修改活动", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult updateActivity(@RequestBody TActivity dto) { |
| | | activityService.updateById(dto); |
| | | return AjaxResult.success(); |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.other.api.domain.TAdvertising; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.dto.AdvertisingDTO; |
| | |
| | | private TAdvertisingService advertisingService; |
| | | @PostMapping("/saveAdvertising") |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告添加") |
| | | @Log(title = "【广告管理】添加广告", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult saveAdvertising(@RequestBody TAdvertising dto) { |
| | | advertisingService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告删除") |
| | | @Log(title = "【广告管理】删除广告", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult delete(String ids) { |
| | | advertisingService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告修改") |
| | | @Log(title = "【广告管理】修改广告", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult updateVip(@RequestBody TAdvertising dto) { |
| | | advertisingService.updateById(dto); |
| | | return AjaxResult.success(); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | |
| | | } |
| | | @PostMapping("/saveGoods") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券添加") |
| | | @Log(title = "【优惠券管理】添加优惠券", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult saveActivity(@RequestBody TCoupon dto) { |
| | | tCouponService.save(dto); |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券删除") |
| | | @Log(title = "【优惠券管理】删除优惠券", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult delete(String ids) { |
| | | tCouponService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券修改") |
| | | @Log(title = "【优惠券管理】修改优惠券", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult updateActivity(@RequestBody TCoupon dto) { |
| | | tCouponService.updateById(dto); |
| | | return AjaxResult.success(); |
| | |
| | | private IRegionService regionService; |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "发放优惠券") |
| | | @PostMapping(value = "/grantCoupon") |
| | | @Log(title = "【优惠券管理】发放优惠券", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | | public AjaxResult grantCoupon(@RequestBody GrantCouponDto dto) { |
| | | TCoupon byId = tCouponService.getById(dto.getCouponId()); |
| | | Integer waysToObtain = byId.getWaysToObtain(); |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TEnterpriseUserApplication; |
| | | import com.ruoyi.other.query.PassDto; |
| | |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | @Log(title = "添加集团用户申请", businessType = BusinessType.INSERT) |
| | | @Log(title = "【集团用户申请】添加集团用户申请", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "后台添加集团用户申请") |
| | | @PostMapping(value = "/back/add") |
| | | public AjaxResult<Boolean> backAdd(@Validated @RequestBody TEnterpriseUserApplication dto) { |
| | |
| | | return R.ok(page); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Log(title = "【集团用户申请】填写备注", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "备注") |
| | | @PostMapping(value = "/remark") |
| | | public AjaxResult pass(@RequestBody PassDto passDto) { |
| | |
| | | enterpriseUserApplicationService.updateById(byId); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "备注") |
| | | |
| | | @Log(title = "【集团用户申请】删除申请数据", businessType = BusinessType.DELETE) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public AjaxResult delete(String ids) { |
| | | String[] split = ids.split(","); |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.domain.TInvoiceType; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | |
| | | @ResponseBody |
| | | @PostMapping("/addEvaluationTag") |
| | | @ApiOperation(value = "添加评价标签", tags = {"管理后台-评价标签设置"}) |
| | | @Log(title = "【评价标签设置】添加评价标签", businessType = BusinessType.INSERT) |
| | | public AjaxResult addEvaluationTag(@RequestBody TEvaluationTag evaluationTag){ |
| | | evaluationTagService.save(evaluationTag); |
| | | return AjaxResult.success(); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/editEvaluationTag") |
| | | @ApiOperation(value = "编辑评价标签", tags = {"管理后台-评价标签设置"}) |
| | | @Log(title = "【评价标签设置】编辑评价标签", businessType = BusinessType.UPDATE) |
| | | public AjaxResult editEvaluationTag(@RequestBody TEvaluationTag evaluationTag){ |
| | | evaluationTagService.updateById(evaluationTag); |
| | | return AjaxResult.success(); |
| | |
| | | @ResponseBody |
| | | @DeleteMapping("/delEvaluationTag") |
| | | @ApiOperation(value = "删除评价标签", tags = {"管理后台-评价标签设置"}) |
| | | @Log(title = "【评价标签设置】删除评价标签", businessType = BusinessType.DELETE) |
| | | public AjaxResult<TInvoiceType> delEvaluationTag(@RequestParam("id") Integer[] id){ |
| | | List<TEvaluationTag> tEvaluationTags = evaluationTagService.listByIds(Arrays.asList(id)); |
| | | for (TEvaluationTag evaluationTag : tEvaluationTags) { |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | |
| | | |
| | | @PostMapping("/saveGoods") |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品添加") |
| | | @Log(title = "【商品管理】添加商品", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveActivity(@RequestBody TGoods dto) { |
| | | goodsService.save(dto); |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品删除") |
| | | @Log(title = "【商品管理】删除商品", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(String ids) { |
| | | goodsService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品修改") |
| | | @Log(title = "【商品管理】修改商品", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateActivity(@RequestBody TGoods dto) { |
| | | goodsService.updateById(dto); |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.other.api.domain.THtml; |
| | | import com.ruoyi.other.api.domain.TNotice; |
| | | import com.ruoyi.other.service.THtmlService; |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改") |
| | | @PostMapping(value = "/saveOrUpdate") |
| | | @Log(title = "【协议服务】新增修改协议", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveOrUpdate(@RequestBody THtml tHtml) { |
| | | THtml one = htmlService.lambdaQuery().eq(THtml::getType, tHtml.getType()).one(); |
| | | if(one!=null){ |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.other.api.domain.THtml; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | | import com.ruoyi.other.api.dto.SaveHtml; |
| | |
| | | |
| | | @PostMapping("/saveSet") |
| | | @ApiOperation(tags = {"管理后台-积分管理"},value = "保存积分设置") |
| | | @Log(title = "【积分管理】保存积分设置", businessType = BusinessType.INSERT) |
| | | public R saveSet(@RequestBody TIntegralRule dto) { |
| | | TIntegralRule one = integralRuleService.getOne(null); |
| | | if (one!=null){ |
| | |
| | | |
| | | @PostMapping("/saveInfo") |
| | | @ApiOperation(tags = {"管理后台-积分管理"},value = "保存积分说明") |
| | | @Log(title = "【积分管理】保存积分说明", businessType = BusinessType.INSERT) |
| | | public R saveInfo(@RequestBody SaveHtml dto) { |
| | | THtml g = htmlService.getOne(new QueryWrapper<THtml>().eq("type",dto.getType())); |
| | | if (g == null){ |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.other.api.domain.TInvoiceType; |
| | | import com.ruoyi.other.query.InvoiceTypePageList; |
| | | import com.ruoyi.other.service.TInvoiceTypeService; |
| | |
| | | PageInfo<TInvoiceType> pageInfo = invoiceTypeService.pageList(pageList); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | @ResponseBody |
| | | @GetMapping("/pageListR") |
| | | @ApiOperation(value = "获取开票公司和类型列表", tags = {"管理后台-发票管理"}) |
| | | public R<List<TInvoiceType>> pageListR( String company){ |
| | | public R<List<TInvoiceType>> pageListR(String invoicingCompany ){ |
| | | List<TInvoiceType> list = new ArrayList<>(); |
| | | if (StringUtils.hasLength(company)){ |
| | | list = invoiceTypeService.lambdaQuery().eq(TInvoiceType::getInvoicingCompany, company).list(); |
| | | if (StringUtils.hasLength(invoicingCompany )){ |
| | | list = invoiceTypeService.lambdaQuery().eq(TInvoiceType::getInvoicingCompany, invoicingCompany).list(); |
| | | }else{ |
| | | list = invoiceTypeService.lambdaQuery().list(); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/addInvoiceType") |
| | | @ApiOperation(value = "添加发票类型", tags = {"管理后台-发票类型管理"}) |
| | | @Log(title = "【发票类型管理】添加发票类型", businessType = BusinessType.INSERT) |
| | | public AjaxResult addInvoiceType(@RequestBody TInvoiceType invoiceType){ |
| | | invoiceTypeService.save(invoiceType); |
| | | return AjaxResult.success(); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/editInvoiceType") |
| | | @ApiOperation(value = "编辑发票类型", tags = {"管理后台-发票类型管理"}) |
| | | @Log(title = "【发票类型管理】编辑发票类型", businessType = BusinessType.UPDATE) |
| | | public AjaxResult editInvoiceType(@RequestBody TInvoiceType invoiceType){ |
| | | invoiceTypeService.updateById(invoiceType); |
| | | return AjaxResult.success(); |
| | |
| | | @ResponseBody |
| | | @DeleteMapping("/delInvoiceType") |
| | | @ApiOperation(value = "删除发票类型", tags = {"管理后台-发票类型管理"}) |
| | | @Log(title = "【发票类型管理】删除发票类型", businessType = BusinessType.DELETE) |
| | | public AjaxResult<TInvoiceType> delInvoiceType(Integer[] id){ |
| | | List<TInvoiceType> tInvoiceTypes = invoiceTypeService.listByIds(Arrays.asList(id)); |
| | | for (TInvoiceType invoiceType : tInvoiceTypes) { |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.other.api.domain.TNotice; |
| | | import com.ruoyi.other.api.dto.NoticeQueryDto; |
| | | import com.ruoyi.other.mapper.SysNoticeMapper; |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "新增修改") |
| | | @PostMapping(value = "/saveOrUpdate") |
| | | @Log(title = "【公告管理】新增修改公告", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveOrUpdate(@RequestBody TNotice notice) { |
| | | noticeService.saveOrUpdate(notice); |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "删除") |
| | | @DeleteMapping(value = "/deleteById") |
| | | @Log(title = "【公告管理】删除公告", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteById(String ids) { |
| | | String[] split = ids.split(","); |
| | | for (String id : split) { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.other.api.domain.TSystemConfiguration; |
| | | import com.ruoyi.other.service.TSystemConfigurationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-内容设置"},value = "客户信息,系统内容设置") |
| | | @PostMapping(value = "/save") |
| | | @Log(title = "【系统内容设置】保存系统内容设置", businessType = BusinessType.INSERT) |
| | | public AjaxResult getDetailById(@RequestBody TSystemConfiguration systemConfiguration) { |
| | | systemConfigurationService.saveOrUpdate(systemConfiguration); |
| | | return AjaxResult.success(); |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | |
| | | private TokenService tokenService; |
| | | @PostMapping("/saveVip") |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员添加") |
| | | @Log(title = "【会员管理】添加会员", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveVip(@RequestBody TVip dto) { |
| | | vipService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员删除") |
| | | @Log(title = "【会员管理】删除会员", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(String ids) { |
| | | vipService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员修改") |
| | | @Log(title = "【会员管理】修改会员", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateVip(@RequestBody TVip dto) { |
| | | vipService.updateById(dto); |
| | | return AjaxResult.success(); |