|
@@ -1,9 +1,24 @@
|
|
|
package com.ims.eval.controller;
|
|
|
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.ims.eval.cache.CacheContext;
|
|
|
+import com.ims.eval.config.CustomException;
|
|
|
+import com.ims.eval.entity.BinStage;
|
|
|
+import com.ims.eval.entity.Indicator;
|
|
|
+import com.ims.eval.entity.PartyBuildingMultiplier;
|
|
|
+import com.ims.eval.entity.dto.result.R;
|
|
|
+import com.ims.eval.service.IBinStageService;
|
|
|
+import com.ims.eval.service.IPartyBuildingMultiplierService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -13,8 +28,78 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
* @author wang
|
|
|
* @since 2023-03-29
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("//party-building-multiplier")
|
|
|
public class PartyBuildingMultiplierController {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IPartyBuildingMultiplierService iPartyBuildingMultiplierService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ *
|
|
|
+ * @param id 主键ID
|
|
|
+ * @param departId 部门id
|
|
|
+ * @param sectionId 板块id
|
|
|
+ * @param year 年度
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ public R list(@RequestParam(value = "pageNum", required = false) Integer pageNum,
|
|
|
+ @RequestParam(value = "pageSize", required = false) Integer pageSize,
|
|
|
+ @RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "departId", required = false) String departId,
|
|
|
+ @RequestParam(value = "sectionId", required = false) String sectionId,
|
|
|
+ @RequestParam(value = "year", required = false) String year) {
|
|
|
+
|
|
|
+ IPage<PartyBuildingMultiplier> list = iPartyBuildingMultiplierService.listAll(pageNum,pageSize,id, departId, sectionId, year);
|
|
|
+ return R.ok().data(list);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param partyBuildingMultiplier
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/save")
|
|
|
+ @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
+ public R addAll(@RequestBody PartyBuildingMultiplier partyBuildingMultiplier) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = iPartyBuildingMultiplierService.saveOrUpdate(partyBuildingMultiplier);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e){
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/remove/{ids}")
|
|
|
+ @ApiOperation(value = "删除", notes = "删除")
|
|
|
+ public R deleteAll(@PathVariable("ids") String ids) {
|
|
|
+ String[] strings = ids.split(",");
|
|
|
+ boolean b = iPartyBuildingMultiplierService.removeByIds(Arrays.asList(strings));
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("删除失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|