Browse Source

lrl-2021-12-01

lirl 3 years ago
parent
commit
a98f713a47

+ 1 - 1
pom.xml

@@ -234,7 +234,7 @@
 <!--				</executions>-->
 <!--			  </plugin>-->
 		</plugins>
-		
+
 		<pluginManagement>
 			<plugins>
 				<!-- This plugin's configuration is used to store Eclipse m2e settings 

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

@@ -77,7 +77,6 @@ public class TRmActItemController extends BaseRESTfulController {
             @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
             @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
     })
-
     //@RequiresPermissions("trmactitem:view")
     @GetMapping(value = "/")
     public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
@@ -198,7 +197,7 @@ public class TRmActItemController extends BaseRESTfulController {
         tRmActItem.setUserid(JwtUtil.getUseridByToken());
         tRmActItem.setState(maps.get("state")==null?"":maps.get("state").toString());
         tRmActItem.setIsup(maps.get("isup")==null?"0":maps.get("isup").toString());
-        tRmActItem.setShowno(maps.get("showno")==null || maps.get("showno").toString().trim().isEmpty() ?null:Integer.valueOf(maps.get("showno").toString()));
+        tRmActItem.setShowno(tRmActItemService.MaxSeq(itemtypeName));
         tRmActItem.setAssociateid(maps.get("associateid")==null?"":maps.get("associateid").toString());
         tRmActItem.setClock(DateUtils.dateStr(new Date(), "yyyy-MM-dd HH:mm:ss"));
         tRmActItem.setFid(maps.get("fid")==null?"":maps.get("fid").toString());
@@ -770,5 +769,4 @@ public class TRmActItemController extends BaseRESTfulController {
     		return success();
     	}
     }
-
 }

+ 6 - 0
src/main/java/com/steerinfo/ems/trmactitem/mapper/TRmActItemMapper.java

@@ -90,4 +90,10 @@ public interface TRmActItemMapper extends IBaseMapper<TRmActItem, String> {
 	 */
 	List<Map<String, Object>> listpv(HashMap<String, Object> parmas);
 
+	/**
+	 * 根据项目类型 进行排序
+	 */
+
+	Integer MaxSeq(@Param("type") String type);
+
 }

+ 5 - 3
src/main/java/com/steerinfo/ems/trmactitem/mapper/TRmActItemMapper.xml

@@ -539,7 +539,7 @@
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
     <include refid="select"/>
     <include refid="whereLike"/>
-	order by showno
+	order by showno,energyid
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
     insert into T_RM_ACT_ITEM 
@@ -732,7 +732,6 @@
       			(select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
       		</if>
         </where>
-        order by t.clock desc,t.seqno
     </select>
 
     <!--查询计划项目维护结果区-->
@@ -899,7 +898,6 @@
                 (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
             </if>
         </where>
-        order by t.clock desc,t.seqno
     </select>
     
     <select id="queryLikew" parameterType="java.util.HashMap" resultMap="BaseResultMap">
@@ -972,4 +970,8 @@
 	    </if>
         order by clock desc,p.workprocid
     </select>
+  <!--根据项目类型排序-->
+  <select id="MaxSeq" parameterType="java.lang.String" resultType="Integer">
+    select nvl(Max(SHOWNO)+1,1) from T_RM_ACT_ITEM where ITEMTYPE =#{type}
+  </select>
 </mapper>

+ 4 - 0
src/main/java/com/steerinfo/ems/trmactitem/service/ITRmActItemService.java

@@ -96,4 +96,8 @@ public interface ITRmActItemService extends IBaseService<TRmActItem, String>{
 	 */
 	List<Map<String, Object>> listpv(HashMap<String, Object> parmas);
 
+	/**
+	 * 获取类型最大的序号
+	 */
+	Integer MaxSeq(@Param("type") String type);
 }

+ 7 - 1
src/main/java/com/steerinfo/ems/trmactitem/service/impl/TRmActItemServiceImpl.java

@@ -108,8 +108,14 @@ public class TRmActItemServiceImpl extends BaseServiceImpl<TRmActItem, String> i
 		return list;
 	}
 
-	@Override
+    @Override
+    public Integer MaxSeq(String type) {
+        return tRmActItemMapper.MaxSeq(type);
+    }
+
+    @Override
 	public List<Map<String, Object>> getProItems() {
 		return tRmActItemMapper.getProItems();
 	}
+
 }

+ 1 - 0
src/main/java/com/steerinfo/ems/trmbalancevalue/controller/TRmBalanceValueController.java

@@ -265,6 +265,7 @@ public class TRmBalanceValueController extends BaseRESTfulController {
     	List<Map<String, Object>> item = tRmBalanceValueService.getItem(parmas);
     	return success(item);
     }
+
     @GetMapping("/aaaa")
     public RESTfulResult aaa() {
         tRmBalanceValueService.state();

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

@@ -87,7 +87,7 @@ public class TRmBalanceValueServiceImpl extends BaseServiceImpl<TRmBalanceValue,
  		// 每月前3天生成上月数据
 			for (TRmActItem tRmActItem : bs) {
 				if(TimegranidUtils.getTimegranidList(tRmActItem.getMintimegranid()).contains("MONTH")){
-					this.restatData(tRmActItem.getItemid(), clockm, "MONTH");
+					this.restatData(tRmActItem.getItemid(), "2021-10", "MONTH");
 				}
 			}
 		// 每年前3天生成去年数据

+ 9 - 0
src/main/java/com/steerinfo/feigen/model/LgWeight.java

@@ -20,6 +20,15 @@ public class LgWeight {
     private String unit;
     private String materialname;
     private String fid;
+    private String roundid;
+
+    public String getRoundid() {
+        return roundid;
+    }
+
+    public void setRoundid(String roundid) {
+        this.roundid = roundid;
+    }
 
     public String getFid() {
         return fid;

+ 2 - 0
src/main/java/com/steerinfo/feigen/service/LgWeightFeigenService.java

@@ -22,4 +22,6 @@ public interface LgWeightFeigenService {
     @GetMapping("v1/lgweight/queryWeightByTime2")
     public List<LgWeight> QueryWeightByTime2(@RequestParam("startTime")String startTime,@RequestParam("endTime")String endTime);
 
+    @GetMapping("v1/lgweight/QueryWeightforRound")
+    public List<LgWeight> QueryWeightforRound(@RequestParam("startTime")String startTime,@RequestParam("endTime")String endTime);
 }

+ 40 - 26
src/main/java/com/steerinfo/task/SpringCronTask.java

@@ -5,6 +5,9 @@ import com.steerinfo.ems.bfhyd.service.IBfhydService;
 import com.steerinfo.ems.dzmaterialsf.service.IDzMaterialSfService;
 import com.steerinfo.ems.emsetiming.service.IEmsETimingService;
 import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
+import com.steerinfo.ems.emsprodplanroundweight.model.EmsProdplanRoundWeight;
+import com.steerinfo.ems.emsprodplanroundweight.service.IEmsProdplanRoundWeightService;
+import com.steerinfo.ems.emsprodplanroundweight.service.impl.EmsProdplanRoundWeightServiceImpl;
 import com.steerinfo.ems.emsscqklg.service.IEmsScqkLgService;
 import com.steerinfo.ems.emsscqklg.service.ILgRealService;
 import com.steerinfo.ems.emswaterrealtime.service.IEmsWaterRealtimeService;
@@ -124,6 +127,8 @@ public class SpringCronTask implements SchedulingConfigurer{
 	ILgRealService lgRealService;
 	@Autowired
 	IFoldTheValuesService foldTheValuesService;
+	@Autowired
+	IEmsProdplanRoundWeightService emsProdplanRoundWeightService;
 	/**
 	 * SchedulingConfigurer接口的方法实现,加载后自动运行
 	 */
@@ -210,32 +215,32 @@ public class SpringCronTask implements SchedulingConfigurer{
 		return new Runnable() {
 			@Override
 			public void run() {
-//				if(!props.getProperty("os.name").equalsIgnoreCase("linux")){
-//					System.out.println("操作系统:" + props.getProperty("os.name") + ", 非linux环境不运行定时任务");
-//					return;
-//				}
-//				if (taskId.equalsIgnoreCase("101")) { // 定时任务1的业务处理-MES数据同步
-//					logger.info("定时任务触发时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
-//					long start = System.currentTimeMillis();
-//					ifMesEmsSwapfileService.synchronousMesAnEmsData(); // 获取MES投入产出数据
-//					ifMesEmsProductorderService.synchronousMesAnEmsData(); // 获取MES生产计划数据
-//					//usageDataService.getAutoSum(DateUtils.dateStr(new Date(start - 24*3600*1000L), "yyyy-MM-dd")); // 统计自动上传的能源上报数据(昨日)
-//					//mesEmsDieseloilService.synchronousMesEmsData(); // 获取MES柴油数据
-//					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
-//				} else if (taskId.equalsIgnoreCase("102")) {
-//					// 计量点定时任务
-//					long start = System.currentTimeMillis();
-//					tRmCalpointValueService.statData(new Date());
-//					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
-//				} else if (taskId.equalsIgnoreCase("103")) {
-//					long start = System.currentTimeMillis();
-//					tRmActValueService.statDataforDay();// 每日数据统计(实绩定时任务)
-//					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
-//				} else if (taskId.equalsIgnoreCase("104")) {
-//					long start = System.currentTimeMillis();
-//					tRmPlanValueService.state();// 每日数据统计(计划定时任务)
-//					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
-//				}
+				if(!props.getProperty("os.name").equalsIgnoreCase("linux")){
+					System.out.println("操作系统:" + props.getProperty("os.name") + ", 非linux环境不运行定时任务");
+					return;
+				}
+				if (taskId.equalsIgnoreCase("101")) { // 定时任务1的业务处理-MES数据同步
+					logger.info("定时任务触发时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
+					long start = System.currentTimeMillis();
+					ifMesEmsSwapfileService.synchronousMesAnEmsData(); // 获取MES投入产出数据
+					ifMesEmsProductorderService.synchronousMesAnEmsData(); // 获取MES生产计划数据
+					//usageDataService.getAutoSum(DateUtils.dateStr(new Date(start - 24*3600*1000L), "yyyy-MM-dd")); // 统计自动上传的能源上报数据(昨日)
+					//mesEmsDieseloilService.synchronousMesEmsData(); // 获取MES柴油数据
+					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
+				} else if (taskId.equalsIgnoreCase("102")) {
+					// 计量点定时任务
+					long start = System.currentTimeMillis();
+					tRmCalpointValueService.statData(new Date());
+					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
+				} else if (taskId.equalsIgnoreCase("103")) {
+					long start = System.currentTimeMillis();
+					tRmActValueService.statDataforDay();// 每日数据统计(实绩定时任务)
+					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
+				} else if (taskId.equalsIgnoreCase("104")) {
+					long start = System.currentTimeMillis();
+					tRmPlanValueService.state();// 每日数据统计(计划定时任务)
+					logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
+				}
 				 if (taskId.equalsIgnoreCase("105")) {
 					// 先计算产品,因为原材料计算单耗需要产品实绩数据参与计算
 					long start = System.currentTimeMillis();
@@ -336,6 +341,15 @@ public class SpringCronTask implements SchedulingConfigurer{
 						 e.printStackTrace();
 					 }
 					 logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
+				 }
+				 else  if(taskId.equalsIgnoreCase("127")){
+					 long start = System.currentTimeMillis();
+					 try {
+						 emsProdplanRoundWeightService.getWeightForLg();
+					 } catch (Exception e) {
+						 e.printStackTrace();
+					 }
+					 logger.info("定时任务"+taskId+"执行时长:" + (System.currentTimeMillis() - start)/1000 + "秒");
 				 }//				 else if (taskId.equalsIgnoreCase("106")) {
 //					// 获取MES水质监测数据
 //					long start = System.currentTimeMillis();