Browse Source

lrl -2021-12-24

lirl 3 years ago
parent
commit
3f03ef3050

+ 6 - 2
src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.xml

@@ -793,11 +793,15 @@
       <if test="specifications != null and specifications != ''">
         and SPECIFICATIONS in (${specifications})
       </if>
-
       <if test="id != null and id != ''">
         and id = #{id}
       </if>
-      and state in ('2','3')
+      <if test="state == null || state == ''">
+        and state in ('2','3')
+      </if>
+      <if test="state != null and state != ''">
+        and state = #{state}
+      </if>
     </where>
     order by JH_TIME desc,ID desc
   </select>

+ 2 - 3
src/main/java/com/steerinfo/ems/emsprodplanroundweight/service/impl/EmsProdplanRoundWeightServiceImpl.java

@@ -42,7 +42,6 @@ public class EmsProdplanRoundWeightServiceImpl extends BaseServiceImpl<EmsProdpl
     private LgWeightFeigenService lgWeightFeigenService;
     @Autowired
     private GxWeightFeigenService gxWeightFeigenService;
-
     @Override
     protected IBaseMapper<EmsProdplanRoundWeight, String> getMapper() {
         return emsProdplanRoundWeightMapper;
@@ -65,8 +64,8 @@ public class EmsProdplanRoundWeightServiceImpl extends BaseServiceImpl<EmsProdpl
             model.setQty(item.getWeight());
             model.setMaterialcode(item.getMaterialcode());
             model.setMaterialname(item.getMaterialname());
-            model.setProdate(model.getProdate());
-            model.setUnit(model.getUnit());
+            model.setProdate(item.getProdate());
+            model.setUnit(item.getUnit());
             EmsProdplanRoundWeight emsProdplanRoundWeight = emsProdplanRoundWeightMapper.selectByPrimaryKey(model.getFid());
             if(emsProdplanRoundWeight !=  null){
                 emsProdplanRoundWeightMapper.updateByPrimaryKeySelective(emsProdplanRoundWeight);

+ 6 - 2
src/main/java/com/steerinfo/ems/emsprodplanyear/controller/EmsProdplanYearController.java

@@ -395,7 +395,7 @@ public class EmsProdplanYearController extends BaseRESTfulController {
                     break;
                 case "JCS" :
                     sumWeight = model.getWeight().intValue();
-                    productid="白灰";
+                    productid="白灰";
                     unit="008";
                     break;
                 case "JCW" :
@@ -470,9 +470,13 @@ public class EmsProdplanYearController extends BaseRESTfulController {
                 monMap.put("endTime",new SimpleDateFormat("yyyy-MM-dd").format(monModel.getMay()));
                 List<EmsProdplanMonth> monList = emsProdplanMonthMapper.selectByParameters(monMap);
                 if(monList.size()<=0){
-                    EmsProdplanMonth emsProdplanMonth = emsProdplanMonthService.add(monModel);
+                        emsProdplanMonthService.add(monModel);
                 } else {
                     if((model.getParentid().equals("LG")&&monModel.getProductid().equals("方坯")) || model.getParentid().equals("JJZ")) {
+                        if (k == 0){
+                            monList.get(0).setWeightMonth(BigDecimal.valueOf(0));
+                            monList.get(0).setWeightDay(BigDecimal.valueOf(0));
+                        }
                         //monModel.setKxf_weight(monList.get(0).getKxf_weight().add(monModel.getKxf_weight()));
                         monModel.setWeightMonth(monList.get(0).getWeightMonth().add(monModel.getWeightMonth()));
                         monModel.setWeightDay(monList.get(0).getWeightDay().add(monModel.getWeightDay()));

+ 1 - 0
src/main/java/com/steerinfo/ems/trmactitem/controller/TRmActItemController.java

@@ -769,4 +769,5 @@ public class TRmActItemController extends BaseRESTfulController {
     		return success();
     	}
     }
+
 }

+ 4 - 4
src/main/java/com/steerinfo/ems/trmbalancevalue/service/impl/TRmBalanceValueServiceImpl.java

@@ -85,15 +85,15 @@ public class TRmBalanceValueServiceImpl extends BaseServiceImpl<TRmBalanceValue,
 			}
 		}
 		// 每月前3天生成上月数据
-//		if(c.get(Calendar.DAY_OF_MONTH) <= 3){
+		if(c.get(Calendar.DAY_OF_MONTH) == 1){
 			for (TRmActItem tRmActItem : bs) {
 				if(TimegranidUtils.getTimegranidList(tRmActItem.getMintimegranid()).contains("MONTH")){
-					this.restatData(tRmActItem.getItemid(), "2021-11", "MONTH");
+					this.restatData(tRmActItem.getItemid(), clockm, "MONTH");
 				}
 			}
-//		}
+		}
 		// 每年前3天生成去年数据
-		if(c.get(Calendar.DAY_OF_YEAR) <= 3){
+		if(c.get(Calendar.DAY_OF_YEAR) == 1){
 			for (TRmActItem tRmActItem : bs) {
 				this.restatData(tRmActItem.getItemid(), clocky, "YEAR");
 			}

+ 6 - 0
src/main/java/com/steerinfo/ems/trmplanvalue/controller/TRmPlanValueController.java

@@ -318,4 +318,10 @@ public class TRmPlanValueController extends BaseRESTfulController {
         }
         return success();
     }
+
+    @GetMapping("/aaa")
+    public RESTfulResult  aaa(){
+        tRmPlanValueService.state();
+        return  success();
+    }
 }

+ 4 - 4
src/main/java/com/steerinfo/ems/trmplanvalue/service/impl/TRmPlanValueServiceImpl.java

@@ -149,13 +149,13 @@ public class TRmPlanValueServiceImpl extends BaseServiceImpl<TRmPlanValue, HashM
     			}
     		}
     		if(mintimegranid.equalsIgnoreCase("MONTH")){
-    			if(DateTypeEnum.getMethod("dm").getDate().equals("1")){
+    			if(DateTypeEnum.getMethod("dm").getDate().equals("23")){
     				this.restatData(tRmActItem.getItemid(), new SimpleDateFormat("yyyy-MM").format(new Date()), "MONTH");
     			}
     			// 12月1日生成年计划数据
-    			if(new SimpleDateFormat("MM-dd").format(new Date()).equals("12-01")){
-    				this.restatData(tRmActItem.getItemid(), new SimpleDateFormat("yyyy").format(new Date()), "YEAR");
-    			}
+//    			if(new SimpleDateFormat("MM-dd").format(new Date()).equals("12-01")){
+//    				this.restatData(tRmActItem.getItemid(), new SimpleDateFormat("yyyy").format(new Date()), "YEAR");
+//    			}
     		}
     		// 年粒度,最小粒度为年的第1天计算,其他12月1日统计
     		if(mintimegranid.equalsIgnoreCase("YEAR") && DateTypeEnum.getMethod("dy").getDate().equals("1")){

+ 10 - 8
src/main/java/com/steerinfo/task/SpringCronTask.java

@@ -392,14 +392,16 @@ public class SpringCronTask implements SchedulingConfigurer{
 //				} else if (taskId.equalsIgnoreCase("112")) {
 //					// 能源上报_晋泰信和
 //					usageDataService.autoUpload();
-//				} else if(taskId.equalsIgnoreCase("113")){
-//					//平衡数据维护
-//					long start = System.currentTimeMillis();
-//					tRmBalanceValueService.state();
-//					// 上报项目数据维护
-//					tRmDwValueService.state(new Date());
-//					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
-//				} else if(taskId.equalsIgnoreCase("114")){
+//				}
+				else if(taskId.equalsIgnoreCase("113")){
+					//平衡数据维护
+					long start = System.currentTimeMillis();
+					tRmBalanceValueService.state();
+					// 上报项目数据维护
+					 // tRmDwValueService.state(new Date());
+					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
+				}
+//				else if(taskId.equalsIgnoreCase("114")){
 //					// 环保监控记录定时任务
 //					zghbjkbzLogService.record();
 //				} else if(taskId.equalsIgnoreCase("115")){