Selaa lähdekoodia

添加查询每月销售额

523096025 2 vuotta sitten
vanhempi
commit
7510c6cc5e
34 muutettua tiedostoa jossa 1355 lisäystä ja 41 poistoa
  1. 74 0
      huimv-hy-production/getdata/pom.xml
  2. 24 0
      huimv-hy-production/getdata/src/main/java/com/huimv/getdata/GetdataApplication.java
  3. 55 0
      huimv-hy-production/getdata/src/main/java/com/huimv/getdata/controller/WeightInformationController.java
  4. 351 0
      huimv-hy-production/getdata/src/main/java/com/huimv/getdata/entity/WeightInformation.java
  5. 16 0
      huimv-hy-production/getdata/src/main/java/com/huimv/getdata/mapper/WeightInformationMapper.java
  6. 16 0
      huimv-hy-production/getdata/src/main/java/com/huimv/getdata/service/IWeightInformationService.java
  7. 20 0
      huimv-hy-production/getdata/src/main/java/com/huimv/getdata/service/impl/WeightInformationServiceImpl.java
  8. 12 0
      huimv-hy-production/getdata/src/main/resources/application-dev.yml
  9. 3 0
      huimv-hy-production/getdata/src/main/resources/application.properties
  10. 74 0
      huimv-hy-production/getdata/src/main/resources/com/huimv/getdata/mapper/WeightInformationMapper.xml
  11. 13 0
      huimv-hy-production/getdata/src/test/java/com/huimv/getdata/GetdataApplicationTests.java
  12. 1 5
      huimv-hy-production/huimv.hy.autoGetData/pom.xml
  13. 9 9
      huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/config/SaticScheduleTask.java
  14. 10 12
      huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/service/impl/AutoGetErpDataImpl.java
  15. 0 5
      huimv-hy-production/huimv.hy.erp.datasource/pom.xml
  16. 6 0
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/controller/ErpDataController.java
  17. 78 1
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/dao/repo/TDeliveryRepo.java
  18. 2 0
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/service/IErpDataService.java
  19. 6 0
      huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/service/impl/ErpDataServiceImpl.java
  20. 1 9
      huimv-hy-production/pom.xml
  21. 33 0
      huimv-hy-production/zhaoyi/.gitignore
  22. 76 0
      huimv-hy-production/zhaoyi/pom.xml
  23. 13 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/DatasourceApplication.java
  24. 28 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/configuration/SqlServerDialect.java
  25. 22 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/configuration/UpperTableStrategy.java
  26. 23 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/controller/WeightInformationController.java
  27. 15 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/dao/WeightInformationDao.java
  28. 284 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/entity/WeightInformation.java
  29. 8 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/service/WeightInformationService.java
  30. 26 0
      huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/service/impl/WeightInformationServericeImpl.java
  31. 20 0
      huimv-hy-production/zhaoyi/src/main/resources/application-dev.yml
  32. 20 0
      huimv-hy-production/zhaoyi/src/main/resources/application-test.yml
  33. 3 0
      huimv-hy-production/zhaoyi/src/main/resources/application.properties
  34. 13 0
      huimv-hy-production/zhaoyi/src/test/java/com/huimv/zhaoyi/demo/DatasourceApplicationTests.java

+ 74 - 0
huimv-hy-production/getdata/pom.xml

@@ -0,0 +1,74 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.6.4</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.huimv</groupId>
+    <artifactId>getdata</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>getdata</name>
+    <description>Demo project for Spring Boot</description>
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.11</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 24 - 0
huimv-hy-production/getdata/src/main/java/com/huimv/getdata/GetdataApplication.java

@@ -0,0 +1,24 @@
+package com.huimv.getdata;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.client.RestTemplate;
+
+@SpringBootApplication
+@MapperScan("com.huimv.getdata.mapper")
+@EnableScheduling
+public class GetdataApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(GetdataApplication.class, args);
+    }
+
+    @Bean
+    public static RestTemplate getRestTemplate(){
+        return new RestTemplate();
+    }
+
+}

+ 55 - 0
huimv-hy-production/getdata/src/main/java/com/huimv/getdata/controller/WeightInformationController.java

@@ -0,0 +1,55 @@
+package com.huimv.getdata.controller;
+
+
+import com.huimv.getdata.entity.WeightInformation;
+import com.huimv.getdata.service.IWeightInformationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2022-03-22
+ */
+@RestController
+@RequestMapping("/weightInformation")
+public class WeightInformationController {
+
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Autowired
+    private IWeightInformationService weightInformationService;
+//    @GetMapping("/test")
+    @Scheduled(cron = "0 0 * * * ?后备 ")
+    public  String  test(){
+        ResponseEntity<WeightInformation[]> forEntity = restTemplate.getForEntity("http://127.0.0.1:9100/weightInformation/getList", WeightInformation[].class);
+
+        WeightInformation[] body = forEntity.getBody();
+        for (WeightInformation weightInformation : body) {
+
+            System.out.println(weightInformation.toString());
+        }
+        weightInformationService.saveBatch(Arrays.asList(body));
+
+        return null;
+
+    }
+
+
+
+}

+ 351 - 0
huimv-hy-production/getdata/src/main/java/com/huimv/getdata/entity/WeightInformation.java

@@ -0,0 +1,351 @@
+package com.huimv.getdata.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2022-03-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("weight_information")
+public class WeightInformation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private String id;
+
+    /**
+     * 流水单号
+     */
+    private String serialNumber;
+
+    /**
+     * 站点编号
+     */
+    private String stationid;
+
+    /**
+     * 站点名称
+     */
+    private String stationname;
+
+    /**
+     * 车号
+     */
+    private String carNumber;
+
+    /**
+     * 车架号
+     */
+    private String vinNumber;
+
+    /**
+     * 称重类型
+     */
+    private String poundType;
+
+    /**
+     * 发货单位
+     */
+    private String consigner;
+
+    /**
+     * 收货单位
+     */
+    private String consignee;
+
+    /**
+     * 货物名称
+     */
+    private String variety;
+
+    /**
+     * 规格
+     */
+    private String specification;
+
+    /**
+     * 毛重
+     */
+    private Integer grossWeight;
+
+    /**
+     * 实际皮重
+     */
+    private Integer tareWeight;
+
+    /**
+     * 实际净重
+     */
+    private Integer netWeight;
+
+    /**
+     * 扣重
+     */
+    private Integer deductionWeight;
+
+    /**
+     * 实重
+     */
+    private Integer actualWeight;
+
+    /**
+     * 单价
+     */
+    private Integer price;
+
+    /**
+     * 金额
+     */
+    private Integer money;
+
+    /**
+     * 折方系数
+     */
+    private Integer coefficient;
+
+    /**
+     * 方量
+     */
+    private Integer capacity;
+
+    /**
+     * 称重费用
+     */
+    private Integer weighingCharges;
+
+    /**
+     * 毛重司磅员
+     */
+    private String grossWeighman;
+
+    /**
+     * 皮重司磅员
+     */
+    private String tareWeighman;
+
+    /**
+     * 过毛重地磅号
+     */
+    private String grossPoundNumber;
+
+    /**
+     * 过皮重地磅号
+     */
+    private String tarePoundNumber;
+
+    /**
+     * 毛重称重时间
+     */
+    private String grossWeightTime;
+
+    /**
+     * 皮重称重时间
+     */
+    private String tareWeightTime;
+
+    /**
+     * 第一次称重时间
+     */
+    private String firstWeighingTime;
+
+    /**
+     * 第二次称重时间
+     */
+    private String secondWeighingTime;
+
+    /**
+     * 称重时间
+     */
+    private String weighingTime;
+
+    /**
+     * 更新人
+     */
+    private String updateUser;
+
+    /**
+     * 更新时间
+     */
+    private String updateTime;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 打印
+     */
+    private Integer timesOfPrints;
+
+    /**
+     * 上传治超
+     */
+    private Boolean isUpload;
+
+    /**
+     * 上传治超
+     */
+    private Boolean isUpload2;
+
+    /**
+     * 上传治超
+     */
+    private Boolean isUpload3;
+
+    /**
+     * 上传科达
+     */
+    private Boolean isUploadCloud;
+
+    /**
+     * 状态
+     */
+    private String dataStatus;
+
+    /**
+     * 车牌颜色
+     */
+    private String memo1;
+
+    /**
+     * 轮轴数
+     */
+    private String memo2;
+
+    /**
+     * 限重
+     */
+    private String memo3;
+
+    /**
+     * 超重
+     */
+    private String memo4;
+
+    /**
+     * 超重比例
+     */
+    private String memo5;
+
+    /**
+     * 允许超重比例
+     */
+    private String memo6;
+
+    /**
+     * 劝返流水单号
+     */
+    private String memo7;
+
+    /**
+     * 劝返卸重
+     */
+    private String memo8;
+
+    /**
+     * 已卸重
+     */
+    private String memo9;
+
+    /**
+     * 劝返时间
+     */
+    private String memo10;
+
+    /**
+     * memo11
+     */
+    private String memo11;
+
+    /**
+     * memo12
+     */
+    private String memo12;
+
+    /**
+     * memo13
+     */
+    private String memo13;
+
+    /**
+     * memo14
+     */
+    private String memo14;
+
+    /**
+     * memo15
+     */
+    private String memo15;
+
+    /**
+     * memo16
+     */
+    private String memo16;
+
+    /**
+     * memo17
+     */
+    private String memo17;
+
+    /**
+     * memo18
+     */
+    private String memo18;
+
+    /**
+     * memo19
+     */
+    private String memo19;
+
+    /**
+     * memo20
+     */
+    private String memo20;
+
+    /**
+     * memo21
+     */
+    private String memo21;
+
+    /**
+     * 过磅类型
+     */
+    private String weighingType;
+
+    /**
+     * 数据上传状态
+     */
+    private Integer uploadKdState;
+
+    /**
+     * 图片上传状态
+     */
+    private Integer uploadKdState2;
+
+    /**
+     * 视频上传状态
+     */
+    private Integer uploadKdState3;
+
+    /**
+     * 上传时间
+     */
+    private String uploadTime;
+
+
+}

+ 16 - 0
huimv-hy-production/getdata/src/main/java/com/huimv/getdata/mapper/WeightInformationMapper.java

@@ -0,0 +1,16 @@
+package com.huimv.getdata.mapper;
+
+import com.huimv.getdata.entity.WeightInformation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2022-03-22
+ */
+public interface WeightInformationMapper extends BaseMapper<WeightInformation> {
+
+}

+ 16 - 0
huimv-hy-production/getdata/src/main/java/com/huimv/getdata/service/IWeightInformationService.java

@@ -0,0 +1,16 @@
+package com.huimv.getdata.service;
+
+import com.huimv.getdata.entity.WeightInformation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2022-03-22
+ */
+public interface IWeightInformationService extends IService<WeightInformation> {
+
+}

+ 20 - 0
huimv-hy-production/getdata/src/main/java/com/huimv/getdata/service/impl/WeightInformationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.huimv.getdata.service.impl;
+
+import com.huimv.getdata.entity.WeightInformation;
+import com.huimv.getdata.mapper.WeightInformationMapper;
+import com.huimv.getdata.service.IWeightInformationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2022-03-22
+ */
+@Service
+public class WeightInformationServiceImpl extends ServiceImpl<WeightInformationMapper, WeightInformation> implements IWeightInformationService {
+
+}

+ 12 - 0
huimv-hy-production/getdata/src/main/resources/application-dev.yml

@@ -0,0 +1,12 @@
+server:
+  port: 9115
+spring:
+  application:
+    name: getdata
+
+  datasource:
+    url: jdbc:mysql://127.0.0.1:3306/yxx?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: root
+    driver-class-name: com.mysql.cj.jdbc.Driver
+

+ 3 - 0
huimv-hy-production/getdata/src/main/resources/application.properties

@@ -0,0 +1,3 @@
+spring.profiles.active=dev
+#spring.profiles.active=test
+

+ 74 - 0
huimv-hy-production/getdata/src/main/resources/com/huimv/getdata/mapper/WeightInformationMapper.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.huimv.getdata.mapper.WeightInformationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.huimv.getdata.entity.WeightInformation">
+        <id column="id" property="id" />
+        <result column="serial_number" property="serialNumber" />
+        <result column="stationid" property="stationid" />
+        <result column="stationname" property="stationname" />
+        <result column="car_number" property="carNumber" />
+        <result column="vin_number" property="vinNumber" />
+        <result column="pound_type" property="poundType" />
+        <result column="consigner" property="consigner" />
+        <result column="consignee" property="consignee" />
+        <result column="variety" property="variety" />
+        <result column="specification" property="specification" />
+        <result column="gross_weight" property="grossWeight" />
+        <result column="tare_weight" property="tareWeight" />
+        <result column="net_weight" property="netWeight" />
+        <result column="deduction_weight" property="deductionWeight" />
+        <result column="actual_weight" property="actualWeight" />
+        <result column="price" property="price" />
+        <result column="money" property="money" />
+        <result column="coefficient" property="coefficient" />
+        <result column="capacity" property="capacity" />
+        <result column="weighing_charges" property="weighingCharges" />
+        <result column="gross_weighman" property="grossWeighman" />
+        <result column="tare_weighman" property="tareWeighman" />
+        <result column="gross_pound_number" property="grossPoundNumber" />
+        <result column="tare_pound_number" property="tarePoundNumber" />
+        <result column="gross_weight_time" property="grossWeightTime" />
+        <result column="tare_weight_time" property="tareWeightTime" />
+        <result column="first_weighing_time" property="firstWeighingTime" />
+        <result column="second_weighing_time" property="secondWeighingTime" />
+        <result column="weighing_time" property="weighingTime" />
+        <result column="update_user" property="updateUser" />
+        <result column="update_time" property="updateTime" />
+        <result column="remarks" property="remarks" />
+        <result column="times_of_prints" property="timesOfPrints" />
+        <result column="is_upload" property="isUpload" />
+        <result column="is_upload2" property="isUpload2" />
+        <result column="is_upload3" property="isUpload3" />
+        <result column="is_upload_cloud" property="isUploadCloud" />
+        <result column="data_status" property="dataStatus" />
+        <result column="memo1" property="memo1" />
+        <result column="memo2" property="memo2" />
+        <result column="memo3" property="memo3" />
+        <result column="memo4" property="memo4" />
+        <result column="memo5" property="memo5" />
+        <result column="memo6" property="memo6" />
+        <result column="memo7" property="memo7" />
+        <result column="memo8" property="memo8" />
+        <result column="memo9" property="memo9" />
+        <result column="memo10" property="memo10" />
+        <result column="memo11" property="memo11" />
+        <result column="memo12" property="memo12" />
+        <result column="memo13" property="memo13" />
+        <result column="memo14" property="memo14" />
+        <result column="memo15" property="memo15" />
+        <result column="memo16" property="memo16" />
+        <result column="memo17" property="memo17" />
+        <result column="memo18" property="memo18" />
+        <result column="memo19" property="memo19" />
+        <result column="memo20" property="memo20" />
+        <result column="memo21" property="memo21" />
+        <result column="weighing_type" property="weighingType" />
+        <result column="uploadKdState" property="uploadKdState" />
+        <result column="uploadKdState2" property="uploadKdState2" />
+        <result column="uploadKdState3" property="uploadKdState3" />
+        <result column="upload_time" property="uploadTime" />
+    </resultMap>
+
+</mapper>

+ 13 - 0
huimv-hy-production/getdata/src/test/java/com/huimv/getdata/GetdataApplicationTests.java

@@ -0,0 +1,13 @@
+package com.huimv.getdata;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class GetdataApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}

+ 1 - 5
huimv-hy-production/huimv.hy.autoGetData/pom.xml

@@ -23,11 +23,7 @@
             <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>

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

@@ -104,7 +104,7 @@ public class SaticScheduleTask  {
 
     //ok
     //
-    @Scheduled(cron = "0 0 8,23 * * ? ")
+    @Scheduled(cron = "0 0 * * * ? ")
     private void getManyFarmProduce() throws IOException {
         //获取多牧场生产数
         iAutoGetErpData.getManyFarmProduce();
@@ -112,56 +112,56 @@ public class SaticScheduleTask  {
     }
 
     //ok
-    @Scheduled(cron = "0 1 0,2,4,6,8,10,12,14,16,18,20,22 * * ? ")
+    @Scheduled(cron = "0 1 * * * ? ")
     private void getManyFarmStock() throws IOException {
         //获取多牧场存栏
         iAutoGetErpData.getManyFarmStock();
     }
 
     //ok
-    @Scheduled(cron = "0 2 0,2,4,6,8,10,12,14,16,18,20,22 * * ? ")
+    @Scheduled(cron = "0 2 * * * ? ")
     private void getCostWithManyFarm() throws IOException, ParseException {
         //获取多牧场生产成本
         iAutoGetErpData.getCostWithManyFarm();
     }
 
     // ok
-    @Scheduled(cron = "0 3 0,2,4,6,8,10,12,14,16,18,20,22 * * ? ")
+    @Scheduled(cron = "0 3 * * * ? ")
     private void getWarningMessage() throws IOException, ParseException {
         //获取预警信息
         iAutoGetErpData.getWarningMessage();
     }
 
     //ok
-    @Scheduled(cron = "0 4 0,2,4,6,8,10,12,14,16,18,20,22 * * ? ")
+    @Scheduled(cron = "0 4 * * * ? ")
     private void getWorkPlan() throws IOException, ParseException {
         //工作计划
         iAutoGetErpData.getWorkPlan();
     }
 
     //ok
-    @Scheduled(cron = "0 5 0,2,4,6,8,10,12,14,16,18,20,22 * * ? ")
+    @Scheduled(cron = "0 5 * * * ? ")
     private void getPrepareStatusQuantity() throws IOException, ParseException {
         //获取各种准备状态数量
         iAutoGetErpData.getPrepareStatusQuantity();
     }
 
     //ok
-    @Scheduled(cron = "0 6 0,2,4,6,8,10,12,14,16,18,20,22 * * ?  ")
+    @Scheduled(cron = "0 6 * * * ?  ")
     private void getPayable() throws IOException, ParseException {
         //应付排名
         iAutoGetErpData.getPayable();
     }
 
     //ok
-    @Scheduled(cron = "0 7 0,2,4,6,8,10,12,14,16,18,20,22 * * ?  ")
+    @Scheduled(cron = "0 7 * * * ?  ")
     private void getSales() throws IOException, ParseException {
         System.out.println("");
         //读取销售数据
         iAutoGetErpData.getSales();
     }
 
-    @Scheduled(cron = "0 8 0,2,4,6,8,10,12,14,16,18,20,22 * * ?  ")
+    @Scheduled(cron = "0 8 * * * ?  ")
     private void getManyFarmPsy() throws IOException, ParseException, InterruptedException {
         System.out.println("");
         //读取多个牧场的PSY

+ 10 - 12
huimv-hy-production/huimv.hy.autoGetData/src/main/java/com/huimv/production/autoGetData/service/impl/AutoGetErpDataImpl.java

@@ -433,6 +433,7 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
     @Autowired
     private ProdProduceRepo produceRepo;
 
+
     @Override
     public void getManyFarmProduce() throws IOException {
         DecimalFormat df = new DecimalFormat("0.00");
@@ -1103,8 +1104,6 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
                         System.out.println("by=" + by);
                         System.out.println("yf=" + yf);
                         System.out.println("total=" + total);
-//                        System.out.println("猪场="+dataJo.getString("mz"));
-//                        System.out.println("母猪后备"+dataJo.getInteger("mzhb"));
                         //母猪存栏
                         ProdStockEntity stockEntity1 = new ProdStockEntity();
                         stockEntity1.setFarmId(farmId);
@@ -1216,7 +1215,7 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
                         ProdStockEntity stockEntity10 = new ProdStockEntity();
                         stockEntity10.setFarmId(farmId);
                         stockEntity10.setStockType("sow_stock_5");
-                        stockEntity10.setStockName("后备");
+                        stockEntity10.setStockName("后备母猪存栏");
 //                        stockEntity10.setStockQuantity(String.valueOf(dataJo.getInteger("hb")));
                         stockEntity10.setStockQuantity(String.valueOf(dataJo.getInteger("mzhb")));
                         stockEntity10.setMonth(Integer.valueOf(month));
@@ -1271,11 +1270,11 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
         //
         Map<String, String> paramsMap = new HashMap<String, String>();
         paramsMap.put("accessToken", token);
-//        paramsMap.put("year", dateUtil.getThisYear());
-//        paramsMap.put("month", dateUtil.getThisMonth());
+        paramsMap.put("year", dateUtil.getThisYear());
+        paramsMap.put("month", dateUtil.getThisMonth());
         // test data
-        paramsMap.put("year", "2021");
-        paramsMap.put("month", "11");
+//        paramsMap.put("year", "2021");
+//        paramsMap.put("month", "8");
         //
         Map<String, Integer> timeoutMap = new HashMap<String, Integer>();
         timeoutMap.put("connectTimeout", Integer.parseInt(connectTimeout));
@@ -1376,10 +1375,9 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
                 warningMsgRepo.deleteAll(warningMsgRepo.findAll(example));
                 //获取牧场所有名称数据
                 List<ProdFarmNameEntity> farmNameEntityList = prodFarmNameRepo.findAll();
-                int x=0;
-                for (ProdFarmNameEntity farmNameEntity : farmNameEntityList) {
-                    System.out.println((++x) + "" + farmNameEntity.toString());
-                }
+//                for (ProdFarmNameEntity farmNameEntity : farmNameEntityList) {
+//                    System.out.println("" + farmNameEntity.toString());
+//                }
                 // 添加入库
                 for (int a = 0; a < dataJa.size(); a++) {
                     JSONObject dataJo = dataJa.getJSONObject(a);
@@ -1776,9 +1774,9 @@ public class AutoGetErpDataImpl implements IAutoGetErpData {
         paramsMap.put("startDate", dateUtil.getStartDateInThisMonth());
         paramsMap.put("endDate", dateUtil.getEndDateInThisMonth());
 
+
         JSONArray psyJa = new JSONArray();
         for (ProdFarmNameEntity farmNameEntity : farmNameEntityList) {
-            System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+farmNameEntity.toString());
             if (null != farmNameEntity.getErpFarmId()) {
 //                Thread.sleep(5000);
                 //

+ 0 - 5
huimv-hy-production/huimv.hy.erp.datasource/pom.xml

@@ -24,11 +24,6 @@
             <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>

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

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

+ 78 - 1
huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/dao/repo/TDeliveryRepo.java

@@ -1387,7 +1387,7 @@ public interface TDeliveryRepo extends JpaRepository<TDeliveryEntity, String>, J
             " where t.排名<=5\n")
     List<Object[]> getPayable();
 
-    //销售数据
+    /*//销售数据
     @Query(nativeQuery = true,value ="select TOrganizeCell.fshortname,SUM (case when datediff(day,FSALEDATE,getdate())=0 then \n" +
             " isnull(TWarePigSaleChild.FnormalPigAmount,0)+isnull(TWarePigSaleChild.FweakPigAmount,0 )END) as 今日数量,\n" +
             " SUM (case when datediff(day,FSALEDATE,getdate())=0 then \n" +
@@ -1412,5 +1412,82 @@ public interface TDeliveryRepo extends JpaRepository<TDeliveryEntity, String>, J
             " WHERE TWarePigSale.FbillState IN(3,4,6)\n" +
             " AND TWarePigSale.FSALEMODE=0 \n" +
             " group by TOrganizeCell.fshortname")
+    List<Object[]> getSales();*/
+    //销售数据 2.0
+    @Query(nativeQuery = true,value ="select TOrganizeCell.fshortname,SUM (case when datediff(day,FSALEDATE,getdate())=0  and TWarePigSaleChild.FPIGTYPE=3  then \n" +
+            "  isnull(TWarePigSaleChild.FnormalPigAmount,0)+isnull(TWarePigSaleChild.FweakPigAmount,0 ) when datediff(day,FSALEDATE,getdate())=0  and TWarePigSaleChild.FPIGTYPE!=3 then 1 END) as 今日数量,\n" +
+            "  SUM (case when datediff(day,FSALEDATE,getdate())=0 then \n" +
+            "  TWarePigSaleChild.FtotalWeight END) as 今日重量,\n" +
+            "  SUM (case when datediff(day,FSALEDATE,getdate())=0 then \n" +
+            "  TWarePigSaleChild.FTOTALPRICE END) as 今日金额,\n" +
+            "  SUM (case when datediff(week,FSALEDATE,getdate())=0 and TWarePigSaleChild.FPIGTYPE=3 then \n" +
+            "  isnull(TWarePigSaleChild.FnormalPigAmount,0)+isnull(TWarePigSaleChild.FweakPigAmount,0 ) when datediff(week,FSALEDATE,getdate())=0 and TWarePigSaleChild.FPIGTYPE!=3 then 1 END) as 本周数量,\n" +
+            "  SUM (case when datediff(week,FSALEDATE,getdate())=0 then \n" +
+            "  TWarePigSaleChild.FtotalWeight END) as 本周重量,\n" +
+            "  SUM (case when datediff(week,FSALEDATE,getdate())=0 then \n" +
+            "  TWarePigSaleChild.FTOTALPRICE END) as 本周金额,\n" +
+            "  SUM (case when datediff(month,FSALEDATE,getdate())=0 and TWarePigSaleChild.FPIGTYPE=3 then \n" +
+            "  isnull(TWarePigSaleChild.FnormalPigAmount,0)+isnull(TWarePigSaleChild.FweakPigAmount,0 ) when datediff(month,FSALEDATE,getdate())=0 and TWarePigSaleChild.FPIGTYPE!=3 then  1 END) as 本月数量,\n" +
+            "  SUM (case when datediff(month,FSALEDATE,getdate())=0 then \n" +
+            "  TWarePigSaleChild.FtotalWeight END) as 本月重量,\n" +
+            "  SUM (case when datediff(month,FSALEDATE,getdate())=0 then \n" +
+            "  TWarePigSaleChild.FTOTALPRICE END) as 本月金额\n" +
+            "  FROM TWarePigSale \n" +
+            "  LEFT JOIN TWarePigSaleChild ON TWarePigSaleChild.FWarePigSaleMainStruID=TWarePigSale.FID \n" +
+            "  left join TOrganizeCell on TOrganizeCell.FID=TWarePigSale.HOGPENID\n" +
+            "  WHERE TWarePigSale.FbillState IN(3,4,6)\n" +
+            "  AND TWarePigSale.FSALEMODE=0 \n" +
+            "  group by TOrganizeCell.fshortname")
     List<Object[]> getSales();
+
+    @Query(nativeQuery = true,value ="select charindex(tw.销售类型,'苗猪,育肥猪,后备母猪,后备公猪,后备商品猪,生产母猪,生产公猪') as pig_number,tw.销售类型,tw.销售日期,tw.杀算时间,tw.销售类别,tw.客户,sum(tw.总重) as '重量',sum(tw.头数) as '头数',tw.金额,tw.销售金额,tw.毛色,tw.基础重,tw.基础单价,tw.品种,tw.备注,tw.关联,tw.FSHORTNAME from(\n" +
+            "SELECT  stuff((case when TWarePigSaleChild.FPIGSTATE IN (14,15,16) then '苗猪'  WHEN TWarePigSaleChild.FPIGSTATE IN (1) THEN '育肥猪'  \n" +
+            "\tWHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (3) THEN '后备商品猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (2) THEN '后备母猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (1) THEN '后备公猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (3,5,6,7,12,13) THEN '生产母猪' WHEN TWarePigSaleChild.FPIGSTATE IN (2) THEN '生产公猪' end+','+Convert(varchar(10),TWarePigSale.FsaleDate,23)+','+TCustomer.FNAME+\n" +
+            "\t ','+case when TBreed.FName IS not NULL then TBreed.FName else '无' end+','+CAST(TWarePigSaleChild.FPIGSTATE AS CHAR)+','+TWarePigSale.FID+'' ),1,0,'') as '关联',\n" +
+            "\n" +
+            "case when TWarePigSaleChild.FPIGSTATE IN (14,15,16) then '苗猪'  WHEN TWarePigSaleChild.FPIGSTATE IN (1) THEN '育肥猪'  \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (2) THEN '后备母猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (1) THEN '后备公猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (3,5,6,7,12,13) THEN '生产母猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (3) THEN '后备商品猪'\n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (2) THEN '生产公猪' end as '销售类型',\n" +
+            "\tConvert(varchar(10),TWarePigSale.FsaleDate,23) AS '销售日期', \n" +
+            "\tTCustomer.FNAME AS '客户',\n" +
+            "\tcase when TBreed.FName IS not NULL then TBreed.FName else '无' end as '品种',\n" +
+            "\tcase when TWarePigSale.CUSTTOHOGPENID IS NOT NULL then '内销' else '外销' end as '销售类别',\n" +
+            "\t\n" +
+            "\tcase when TWarePigSaleChild.FPIGTYPE IN (3)  then sum(ISNULL(TWarePigSaleChild.FnormalPigAmount + TWarePigSaleChild.FweakPigAmount,0))\n" +
+            "\t WHEN TWarePigSaleChild.FPIGTYPE IN (1,2) THEN count(TPigArchives.FNUMBER) end as '头数',\n" +
+            "\t\n" +
+            "\tsum(convert(decimal(28,2),isnull(TWarePigSaleChild.FtotalWeight,0))) AS '总重',\n" +
+            "\tSUM(convert(decimal(28,2),isnull(TWarePigSaleChild.FTOTALPRICE,0))) AS '金额',\n" +
+            "\tQSaleWrite.KILLDATE as '杀算时间',\n" +
+            "\tQSaleWrite.COATCOLORINT as '毛色',\n" +
+            "\tQSaleWrite.REMARK as '备注',\n" +
+            "\tisnull(convert(decimal(28,2),QSaleWrite.BASICSWEIGHT),0)as '基础重',\n" +
+            "\tisnull(convert(decimal(28,2),QSaleWrite.BASICSMPRICE),0) as '基础单价',\n" +
+            "\tQSaleWrite.SaleMoney as '销售金额',TOrganizeCell.FSHORTNAME\n" +
+            "\t\n" +
+            "FROM TWarePigSale \n" +
+            "\tLEFT JOIN TCustomer ON TWarePigSale.customerID =  TCustomer.FID  \n" +
+            "\tLEFT JOIN TWarePigSaleChild ON TWarePigSale.FID = TWarePigSaleChild.FWarePigSaleMainStruID \n" +
+            "\tleft join TBreed on TWarePigSaleChild.BreedID=TBreed.FID \n" +
+            "\tLEFT JOIN TPigArchives ON TPigArchives.Fid =TWarePigSaleChild.numberID\n" +
+            "\tleft join TOrganizeCell on TOrganizeCell.FID=TWarePigSale.HOGPENID\n" +
+            "\tleft JOIN QSaleWrite on QSaleWrite.STRINGID = stuff((case when TWarePigSaleChild.FPIGSTATE IN (14,15,16) then '苗猪'  WHEN TWarePigSaleChild.FPIGSTATE IN (1) THEN '育肥猪'  \n" +
+            "\tWHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (3) THEN '后备商品猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (2) THEN '后备母猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (11) and TWarePigSaleChild.FPIGTYPE IN (1) THEN '后备公猪' \n" +
+            "\t WHEN TWarePigSaleChild.FPIGSTATE IN (3,5,6,7,12,13) THEN '生产母猪' WHEN TWarePigSaleChild.FPIGSTATE IN (2) THEN '生产公猪' end+','+Convert(varchar(10),TWarePigSale.FsaleDate,23)+','+TCustomer.FNAME+\n" +
+            "\t ','+case when TBreed.FName IS not NULL then TBreed.FName else '无' end+','+CAST(TWarePigSaleChild.FPIGSTATE AS CHAR)+','+TWarePigSale.FID+'' ),1,0,'')\n" +
+            "WHERE FbillState=3  And (TWarePigSale.hogpenID in(?1))\n" +
+            "\tAND datediff(month,TWarePigSale.FSALEDATE,getdate() )>=0 \n" +
+            "\tgroup by TWarePigSaleChild.FPIGSTATE,TWarePigSaleChild.FPIGTYPE,TWarePigSale.FSALEDATE,TCustomer.FNAME,TBreed.FName,TWarePigSale.CUSTTOHOGPENID,QSaleWrite.KILLDATE,QSaleWrite.COATCOLORINT,QSaleWrite.BASICSWEIGHT,QSaleWrite.BASICSMPRICE,QSaleWrite.SaleMoney,QSaleWrite.REMARK,TWarePigSale.FID,TOrganizeCell.FSHORTNAME\n" +
+            "\t)tw group by tw.销售类型,tw.销售日期,tw.杀算时间,tw.销售类别,tw.客户,tw.销售金额,tw.毛色,tw.基础重,tw.基础单价,tw.品种,tw.关联,tw.金额,tw.备注,tw.FSHORTNAME\n" +
+            "\t\n" +
+            "ORDER BY pig_number")
+    List<Object[]> getSalesTest(String farmCode);
 }

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

@@ -45,4 +45,6 @@ public interface IErpDataService {
     Result getPayable();
 
     Result getSales();
+
+    Result getSalesTest(String farmCode);
 }

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

@@ -662,4 +662,10 @@ public class ErpDataServiceImpl implements IErpDataService {
         return new Result(ResultCode.SUCCESS,produceJa);
     }
 
+    @Override
+    public Result getSalesTest(String farmCode) {
+        List<Object[]> payableList = tDeliveryRepo.getSalesTest( farmCode);
+        return new Result(ResultCode.SUCCESS,payableList);
+    }
+
 }

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

@@ -44,15 +44,7 @@
             <version>1.2.62</version>
         </dependency>
         <!-- JPA -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-jpa</artifactId>
-        </dependency>
-        <!-- mysql -->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
+
         <!-- alibaba的druid数据库连接池 -->
 <!--        <dependency>-->
 <!--            <groupId>com.alibaba</groupId>-->

+ 33 - 0
huimv-hy-production/zhaoyi/.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 76 - 0
huimv-hy-production/zhaoyi/pom.xml

@@ -0,0 +1,76 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.6.3</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.huimv.zhaoyi</groupId>
+    <artifactId>demo</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <description>datasource</description>
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>8.0.16</version>
+        </dependency>
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>sqljdbc4</artifactId>
+            <version>4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+            <version>2.3.1.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 13 - 0
huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/DatasourceApplication.java

@@ -0,0 +1,13 @@
+package com.huimv.zhaoyi;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class DatasourceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(DatasourceApplication.class, args);
+    }
+
+}

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

@@ -0,0 +1,28 @@
+package com.huimv.zhaoyi.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/zhaoyi/src/main/java/com/huimv/zhaoyi/configuration/UpperTableStrategy.java

@@ -0,0 +1,22 @@
+package com.huimv.zhaoyi.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);
+    }
+}

+ 23 - 0
huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/controller/WeightInformationController.java

@@ -0,0 +1,23 @@
+package com.huimv.zhaoyi.controller;
+
+
+import com.huimv.zhaoyi.service.WeightInformationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/weightInformation")
+public class WeightInformationController {
+
+        @Autowired
+        private WeightInformationService weightInformationService;
+
+        @GetMapping("/getList")
+        public List getList (){
+                return weightInformationService.getList();
+        }
+}

+ 15 - 0
huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/dao/WeightInformationDao.java

@@ -0,0 +1,15 @@
+package com.huimv.zhaoyi.dao;
+
+
+import com.huimv.zhaoyi.entity.WeightInformation;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.Date;
+import java.util.List;
+
+public interface WeightInformationDao  extends JpaRepository<WeightInformation,String>, JpaSpecificationExecutor<WeightInformation> {
+    List<WeightInformation> findAllByUploadTimeGreaterThanEqual (Date startDate);
+
+
+}

+ 284 - 0
huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/entity/WeightInformation.java

@@ -0,0 +1,284 @@
+package com.huimv.zhaoyi.entity;
+
+
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+@Entity
+@Data
+@Table(name = "weight_information")
+public class WeightInformation implements Serializable {
+    @Id
+    @Column(name =  "id")
+    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 Integer grossWeight;
+
+    //实际皮重
+    @Column(name =  "tare_weight")
+    private Integer tareWeight;
+
+    //实际净重
+    @Column(name =  "net_weight")
+    private Integer netWeight;
+
+    //扣重
+    @Column(name =  "deduction_weight")
+    private Integer deductionWeight;
+
+    //实重
+    @Column(name =  "actual_weight")
+    private Integer actualWeight;
+
+    //单价
+    @Column(name =  "price")
+    private Integer price;
+
+    //金额
+    @Column(name =  "money")
+    private Integer money;
+
+    //折方系数
+    @Column(name =  "coefficient")
+    private Integer coefficient;
+
+    //方量
+    @Column(name =  "capacity")
+    private Integer capacity;
+
+    //称重费用
+    @Column(name =  "weighing_charges")
+    private Integer 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 =  "upload_time")
+    private Date uploadTime;
+  /*  //第二次称重时间
+    @Column(name =  "second_weighing_time")
+    private String secondWeighingTime;
+
+    //称重时间
+    @Column(name =  "weighing_time")
+    private String weighingTime;
+
+    //更新人
+    @Column(name =  "update_user")
+    private String updateUser;
+
+    //更新时间
+    @Column(name =  "updateTime")
+    private String updateTime;
+
+    //备注
+    @Column(name =  "remarks")
+    private String remarks;
+
+    //打印
+    @Column(name =  "times_of_prints")
+    private String timesOfPrints;
+
+    //上传治超
+    @Column(name =  "is_upload")
+    private String isUpload;
+
+    //上传治超
+    @Column(name =  "is_upload")
+    private String isUpload2;
+
+    //上传治超
+    @Column(name =  "is_upload")
+    private String isUpload3;
+
+
+    //上传科达
+    @Column(name =  "is_upload_cloud")
+    private String isUploadCloud;
+
+    //状态
+    @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;
+
+    //memo11
+    @Column(name =  "memo11")
+    private String memo11;
+
+    //memo12
+    @Column(name =  "memo12")
+    private String memo12;
+
+    //memo13
+    @Column(name =  "memo13")
+    private String memo13;
+
+    //memo14
+    @Column(name =  "memo14")
+    private String memo14;
+
+    //memo15
+    @Column(name =  "memo15")
+    private String memo15;
+
+    //memo16
+    @Column(name =  "memo16")
+    private String memo16;
+
+    //memo17
+    @Column(name =  "memo17")
+    private String memo17;
+
+    //memo18
+    @Column(name =  "memo18")
+    private String memo18;
+
+    //memo19
+    @Column(name =  "memo19")
+    private String memo19;
+
+    //memo20
+    @Column(name =  "memo20")
+    private String memo20;
+
+    //memo21
+    @Column(name =  "memo21")
+    private String memo21;
+
+    //过磅类型
+    @Column(name =  "weighing_type")
+    private String weighingType;
+
+
+    //数据上传状态
+    @Column(name =  "uploadKdState")
+    private String uploadKdState;
+
+    //图片上传状态
+    @Column(name =  "uploadKdState2")
+    private String uploadKdState2;
+
+    //视频上传状态
+    @Column(name =  "uploadKdState3")
+    private String uploadKdState3;
+
+
+*/
+
+}

+ 8 - 0
huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/service/WeightInformationService.java

@@ -0,0 +1,8 @@
+package com.huimv.zhaoyi.service;
+
+
+import java.util.List;
+
+public interface WeightInformationService {
+    List getList();
+}

+ 26 - 0
huimv-hy-production/zhaoyi/src/main/java/com/huimv/zhaoyi/service/impl/WeightInformationServericeImpl.java

@@ -0,0 +1,26 @@
+package com.huimv.zhaoyi.service.impl;
+
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.huimv.zhaoyi.dao.WeightInformationDao;
+import com.huimv.zhaoyi.service.WeightInformationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class WeightInformationServericeImpl implements WeightInformationService {
+    @Autowired
+    private WeightInformationDao weightInformationDao;
+
+    @Override
+    public List getList() {
+        DateTime dateTime = DateUtil.offsetHour(new Date(), -1);
+
+
+        return weightInformationDao.findAllByUploadTimeGreaterThanEqual(dateTime);
+    }
+}

+ 20 - 0
huimv-hy-production/zhaoyi/src/main/resources/application-dev.yml

@@ -0,0 +1,20 @@
+server:
+  port: 9100
+spring:
+  application:
+    name: huimv-hy-erp-datasource
+  datasource:
+    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#    url: jdbc:sqlserver://115.238.57.190:1433;DatabaseName=qlyz
+    url: jdbc:sqlserver://192.168.1.250:1433;DatabaseName=qlyz
+    username: sa
+    password: kd1233456
+  jpa:
+    show-sql: true
+    properties:
+      hibernate:
+        default_schema: dbo
+    hibernate:
+      naming:
+        physical-strategy: com.huimv.zhaoyi.configuration.UpperTableStrategy
+

+ 20 - 0
huimv-hy-production/zhaoyi/src/main/resources/application-test.yml

@@ -0,0 +1,20 @@
+server:
+  port: 9100
+spring:
+  application:
+    name: huimv-hy-erp-datasource
+  datasource:
+    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#    url: jdbc:sqlserver://115.238.57.190:1433;DatabaseName=qlyz
+    url: jdbc:sqlserver://192.168.1.20:1433;DatabaseName=zhaoyi_test
+    username: sa
+    password: hm123456@
+  jpa:
+    show-sql: true
+    properties:
+      hibernate:
+        default_schema: dbo
+    hibernate:
+      naming:
+        physical-strategy: com.huimv.zhaoyi.configuration.UpperTableStrategy
+

+ 3 - 0
huimv-hy-production/zhaoyi/src/main/resources/application.properties

@@ -0,0 +1,3 @@
+#spring.profiles.active=dev
+spring.profiles.active=test
+

+ 13 - 0
huimv-hy-production/zhaoyi/src/test/java/com/huimv/zhaoyi/demo/DatasourceApplicationTests.java

@@ -0,0 +1,13 @@
+package com.huimv.zhaoyi.demo;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class DatasourceApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}