| | |
| | | import com.ruoyi.chargingPile.service.TAccountingStrategyService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.SteategyPassDto; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BaseDelete; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | |
| | | import java.math.BigInteger; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalTime; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-06 |
| | | */ |
| | | @Api(tags = "计费策略") |
| | | |
| | | @RestController |
| | | @RequestMapping("/t-accounting-strategy") |
| | | public class TAccountingStrategyController { |
| | |
| | | @Log(title = "批量删除计费策略", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "批量删除计费策略") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Integer> deleteByIds(@RequestBody List<Integer> ids) { |
| | | public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | // 刪除计费策略明细信息 |
| | | accountingStrategyDetailService.remove(Wrappers.lambdaQuery(TAccountingStrategyDetail.class) |
| | | .in(TAccountingStrategyDetail::getAccountingStrategyId, ids)); |
| | | return AjaxResult.success(accountingStrategyService.removeByIds(ids)); |
| | | .in(TAccountingStrategyDetail::getAccountingStrategyId, Arrays.asList(split))); |
| | | return AjaxResult.success(accountingStrategyService.removeByIds(Arrays.asList(split))); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "查询计费审核分页列表") |
| | | @PostMapping(value = "/auth/pageList") |
| | | public AjaxResult authPageList(@RequestBody TAccountingStrategyQuery query) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | Page<TAccountingStrategy> page = accountingStrategyService.lambdaQuery() |
| | | .in(TAccountingStrategy::getFirstUserId, userid) |
| | | .or().in(TAccountingStrategy::getTwoUserId, userid) |
| | | .page(Page.of(query.getPageCurr(), query.getPageSize())); |
| | | public AjaxResult<PageInfo<TAccountingStrategyVO>> authPageList(@RequestBody TAccountingStrategyQuery query) { |
| | | |
| | | List<TAccountingStrategy> records = page.getRecords(); |
| | | for (TAccountingStrategy record : records) { |
| | | if (record.getAuditStatus()==2){ |
| | | if (record.getFirstUserId().equals(userid)){ |
| | | record.setAuditStatus(3); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return AjaxResult.ok(accountingStrategyService.pageList(query)); |
| | | } |
| | | |
| | | // @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核") |
| | | // @PostMapping(value = "/auth/pass") |
| | | // public AjaxResult<PageInfo<TAccountingStrategyVO>> authPass(@RequestBody SteategyPassDto steategyPassDto) { |
| | | // TAccountingStrategy byId = accountingStrategyService.getById(steategyPassDto.getId()); |
| | | // Long userId = tokenService.getLoginUser().getSysUser().getUserId(); |
| | | // if (byId.getAuditStatus()==1&&byId.getFirstUserId()!=userId){ |
| | | // return AjaxResult.error("您不是一级审核人员,无法审核"); |
| | | // } |
| | | // if (byId.getAuditStatus()==2&&byId.getTwoUserId()!=userId){ |
| | | // return AjaxResult.error("您不是二级审核人员,无法审核"); |
| | | // } |
| | | // if (steategyPassDto.getPass()==1){ |
| | | // if (byId.getAuditStatus()==1){ |
| | | // |
| | | // byId.setAuditStatus(2); |
| | | // byId.setFirstRemark(steategyPassDto.getRemark()); |
| | | // |
| | | // }else if (byId.getAuditStatus()==2){ |
| | | // byId.setAuditStatus(3); |
| | | // byId.setTwoRemark(steategyPassDto.getRemark()); |
| | | // |
| | | // } |
| | | // }else { |
| | | // byId.setAuditStatus(4); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | |
| | | /** |
| | | * 小程序远程调用 根据会员折扣、预付金额 计算服务费 |
| | | * @return |