Przeglądaj źródła

新建重要指标试点数据:增加3个指标的自动取数。

zhuoning 2 lat temu
rodzic
commit
28f3f3e481
30 zmienionych plików z 1767 dodań i 62 usunięć
  1. 178 0
      huimv-hy-production/huimv.egg.datasource/pom.xml
  2. 19 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/HuimvEggApplication.java
  3. 28 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/configuration/SqlServerDialect.java
  4. 22 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/configuration/UpperTableStrategy.java
  5. 33 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/controller/DemoController.java
  6. 80 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/controller/TokenController.java
  7. 40 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/controller/WeightController.java
  8. 260 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/dao/entity/WeightInformationEntity.java
  9. 17 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/dao/repo/WeightInformationRepo.java
  10. 8 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/service/IEggService.java
  11. 48 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/service/impl/EggServiceImpl.java
  12. 270 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/DateUtils.java
  13. 55 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/MathUtil.java
  14. 33 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/SignUtil.java
  15. 92 0
      huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/TokenUtil.java
  16. 50 0
      huimv-hy-production/huimv.egg.datasource/src/main/resources/application-prod.yml
  17. 50 0
      huimv-hy-production/huimv.egg.datasource/src/main/resources/application-test.yml
  18. 7 0
      huimv-hy-production/huimv.egg.datasource/src/main/resources/application.properties
  19. 44 0
      huimv-hy-production/huimv.egg.datasource/src/test/java/com/egg/datasource/service/EggTest.java
  20. 2 0
      huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/config/SaticScheduleTask.java
  21. 2 0
      huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/service/IAutoGetErpData.java
  22. 230 0
      huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/service/impl/AutoGetErpDataImpl.java
  23. 7 0
      huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/utils/DateUtil.java
  24. 7 0
      huimv-hy-production/huimv.hy.autoGetData/src/test/java/com/huimv/production/autoGetData/utils/AutoGetDataTEst.java
  25. 6 2
      huimv-hy-production/huimv.hy.autoGetData/src/test/java/com/huimv/production/autoGetData/utils/DateTest.java
  26. 2 2
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/controller/ErpDataController.java
  27. 95 54
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/dao/repo/TDeliveryRepo.java
  28. 1 1
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/service/IErpDataService.java
  29. 80 3
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/service/impl/ErpDataServiceImpl.java
  30. 1 0
      huimv-hy-production/pom.xml

+ 178 - 0
huimv-hy-production/huimv.egg.datasource/pom.xml

@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>huimv-hy-production</artifactId>
+        <groupId>com.huimv</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>huimv.egg.datasource</artifactId>
+
+    <dependencies>
+        <!-- SQLServer 2008 -->
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>sqljdbc4</artifactId>-->
+<!--            <version>4.0</version>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>6.2.2.jre8</version>-->
+<!--        </dependency>-->
+
+        <!-- ok SQLServer 2012 -->
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>6.4.0.jre8</version>-->
+<!--        </dependency>-->
+
+        <!-- ok SQLServer 2012 -->
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>7.0.0.jre8</version>-->
+<!--        </dependency>-->
+
+        <!-- ok SQLServer 2012 -->
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>7.2.2.jre8</version>-->
+<!--        </dependency>-->
+
+        <!-- ok SQLServer 2012 -->
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>7.4.1.jre8</version>-->
+<!--        </dependency>-->
+
+        <!-- ok SQLServer 2012 -->
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <version>8.2.2.jre8</version>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>8.4.1.jre8</version>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>9.2.1.jre8</version>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>9.4.1.jre8</version>-->
+<!--        </dependency>-->
+
+        <!-- failure -->
+<!--        <dependency>-->
+<!--            <groupId>com.microsoft.sqlserver</groupId>-->
+<!--            <artifactId>mssql-jdbc</artifactId>-->
+<!--            <version>10.2.0.jre8</version>-->
+<!--        </dependency>-->
+
+        <!-- jwt -->
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.8.3</version>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <!--commons-lang-->
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <!--hutool-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.studio</groupId>
+            <artifactId>org.apache.commons.codec</artifactId>
+            <version>1.8</version>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.9.4</version>
+        </dependency>
+        <!-- 排除Tomcat容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <!-- 移除掉默认支持的 Tomcat -->
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- 添加 Undertow 容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+        <!-- fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.28</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.7</version>
+        </dependency>
+
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>apache</id>
+            <url>https://repo.maven.apache.org/maven2</url>
+        </repository>
+        <repository>
+            <id>clojars</id>
+            <url>http://clojars.org/repo/</url>
+        </repository>
+    </repositories>
+
+</project>

+ 19 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/HuimvEggApplication.java

@@ -0,0 +1,19 @@
+package com.egg.datasource;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvEggApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(HuimvEggApplication.class, args);
+    }
+}

+ 28 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/configuration/SqlServerDialect.java

@@ -0,0 +1,28 @@
+package com.egg.datasource.configuration;
+
+import org.hibernate.dialect.SQLServer2012Dialect;
+import org.hibernate.type.StandardBasicTypes;
+
+import java.sql.Types;
+
+/**
+ * @Project : huimv
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+public class SqlServerDialect extends SQLServer2012Dialect {
+    /**
+     * 设置sql server 数据库方言转换
+     */
+    public SqlServerDialect() {
+        registerHibernateType(Types.NCHAR, StandardBasicTypes.CHARACTER.getName());
+        registerHibernateType(Types.NCHAR, 1, StandardBasicTypes.CHARACTER.getName());
+        registerHibernateType(Types.NCHAR, 255, StandardBasicTypes.STRING.getName());
+        registerHibernateType(Types.NVARCHAR, StandardBasicTypes.STRING.getName());
+        registerHibernateType(Types.LONGNVARCHAR, StandardBasicTypes.TEXT.getName());
+        registerHibernateType(Types.NCLOB, StandardBasicTypes.CLOB.getName());
+    }
+}

+ 22 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/configuration/UpperTableStrategy.java

@@ -0,0 +1,22 @@
+package com.egg.datasource.configuration;
+
+import org.hibernate.boot.model.naming.Identifier;
+import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl;
+import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+public class UpperTableStrategy extends PhysicalNamingStrategyStandardImpl {
+    @Override
+    public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment context) {
+        // 将表名全部转换成大写
+        String tableName = name.getText().toUpperCase();
+        return Identifier.toIdentifier(tableName);
+    }
+}

+ 33 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/controller/DemoController.java

@@ -0,0 +1,33 @@
+package com.egg.datasource.controller;
+
+import com.huimv.common.result.Result;
+import com.huimv.common.result.ResultCode;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@CrossOrigin
+@RestController
+@Slf4j
+@RequestMapping(value = "/demo")
+public class DemoController {
+
+    @RequestMapping(value = "/saveDemo",method = RequestMethod.POST)
+    public Result saveDemo(@RequestParam(value = "name",required = true) String name,@RequestParam(value = "age",required = false) String age,@RequestParam(value = "no",required = false) String no){
+        log.info("接收参数:");
+        log.info("name="+name);
+        log.info("age="+age);
+        log.info("no="+no);
+        //执行逻辑操作
+        System.out.println("已经保存数据.");
+
+        return new Result(ResultCode.SUCCESS);
+    }
+}

+ 80 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/controller/TokenController.java

@@ -0,0 +1,80 @@
+package com.egg.datasource.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.egg.datasource.utils.TokenUtil;
+import org.apache.commons.codec.binary.Hex;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@RestController
+@RequestMapping(value="/token",method = RequestMethod.GET)
+public class TokenController {
+
+    @Value("${apiService.client}")
+    private String clientId;
+
+    /**
+     * @Method      : getToken
+     * @Description : 
+     * @Params      : [userId, timestamp, random, sign]
+     * @Return      : java.lang.String
+     * 
+     * @Author      : ZhuoNing
+     * @Date        : 2021/5/15       
+     * @Time        : 18:55
+     */
+    @RequestMapping(value ="/getToken")
+    public String getToken(@RequestParam("userId") String userId,@RequestParam("timestamp") String timestamp, @RequestParam("random") String random, @RequestParam("sign") String sign) throws NoSuchAlgorithmException {
+        JSONObject result = new JSONObject();
+        if (!clientId.equals(userId)) {
+            result.put("code", 201);
+            result.put("msg", "用户信息错误");
+            return result.toJSONString();
+        }
+        MessageDigest md = MessageDigest.getInstance("MD5");
+        String data = random + ";" + timestamp;
+        String oneSign = Hex.encodeHexString(md.digest(data.getBytes(StandardCharsets.UTF_8)));
+        oneSign = oneSign + "HuiMv";
+        String twoSign = Hex.encodeHexString(md.digest(oneSign.getBytes(StandardCharsets.UTF_8)));
+        if (!sign.equals(twoSign)) {
+            result.put("code", 201);
+            result.put("msg", "加密方式错误");
+            return result.toJSONString();
+        }
+        String token = TokenUtil.sign(userId);
+        System.out.println(token);
+        result.put("code", 200);
+        result.put("accessToken", token);
+        return result.toJSONString();
+    }
+
+    /**
+     * @Method      : getToken
+     * @Description : 
+     * @Params      : [verify]
+     * @Return      : boolean
+     * 
+     * @Author      : ZhuoNing
+     * @Date        : 2021/5/15       
+     * @Time        : 19:06
+     */
+    @RequestMapping("/verify")
+    public boolean getToken(String verify) {
+        return TokenUtil.verify(verify);
+    }
+}

+ 40 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/controller/WeightController.java

@@ -0,0 +1,40 @@
+package com.egg.datasource.controller;
+
+//import com.huimv.production.datasource.service.IErpDataService;
+//import com.huimv.production.datasource.utils.TokenUtil;
+import com.egg.datasource.service.IEggService;
+import com.egg.datasource.utils.TokenUtil;
+import com.huimv.common.result.Result;
+import com.huimv.common.result.ResultCode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.repository.query.Param;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@RestController
+@RequestMapping(value = "/egg",method = RequestMethod.GET)
+public class WeightController {
+    @Autowired
+    private IEggService iEggService;
+
+    @Autowired
+    private TokenUtil tokenUtil;
+
+    @GetMapping("/getWeightDetails")
+    public String getWeightDetails(@Param(value="date") String date){
+// 验证token
+//        Result result = tokenUtil.verifyToken(accessToken);
+//        if(!result.isSuccess()){
+//            return result;
+//        }
+//        return new Result(ResultCode.SUCCESS,iEggService.getWeightDetails(date));
+        return iEggService.getWeightDetails(date);
+    }
+}

+ 260 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/dao/entity/WeightInformationEntity.java

@@ -0,0 +1,260 @@
+package com.egg.datasource.dao.entity;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+
+@Entity
+@Table(name = "weight_information")
+@Data
+@Accessors(chain = true)
+public class WeightInformationEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @Column(name = "id", nullable = false)
+    private String id;
+
+    @Column(name = "serial_number")
+    private String serialNumber;
+
+    @Column(name = "stationid")
+    private String stationid;
+
+    @Column(name = "stationname")
+    private String stationname;
+
+    @Column(name = "car_number")
+    private String carNumber;
+
+    @Column(name = "vin_number")
+    private String vinNumber;
+
+    @Column(name = "pound_type")
+    private String poundType;
+
+    @Column(name = "consigner")
+    private String consigner;
+
+    @Column(name = "consignee")
+    private String consignee;
+
+    @Column(name = "variety")
+    private String variety;
+
+    @Column(name = "specification")
+    private String specification;
+
+    @Column(name = "gross_weight")
+    private BigDecimal grossWeight;
+
+    @Column(name = "tare_weight")
+    private BigDecimal tareWeight;
+
+    @Column(name = "net_weight")
+    private BigDecimal netWeight;
+
+    @Column(name = "deduction_weight")
+    private BigDecimal deductionWeight;
+
+    @Column(name = "actual_weight")
+    private BigDecimal actualWeight;
+
+    @Column(name = "price")
+    private BigDecimal price;
+
+    @Column(name = "money")
+    private BigDecimal money;
+
+    @Column(name = "coefficient")
+    private BigDecimal coefficient;
+
+    @Column(name = "capacity")
+    private BigDecimal capacity;
+
+    @Column(name = "weighing_charges")
+    private BigDecimal weighingCharges;
+
+    @Column(name = "gross_weighman")
+    private String grossWeighman;
+
+    @Column(name = "tare_weighman")
+    private String tareWeighman;
+
+    @Column(name = "gross_pound_number")
+    private String grossPoundNumber;
+
+    @Column(name = "tare_pound_number")
+    private String tarePoundNumber;
+
+    @Column(name = "gross_weight_time")
+    private String grossWeightTime;
+
+    @Column(name = "tare_weight_time")
+    private String tareWeightTime;
+
+    @Column(name = "first_weighing_time")
+    private String firstWeighingTime;
+
+    @Column(name = "second_weighing_time")
+    private String secondWeighingTime;
+
+    @Column(name = "weighing_time")
+    private String weighingTime;
+
+    @Column(name = "update_user")
+    private String updateUser;
+
+    @Column(name = "update_time")
+    private String updateTime;
+
+    @Column(name = "remarks")
+    private String remarks;
+
+    @Column(name = "times_of_prints")
+    private Integer timesOfPrints;
+
+    @Column(name = "is_upload")
+    private Boolean upload;
+
+    @Column(name = "is_upload2")
+    private Boolean upload2;
+
+    @Column(name = "is_upload3")
+    private Boolean upload3;
+
+    @Column(name = "is_upload_cloud")
+    private Boolean uploadCloud;
+
+    @Column(name = "data_status")
+    private String dataStatus;
+
+    @Column(name = "memo1")
+    private String memo1;
+
+    @Column(name = "memo2")
+    private String memo2;
+
+    @Column(name = "memo3")
+    private String memo3;
+
+    @Column(name = "memo4")
+    private String memo4;
+
+    @Column(name = "memo5")
+    private String memo5;
+
+    @Column(name = "memo6")
+    private String memo6;
+
+    @Column(name = "memo7")
+    private String memo7;
+
+    @Column(name = "memo8")
+    private String memo8;
+
+    @Column(name = "memo9")
+    private String memo9;
+
+    @Column(name = "memo10")
+    private String memo10;
+
+    @Column(name = "memo11")
+    private String memo11;
+
+    @Column(name = "memo12")
+    private String memo12;
+
+    @Column(name = "memo13")
+    private String memo13;
+
+    @Column(name = "memo14")
+    private String memo14;
+
+    @Column(name = "memo15")
+    private String memo15;
+
+    @Column(name = "memo16")
+    private String memo16;
+
+    @Column(name = "memo17")
+    private String memo17;
+
+    @Column(name = "memo18")
+    private String memo18;
+
+    @Column(name = "memo19")
+    private String memo19;
+
+    @Column(name = "memo20")
+    private String memo20;
+
+    @Column(name = "memo21")
+    private String memo21;
+
+    @Column(name = "weighing_type")
+    private String weighingType;
+
+    @Column(name = "uploadKdState")
+    private Integer uploadKdState;
+
+    @Column(name = "uploadKdState2")
+    private Integer uploadKdState2;
+
+    @Column(name = "uploadKdState3")
+    private Integer uploadKdState3;
+
+    @Column(name = "upload_time")
+    private String uploadTime;
+
+    @Column(name = "transferdatasign")
+    private Integer transferdatasign;
+
+    @Column(name = "transferdatatime")
+    private Timestamp transferdatatime;
+
+    @Column(name = "transferpicsign")
+    private Integer transferpicsign;
+
+    @Column(name = "transferpictime")
+    private Timestamp transferpictime;
+
+    @Column(name = "uploadZcState")
+    private Integer uploadZcState;
+
+    @Column(name = "uploadMeterState")
+    private Integer uploadMeterState;
+
+    @Column(name = "unit1")
+    private String unit1;
+
+    @Column(name = "order_serial")
+    private String orderSerial;
+
+    @Column(name = "car_serial")
+    private String carSerial;
+
+    @Column(name = "loadingStatus")
+    private Integer loadingStatus;
+
+    @Column(name = "pay_scan")
+    private String payScan;
+
+    @Column(name = "consignerId")
+    private String consignerId;
+
+    @Column(name = "entranceGuardNo")
+    private String entranceGuardNo;
+
+    @Column(name = "weight_timestamp")
+    private String weightTimestamp;
+
+}

+ 17 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/dao/repo/WeightInformationRepo.java

@@ -0,0 +1,17 @@
+package com.egg.datasource.dao.repo;
+
+import com.egg.datasource.dao.entity.WeightInformationEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.List;
+
+public interface WeightInformationRepo extends JpaRepository<WeightInformationEntity, String>, JpaSpecificationExecutor<WeightInformationEntity> {
+
+    @Query(nativeQuery = true,value = "select t.* from weight_information t where t.weighing_time like %?1% ORDER BY weighing_time ASC")
+    List<WeightInformationEntity> findByWeightLike(String name);
+
+    @Query(nativeQuery = true,value = "select t.* from weight_information t")
+    List<WeightInformationEntity> findByWeight();
+}

+ 8 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/service/IEggService.java

@@ -0,0 +1,8 @@
+package com.egg.datasource.service;
+
+import java.util.List;
+
+public interface IEggService {
+
+    String getWeightDetails(String date);
+}

+ 48 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/service/impl/EggServiceImpl.java

@@ -0,0 +1,48 @@
+package com.egg.datasource.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.egg.datasource.dao.entity.WeightInformationEntity;
+import com.egg.datasource.dao.repo.WeightInformationRepo;
+import com.egg.datasource.service.IEggService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Example;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@Service
+@Slf4j
+public class EggServiceImpl implements IEggService {
+    @Autowired
+    private WeightInformationRepo weightInformationRepo;
+
+    @Override
+    public String getWeightDetails(String date) {
+        List<WeightInformationEntity> list = null;
+        if (date == null || StringUtils.isBlank(date)) {
+//            return JSONObject.toJSONString(list);
+            return JSON.toJSON(weightInformationRepo.findByWeight()).toString();
+        } else {
+//            return JSONObject.toJSONString(list);
+//            JSONObject.toJSON(list);
+            return JSON.toJSON( weightInformationRepo.findByWeightLike(date)).toString();
+        }
+//        for(WeightInformationEntity weightInformation:list){
+////            System.out.println("weightInformation="+weightInformation.toString());
+//            System.out.println("weight="+weightInformation.getWeighingTime());
+//        }
+//        return JSONObject.toJSONString(list);
+    }
+}

+ 270 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/DateUtils.java

@@ -0,0 +1,270 @@
+/**
+ * Copyright (c) 2016-2019 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.egg.datasource.utils;
+
+import org.apache.commons.lang.StringUtils;
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ * 日期处理
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Component
+public class DateUtils {
+	/** 时间格式(yyyy-MM-dd) */
+	public final static String DATE_PATTERN = "yyyy-MM-dd";
+	/** 时间格式(yyyy-MM-dd HH:mm:ss) */
+	public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
+
+	//格式化日期(Long --> Date)
+    public String formatLongToDate(Long longDate){
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date= new Date(longDate);
+        return df.format(date);
+    }
+
+	//解析日期
+	public Date parseDate(String textDate){
+        //将String转换为Date
+        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = null;
+        try {
+            date = df.parse(textDate);
+            return date;
+        } catch (ParseException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    //解析日期和时间
+    public Date parseDateTime(String textDate){
+        //将String转换为Date
+        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = null;
+        try {
+            date = df.parse(textDate);
+            return date;
+        } catch (ParseException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     * @param date  日期
+     * @return  返回yyyy-MM-dd格式日期
+     */
+	public static String format(Date date) {
+        return format(date, DATE_PATTERN);
+    }
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     * @param date  日期
+     * @param pattern  格式,如:DateUtils.DATE_TIME_PATTERN
+     * @return  返回yyyy-MM-dd格式日期
+     */
+    public static String format(Date date, String pattern) {
+        if(date != null){
+            SimpleDateFormat df = new SimpleDateFormat(pattern);
+            return df.format(date);
+        }
+        return null;
+    }
+
+    /**
+     * 字符串转换成日期
+     * @param strDate 日期字符串
+     * @param pattern 日期的格式,如:DateUtils.DATE_TIME_PATTERN
+     */
+    public static Date stringToDate(String strDate, String pattern) {
+        if (StringUtils.isBlank(strDate)){
+            return null;
+        }
+        DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+        return fmt.parseLocalDateTime(strDate).toDate();
+    }
+
+    /**
+     * 根据周数,获取开始日期、结束日期
+     * @param week  周期  0本周,-1上周,-2上上周,1下周,2下下周
+     * @return  返回date[0]开始日期、date[1]结束日期
+     */
+    public static Date[] getWeekStartAndEnd(int week) {
+        DateTime dateTime = new DateTime();
+        LocalDate date = new LocalDate(dateTime.plusWeeks(week));
+
+        date = date.dayOfWeek().withMinimumValue();
+        Date beginDate = date.toDate();
+        Date endDate = date.plusDays(6).toDate();
+        return new Date[]{beginDate, endDate};
+    }
+
+    /**
+     * 对日期的【秒】进行加/减
+     *
+     * @param date 日期
+     * @param seconds 秒数,负数为减
+     * @return 加/减几秒后的日期
+     */
+    public static Date addDateSeconds(Date date, int seconds) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusSeconds(seconds).toDate();
+    }
+
+    /**
+     * 对日期的【分钟】进行加/减
+     *
+     * @param date 日期
+     * @param minutes 分钟数,负数为减
+     * @return 加/减几分钟后的日期
+     */
+    public static Date addDateMinutes(Date date, int minutes) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusMinutes(minutes).toDate();
+    }
+
+    /**
+     * 对日期的【小时】进行加/减
+     *
+     * @param date 日期
+     * @param hours 小时数,负数为减
+     * @return 加/减几小时后的日期
+     */
+    public static Date addDateHours(Date date, int hours) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusHours(hours).toDate();
+    }
+
+    /**
+     * 对日期的【天】进行加/减
+     *
+     * @param date 日期
+     * @param days 天数,负数为减
+     * @return 加/减几天后的日期
+     */
+    public static Date addDateDays(Date date, int days) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusDays(days).toDate();
+    }
+
+    /**
+     * 对日期的【周】进行加/减
+     *
+     * @param date 日期
+     * @param weeks 周数,负数为减
+     * @return 加/减几周后的日期
+     */
+    public static Date addDateWeeks(Date date, int weeks) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusWeeks(weeks).toDate();
+    }
+
+    /**
+     * 对日期的【月】进行加/减
+     *
+     * @param date 日期
+     * @param months 月数,负数为减
+     * @return 加/减几月后的日期
+     */
+    public static Date addDateMonths(Date date, int months) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusMonths(months).toDate();
+    }
+
+    /**
+     * 对日期的【年】进行加/减
+     *
+     * @param date 日期
+     * @param years 年数,负数为减
+     * @return 加/减几年后的日期
+     */
+    public static Date addDateYears(Date date, int years) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusYears(years).toDate();
+    }
+
+    /**
+     *method 将字符串类型的日期转换为一个timestamp(时间戳记java.sql.Timestamp)
+     dateString 需要转换为timestamp的字符串
+     dataTime timestamp
+     */
+    public final static Timestamp string2Time(String dateString)
+            throws ParseException {
+        DateFormat dateFormat;
+        dateFormat = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss.SSS", Locale.ENGLISH);//设定格式
+        //dateFormat = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss", Locale.ENGLISH);
+        dateFormat.setLenient(false);
+        Date timeDate = dateFormat.parse(dateString);//util类型
+        Timestamp dateTime = new Timestamp(timeDate.getTime());//Timestamp类型,timeDate.getTime()返回一个long型
+        return dateTime;
+    }
+    /**
+     *method 将字符串类型的日期转换为一个Date(java.sql.Date)
+     dateString 需要转换为Date的字符串
+     dataTime Date
+     */
+    public final static java.sql.Date string2Date(String dateString)
+            throws Exception {
+        DateFormat dateFormat;
+        dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
+        dateFormat.setLenient(false);
+        Date timeDate = dateFormat.parse(dateString);//util类型
+        java.sql.Date dateTime = new java.sql.Date(timeDate.getTime());//sql类型
+        return dateTime;
+    }
+
+    public static void main(String[] args){
+        Date da = new Date();
+        //注意:这个地方da.getTime()得到的是一个long型的值
+        System.out.println(da.getTime());
+
+        //由日期date转换为timestamp
+
+        //第一种方法:使用new Timestamp(long)
+        Timestamp t = new Timestamp(new Date().getTime());
+        System.out.println(t);
+
+        //第二种方法:使用Timestamp(int year,int month,int date,int hour,int minute,int second,int nano)
+        Timestamp tt = new Timestamp(Calendar.getInstance().get(
+                Calendar.YEAR) - 1900, Calendar.getInstance().get(
+                Calendar.MONTH), Calendar.getInstance().get(
+                Calendar.DATE), Calendar.getInstance().get(
+                Calendar.HOUR), Calendar.getInstance().get(
+                Calendar.MINUTE), Calendar.getInstance().get(
+                Calendar.SECOND), 0);
+        System.out.println(tt);
+
+        try {
+            String sToDate = "2005-8-18";//用于转换成java.sql.Date的字符串
+            String sToTimestamp = "2005-8-18 14:21:12.123";//用于转换成java.sql.Timestamp的字符串
+            Date date1 = string2Date(sToDate);
+            Timestamp date2 = string2Time(sToTimestamp);
+            System.out.println("Date:"+date1.toString());//结果显示
+            System.out.println("Timestamp:"+date2.toString());//结果显示
+        }catch(Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 55 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/MathUtil.java

@@ -0,0 +1,55 @@
+package com.egg.datasource.utils;
+
+import org.springframework.stereotype.Component;
+
+import java.text.NumberFormat;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@Component
+public class MathUtil {
+
+    //计算占比
+    public String countRate(float num, int bit) {
+        // 创建一个数值格式化对象
+        NumberFormat numberFormat = NumberFormat.getInstance();
+        // 设置精确到小数点后2位
+        numberFormat.setMaximumFractionDigits(bit);
+        return numberFormat.format(num * 100);//所占百分比
+    }
+
+    //计算占比
+    public String countRate(float num, float total,int bit) {
+        // 创建一个数值格式化对象
+        NumberFormat numberFormat = NumberFormat.getInstance();
+        // 设置精确到小数点后2位
+        numberFormat.setMaximumFractionDigits(bit);
+        //所占百分比
+        return numberFormat.format((float)  num/ (float)total* 100);
+    }
+
+    //格式化
+    public String format(float num, int bit) {
+        // 创建一个数值格式化对象
+        NumberFormat numberFormat = NumberFormat.getInstance();
+        // 设置精确到小数点后2位
+        numberFormat.setMaximumFractionDigits(bit);
+        return numberFormat.format(num * 100);//所占百分比
+    }
+
+    //格式化
+    public String format(float num, float total,int bit) {
+        // 创建一个数值格式化对象
+        NumberFormat numberFormat = NumberFormat.getInstance();
+        // 设置精确到小数点后2位
+        numberFormat.setMaximumFractionDigits(bit);
+        //所占百分比
+        return numberFormat.format((float)  num/ (float)total* 100);
+    }
+}

+ 33 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/SignUtil.java

@@ -0,0 +1,33 @@
+package com.egg.datasource.utils;
+
+import org.apache.commons.codec.binary.Hex;
+
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+public class SignUtil {
+
+    public String newSign(String random,String timestamp) throws NoSuchAlgorithmException {
+        MessageDigest md = MessageDigest.getInstance("MD5");
+        String data = random + ";" + timestamp;
+        String oneSign = Hex.encodeHexString(md.digest(data.getBytes(StandardCharsets.UTF_8)));
+        oneSign = oneSign + "HuiMv";
+        String twoSign = Hex.encodeHexString(md.digest(oneSign.getBytes(StandardCharsets.UTF_8)));
+        System.out.println(twoSign);
+        return twoSign;
+    }
+
+    public static void main(String[] args) throws NoSuchAlgorithmException {
+        String sign = new SignUtil().newSign("123456","1621076696178");
+        System.out.println("生成sign:"+sign);
+    }
+}

+ 92 - 0
huimv-hy-production/huimv.egg.datasource/src/main/java/com/egg/datasource/utils/TokenUtil.java

@@ -0,0 +1,92 @@
+package com.egg.datasource.utils;
+
+
+import cn.hutool.core.date.DateUtil;
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.JWTVerifier;
+import com.auth0.jwt.algorithms.Algorithm;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import com.huimv.common.result.Result;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.example.demo.util
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2021/2/26 0026 9:06
+ **/
+@Component
+@Slf4j
+public class TokenUtil {
+    // 过期时间设为30分钟
+    private static final long EXPIRE_TIME = 1 * 30 * 60 * 1000;  //有效时长
+    private static final String TOKEN_SECRET = "qinglian";       // 秘钥
+
+    /**
+     * 签名 生成
+     *
+     * @parm userName
+     */
+    public static String sign(String userName) {
+        String token = null;
+        try {
+            Date expiresAt = new Date(System.currentTimeMillis() + EXPIRE_TIME);
+            token = JWT.create()
+                    .withIssuer("auth0")
+                    .withClaim("userName", userName)
+                    .withExpiresAt(expiresAt)
+                    //使用HMAC256算法加密
+                    .sign(Algorithm.HMAC256(TOKEN_SECRET));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return token;
+    }
+
+    /**
+     * 签名验证
+     *
+     * @param token
+     */
+    public static boolean verify(String token) {
+        try {
+            JWTVerifier verifier = JWT.require(Algorithm.HMAC256(TOKEN_SECRET))
+                    .withIssuer("auth0").build();
+            DecodedJWT jwt = verifier.verify(token);
+//            log.info("TOKEN过期时间:" + DateUtil.format(jwt.getExpiresAt(), "yyyy-MM-dd HH:mm:ss"));
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /**
+     * @Method      : verifyToken
+     * @Description : 签名验证
+     * @Params      : [token]
+     * @Return      : com.alibaba.fastjson.JSONObject
+     * 
+     * @Author      : ZhuoNing
+     * @Date        : 2021/5/15       
+     * @Time        : 18:53
+     */
+    public Result verifyToken(String token) {
+        if(StringUtils.isBlank(token)){
+            return new Result(10001,"token不能为空.",false);
+        }
+        try {
+            JWTVerifier verifier = JWT.require(Algorithm.HMAC256(TOKEN_SECRET))
+                    .withIssuer("auth0").build();
+            DecodedJWT jwt = verifier.verify(token);
+            log.info("TOKEN过期时间:" + DateUtil.format(jwt.getExpiresAt(), "yyyy-MM-dd HH:mm:ss"));
+            return new Result(10000,"验证token成功.",true);
+        } catch (Exception e) {
+            return new Result(10004,"验证token出错:"+e.getMessage(),false);
+        }
+    }
+}

+ 50 - 0
huimv-hy-production/huimv.egg.datasource/src/main/resources/application-prod.yml

@@ -0,0 +1,50 @@
+server:
+  port: 9200
+spring:
+  application:
+    name: huimv-egg-datasource
+  datasource:
+    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+    url: jdbc:sqlserver://192.168.1.250:1433;DatabaseName=Weighing
+    username: sa
+    password: kd123456
+    maxActive: 20
+    initialSize: 1
+    maxWait: 60000
+    minIdle: 1
+    timeBetweenEvictionRunsMillis: 60000
+    minEvictableIdleTimeMillis: 300000
+    validationQuery: select 1
+    testWhileIdle: true
+    testOnBorrow: true
+    testOnReturn: true
+    poolPreparedStatements: true
+    maxOpenPreparedStatements: 20
+  jpa:
+    show-sql: true
+    properties:
+      hibernate:
+        default_schema: dbo
+    hibernate:
+      naming:
+        physical-strategy: com.egg.datasource.configuration.UpperTableStrategy
+#    database-platform: com.huimv.production.datasource.configuration.SqlServerDialect # Error
+
+#  datasource:
+#    url: jdbc:sqlserver://localhost:1433;DatabaseName=test
+#    username: sa
+#    password: hm123456@
+#    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#  jpa:
+#    show-sql: true
+##    database: mysql
+#    database-platform: com.ford.configuration.SqlServerDialect
+#    open-in-view: true
+#    properties:
+#      hibernate:
+#        default_schema: dbo
+#        naming:
+#          physical-strategy: com.ford.configuration.UpperTableStrategy
+#    hibernate:
+#      ddl-auto: update
+

+ 50 - 0
huimv-hy-production/huimv.egg.datasource/src/main/resources/application-test.yml

@@ -0,0 +1,50 @@
+server:
+  port: 9200
+spring:
+  application:
+    name: huimv-egg-datasource
+  datasource:
+    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+    url: jdbc:sqlserver://39.171.45.196:5555;DatabaseName=Weighing
+    username: sa
+    password: kd123456
+    maxActive: 20
+    initialSize: 1
+    maxWait: 60000
+    minIdle: 1
+    timeBetweenEvictionRunsMillis: 60000
+    minEvictableIdleTimeMillis: 300000
+    validationQuery: select 1
+    testWhileIdle: true
+    testOnBorrow: true
+    testOnReturn: true
+    poolPreparedStatements: true
+    maxOpenPreparedStatements: 20
+  jpa:
+    show-sql: true
+    properties:
+      hibernate:
+        default_schema: dbo
+    hibernate:
+      naming:
+        physical-strategy: com.egg.datasource.configuration.UpperTableStrategy
+#    database-platform: com.huimv.production.datasource.configuration.SqlServerDialect # Error
+
+#  datasource:
+#    url: jdbc:sqlserver://localhost:1433;DatabaseName=test
+#    username: sa
+#    password: hm123456@
+#    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#  jpa:
+#    show-sql: true
+##    database: mysql
+#    database-platform: com.ford.configuration.SqlServerDialect
+#    open-in-view: true
+#    properties:
+#      hibernate:
+#        default_schema: dbo
+#        naming:
+#          physical-strategy: com.ford.configuration.UpperTableStrategy
+#    hibernate:
+#      ddl-auto: update
+

+ 7 - 0
huimv-hy-production/huimv.egg.datasource/src/main/resources/application.properties

@@ -0,0 +1,7 @@
+spring.profiles.active=test
+#spring.profiles.active=prod
+
+apiService.client= 20210501
+
+# 各品种及各自存栏(1:模拟数据 0:真实数据)
+apiService.data.getStorage.isDemo=0

+ 44 - 0
huimv-hy-production/huimv.egg.datasource/src/test/java/com/egg/datasource/service/EggTest.java

@@ -0,0 +1,44 @@
+package com.egg.datasource.service;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.math.BigDecimal;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class EggTest {
+    @Autowired
+    private IEggService iEggService;
+
+    @Test
+    public void test(){
+        String date="2022-06-10";
+//        String json = iEggService.getWeightDetails(date);
+//        System.out.println(""+json);
+    }
+
+    @Test
+    public void test2(){
+        BigDecimal bg1 = new BigDecimal("0");
+        System.out.println(""+bg1.toString());
+        BigDecimal bg2 = new BigDecimal("1");
+        bg1 = bg1.add(bg2);
+        BigDecimal bg3 = new BigDecimal("2");
+        bg1 = bg1.add(bg3);
+        BigDecimal bg4 = new BigDecimal("3");
+        bg1=bg1.add(bg4);
+        System.out.println(""+bg1.toString());
+    }
+}

+ 2 - 0
huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/config/SaticScheduleTask.java

@@ -159,6 +159,8 @@ public class SaticScheduleTask  {
         System.out.println("");
         System.out.println("");
         //读取销售数据
         //读取销售数据
         iAutoGetErpData.getSales();
         iAutoGetErpData.getSales();
+        //读取销售金额和销售数量
+        iAutoGetErpData.getSalesMoney();
     }
     }
 
 
     @Scheduled(cron = "0 8 * * * ?  ")
     @Scheduled(cron = "0 8 * * * ?  ")

+ 2 - 0
huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/service/IAutoGetErpData.java

@@ -52,4 +52,6 @@ public interface IAutoGetErpData {
     void getManyFarmParturitionRate() throws IOException;
     void getManyFarmParturitionRate() throws IOException;
 
 
     void testGetManyFarmPsy() throws IOException;
     void testGetManyFarmPsy() throws IOException;
+
+    void getSalesMoney() throws ParseException, IOException;
 }
 }

+ 230 - 0
huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/service/impl/AutoGetErpDataImpl.java

@@ -1756,6 +1756,236 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
 
 
     }
     }
 
 
+//    @Override
+    public void getSalesMoney_old() throws ParseException, IOException {
+        //
+        Map timeoutMap = httpClientUtil.setTimeout(connectTimeout, requestTimeout, socketTimeout);
+        //
+        String token = getRemoteToken();
+        //
+        Map<String, String> paramsMap = new HashMap<String, String>();
+        paramsMap.put("accessToken", token);
+        String farmCode = "31025DA4-F9E1-46B8-BF38-5F2FA25E9C07";
+        paramsMap.put("farmCode", farmCode);
+
+//        String url = apiIp + apiPort + serviceName + "/getSales";
+        String url = apiIp + apiPort + serviceName + "/getSalesTest";
+        log.info("销售数据接口访问地址=" + url);
+        log.info("业务请求参数=" + paramsMap.toString());
+        log.info("开始取数=" + new Date(System.currentTimeMillis()));
+        //
+        JSONObject outJo = httpClientUtil.doGet(url, paramsMap);
+//        log.info("返回结果=" + outJo);
+        log.info("结束取数=" + new Date(System.currentTimeMillis()));
+        if (outJo.getBoolean("status")) {
+            JSONObject contentJo = outJo.getJSONObject("content");
+            if (contentJo.getBoolean("success")) {
+                JSONArray dataJa = contentJo.getJSONArray("data");
+                if (dataJa.size() == 0) {
+                    log.info("未取到数据 。");
+                } else {
+                    System.out.println("dataJa.size="+dataJa.size());
+                    log.info("取回记录条数="+dataJa.size());
+                    JSONArray saleJa = new JSONArray();
+                    BigDecimal totalMoneyBg = new BigDecimal(0);
+                    BigDecimal totalBg = new BigDecimal(0);
+                    for(int a=0;a<dataJa.size();a++){
+                        JSONObject dataJo = dataJa.getJSONObject(a);
+                        System.out.println((a+1)+","+dataJo);
+//                        if(dataJo.getString("f16").trim().equalsIgnoreCase("海盐曙光") && dataJo.getString("f02").trim().indexOf(dateUtil.getThisMonthText()) !=-1){
+//                          if(dataJo.getString("f16").trim().equalsIgnoreCase("海盐曙光") && dataJo.getString("f02").trim().indexOf("2022-07-12") !=-1){
+//                            System.out.println((a+1)+" "+dataJo);
+                             String saleMoney = "0";
+                             if(dataJo.getString("f09") != null){
+                                 saleMoney = dataJo.getString("f09");
+                             }
+                             String total = "0";
+                            if(dataJo.getString("f07") != null){
+                                total = dataJo.getString("f07");
+                            }
+                            totalMoneyBg = totalMoneyBg.add(new BigDecimal(saleMoney));
+                            totalBg = totalBg.add(new BigDecimal(total));
+                            saleJa.add(dataJo);
+//                        }
+                    }
+                    log.info("符合条件的记录条数="+saleJa.size());
+                    System.out.println("totalMoneyBg="+totalMoneyBg.toString());
+                    System.out.println("totalBg="+totalBg.toString());
+
+//                    //删除旧数据
+//                    ProdSalesEntity delSalesEntity = new ProdSalesEntity();
+//                    delSalesEntity.setAddDate(dateUtil.getTodayDate());
+//                    Example<ProdSalesEntity> example = Example.of(delSalesEntity);
+//                    salesRepo.deleteAll(salesRepo.findAll(example));
+//
+//                    //获取牧场所有名称数据
+//                    List<ProdFarmNameEntity> farmNameEntityList = prodFarmNameRepo.findAll();
+//                    //获取牧场所有名称数据
+//                    for (int a = 0; a < dataJa.size(); a++) {
+//                        JSONObject dataJo = dataJa.getJSONObject(a);
+//                        System.out.println("dataJ>>" + dataJo);
+//                        ProdSalesEntity addSalesEntity = new ProdSalesEntity();
+//                        String farmName = dataJo.getString("farm_name");
+//                        addSalesEntity.setFarmName(farmName);
+//                        //
+//                        addSalesEntity.setFarmId(_getFarmIdByShortName(farmName, farmNameEntityList));
+//                        addSalesEntity.setTodayMoney(dataJo.getString("today_money"));
+//                        addSalesEntity.setTodayQuantity(dataJo.getString("today_quantity"));
+//                        addSalesEntity.setTodayWeight(dataJo.getString("today_weight"));
+//                        addSalesEntity.setWeekMoney(dataJo.getString("week_money"));
+//                        addSalesEntity.setWeekQuantity(dataJo.getString("week_quantity"));
+//                        addSalesEntity.setWeekWeight(dataJo.getString("week_weight"));
+//                        addSalesEntity.setMonthMoney(dataJo.getString("month_money"));
+//                        addSalesEntity.setMonthQuantity(dataJo.getString("month_quantity"));
+//                        addSalesEntity.setMonthWeight(dataJo.getString("month_weight"));
+//                        addSalesEntity.setAddDate(new Timestamp(new Date().getTime()));
+//                        salesRepo.save(addSalesEntity);
+//                    }
+                }
+            }
+        }
+    }
+
+//    @Override
+    public void getSalesMoney_new1() throws ParseException, IOException {
+        //
+        Map timeoutMap = httpClientUtil.setTimeout(connectTimeout, requestTimeout, socketTimeout);
+        //
+        String token = getRemoteToken();
+
+        //查询所有记录
+        List<ProdFarmNameEntity> farmNameEntityList = prodFarmNameRepo.findAll();
+
+        Map<String, String> paramsMap = new HashMap<String, String>();
+        paramsMap.put("accessToken", token);
+
+        paramsMap.put("startDate", dateUtil.getStartDateInThisMonth());
+        paramsMap.put("endDate", dateUtil.getEndDateInThisMonth());
+
+        for (ProdFarmNameEntity farmNameEntity : farmNameEntityList) {
+            if (null != farmNameEntity.getErpFarmId()) {
+                System.out.println(""+farmNameEntity.getErpShortName());
+                //
+                paramsMap.put("farmID", farmNameEntity.getErpFarmId());
+                System.out.println("" + farmNameEntity.getErpFarmName() + " , " + farmNameEntity.getErpFarmId());
+                paramsMap.put("farmCode", farmNameEntity.getErpFarmId());
+                String url = apiIp + apiPort + serviceName + "/getSalesTest";
+                log.info("销售数据接口访问地址=" + url);
+                log.info("业务请求参数=" + paramsMap.toString());
+                log.info("开始取数=" + new Date(System.currentTimeMillis()));
+                //
+                JSONObject outJo = httpClientUtil.doGet(url, paramsMap);
+                log.info("返回结果>>" + outJo);
+                log.info("结束取数=" + new Date(System.currentTimeMillis()));
+                if (outJo.getBoolean("status")) {
+                    JSONObject contentJo = outJo.getJSONObject("content");
+                    if (contentJo.getBoolean("success")) {
+//                        String dataJa = contentJo.getString("data");
+                        JSONArray dataJa = contentJo.getJSONArray("data");
+                        System.out.println(">>" + dataJa);
+                        if (dataJa.size() == 0) {
+                            log.info("未取到数据 。");
+                        } else {
+                            JSONArray saleJa = new JSONArray();
+                            BigDecimal totalBg = new BigDecimal(0);
+                            BigDecimal totalMoneyBg = new BigDecimal(0);
+                            for(int a=0;a<dataJa.size();a++){
+                                JSONObject dataJo = dataJa.getJSONObject(a);
+                                    String saleMoney = "0";
+                                    if(dataJo.getString("f09") != null){
+                                        saleMoney = dataJo.getString("f09");
+                                    }
+                                    String total = "0";
+                                    if(dataJo.getString("f07") != null){
+                                        total = dataJo.getString("f07");
+                                    }
+                                    totalMoneyBg = totalMoneyBg.add(new BigDecimal(saleMoney));
+                                    totalBg = totalBg.add(new BigDecimal(total));
+                                    saleJa.add(dataJo);
+                                }
+//                            }
+                            System.out.println("totalMoneyBg="+totalMoneyBg.toString());
+                            System.out.println("totalBg="+totalBg.toString());
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void getSalesMoney() throws ParseException, IOException {
+        //
+        Map timeoutMap = httpClientUtil.setTimeout(connectTimeout, requestTimeout, socketTimeout);
+        //
+        String token = getRemoteToken();
+        //查询所有记录
+        List<ProdFarmNameEntity> farmNameEntityList = prodFarmNameRepo.findAll();
+        Map<String, String> paramsMap = new HashMap<String, String>();
+        paramsMap.put("accessToken", token);
+        String todayText = dateUtil.getTodayDateText();
+        JSONArray saleJa = new JSONArray();
+        for (ProdFarmNameEntity farmNameEntity : farmNameEntityList) {
+            if (null != farmNameEntity.getErpFarmId()) {
+                System.out.println(""+farmNameEntity.getErpShortName());
+                //
+                paramsMap.put("farmID", farmNameEntity.getErpFarmId());
+                System.out.println("" + farmNameEntity.getErpFarmName() + " , " + farmNameEntity.getErpFarmId());
+                paramsMap.put("farmCode", farmNameEntity.getErpFarmId());
+                String url = apiIp + apiPort + serviceName + "/getSales2";
+                log.info("销售数据接口访问地址=" + url);
+                log.info("业务请求参数=" + paramsMap.toString());
+                log.info("开始取数=" + new Date(System.currentTimeMillis()));
+                //
+                JSONObject outJo = httpClientUtil.doGet(url, paramsMap);
+                log.info("返回结果>>" + outJo);
+                log.info("结束取数=" + new Date(System.currentTimeMillis()));
+                if (outJo.getBoolean("status")) {
+                    JSONObject contentJo = outJo.getJSONObject("content");
+                    if (contentJo.getBoolean("success")) {
+//                        String data = contentJo.getString("data");
+//                        JSONArray dataJa = contentJo.getJSONArray("data");
+                        JSONObject dataJo = contentJo.getJSONObject("data");
+                        if (dataJo.size() == 0) {
+                            log.info("未取到数据 。");
+                        } else {
+                            String totalMoney = dataJo.getString("totalMoney");
+                            String sum =  dataJo.getString("sum");
+                            System.out.println("farmId="+farmNameEntity.getFarmId());
+                            System.out.println("todayText="+todayText);
+                            System.out.println("totalMoney="+totalMoney);
+                            System.out.println("sum="+sum);
+                            dataJo.put("farmId",farmNameEntity.getFarmId());
+                            dataJo.put("today",todayText);
+                            saleJa.add(dataJo);
+                        }
+                    }
+                }
+            }
+        }
+//        ProdSalesEntity delSalesEntity = new ProdSalesEntity();
+//        delSalesEntity.setAddDate(dateUtil.getTodayDate());
+//        Example<ProdSalesEntity> example = Example.of(delSalesEntity);
+//        salesRepo.deleteAll(salesRepo.findAll(example));
+
+        System.out.println("saleJa.size="+saleJa.size());
+        for(int a=0;a<saleJa.size();a++){
+            JSONObject saleJo = saleJa.getJSONObject(a);
+            System.out.println("saleJo="+saleJo);
+            ProdSalesEntity salesEntity = new ProdSalesEntity();
+            salesEntity.setAddDate(saleJo.getDate("today"));
+            salesEntity.setFarmId(saleJo.getInteger("farmId"));
+            Example<ProdSalesEntity> example = Example.of(salesEntity);
+            Optional<ProdSalesEntity> optional = salesRepo.findOne(example);
+            if(optional.isPresent()){
+                ProdSalesEntity prodSalesEntity = optional.get();
+                prodSalesEntity.setMonthQuantity(saleJo.getString("sum"));
+                prodSalesEntity.setMonthMoney(saleJo.getString("totalMoney"));
+                salesRepo.save(prodSalesEntity);
+            }
+        }
+    }
+
     @Override
     @Override
     public void getManyFarmPsy() throws IOException, InterruptedException {
     public void getManyFarmPsy() throws IOException, InterruptedException {
         //
         //

+ 7 - 0
huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/utils/DateUtil.java

@@ -83,6 +83,13 @@ public class DateUtil {
         return sdf.format(new Date());
         return sdf.format(new Date());
     }
     }
 
 
+    public String getThisMonthText() throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String todayDateText = sdf.format(new Date());
+        String[] dateArray = todayDateText.split("-");
+        return dateArray[0]+"-"+dateArray[1];
+    }
+
     public String getStartDateInThisMonth(){
     public String getStartDateInThisMonth(){
         DateTime date = cn.hutool.core.date.DateUtil.date();
         DateTime date = cn.hutool.core.date.DateUtil.date();
         return (cn.hutool.core.date.DateUtil.beginOfMonth(date) + "").substring(0, 10);
         return (cn.hutool.core.date.DateUtil.beginOfMonth(date) + "").substring(0, 10);

+ 7 - 0
huimv-hy-production/huimv.hy.autoGetData/src/test/java/com/huimv/production/autoGetData/utils/AutoGetDataTEst.java

@@ -100,6 +100,13 @@ public class AutoGetDataTEst {
         autoGetErpData.getManyFarmParturitionRate();
         autoGetErpData.getManyFarmParturitionRate();
     }
     }
 
 
+    // 测试销售金额
+    @Test
+    public void testGetSalesMoney() throws IOException, ParseException {
+        //
+        autoGetErpData.getSalesMoney();
+    }
+
 
 
 
 
 }
 }

+ 6 - 2
huimv-hy-production/huimv.hy.autoGetData/src/test/java/com/huimv/production/autoGetData/utils/DateTest.java

@@ -30,13 +30,12 @@ public class DateTest {
         Calendar cal = Calendar.getInstance();
         Calendar cal = Calendar.getInstance();
         int month = cal.get(Calendar.MONTH) + 1;
         int month = cal.get(Calendar.MONTH) + 1;
         int year = cal.get(Calendar.YEAR);
         int year = cal.get(Calendar.YEAR);
-
-
         System.out.println("当期时间: " + cal.getTime());
         System.out.println("当期时间: " + cal.getTime());
         System.out.println("月份: " + month);
         System.out.println("月份: " + month);
         System.out.println("年份: " + year);
         System.out.println("年份: " + year);
     }
     }
 
 
+
     @Autowired
     @Autowired
     private DateUtil dateUtil;
     private DateUtil dateUtil;
     @Test
     @Test
@@ -46,6 +45,11 @@ public class DateTest {
     }
     }
 
 
     @Test
     @Test
+    public void test3() throws ParseException {
+        System.out.println("year="+dateUtil.getThisMonthText());
+    }
+
+    @Test
     public void testFormatDatetime() throws ParseException {
     public void testFormatDatetime() throws ParseException {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
         String dateText = "2021-11-15T16:10:01.570+00:00";
         String dateText = "2021-11-15T16:10:01.570+00:00";

+ 2 - 2
huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/controller/ErpDataController.java

@@ -402,10 +402,10 @@ public class ErpDataController {
         return erpDataService.getSales();
         return erpDataService.getSales();
     }
     }
 
 
-    @RequestMapping(value = "/getSalesTest",method = RequestMethod.GET)
+    @RequestMapping(value = "/getSales2",method = RequestMethod.GET)
     public Result getSalesTest(@RequestParam(value = "farmCode" )String farmCode){
     public Result getSalesTest(@RequestParam(value = "farmCode" )String farmCode){
 
 
-        return erpDataService.getSalesTest(farmCode);
+        return erpDataService.getSales2(farmCode);
     }
     }
 
 
 }
 }

Plik diff jest za duży
+ 95 - 54
huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/dao/repo/TDeliveryRepo.java


+ 1 - 1
huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/service/IErpDataService.java

@@ -46,5 +46,5 @@ public interface IErpDataService {
 
 
     Result getSales();
     Result getSales();
 
 
-    Result getSalesTest(String farmCode);
+    Result getSales2(String farmCode);
 }
 }

+ 80 - 3
huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/service/impl/ErpDataServiceImpl.java

@@ -2,6 +2,7 @@ package com.huimv.production.datasource.service.impl;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.JsonNode;
 import com.huimv.common.date.DateUtil;
 import com.huimv.common.date.DateUtil;
 import com.huimv.common.result.Result;
 import com.huimv.common.result.Result;
 import com.huimv.common.result.ResultCode;
 import com.huimv.common.result.ResultCode;
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
@@ -662,10 +664,85 @@ public class ErpDataServiceImpl implements IErpDataService {
         return new Result(ResultCode.SUCCESS,produceJa);
         return new Result(ResultCode.SUCCESS,produceJa);
     }
     }
 
 
+//    @Override
+    public Result getSales2_old(String farmCode) {
+//        List<Object[]> payableList = tDeliveryRepo.getSalesTest(farmCode);
+        List<Object[]> payableList = tDeliveryRepo.getSales2(farmCode);
+        JSONArray saleJa = new JSONArray();
+        for(int a=0;a<payableList.size();a++) {
+            Object[] salesObj = (Object[]) payableList.get(a);
+//            System.out.println("salesObj.length="+salesObj.length);
+            JSONObject saleJo = new JSONObject();
+            saleJa.add(saleJo);
+            //牧场名称
+            saleJo.put("f00", salesObj[0]);
+            saleJo.put("f01", salesObj[1]);
+            saleJo.put("f02", salesObj[2]);
+            saleJo.put("f03", salesObj[3]);
+            saleJo.put("f04", salesObj[4]);
+            saleJo.put("f05", salesObj[5]);
+            saleJo.put("f06", salesObj[6]);
+            saleJo.put("f07", salesObj[7]);
+            saleJo.put("f08", salesObj[8]);
+            saleJo.put("f09", salesObj[9]);
+            saleJo.put("f10", salesObj[10]);
+            saleJo.put("f11", salesObj[11]);
+            saleJo.put("f12", salesObj[12]);
+            saleJo.put("f13", salesObj[13]);
+            saleJo.put("f14", salesObj[14]);
+            saleJo.put("f15", salesObj[15]);
+            saleJo.put("f16", salesObj[16]);
+        }
+        return new Result(ResultCode.SUCCESS,saleJa);
+    }
+
     @Override
     @Override
-    public Result getSalesTest(String farmCode) {
-        List<Object[]> payableList = tDeliveryRepo.getSalesTest( farmCode);
-        return new Result(ResultCode.SUCCESS,payableList);
+    public Result getSales2(String farmCode) {
+//        List<Object[]> payableList = tDeliveryRepo.getSalesTest(farmCode);
+        List<Object[]> payableList = tDeliveryRepo.getSales2(farmCode);
+        JSONArray saleJa = new JSONArray();
+        BigDecimal totalBg = new BigDecimal(0);
+        BigDecimal totalMoneyBg = new BigDecimal(0);
+        for(int a=0;a<payableList.size();a++) {
+            Object[] salesObj = (Object[]) payableList.get(a);
+//            System.out.println("salesObj.length="+salesObj.length);
+            JSONObject saleJo = new JSONObject();
+            saleJa.add(saleJo);
+            //牧场名称
+            saleJo.put("f00", salesObj[0]);
+            saleJo.put("f01", salesObj[1]);
+            saleJo.put("f02", salesObj[2]);
+            saleJo.put("f03", salesObj[3]);
+            saleJo.put("f04", salesObj[4]);
+            saleJo.put("f05", salesObj[5]);
+            saleJo.put("f06", salesObj[6]);
+            saleJo.put("f07", salesObj[7]);
+            saleJo.put("f08", salesObj[8]);
+            saleJo.put("f09", salesObj[9]);
+            saleJo.put("f10", salesObj[10]);
+            saleJo.put("f11", salesObj[11]);
+            saleJo.put("f12", salesObj[12]);
+            saleJo.put("f13", salesObj[13]);
+            saleJo.put("f14", salesObj[14]);
+            saleJo.put("f15", salesObj[15]);
+            saleJo.put("f16", salesObj[16]);
+            String saleMoney = "0";
+            if(salesObj[9] != null){
+                saleMoney = salesObj[9] + "";
+            }
+            String total = "0";
+            if(salesObj[7] != null){
+                total = salesObj[7] + "";
+            }
+            totalMoneyBg = totalMoneyBg.add(new BigDecimal(saleMoney));
+            totalBg = totalBg.add(new BigDecimal(total));
+
+        }
+//        return new Result(ResultCode.SUCCESS,saleJa);
+        JSONObject resultJo = new JSONObject();
+        resultJo.put("totalMoney",totalMoneyBg.toString());
+        resultJo.put("sum",totalBg.toString());
+        return new Result(ResultCode.SUCCESS,resultJo);
     }
     }
 
 
 }
 }

+ 1 - 0
huimv-hy-production/pom.xml

@@ -6,6 +6,7 @@
     <modules>
     <modules>
         <module>huimv.hy.erp.datasource</module>
         <module>huimv.hy.erp.datasource</module>
         <module>huimv.hy.autoGetData</module>
         <module>huimv.hy.autoGetData</module>
+        <module>huimv.egg.datasource</module>
     </modules>
     </modules>
     <parent>
     <parent>
         <groupId>org.springframework.boot</groupId>
         <groupId>org.springframework.boot</groupId>