|
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.system.domain.projectV2.ZsyzSbbzb;
|
|
@@ -18,6 +19,9 @@ import com.ruoyi.system.service.projectV2.IZsyzShyjService;
|
|
|
import com.ruoyi.system.service.projectV2.common.IZsyzCommonService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -173,7 +177,7 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
|
|
|
zsyzShyj.setDeptId(deptId);
|
|
|
List<ZsyzShyj> zsyzShyjs = zsyzShyjService.selectZsyzShyjListByWt(zsyzShyj);
|
|
|
int wt = 0;
|
|
|
- if (zsyzShyjs != null ){
|
|
|
+ if (zsyzShyjs != null) {
|
|
|
wt = zsyzShyjs.size();
|
|
|
}
|
|
|
map.put("wt", wt);
|
|
@@ -181,7 +185,7 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
|
|
|
long ps = zsyzSbbzbMapper.ldpsListCount(new ZsyzSbbzb());
|
|
|
map.put("ps", ps);
|
|
|
map.put("all", all);
|
|
|
- redisCache.setCacheObject(INDEX, map,1, TimeUnit.HOURS);
|
|
|
+ redisCache.setCacheObject(INDEX, map, 1, TimeUnit.HOURS);
|
|
|
}
|
|
|
return AjaxResult.success(map);
|
|
|
}
|
|
@@ -189,8 +193,73 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
|
|
|
//首页统计折线图
|
|
|
@Override
|
|
|
public AjaxResult censusXy() {
|
|
|
-
|
|
|
- return null;
|
|
|
+ //1.创建一个放所有日期的集合
|
|
|
+ List<String> dates = new ArrayList();
|
|
|
+ dates.add("第一季度");
|
|
|
+ dates.add("第二季度");
|
|
|
+ dates.add("第三季度");
|
|
|
+ dates.add("第四季度");
|
|
|
+ Map map = new HashMap(2);
|
|
|
+ map.put("x", dates);
|
|
|
+ Map<String, List<Integer>> yMpa = new HashMap();
|
|
|
+ List<Integer> xs = new ArrayList();
|
|
|
+ List<Integer> qy = new ArrayList();
|
|
|
+ List<Integer> kg = new ArrayList();
|
|
|
+ List<Integer> tc = new ArrayList();
|
|
|
+ //查询对应季度所有正常的项目
|
|
|
+ List<Map<String, Object>> dateList = new ArrayList<>();
|
|
|
+ String year = DateUtils.getTime();
|
|
|
+ //获取当前年
|
|
|
+ Map<String,Object> timeMapOne = new HashMap<>(2);
|
|
|
+ Map<String,Object> timeMapTwo = new HashMap<>(2);
|
|
|
+ Map<String,Object> timeMapThr= new HashMap<>(2);
|
|
|
+ Map<String,Object> timeMapFor = new HashMap<>(2);
|
|
|
+ timeMapOne.put("beginTime", year + "0101");
|
|
|
+ timeMapOne.put("endTime", year + "0331");
|
|
|
+ timeMapTwo.put("beginTime", year + "0401");
|
|
|
+ timeMapTwo.put("endTime", year + "0630");
|
|
|
+ timeMapThr.put("beginTime", year + "0701");
|
|
|
+ timeMapThr.put("endTime", year + "0930");
|
|
|
+ timeMapFor.put("beginTime", year + "1001");
|
|
|
+ timeMapFor.put("endTime", year + "1231");
|
|
|
+ dateList.add(timeMapOne);
|
|
|
+ dateList.add(timeMapTwo);
|
|
|
+ dateList.add(timeMapThr);
|
|
|
+ dateList.add(timeMapFor);
|
|
|
+ for (int i = 0; i < 4; i++) {
|
|
|
+ ZsyzSbbzb zsyzSbbzb = new ZsyzSbbzb();
|
|
|
+ zsyzSbbzb.setParams(dateList.get(i));
|
|
|
+ List<ZsyzSbbzb> zsyzSbbzbs = zsyzSbbzbMapper.selectZsyzSbbzbList(zsyzSbbzb);
|
|
|
+ if (zsyzSbbzbs != null && zsyzSbbzbs.size() > 0) {
|
|
|
+ int xsNub = 0;
|
|
|
+ int qyNub = 0;
|
|
|
+ int kgNub = 0;
|
|
|
+ int tcNub = 0;
|
|
|
+ for (ZsyzSbbzb sbbzb : zsyzSbbzbs) {
|
|
|
+ String progress = sbbzb.getProgress();
|
|
|
+ String xmjd = xmjd(progress);
|
|
|
+ if (XMJD_XS.equals(xmjd)){
|
|
|
+ xsNub = xsNub + 1;
|
|
|
+ }else if (XMJD_QY.equals(xmjd)){
|
|
|
+ qyNub = qyNub +1;
|
|
|
+ }else if (XMJD_KG.equals(xmjd)){
|
|
|
+ kgNub = kgNub +1;
|
|
|
+ }else if (XMJD_TC.equals(xmjd)){
|
|
|
+ tcNub = tcNub +1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ xs.add(xsNub);
|
|
|
+ qy.add(qyNub);
|
|
|
+ kg.add(kgNub);
|
|
|
+ tc.add(tcNub);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ yMpa.put("线索", xs);
|
|
|
+ yMpa.put("签约", qy);
|
|
|
+ yMpa.put("开工", kg);
|
|
|
+ yMpa.put("投产", tc);
|
|
|
+ map.put("y",yMpa);
|
|
|
+ return AjaxResult.success(map);
|
|
|
}
|
|
|
|
|
|
//更改项目进度前进
|
|
@@ -228,13 +297,13 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
|
|
|
//根据项目进度判断项目阶段
|
|
|
public String xmjd(String code) {
|
|
|
if (ONE.equals(code) || TWO.equals(code) || THR.equals(code) || FOR.equals(code) || FIV.equals(code)) {
|
|
|
- return "线索阶段";
|
|
|
+ return XMJD_XS;
|
|
|
} else if (SIX.equals(code) || SEV.equals(code)) {
|
|
|
- return "签约阶段";
|
|
|
+ return XMJD_QY;
|
|
|
} else if (EIG.equals(code) || NIN.equals(code)) {
|
|
|
- return "开工阶段";
|
|
|
+ return XMJD_KG;
|
|
|
} else if (TEN.equals(code) || ELE.equals(code)) {
|
|
|
- return "投产阶段";
|
|
|
+ return XMJD_TC;
|
|
|
}
|
|
|
return "入归阶段";
|
|
|
}
|