|
@@ -0,0 +1,126 @@
|
|
|
+package cn.ezhizao.project.business.outsourceBalanceMonth.controller;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import cn.ezhizao.common.utils.poi.ExcelUtil;
|
|
|
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
|
|
|
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
|
|
|
+import cn.ezhizao.framework.web.controller.BaseController;
|
|
|
+import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
|
+import cn.ezhizao.framework.web.page.TableDataInfo;
|
|
|
+import cn.ezhizao.project.business.outsourceBalanceMonth.domain.BizOutsourceBalanceMonth;
|
|
|
+import cn.ezhizao.project.business.outsourceBalanceMonth.service.IBizOutsourceBalanceMonthService;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 外协结算月设置Controller
|
|
|
+ *
|
|
|
+ * @author ezhizao
|
|
|
+ * @date 2024-08-13
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/business/outsourceBalanceMonth")
|
|
|
+public class BizOutsourceBalanceMonthController extends BaseController
|
|
|
+{
|
|
|
+ @Resource
|
|
|
+ private IBizOutsourceBalanceMonthService bizOutsourceBalanceMonthService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询外协结算月设置列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:outsourceBalanceMonth:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(BizOutsourceBalanceMonth bizOutsourceBalanceMonth) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(bizOutsourceBalanceMonth);
|
|
|
+ startPage();
|
|
|
+ List<BizOutsourceBalanceMonth> list = bizOutsourceBalanceMonthService.getList(bizOutsourceBalanceMonth);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出外协结算月设置列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:outsourceBalanceMonth:export')")
|
|
|
+ @Log(title = "外协结算月设置", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, BizOutsourceBalanceMonth bizOutsourceBalanceMonth) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(bizOutsourceBalanceMonth);
|
|
|
+ List<BizOutsourceBalanceMonth> list = bizOutsourceBalanceMonthService.getList(bizOutsourceBalanceMonth);
|
|
|
+ ExcelUtil<BizOutsourceBalanceMonth> util = new ExcelUtil<BizOutsourceBalanceMonth>(BizOutsourceBalanceMonth.class);
|
|
|
+ util.exportExcel(response, list, "外协结算月设置数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取外协结算月设置详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:outsourceBalanceMonth:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ {
|
|
|
+ return success(bizOutsourceBalanceMonthService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增外协结算月设置
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:outsourceBalanceMonth:add')")
|
|
|
+ @Log(title = "外协结算月设置", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody BizOutsourceBalanceMonth bizOutsourceBalanceMonth) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(bizOutsourceBalanceMonth);
|
|
|
+ return toAjax(bizOutsourceBalanceMonthService.save(bizOutsourceBalanceMonth));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改外协结算月设置
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:outsourceBalanceMonth:edit')")
|
|
|
+ @Log(title = "外协结算月设置", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody BizOutsourceBalanceMonth bizOutsourceBalanceMonth) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(bizOutsourceBalanceMonth);
|
|
|
+ return toAjax(bizOutsourceBalanceMonthService.updateById(bizOutsourceBalanceMonth));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除外协结算月设置
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:outsourceBalanceMonth:remove')")
|
|
|
+ @Log(title = "外协结算月设置", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable List<Long> ids)
|
|
|
+ {
|
|
|
+ return toAjax(bizOutsourceBalanceMonthService.removeBatchByIds(ids));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改外协结算月设置
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:outsourceBalanceMonth:save')")
|
|
|
+ @Log(title = "外协结算月设置", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/save")
|
|
|
+ public AjaxResult save(@RequestBody BizOutsourceBalanceMonth bizOutsourceBalanceMonth) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(bizOutsourceBalanceMonth);
|
|
|
+ bizOutsourceBalanceMonth.setUserId(getUserId());
|
|
|
+ List<BizOutsourceBalanceMonth> month = bizOutsourceBalanceMonthService.query().isNull("stop_date").list();
|
|
|
+ month.forEach(l -> l.setStopDate(new Date()));
|
|
|
+ bizOutsourceBalanceMonthService.updateBatchById(month);
|
|
|
+ return toAjax(bizOutsourceBalanceMonthService.save(bizOutsourceBalanceMonth));
|
|
|
+ }
|
|
|
+}
|