|
@@ -1404,6 +1404,173 @@ public class SubInfoController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("detailFgwView")
|
|
|
+ public ModelAndView detailFgwView(Model model, String subId, String lastUrl, Boolean layer, String queryYear, Boolean isCt) {
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> subInfo = subInfoService.getSubInfoByFgwId(subId, queryYear);
|
|
|
+
|
|
|
+
|
|
|
+ final String[] light = {""};
|
|
|
+
|
|
|
+
|
|
|
+ if ((subInfo.get("status") == null ? "0" : subInfo.get("status") + "").equals(ProjectStatusEnum.PRE.getKey())) {
|
|
|
+ //判断灯色
|
|
|
+ //判断项目前期问题
|
|
|
+
|
|
|
+ //获取项目前期资料
|
|
|
+ List<SubPreNewResultVO> list = subPreNewService.listBySubId(subId);
|
|
|
+ //判断前期是否有问题
|
|
|
+ list.stream().forEach(v -> {
|
|
|
+ String status = checkPreLigth(v);
|
|
|
+ if ("yellow".equals(status)) {
|
|
|
+ if (!"red".equals(status)) {
|
|
|
+ light[0] = "yellow";
|
|
|
+ }
|
|
|
+ } else if ("red".equals(status)) {
|
|
|
+ light[0] = "red";
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ //判断偏离度问题
|
|
|
+ BigDecimal pld = subInfo.get("pld") == null ? BigDecimal.ZERO : (BigDecimal) subInfo.get("pld");
|
|
|
+ //-30到-10 为黄色
|
|
|
+ if (new BigDecimal(-30).compareTo(pld) <= 0 && new BigDecimal(-10).compareTo(pld) >= 0) {
|
|
|
+ light[0] = "yellow";
|
|
|
+ }//小于 -30 为红色
|
|
|
+ else if (new BigDecimal(-30).compareTo(pld) > 0) {
|
|
|
+ light[0] = "red";
|
|
|
+ }
|
|
|
+
|
|
|
+ //判断 月报红黄灯
|
|
|
+ PreWarnDataQueryVO queryVO = new PreWarnDataQueryVO();
|
|
|
+ queryVO.setSubId(subId);
|
|
|
+ Page pageData = subRptContService.pageMonthWarnData(new Page(), getCurUser().getLoginUser(), queryVO);
|
|
|
+ if (pageData.getList().size() > 0) {
|
|
|
+ List<Map<String, Object>> list = pageData.getList();
|
|
|
+ list.stream().forEach(v -> {
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ Date newDate = calendar.getTime();
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 5);
|
|
|
+
|
|
|
+ if (v.get("monthId") != null) {
|
|
|
+ if (v.get("create_time") != null) {
|
|
|
+ //填写了月报 但是超过3天为 红色
|
|
|
+ if ((((Date) v.get("create_time")).getTime() - calendar.getTime().getTime()) > (86400 * 3)) {
|
|
|
+ light[0] = "red";
|
|
|
+ } else {
|
|
|
+ if (!"red".equals(light[0])) {
|
|
|
+ light[0] = "yellow";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //未填写 月报 超过下月5号 3天 为红色
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String time = format.format(calendar.getTime());
|
|
|
+ if (newDate.getTime() - calendar.getTime().getTime() > (86400 * 3)) {
|
|
|
+ light[0] = "red";
|
|
|
+ } else {
|
|
|
+ if (!"red".equals(light[0])) {
|
|
|
+ light[0] = "yellow";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //项目前期,月报 ,偏离度 都没有灯色
|
|
|
+ if ("yellow".equals(light[0])) {
|
|
|
+ subInfo.put("status_fgw", "1");
|
|
|
+ } else if ("red".equals(light[0])) {
|
|
|
+ subInfo.put("status_fgw", "2");
|
|
|
+ } else {
|
|
|
+ subInfo.put("status_fgw", "0");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //判断是否 是项目单位, 并且项目处于 项目前期过程中。 能直接进入项目前期
|
|
|
+ String status = String.valueOf(subInfo.get("status"));
|
|
|
+ if (ProjectStatusEnum.PRE.getKey().equals(status) && "2".equals(getCurUser().getKindUnit())) {
|
|
|
+ subInfo.put("preCheck", true);
|
|
|
+ }
|
|
|
+ //判断是否项目已经竣工
|
|
|
+ model.addAttribute("completeCheck", ProjectStatusEnum.END.getKey().equals(status));
|
|
|
+
|
|
|
+ model.addAttribute("sunInfo", subInfo);
|
|
|
+
|
|
|
+ int currYear = DateUtil.thisYear();
|
|
|
+ model.addAttribute("currYear", currYear);
|
|
|
+ model.addAttribute("lastUrl", lastUrl);
|
|
|
+
|
|
|
+ model.addAttribute("layer", Boolean.TRUE.equals(layer));
|
|
|
+ model.addAttribute("canPrint", false);
|
|
|
+ model.addAttribute("queryYear", queryYear);
|
|
|
+
|
|
|
+ //当前状态
|
|
|
+ if (Boolean.TRUE.equals(isCt)) {
|
|
|
+ return new ModelAndView("/vmodules/statics/layer/subInfo/projectInfo.jsp");
|
|
|
+ }
|
|
|
+
|
|
|
+ //总完成投资
|
|
|
+ BigDecimal allEndAmt = BigDecimal.ZERO;
|
|
|
+ BigDecimal totalAmt = (BigDecimal) (subInfo.get("amt_total")); //这个原始用法出现问题,类型错误报错
|
|
|
+// BigDecimal totalAmt = new BigDecimal(((Float) subInfo.get("amt_total")).toString());
|
|
|
+ List<RptCont> allRpt = subRptContService.getListBySub(subId, null, RptContKindEnum.MONTH);
|
|
|
+ if (CollectionUtil.isNotEmpty(allRpt)) {
|
|
|
+ double sum = allRpt.stream().mapToDouble(new ToDoubleFunction<RptCont>() {
|
|
|
+ @Override
|
|
|
+ public double applyAsDouble(RptCont value) {
|
|
|
+ if (value.getAmt() != null) {
|
|
|
+ return value.getAmt().doubleValue();
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }).sum();
|
|
|
+ allEndAmt = BigDecimal.valueOf(sum);
|
|
|
+ }
|
|
|
+ if (totalAmt == null) {
|
|
|
+ totalAmt = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ model.addAttribute("totalAmt", totalAmt.divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP));
|
|
|
+ model.addAttribute("allEndAmt", allEndAmt.divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP));
|
|
|
+ if (BigDecimal.ZERO.compareTo(totalAmt) != 0) {
|
|
|
+ model.addAttribute("allEndAmtRate", allEndAmt.divide(totalAmt, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ } else {
|
|
|
+ model.addAttribute("allEndAmtRate", "0");
|
|
|
+ }
|
|
|
+ BigDecimal yearAmt = BigDecimal.ZERO;
|
|
|
+ List<SubAmtPlan> currYearAmtPlanList = subAmtPlanDao.getBySubId(subId, String.valueOf(currYear));
|
|
|
+ if (CollectionUtil.isNotEmpty(currYearAmtPlanList)) {
|
|
|
+ for (SubAmtPlan amt : currYearAmtPlanList) {
|
|
|
+ if (amt.getAmt() != null) {
|
|
|
+ yearAmt = yearAmt.add(amt.getAmt());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal yearAmtSj = (BigDecimal) subInfo.get("yearAmtSj");
|
|
|
+ if (yearAmtSj == null) {
|
|
|
+ yearAmtSj = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ model.addAttribute("yearPlanAmt", (yearAmt).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ model.addAttribute("yearAmt", yearAmt.divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ model.addAttribute("yearAmtSj", yearAmtSj.divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ if (BigDecimal.ZERO.compareTo(yearAmt) != 0) {
|
|
|
+ model.addAttribute("yearEndAmtRate", yearAmtSj.divide(yearAmt, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ } else {
|
|
|
+ model.addAttribute("yearEndAmtRate", 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ return new ModelAndView("/vmodules/subject/subInfo/oldDetailView.jsp");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@GetMapping("detailViewOut")
|
|
|
public ModelAndView detailViewOut(Model model, String subId, String lastUrl, Boolean layer, String queryYear, Boolean isCt) {
|