|
@@ -0,0 +1,85 @@
|
|
|
+package com.huimv.farm.damsubsidy.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.huimv.farm.damsubsidy.common.token.TokenSign;
|
|
|
+import com.huimv.farm.damsubsidy.common.utils.Result;
|
|
|
+import com.huimv.farm.damsubsidy.common.utils.ResultCode;
|
|
|
+import com.huimv.farm.damsubsidy.entity.BillLandingInspection;
|
|
|
+import com.huimv.farm.damsubsidy.entity.BillSubsidy;
|
|
|
+import com.huimv.farm.damsubsidy.entity.SysUser;
|
|
|
+import com.huimv.farm.damsubsidy.mapper.SysUserMapper;
|
|
|
+import com.huimv.farm.damsubsidy.service.IBillLandingInspectionService;
|
|
|
+import com.huimv.farm.damsubsidy.service.IBillSubsidyService;
|
|
|
+import com.huimv.farm.damsubsidy.service.ISysUserService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 企业合作社 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author Newspaper
|
|
|
+ * @since 2023-04-27
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/Enterprise-Cooperative")
|
|
|
+public class EnterpriseCooperativeController {
|
|
|
+ @Autowired
|
|
|
+ private IBillSubsidyService iBillSubsidyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBillLandingInspectionService iBillLandingInspectionService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SysUserMapper sysUserMapper;
|
|
|
+
|
|
|
+ @PostMapping("/listApplication")
|
|
|
+ public Result listApplication(HttpServletRequest httpServletRequest, @RequestBody Map<String,String> paramsMap){
|
|
|
+ String applicationType = paramsMap.get("applicationType");
|
|
|
+ String applicationStatus = paramsMap.get("applicationStatus");
|
|
|
+
|
|
|
+ QueryWrapper<BillSubsidy> subsidyQueryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<BillLandingInspection> landingInspectionQueryWrapper = new QueryWrapper<>();
|
|
|
+ subsidyQueryWrapper.eq("creat_user",TokenSign.getUserName(httpServletRequest))
|
|
|
+ .orderByDesc("create_time");
|
|
|
+ landingInspectionQueryWrapper.eq("creat_user",TokenSign.getUserName(httpServletRequest))
|
|
|
+ .orderByDesc("create_time");
|
|
|
+
|
|
|
+ Map resultMap = new HashMap();
|
|
|
+ if (ObjectUtil.isNotEmpty(applicationStatus)){
|
|
|
+ landingInspectionQueryWrapper.eq("inspection_sch",applicationStatus);
|
|
|
+ subsidyQueryWrapper.eq("subsidy_sch",applicationStatus);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(applicationStatus)){
|
|
|
+ landingInspectionQueryWrapper.eq("inspection_sch",applicationStatus);
|
|
|
+ subsidyQueryWrapper.eq("subsidy_sch",applicationStatus);
|
|
|
+ }
|
|
|
+ if (applicationType.equals("0")){
|
|
|
+ List<BillSubsidy> subsidyList = iBillSubsidyService.list(subsidyQueryWrapper);
|
|
|
+ List<BillLandingInspection> landingInspectionList = iBillLandingInspectionService.list(landingInspectionQueryWrapper);
|
|
|
+ resultMap.put("subsidyList",subsidyList);
|
|
|
+ resultMap.put("LandingInspectionList",landingInspectionList);
|
|
|
+ }else if (applicationType.equals("1")){
|
|
|
+ List<BillLandingInspection> subsidyList = iBillLandingInspectionService.list(landingInspectionQueryWrapper);
|
|
|
+ resultMap.put("subsidyList",subsidyList);
|
|
|
+ }else {
|
|
|
+ List<BillLandingInspection> landingInspectionList = iBillLandingInspectionService.list(landingInspectionQueryWrapper);
|
|
|
+ resultMap.put("LandingInspectionList",landingInspectionList);
|
|
|
+ }
|
|
|
+ return new Result(ResultCode.SUCCESS,resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|