|
@@ -22,6 +22,7 @@ import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.sql.Timestamp;
|
|
import java.sql.Timestamp;
|
|
|
|
+import java.text.DecimalFormat;
|
|
import java.text.NumberFormat;
|
|
import java.text.NumberFormat;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -62,10 +63,10 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
private HttpTemplete httpClientUtil;
|
|
private HttpTemplete httpClientUtil;
|
|
@Autowired
|
|
@Autowired
|
|
private RestTemplate template;
|
|
private RestTemplate template;
|
|
- @Autowired
|
|
|
|
|
|
+ /* @Autowired
|
|
private IndexParameterRepository parameterRepository;
|
|
private IndexParameterRepository parameterRepository;
|
|
@Autowired
|
|
@Autowired
|
|
- private ProductionGroupRepo productionGroupRepo;
|
|
|
|
|
|
+ private ProductionGroupRepo productionGroupRepo;*/
|
|
@Autowired
|
|
@Autowired
|
|
private com.huimv.production.autoGetData.utils.DateUtil dateUtil;
|
|
private com.huimv.production.autoGetData.utils.DateUtil dateUtil;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -79,7 +80,7 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
@Autowired
|
|
@Autowired
|
|
private ProdWorkPlanRepo workPlanRepo;
|
|
private ProdWorkPlanRepo workPlanRepo;
|
|
|
|
|
|
- //PSY
|
|
|
|
|
|
+ /* //PSY
|
|
@Override
|
|
@Override
|
|
public void getPsy() {
|
|
public void getPsy() {
|
|
String token = getToken();
|
|
String token = getToken();
|
|
@@ -423,12 +424,15 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
list.add(map3);
|
|
list.add(map3);
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+*/
|
|
@Autowired
|
|
@Autowired
|
|
private ProdProduceRepo produceRepo;
|
|
private ProdProduceRepo produceRepo;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void getManyFarmProduce() throws IOException {
|
|
public void getManyFarmProduce() throws IOException {
|
|
|
|
+
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
+
|
|
String startDate;
|
|
String startDate;
|
|
String endDate;
|
|
String endDate;
|
|
DateTime date = DateUtil.date();
|
|
DateTime date = DateUtil.date();
|
|
@@ -599,7 +603,8 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
addEntity4.setFarmId(farmId);
|
|
addEntity4.setFarmId(farmId);
|
|
addEntity4.setStockType("avg_farrow_1");
|
|
addEntity4.setStockType("avg_farrow_1");
|
|
addEntity4.setStockName("平均窝产仔猪");
|
|
addEntity4.setStockName("平均窝产仔猪");
|
|
- addEntity4.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjwczz)));
|
|
|
|
|
|
+// addEntity4.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjwczz)));
|
|
|
|
+ addEntity4.setStockQuantity( df.format(Float.parseFloat(pjwczz)));
|
|
// addEntity4.setRate();
|
|
// addEntity4.setRate();
|
|
addEntity4.setMonth(Integer.valueOf(month));
|
|
addEntity4.setMonth(Integer.valueOf(month));
|
|
addEntity4.setYear(Integer.parseInt(year));
|
|
addEntity4.setYear(Integer.parseInt(year));
|
|
@@ -613,7 +618,8 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
addEntity5.setFarmId(farmId);
|
|
addEntity5.setFarmId(farmId);
|
|
addEntity5.setStockType("avg_farrow_2");
|
|
addEntity5.setStockType("avg_farrow_2");
|
|
addEntity5.setStockName("平均窝产活仔数");
|
|
addEntity5.setStockName("平均窝产活仔数");
|
|
- addEntity5.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjwchzs)));
|
|
|
|
|
|
+// addEntity5.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjwchzs)));
|
|
|
|
+ addEntity5.setStockQuantity(df.format(Float.parseFloat(pjwchzs)));
|
|
// addEntity5.setRate();
|
|
// addEntity5.setRate();
|
|
addEntity5.setMonth(Integer.valueOf(month));
|
|
addEntity5.setMonth(Integer.valueOf(month));
|
|
addEntity5.setYear(Integer.parseInt(year));
|
|
addEntity5.setYear(Integer.parseInt(year));
|
|
@@ -627,7 +633,8 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
addEntity6.setFarmId(farmId);
|
|
addEntity6.setFarmId(farmId);
|
|
addEntity6.setStockType("avg_farrow_3");
|
|
addEntity6.setStockType("avg_farrow_3");
|
|
addEntity6.setStockName("平均窝产正常仔数");
|
|
addEntity6.setStockName("平均窝产正常仔数");
|
|
- addEntity6.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjwczczs)));
|
|
|
|
|
|
+// addEntity6.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjwczczs)));
|
|
|
|
+ addEntity6.setStockQuantity(df.format(Float.parseFloat(pjwczczs)));
|
|
// addEntity6.setRate();
|
|
// addEntity6.setRate();
|
|
addEntity6.setMonth(Integer.valueOf(month));
|
|
addEntity6.setMonth(Integer.valueOf(month));
|
|
addEntity6.setYear(Integer.parseInt(year));
|
|
addEntity6.setYear(Integer.parseInt(year));
|
|
@@ -641,7 +648,8 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
addEntity7.setFarmId(farmId);
|
|
addEntity7.setFarmId(farmId);
|
|
addEntity7.setStockType("break_grice");
|
|
addEntity7.setStockType("break_grice");
|
|
addEntity7.setStockName("窝断奶仔猪数");
|
|
addEntity7.setStockName("窝断奶仔猪数");
|
|
- addEntity7.setStockQuantity(mathUtil.formatBit(Float.parseFloat(wdnzzs)));
|
|
|
|
|
|
+// addEntity7.setStockQuantity(mathUtil.formatBit(Float.parseFloat(wdnzzs)));
|
|
|
|
+ addEntity7.setStockQuantity(df.format(Float.parseFloat(wdnzzs)));
|
|
// addEntity7.setRate();
|
|
// addEntity7.setRate();
|
|
addEntity7.setMonth(Integer.valueOf(month));
|
|
addEntity7.setMonth(Integer.valueOf(month));
|
|
addEntity7.setYear(Integer.parseInt(year));
|
|
addEntity7.setYear(Integer.parseInt(year));
|
|
@@ -655,7 +663,8 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
addEntity8.setFarmId(farmId);
|
|
addEntity8.setFarmId(farmId);
|
|
addEntity8.setStockType("avg_weight");
|
|
addEntity8.setStockType("avg_weight");
|
|
addEntity8.setStockName("平均断奶窝重");
|
|
addEntity8.setStockName("平均断奶窝重");
|
|
- addEntity8.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjdnwz)));
|
|
|
|
|
|
+// addEntity8.setStockQuantity(mathUtil.formatBit(Float.parseFloat(pjdnwz)));
|
|
|
|
+ addEntity8.setStockQuantity(df.format(Float.parseFloat(pjdnwz)));
|
|
// addEntity8.setRate();
|
|
// addEntity8.setRate();
|
|
addEntity8.setMonth(Integer.valueOf(month));
|
|
addEntity8.setMonth(Integer.valueOf(month));
|
|
addEntity8.setYear(Integer.parseInt(year));
|
|
addEntity8.setYear(Integer.parseInt(year));
|
|
@@ -683,7 +692,8 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
addEntity10.setFarmId(farmId);
|
|
addEntity10.setFarmId(farmId);
|
|
addEntity10.setStockType("nest_times");
|
|
addEntity10.setStockType("nest_times");
|
|
addEntity10.setStockName("年产窝数");
|
|
addEntity10.setStockName("年产窝数");
|
|
- addEntity10.setStockQuantity(mathUtil.formatBit(Float.parseFloat(ncws)));
|
|
|
|
|
|
+// addEntity10.setStockQuantity(mathUtil.formatBit(Float.parseFloat(ncws)));
|
|
|
|
+ addEntity10.setStockQuantity(df.format(Float.parseFloat(ncws)));
|
|
// addEntity10.setRate();
|
|
// addEntity10.setRate();
|
|
addEntity10.setMonth(Integer.valueOf(month));
|
|
addEntity10.setMonth(Integer.valueOf(month));
|
|
addEntity10.setYear(Integer.parseInt(year));
|
|
addEntity10.setYear(Integer.parseInt(year));
|
|
@@ -1042,6 +1052,7 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void getCostWithManyFarm() throws IOException, ParseException {
|
|
public void getCostWithManyFarm() throws IOException, ParseException {
|
|
|
|
+
|
|
//
|
|
//
|
|
String token = getRemoteToken();
|
|
String token = getRemoteToken();
|
|
//
|
|
//
|
|
@@ -1089,12 +1100,12 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
costStatisticsEntity.setFarmName(dataJo.getString("mcmc"));
|
|
costStatisticsEntity.setFarmName(dataJo.getString("mcmc"));
|
|
//牧场名称
|
|
//牧场名称
|
|
costStatisticsEntity.setFarmId(_getFarmIdByShortName(dataJo.getString("mcmc"), farmNameEntityList));
|
|
costStatisticsEntity.setFarmId(_getFarmIdByShortName(dataJo.getString("mcmc"), farmNameEntityList));
|
|
- costStatisticsEntity.setBaseGroup(dataJo.getString("jczq"));
|
|
|
|
- costStatisticsEntity.setPigletGroup(dataJo.getString("byzq"));
|
|
|
|
- costStatisticsEntity.setFattenPig(dataJo.getString("yf"));
|
|
|
|
- costStatisticsEntity.setReplaceGilt(dataJo.getString("hb"));
|
|
|
|
- costStatisticsEntity.setCommonCost(dataJo.getString("gtfy"));
|
|
|
|
- costStatisticsEntity.setTotal(dataJo.getString("hj"));
|
|
|
|
|
|
+ costStatisticsEntity.setBaseGroup(mathUtil.format1(dataJo.getString("jczq")));
|
|
|
|
+ costStatisticsEntity.setPigletGroup(mathUtil.format1(dataJo.getString("byzq")));
|
|
|
|
+ costStatisticsEntity.setFattenPig(mathUtil.format1(dataJo.getString("yf")));
|
|
|
|
+ costStatisticsEntity.setReplaceGilt(mathUtil.format1(dataJo.getString("hb")));
|
|
|
|
+ costStatisticsEntity.setCommonCost(mathUtil.format1(dataJo.getString("gtfy")));
|
|
|
|
+ costStatisticsEntity.setTotal(mathUtil.format1(dataJo.getString("hj")));
|
|
costStatisticsEntity.setProjectName(dataJo.getString("xmmc"));
|
|
costStatisticsEntity.setProjectName(dataJo.getString("xmmc"));
|
|
costStatisticsEntity.setAddDate(new java.util.Date());
|
|
costStatisticsEntity.setAddDate(new java.util.Date());
|
|
costStatisticsRepo.save(costStatisticsEntity);
|
|
costStatisticsRepo.save(costStatisticsEntity);
|
|
@@ -1373,6 +1384,7 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void getSales() throws IOException, ParseException {
|
|
public void getSales() throws IOException, ParseException {
|
|
|
|
+
|
|
//
|
|
//
|
|
Map timeoutMap = httpClientUtil.setTimeout(connectTimeout, requestTimeout, socketTimeout);
|
|
Map timeoutMap = httpClientUtil.setTimeout(connectTimeout, requestTimeout, socketTimeout);
|
|
//
|
|
//
|