| | |
| | | import com.ruoyi.lavorissue.service.LavorIssueService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/13 11:19 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "劳保发放") |
| | | @Tag(name = "劳保发放") |
| | | @RequestMapping("/lavorIssue") |
| | | @AllArgsConstructor |
| | | public class LavorIssueController extends BaseController { |
| | | |
| | | @Autowired |
| | | private LavorIssueService laborIssueService; |
| | | |
| | | @Autowired |
| | | private LavorIssueMapper lavorIssueMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "劳保发放-分页查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation("劳保发放-分页查询") |
| | | @Operation(summary = "劳保发放-分页查询") |
| | | public AjaxResult listPage(Page page, LaborIssue laborIssue){ |
| | | IPage<LaborIssue> listPage = laborIssueService.listPage(page, laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @GetMapping("/statisticsList") |
| | | @Log(title = "劳保发放-统计查询", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "劳保发放-统计查询") |
| | | public AjaxResult statisticsList(LaborIssue laborIssue){ |
| | | List<Map<String, Object>> listPage = laborIssueService.statisticsList(laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "劳保发放-添加", businessType = BusinessType.INSERT) |
| | | @ApiOperation("劳保发放-添加") |
| | | @Operation(summary = "劳保发放-添加") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody LaborIssue laborIssue){ |
| | | String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "劳保发放-修改", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("劳保发放-修改") |
| | | @Operation(summary = "劳保发放-修改") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody LaborIssue laborIssue){ |
| | | boolean update = laborIssueService.updateById(laborIssue); |
| | |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "劳保发放-删除", businessType = BusinessType.DELETE) |
| | | @ApiOperation("劳保发放-删除") |
| | | @Operation(summary = "劳保发放-删除") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | boolean delete = laborIssueService.removeBatchByIds(ids); |
| | |
| | | } |
| | | |
| | | @GetMapping("/statistics") |
| | | @ApiOperation("劳保发放-统计") |
| | | @Operation(summary = "劳保发放-统计") |
| | | public AjaxResult statistics(StatisticsLaborIssue req) throws Exception { |
| | | StatisticsLaborIssue statisticsLaborIssue = laborIssueService.statistics(req); |
| | | return AjaxResult.success(statisticsLaborIssue); |
| | |
| | | */ |
| | | @Log(title = "劳保发放-导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("劳保发放-导出") |
| | | @Operation(summary = "劳保发放-导出") |
| | | public void export(HttpServletResponse response) { |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | ExcelUtil<LaborIssue> util = new ExcelUtil<LaborIssue>(LaborIssue.class); |
| | |
| | | */ |
| | | @Log(title = "劳保发放-导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportCopy") |
| | | @ApiOperation("劳保发放-导出") |
| | | public void exportCopy(HttpServletResponse response) throws UnsupportedEncodingException { |
| | | laborIssueService.exportCopy(response); |
| | | @Operation(summary = "劳保发放-导出") |
| | | public void exportCopy(HttpServletResponse response,LaborIssue laborIssue) throws UnsupportedEncodingException { |
| | | laborIssueService.exportCopy(response,laborIssue); |
| | | } |
| | | |
| | | } |