Parcourir la source

产品实绩管理 和原材料消耗 修改人更新

zhangy il y a 2 ans
Parent
commit
fcbf0d6da4

+ 11 - 4
src/main/java/com/steerinfo/ems/trmworkprocmaterialvalue/service/impl/TRmWorkprocMaterialValueServiceImpl.java

@@ -1,5 +1,6 @@
 package com.steerinfo.ems.trmworkprocmaterialvalue.service.impl;
 
+import com.steerinfo.auth.utils.JwtUtil;
 import com.steerinfo.ems.Utils.BigDecimalUtil;
 import com.steerinfo.ems.Utils.DateUtils;
 import com.steerinfo.ems.formula.model.Formula;
@@ -64,7 +65,7 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
     ITRmMaterialService tRmMaterialService;
     @Autowired
     ITRmWorkprocService tRmWorkprocService;
-    
+
     @Override
     protected IBaseMapper<TRmWorkprocMaterialValue, HashMap<String, Object>> getMapper() {
         return tRmWorkprocMaterialValueMapper;
@@ -81,6 +82,8 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
 
 	@Override
 	public TRmWorkprocMaterialValue updateForUKey(TRmWorkprocMaterialValue tRmWorkprocMaterialValue) {
+		tRmWorkprocMaterialValue.setUpman(JwtUtil.getUseridByToken());
+		tRmWorkprocMaterialValue.setUptime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
 		this.getMapper().updateByPrimaryKeySelective(tRmWorkprocMaterialValue);
 		return tRmWorkprocMaterialValueMapper.selectByUPrimaryKey(tRmWorkprocMaterialValue);
 	}
@@ -370,7 +373,7 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
 		}
 		logger.info("[投入数据添加完毕]" + DateUtils.dateStr(new Date(), "yyyy-MM-dd HH:mm:ss") + ":数据添加成功" + success + "条(其中修改数据为" + delSize + "条),放弃" + abandon + "条,失败" + failure + "条;");
 	}
-	
+
 	/**
 	 * 原料购入0数据处理(type=4)
 	 */
@@ -559,7 +562,7 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
 		}
 		logger.info("[原料购入数据添加完毕]" + DateUtils.dateStr(new Date(), "yyyy-MM-dd HH:mm:ss") + ":数据添加成功" + success + "条(其中修改数据为" + delSize + "条),放弃" + abandon + "条,失败" + failure + "条;");
 	}
-	
+
 	/**
 	 * 原料库存-数据处理(type=5)
 	 */
@@ -723,6 +726,8 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
     		            //最终值
     	            	tv.setApportvalue(swapfile.getQty());
     	            	tv.setBz("MES-" + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()) + " fid:" + swapfile.getFid());
+						tv.setUserid("系统");
+						tv.setUpdatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
     	            	tRmWorkprocMaterialValueMapper.insert(tv);
     				}
     				success++;
@@ -980,6 +985,8 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
 	            	tv.setCorrectvalue(new BigDecimal(0));
 		            //最终值
 	            	tv.setApportvalue(new BigDecimal(actualvalue));
+					tv.setUserid("系统");
+					tv.setUpdatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
 	            	tRmWorkprocMaterialValueMapper.insert(tv);
 				}
 			} else if((timegranid.equalsIgnoreCase("MONTH") || timegranid.equalsIgnoreCase("YEAR"))){
@@ -1118,4 +1125,4 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
 	}
 
 
-}
+}

+ 5 - 0
src/main/java/com/steerinfo/ems/trmworkprocproductvalue/service/impl/TRmWorkprocProductValueServiceImpl.java

@@ -1,5 +1,6 @@
 package com.steerinfo.ems.trmworkprocproductvalue.service.impl;
 
+import com.steerinfo.auth.utils.JwtUtil;
 import com.steerinfo.ems.Utils.BigDecimalUtil;
 import com.steerinfo.ems.Utils.DateUtils;
 import com.steerinfo.ems.common.DateTypeEnum;
@@ -76,6 +77,8 @@ public class TRmWorkprocProductValueServiceImpl extends BaseServiceImpl<TRmWorkp
 
 	@Override
 	public TRmWorkprocProductValue updateForUKey(TRmWorkprocProductValue tRmWorkprocProductValue) {
+		tRmWorkprocProductValue.setUpman(JwtUtil.getUseridByToken());
+		tRmWorkprocProductValue.setUptime(new Date());
 		this.getMapper().updateByPrimaryKeySelective(tRmWorkprocProductValue);
 		return tRmWorkprocProductValueMapper.selectByUPrimaryKey(tRmWorkprocProductValue);
 	}
@@ -728,6 +731,7 @@ public class TRmWorkprocProductValueServiceImpl extends BaseServiceImpl<TRmWorkp
                     tv.setActualvalue(new BigDecimal(val));
                     tv.setApportvalue(new BigDecimal(val));
                     tv.setCorrectvalue(BigDecimal.ZERO);
+					tv.setUserid("系统");
                     tv.setUpdatetime(DateUtils.dateStr(new Date(), "yyyy-MM-dd HH:mm:ss"));
                     this.insert(tv);
             	} else {
@@ -927,6 +931,7 @@ public class TRmWorkprocProductValueServiceImpl extends BaseServiceImpl<TRmWorkp
 	    	            //最终值
 	    				tv.setApportvalue(new BigDecimal(actualvalue).setScale(digits, RoundingMode.HALF_UP));
 	    				tv.setUpdatetime(DateUtils.dateStr(new Date(), "yyyy-MM-dd HH:mm:ss"));
+	    				tv.setUserid("系统");
 	    				if (!ids.isEmpty()){
 	    	            	tv.setBz("MES-" + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()) + " fid:" + ids);
 	    	            }