|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.DateUtil; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Solutions; | 
|---|
|  |  |  | import com.doumee.dao.system.vo.BigDecimalVO; | 
|---|
|  |  |  | import com.doumee.service.business.SolutionsService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("禁用启用") | 
|---|
|  |  |  | @PostMapping("/updateStatus") | 
|---|
|  |  |  | @RequiresPermissions("business:solutions:update") | 
|---|
|  |  |  | public ApiResponse updateStatus(@RequestBody Solutions solutions) { | 
|---|
|  |  |  | solutionsService.updateStatus(solutions); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("批量删除") | 
|---|
|  |  |  | @GetMapping("/delete/batch") | 
|---|
|  |  |  | @RequiresPermissions("business:solutions:delete") | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @ApiOperation("【平台端】分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:solutions:query") | 
|---|
|  |  |  | public ApiResponse<PageData<Solutions>> findPage (@RequestBody PageWrap<Solutions> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("列表查询") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @RequiresPermissions("business:solutions:query") | 
|---|
|  |  |  | public ApiResponse<List<Solutions>> findList (@RequestBody Solutions pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.findList(pageWrap)); | 
|---|
|  |  |  | public ApiResponse<List<Solutions>> findList (Solutions solutions) { | 
|---|
|  |  |  | Integer dateType = Constants.TWO; | 
|---|
|  |  |  | if(!Objects.isNull(solutions)&&!Objects.isNull(solutions.getDataType())){ | 
|---|
|  |  |  | dateType = solutions.getDataType(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.findListForCompany(dateType)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据历史版本查询当前最新启用版本") | 
|---|
|  |  |  | @GetMapping("/getNewVersion") | 
|---|
|  |  |  | public ApiResponse<Solutions> getNewVersion (@RequestParam Integer solutionId) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.getNewVersion(solutionId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    @ApiOperation("列表查询") | 
|---|
|  |  |  | //    @PostMapping("/page") | 
|---|
|  |  |  | //    public ApiResponse<List<Solutions>> findPage (@RequestBody Solutions solutions) { | 
|---|
|  |  |  | //        return ApiResponse.success(solutionsService.findList(solutions)); | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("testSolutionAddMoney") | 
|---|
|  |  |  | @GetMapping("/testSolutionAddMoney") | 
|---|
|  |  |  | public ApiResponse<BigDecimal> testSolutionAddMoney (Integer id, BigDecimal fee, String start, String end, String newDate, String newEndDate) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.testSolutionAddMoney(id,fee, DateUtil.StringToDate(start),DateUtil.StringToDate(end) | 
|---|
|  |  |  | ,DateUtil.StringToDate(newDate),DateUtil.StringToDate(newEndDate))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("testSolutionReduceMoney") | 
|---|
|  |  |  | @GetMapping("/testSolutionReduceMoney") | 
|---|
|  |  |  | public ApiResponse<BigDecimal> testSolutionReduceMoney (Integer id, BigDecimal fee, String start, String end, String reduceStartTime,String reduceEndTime) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.testSolutionReduceMoney(id,fee, DateUtil.StringToDate(start),DateUtil.StringToDate(end) ,DateUtil.StringToDate(reduceStartTime),DateUtil.StringToDate(reduceEndTime))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("testSolutionProduceMoney") | 
|---|
|  |  |  | @GetMapping("/testSolutionProduceMoney") | 
|---|
|  |  |  | public ApiResponse<BigDecimal> testSolutionProduceMoney (Integer id, BigDecimal fee, String start, String end,String produceStart) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsService.testSolutionProduceMoney(id,fee, DateUtil.StringToDate(start),DateUtil.StringToDate(end),DateUtil.StringToDate(produceStart))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|