| | |
| | | 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.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.context.SecurityContextHolder.getUserId; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "添加计费策略") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Integer> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | if(null != dto.getSiteId()){ |
| | | dto.setAuditStatus(3); |
| | | } |
| | | accountingStrategyService.save(dto); |
| | | // 添加明细 |
| | | dto.getAccountingStrategyDetails().forEach(detail -> detail.setAccountingStrategyId(dto.getId())); |
| | |
| | | TAccountingStrategyVO accountingStrategyVO = new TAccountingStrategyVO(); |
| | | BeanUtils.copyProperties(accountingStrategy,accountingStrategyVO); |
| | | // 查询用户信息 |
| | | String firstUserName = sysUserClient.getSysUser(accountingStrategy.getFirstUserId()).getData().getNickName(); |
| | | String twoUserName = sysUserClient.getSysUser(accountingStrategy.getTwoUserId()).getData().getNickName(); |
| | | accountingStrategyVO.setFirstUserName(firstUserName); |
| | | accountingStrategyVO.setTwoUserName(twoUserName); |
| | | if(null != accountingStrategy.getFirstUserId()){ |
| | | String firstUserName = sysUserClient.getSysUser(accountingStrategy.getFirstUserId()).getData().getNickName(); |
| | | accountingStrategyVO.setFirstUserName(firstUserName); |
| | | } |
| | | if(null != accountingStrategy.getTwoUserId()){ |
| | | String twoUserName = sysUserClient.getSysUser(accountingStrategy.getTwoUserId()).getData().getNickName(); |
| | | accountingStrategyVO.setTwoUserName(twoUserName); |
| | | } |
| | | return AjaxResult.ok(accountingStrategyVO); |
| | | } |
| | | |
| | |
| | | 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); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核") |
| | | @PostMapping(value = "/auth/pass") |
| | | public AjaxResult<PageInfo<TAccountingStrategyVO>> authPass(@RequestBody SteategyPassDto steategyPassDto) { |
| | | TAccountingStrategy byId = accountingStrategyService.getById(steategyPassDto.getId()); |
| | | Long userId = SecurityUtils.getLoginUser().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()); |
| | | byId.setFirstAuditTime(LocalDateTime.now()); |
| | | |
| | | }else if (byId.getAuditStatus()==2){ |
| | | byId.setAuditStatus(3); |
| | | byId.setTwoRemark(steategyPassDto.getRemark()); |
| | | byId.setTwoAuditTime(LocalDateTime.now()); |
| | | } |
| | | }else { |
| | | byId.setAuditStatus(4); |
| | | } |
| | | accountingStrategyService.updateById(byId); |
| | | |
| | | return AjaxResult.success(); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(String ids) { |
| | | String[] split = ids.split(","); |
| | | for (String s : split) { |
| | | accountingStrategyService.removeById(s); |
| | | } |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 小程序远程调用 根据会员折扣、预付金额 计算服务费 |