|
@@ -417,6 +417,8 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
|
DateTime date = DateUtil.date();
|
|
|
endDate = (date + "").substring(0, 10);
|
|
|
startDate = (DateUtil.beginOfMonth(date) + "").substring(0, 10);
|
|
|
+ String year = dateUtil.getThisYear();
|
|
|
+ String month = dateUtil.getThisMonth();
|
|
|
//
|
|
|
String token = getRemoteToken();
|
|
|
// JSONObject jsonObject = template.getForObject(apiIp + apiPort + serviceName +"/getManyFarmProduce?startDate="+startDate+"&endDate="+endDate+"&accessToken="+token
|
|
@@ -447,10 +449,235 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
|
JSONObject contentJo = outJo.getJSONObject("content");
|
|
|
if (contentJo.getBoolean("success")) {
|
|
|
JSONArray dataJa = contentJo.getJSONArray("data");
|
|
|
+ if(dataJa.size()>0){
|
|
|
+ //获取牧场所有名称数据
|
|
|
+ List<ProdFarmNameEntity> farmNameEntityList = prodFarmNameRepo.findAll();
|
|
|
+
|
|
|
+ //删除旧数据
|
|
|
+ //删除产房成活率
|
|
|
+ ProdStockEntity delStockEntity1 = new ProdStockEntity();
|
|
|
+ delStockEntity1.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity1.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity1.setStockType("grice_rate");
|
|
|
+ Example<ProdStockEntity> example1 =Example.of(delStockEntity1);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example10).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example1));
|
|
|
+ //删除保育成活率
|
|
|
+ ProdStockEntity delStockEntity2 = new ProdStockEntity();
|
|
|
+ delStockEntity2.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity2.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity2.setStockType("piglet_rate");
|
|
|
+ Example<ProdStockEntity> example2 =Example.of(delStockEntity2);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example2));
|
|
|
+ //删除育肥成活率
|
|
|
+ ProdStockEntity delStockEntity3 = new ProdStockEntity();
|
|
|
+ delStockEntity3.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity3.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity3.setStockType("fatpig_rate");
|
|
|
+ Example<ProdStockEntity> example3 =Example.of(delStockEntity3);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example3));
|
|
|
+ //删除7日内断配率
|
|
|
+ ProdStockEntity delStockEntity4 = new ProdStockEntity();
|
|
|
+ delStockEntity4.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity4.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity4.setStockType("break_rate");
|
|
|
+ Example<ProdStockEntity> example4 =Example.of(delStockEntity4);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example4));
|
|
|
+ //删除平均窝产仔猪
|
|
|
+ ProdStockEntity delStockEntity5 = new ProdStockEntity();
|
|
|
+ delStockEntity5.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity5.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity5.setStockType("avg_farrow_1");
|
|
|
+ Example<ProdStockEntity> example5 =Example.of(delStockEntity5);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example5));
|
|
|
+ //删除平均窝产活仔数
|
|
|
+ ProdStockEntity delStockEntity6 = new ProdStockEntity();
|
|
|
+ delStockEntity6.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity6.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity6.setStockType("avg_farrow_2");
|
|
|
+ Example<ProdStockEntity> example6 =Example.of(delStockEntity6);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example6));
|
|
|
+ //删除平均窝产正常仔数
|
|
|
+ ProdStockEntity delStockEntity7 = new ProdStockEntity();
|
|
|
+ delStockEntity7.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity7.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity7.setStockType("avg_farrow_3");
|
|
|
+ Example<ProdStockEntity> example7 =Example.of(delStockEntity7);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example7));
|
|
|
+ //删除窝断奶仔猪数
|
|
|
+ ProdStockEntity delStockEntity8 = new ProdStockEntity();
|
|
|
+ delStockEntity8.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity8.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity8.setStockType("break_grice");
|
|
|
+ Example<ProdStockEntity> example8 =Example.of(delStockEntity8);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example8));
|
|
|
+ //删除平均窝断奶重
|
|
|
+ ProdStockEntity delStockEntity9 = new ProdStockEntity();
|
|
|
+ delStockEntity9.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity9.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity9.setStockType("avg_weight");
|
|
|
+ Example<ProdStockEntity> example9 =Example.of(delStockEntity9);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example9));
|
|
|
+ //删除产房成活率
|
|
|
+ ProdStockEntity delStockEntity10 = new ProdStockEntity();
|
|
|
+ delStockEntity10.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity10.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity10.setStockType("nest_times");
|
|
|
+ Example<ProdStockEntity> example10 =Example.of(delStockEntity10);
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example10));
|
|
|
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+
|
|
|
// 添加入库
|
|
|
for (int a = 0; a < dataJa.size(); a++) {
|
|
|
JSONObject dataJo = dataJa.getJSONObject(a);
|
|
|
System.out.println((a + 1) + " " + dataJo);
|
|
|
+ String fullName = dataJo.getString("mcmc");
|
|
|
+ //
|
|
|
+ int farmId = _getFarmIdByFullName(fullName,farmNameEntityList);
|
|
|
+ //产房成活率
|
|
|
+ String cfchl = dataJo.getString("cfchl");
|
|
|
+ if(cfchl == null || cfchl.trim().length()==0){
|
|
|
+ cfchl = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity1 = new ProdStockEntity();
|
|
|
+ stockEntity1.setFarmId(farmId);
|
|
|
+ stockEntity1.setStockType("grice_rate");
|
|
|
+ stockEntity1.setStockName("产房成活率");
|
|
|
+ stockEntity1.setStockQuantity(mathUtil.countRate(Float.parseFloat(cfchl),1));
|
|
|
+// stockEntity1.setRate();
|
|
|
+ stockEntity1.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity1.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity1);
|
|
|
+
|
|
|
+ //保育成活率
|
|
|
+ String bychl = dataJo.getString("bychl");
|
|
|
+ if(bychl == null || bychl.trim().length()==0){
|
|
|
+ bychl = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity2 = new ProdStockEntity();
|
|
|
+ stockEntity2.setFarmId(farmId);
|
|
|
+ stockEntity2.setStockType("piglet_rate");
|
|
|
+ stockEntity2.setStockName("保育成活率");
|
|
|
+ stockEntity2.setStockQuantity(mathUtil.countRate(Float.parseFloat(bychl),1));
|
|
|
+// stockEntity2.setRate();
|
|
|
+ stockEntity2.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity2.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity2);
|
|
|
+ //肥猪成活率
|
|
|
+ String fzchl = dataJo.getString("fzchl");
|
|
|
+ if(fzchl == null || fzchl.trim().length()==0){
|
|
|
+ fzchl = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity3 = new ProdStockEntity();
|
|
|
+ stockEntity3.setFarmId(farmId);
|
|
|
+ stockEntity3.setStockType("fatpig_rate");
|
|
|
+ stockEntity3.setStockName("肥猪成活率");
|
|
|
+ stockEntity3.setStockQuantity(mathUtil.countRate(Float.parseFloat(fzchl),1));
|
|
|
+// stockEntity3.setRate();
|
|
|
+ stockEntity3.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity3.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity3);
|
|
|
+ //平均窝产仔猪
|
|
|
+ String pjwczz = dataJo.getString("pjwczz");
|
|
|
+ if(pjwczz == null || pjwczz.trim().length()==0){
|
|
|
+ pjwczz = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity4 = new ProdStockEntity();
|
|
|
+ stockEntity4.setFarmId(farmId);
|
|
|
+ stockEntity4.setStockType("avg_farrow_1");
|
|
|
+ stockEntity4.setStockName("平均窝产仔猪");
|
|
|
+ stockEntity4.setStockQuantity(mathUtil.countRate(Float.parseFloat(pjwczz),1));
|
|
|
+// stockEntity4.setRate();
|
|
|
+ stockEntity4.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity4.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity4);
|
|
|
+ //平均窝产活仔数
|
|
|
+ String pjwchzs = dataJo.getString("pjwchzs");
|
|
|
+ if(pjwchzs == null || pjwchzs.trim().length()==0){
|
|
|
+ pjwchzs = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity5 = new ProdStockEntity();
|
|
|
+ stockEntity5.setFarmId(farmId);
|
|
|
+ stockEntity5.setStockType("avg_farrow_2");
|
|
|
+ stockEntity5.setStockName("平均窝产活仔数");
|
|
|
+ stockEntity5.setStockQuantity(mathUtil.countRate(Float.parseFloat(pjwchzs),1));
|
|
|
+// stockEntity5.setRate();
|
|
|
+ stockEntity5.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity5.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity5);
|
|
|
+ //平均窝产正常仔数
|
|
|
+ String pjwczczs = dataJo.getString("pjwczczs");
|
|
|
+ if(pjwczczs == null || pjwczczs.trim().length()==0){
|
|
|
+ pjwczczs = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity6 = new ProdStockEntity();
|
|
|
+ stockEntity6.setFarmId(farmId);
|
|
|
+ stockEntity6.setStockType("avg_farrow_3");
|
|
|
+ stockEntity6.setStockName("平均窝产正常仔数");
|
|
|
+ stockEntity6.setStockQuantity(mathUtil.countRate(Float.parseFloat(pjwczczs),1));
|
|
|
+// stockEntity6.setRate();
|
|
|
+ stockEntity6.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity6.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity6);
|
|
|
+ //窝断奶仔猪数
|
|
|
+ String wdnzzs = dataJo.getString("wdnzzs");
|
|
|
+ if(wdnzzs == null || wdnzzs.trim().length()==0){
|
|
|
+ wdnzzs = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity7 = new ProdStockEntity();
|
|
|
+ stockEntity7.setFarmId(farmId);
|
|
|
+ stockEntity7.setStockType("break_grice");
|
|
|
+ stockEntity7.setStockName("窝断奶仔猪数");
|
|
|
+ stockEntity7.setStockQuantity(mathUtil.countRate(Float.parseFloat(wdnzzs),1));
|
|
|
+// stockEntity7.setRate();
|
|
|
+ stockEntity7.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity7.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity7);
|
|
|
+ //平均断奶窝重
|
|
|
+ String pjdnwz = dataJo.getString("pjdnwz");
|
|
|
+ if(pjdnwz == null || pjdnwz.trim().length()==0){
|
|
|
+ pjdnwz = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity8 = new ProdStockEntity();
|
|
|
+ stockEntity8.setFarmId(farmId);
|
|
|
+ stockEntity8.setStockType("avg_weight");
|
|
|
+ stockEntity8.setStockName("平均断奶窝重");
|
|
|
+ stockEntity8.setStockQuantity(mathUtil.countRate(Float.parseFloat(pjdnwz),1));
|
|
|
+// stockEntity8.setRate();
|
|
|
+ stockEntity8.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity8.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity8);
|
|
|
+ //7日断配率
|
|
|
+ String dpl7r = dataJo.getString("7rdpl");
|
|
|
+ if(dpl7r == null || dpl7r.trim().length()==0){
|
|
|
+ dpl7r = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity9 = new ProdStockEntity();
|
|
|
+ stockEntity9.setFarmId(farmId);
|
|
|
+ stockEntity9.setStockType("break_rate");
|
|
|
+ stockEntity9.setStockName("7日断配率");
|
|
|
+ stockEntity9.setStockQuantity(mathUtil.countRate(Float.parseFloat(dpl7r),1));
|
|
|
+// stockEntity9.setRate();
|
|
|
+ stockEntity9.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity9.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity9);
|
|
|
+ //年产窝数
|
|
|
+ String ncws = dataJo.getString("ncws");
|
|
|
+ if(ncws == null || ncws.length()==0){
|
|
|
+ ncws = "0";
|
|
|
+ }
|
|
|
+ ProdStockEntity stockEntity10 = new ProdStockEntity();
|
|
|
+ stockEntity10.setFarmId(farmId);
|
|
|
+ stockEntity10.setStockType("nest_times");
|
|
|
+ stockEntity10.setStockName("年产窝数");
|
|
|
+ stockEntity10.setStockQuantity(mathUtil.countRate(Float.parseFloat(ncws),1));
|
|
|
+// stockEntity10.setRate();
|
|
|
+ stockEntity10.setMonth(Integer.valueOf(month));
|
|
|
+ stockEntity10.setYear(Integer.parseInt(year));
|
|
|
+ prodStockRepo.saveAndFlush(stockEntity10);
|
|
|
+
|
|
|
+ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
System.out.println("取数失败");
|
|
@@ -460,6 +687,23 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //读取ERP数据中对应的名称
|
|
|
+ private int _getFarmIdByFullName(String pigfarm, List<ProdFarmNameEntity> farmNameEntityList) {
|
|
|
+ //
|
|
|
+ int farmId = 0;
|
|
|
+ boolean isExist = false;
|
|
|
+ for (ProdFarmNameEntity prodFarmNameEntity : farmNameEntityList) {
|
|
|
+ if (prodFarmNameEntity.getErpShortName() != null && prodFarmNameEntity.getErpFarmName().equalsIgnoreCase(pigfarm)) {
|
|
|
+ farmId = prodFarmNameEntity.getFarmId();
|
|
|
+ isExist = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isExist) {
|
|
|
+ log.info("牧场简称‘" + pigfarm + "’在prod_farm_name表中不存在对应的数据.");
|
|
|
+ }
|
|
|
+ return farmId;
|
|
|
+ }
|
|
|
|
|
|
private String getToken() {
|
|
|
JSONObject token = template.getForObject("http://127.0.0.1:9100/token/getToken?userId=20210501×tamp=45546546454&random=1156&sign=7fa431325504e01e9fa87ed0e274c40c",
|
|
@@ -520,15 +764,88 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
|
if (dataJa.size() > 0) {
|
|
|
//获取牧场所有名称数据
|
|
|
List<ProdFarmNameEntity> farmNameEntityList = prodFarmNameRepo.findAll();
|
|
|
-// for(ProdFarmNameEntity farmNameEntity:farmNameEntityList){
|
|
|
-// System.out.println(""+farmNameEntity.toString());
|
|
|
-// }
|
|
|
//删除旧数据
|
|
|
- ProdStockEntity prodStockEntity = new ProdStockEntity();
|
|
|
- prodStockEntity.setYear(Integer.parseInt(year));
|
|
|
- prodStockEntity.setMonth(Integer.parseInt(month));
|
|
|
- Example<ProdStockEntity> example = Example.of(prodStockEntity);
|
|
|
+ //母猪存栏
|
|
|
+ ProdStockEntity delStockEntity1 = new ProdStockEntity();
|
|
|
+ delStockEntity1.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity1.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity1.setStockType("sow_stock");
|
|
|
+ Example<ProdStockEntity> example =Example.of(delStockEntity1);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example).get());
|
|
|
prodStockRepo.deleteAll(prodStockRepo.findAll(example));
|
|
|
+ //公猪存栏
|
|
|
+ ProdStockEntity delStockEntity2 = new ProdStockEntity();
|
|
|
+ delStockEntity2.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity2.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity2.setStockType("boar_stock");
|
|
|
+ Example<ProdStockEntity> example2 =Example.of(delStockEntity2);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example2).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example2));
|
|
|
+ //哺乳猪存栏/仔猪存栏
|
|
|
+ ProdStockEntity delStockEntity3 = new ProdStockEntity();
|
|
|
+ delStockEntity3.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity3.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity3.setStockType("grice_stock");
|
|
|
+ Example<ProdStockEntity> example3 =Example.of(delStockEntity3);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example3).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example3));
|
|
|
+ //保育猪存栏
|
|
|
+ ProdStockEntity delStockEntity4 = new ProdStockEntity();
|
|
|
+ delStockEntity4.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity4.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity4.setStockType("piglet_stock");
|
|
|
+ Example<ProdStockEntity> example4 =Example.of(delStockEntity4);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example4).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example4));
|
|
|
+ //育肥猪存栏
|
|
|
+ ProdStockEntity delStockEntity5 = new ProdStockEntity();
|
|
|
+ delStockEntity5.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity5.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity5.setStockType("fatpig_stock");
|
|
|
+ Example<ProdStockEntity> example5 =Example.of(delStockEntity5);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example5).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example5));
|
|
|
+ //总存栏
|
|
|
+ ProdStockEntity delStockEntity6 = new ProdStockEntity();
|
|
|
+ delStockEntity6.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity6.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity6.setStockType("total_stock");
|
|
|
+ Example<ProdStockEntity> example6 =Example.of(delStockEntity6);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example6).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example6));
|
|
|
+ //妊娠
|
|
|
+ ProdStockEntity delStockEntity7 = new ProdStockEntity();
|
|
|
+ delStockEntity7.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity7.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity7.setStockType("sow_stock_1");
|
|
|
+ Example<ProdStockEntity> example7 =Example.of(delStockEntity7);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example7).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example7));
|
|
|
+ //哺乳
|
|
|
+ ProdStockEntity delStockEntity8 = new ProdStockEntity();
|
|
|
+ delStockEntity8.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity8.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity8.setStockType("sow_stock_2");
|
|
|
+ Example<ProdStockEntity> example8 =Example.of(delStockEntity8);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example8).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example8));
|
|
|
+ //空怀(空怀包含返情)
|
|
|
+ ProdStockEntity delStockEntity9 = new ProdStockEntity();
|
|
|
+ delStockEntity9.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity9.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity9.setStockType("sow_stock_3");
|
|
|
+ prodStockRepo.delete(delStockEntity9);
|
|
|
+ Example<ProdStockEntity> example9 =Example.of(delStockEntity9);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example9).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example9));
|
|
|
+ //后备
|
|
|
+ ProdStockEntity delStockEntity10 = new ProdStockEntity();
|
|
|
+ delStockEntity10.setYear(Integer.parseInt(year));
|
|
|
+ delStockEntity10.setMonth(Integer.parseInt(month));
|
|
|
+ delStockEntity10.setStockType("sow_stock_5");
|
|
|
+ Example<ProdStockEntity> example10 =Example.of(delStockEntity10);
|
|
|
+// prodStockRepo.delete(prodStockRepo.findOne(example10).get());
|
|
|
+ prodStockRepo.deleteAll(prodStockRepo.findAll(example10));
|
|
|
// prodStockRepo.deleteByYearAndMonth(Integer.parseInt(year),Integer.parseInt(month));
|
|
|
|
|
|
// 添加入库
|
|
@@ -656,7 +973,6 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
|
|
|
|
//读取ERP数据中对应的名称
|
|
|
private int _getFarmId2(String pigfarm, List<ProdFarmNameEntity> farmNameEntityList) {
|
|
|
- System.out.println("pigfarm=" + pigfarm);
|
|
|
//
|
|
|
int farmId = 0;
|
|
|
boolean isExist = false;
|