Переглянути джерело

外协价格库导入(分页列表查询,右上角是否显示报警标志,如果有报警信息,需要处理才能导入)

sl 1 рік тому
батько
коміт
c2803a597e

+ 35 - 7
module_kzks/src/main/java/org/jeecg/modules/costModelWxPrice/controller/CostModelWxPriceController.java

@@ -20,10 +20,7 @@ import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * @Description: 外协价格库
@@ -42,7 +39,7 @@ public class CostModelWxPriceController extends JeecgController<CostModelWxPrice
 	private ICostModelWxRepeatService costModelWxRepeatService;
 
 	/**
-	 * 分页列表查询
+	 * 分页列表查询:加入报警状态
 	 *
 	 * @param costModelWxPrice
 	 * @param pageNo
@@ -53,16 +50,47 @@ public class CostModelWxPriceController extends JeecgController<CostModelWxPrice
 	//@AutoLog(value = "外协价格库-分页列表查询")
 	@ApiOperation(value="外协价格库-分页列表查询", notes="外协价格库-分页列表查询")
 	@GetMapping(value = "/list")
-	public Result<IPage<CostModelWxPrice>> queryPageList(CostModelWxPrice costModelWxPrice,
+	public Result<HashMap<String, Object>> queryPageList(CostModelWxPrice costModelWxPrice,
 								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 								   HttpServletRequest req) {
 		QueryWrapper<CostModelWxPrice> queryWrapper = QueryGenerator.initQueryWrapper(costModelWxPrice, req.getParameterMap());
 		Page<CostModelWxPrice> page = new Page<CostModelWxPrice>(pageNo, pageSize);
 		IPage<CostModelWxPrice> pageList = costModelWxPriceService.page(page, queryWrapper);
-		return Result.OK(pageList);
+
+		return costModelWxPriceService.queryPageListIsAlarm(pageList);
+
+//		HashMap<String, Object> map = new HashMap<>();
+//		map.put("isalarm", 1);
+//		map.put("content", pageList);
+//
+//		return Result.OK(map);
+//		return Result.OK(pageList);
 	}
 
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param costModelWxPrice
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "外协价格库-分页列表查询")
+//	@ApiOperation(value="外协价格库-分页列表查询", notes="外协价格库-分页列表查询")
+//	@GetMapping(value = "/list")
+//	public Result<IPage<CostModelWxPrice>> queryPageList(CostModelWxPrice costModelWxPrice,
+//														 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+//														 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+//														 HttpServletRequest req) {
+//		QueryWrapper<CostModelWxPrice> queryWrapper = QueryGenerator.initQueryWrapper(costModelWxPrice, req.getParameterMap());
+//		Page<CostModelWxPrice> page = new Page<CostModelWxPrice>(pageNo, pageSize);
+//		IPage<CostModelWxPrice> pageList = costModelWxPriceService.page(page, queryWrapper);
+//		return Result.OK(pageList);
+//	}
+
 	/**
 	 *   添加
 	 *  添加重复的数据报错不予录入   思路和导入excel相同  --sl

+ 8 - 0
module_kzks/src/main/java/org/jeecg/modules/costModelWxPrice/service/ICostModelWxPriceService.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.costModelWxPrice.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.costModelWxPrice.entity.CostModelWxPrice;
@@ -7,6 +8,7 @@ import org.jeecg.modules.costModelXmxqWx.entity.CostModelXmxqWx;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -41,4 +43,10 @@ public interface ICostModelWxPriceService extends IService<CostModelWxPrice> {
     /**外协价格库-通过外协项目、外协单位、计量单位更新单价最大最小值平均值*/
     public Boolean updateWXPDetail(String maxP, String minP, String aveP, String remark, String wxPro, String wxComp, String unit);
 
+    /**
+     * 分页列表查询:加入报警状态
+     * @return
+     */
+    public Result<HashMap<String, Object>> queryPageListIsAlarm(IPage<CostModelWxPrice> pageList);
+
 }

+ 18 - 0
module_kzks/src/main/java/org/jeecg/modules/costModelWxPrice/service/impl/CostModelWxPriceServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.costModelWxPrice.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
@@ -354,4 +355,21 @@ public class CostModelWxPriceServiceImpl extends ServiceImpl<CostModelWxPriceMap
     public Boolean updateWXPDetail(String maxP, String minP, String aveP, String remark, String wxPro, String wxComp, String unit){
         return wxpMapper.updateWXPDetail(maxP, minP, aveP, remark, wxPro, wxComp, unit);
     }
+
+    /**
+     * 分页列表查询:加入报警状态
+     * @return
+     */
+    public Result<HashMap<String, Object>> queryPageListIsAlarm(IPage<CostModelWxPrice> pageList){
+        HashMap<String, Object> map = new HashMap<>();
+        if(costModelWxRepeatService.getWXRepeatRow() == 0){
+            map.put("isalarm", 0); //不报警,可以导入新数据
+        }else{
+            map.put("isalarm", 1); //报警,不可以导入新数据
+        }
+		map.put("content", pageList);
+
+		return Result.OK(map);
+    }
+
 }

+ 4 - 0
module_kzks/src/main/java/org/jeecg/modules/costModelWxRepeat/mapper/CostModelWxRepeatMapper.java

@@ -17,6 +17,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Version: V1.0
  */
 public interface CostModelWxRepeatMapper extends BaseMapper<CostModelWxRepeat> {
+    /**外协价格重复数据存储库-查看表是否为空*/
+    @Select("select count(*) from kzks_cost_model_wx_repeat")
+    public Integer getWXRepeatRow();
+
     /**外协价格重复数据存储库-通过id查看表中的数据*/
     @Select("select * from kzks_cost_model_wx_repeat where id = #{id}")
     public CostModelWxRepeat getWXRepeatDetail(@Param("id") String id);

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/costModelWxRepeat/service/ICostModelWxRepeatService.java

@@ -33,5 +33,8 @@ public interface ICostModelWxRepeatService extends IService<CostModelWxRepeat> {
     /**外协价格重复数据存储库-通过外协项目、外协单位、计量单位删除相应数据*/
     public Boolean deleteWXRepeatDetail(String wxPro, String wxComp, String unit);
 
+    /**外协价格重复数据存储库-查看表是否为空*/
+    public Integer getWXRepeatRow();
+
 
 }

+ 5 - 0
module_kzks/src/main/java/org/jeecg/modules/costModelWxRepeat/service/impl/CostModelWxRepeatServiceImpl.java

@@ -78,4 +78,9 @@ public class CostModelWxRepeatServiceImpl extends ServiceImpl<CostModelWxRepeatM
         return costModelWxRepeatMapper.deleteWXRepeatDetail(wxPro, wxComp, unit);
     }
 
+    /**外协价格重复数据存储库-查看表是否为空*/
+    public Integer getWXRepeatRow(){
+        return costModelWxRepeatMapper.getWXRepeatRow();
+    }
+
 }