Ver código fonte

生物防控人员2

523096025 3 semanas atrás
pai
commit
dbdd2abd76

+ 5 - 12
huimv-receive/pom.xml

@@ -26,17 +26,6 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-validation</artifactId>
         </dependency>
-        <dependency>
-            <groupId>net.sourceforge.jtds</groupId>
-            <artifactId>jtds</artifactId>
-            <version>1.2.4</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-dbcp2</artifactId>
-            <version>2.12.0</version>
-        </dependency>
 
         <dependency>
             <groupId>org.projectlombok</groupId>
@@ -54,7 +43,11 @@
             <artifactId>mysql-connector-java</artifactId>
         </dependency>
 
-
+        <dependency>
+            <groupId>net.sourceforge.jtds</groupId>
+            <artifactId>jtds</artifactId>
+            <version>1.2.4</version>
+        </dependency>
 
         <dependency>
             <groupId>com.alibaba</groupId>

+ 30 - 0
huimv-receive/src/main/java/com/huimv/receive/controller/LoginController.java

@@ -9,12 +9,15 @@ import com.huimv.receive.common.exception.ExceptionEnum;
 import com.huimv.receive.common.exception.MiException;
 import com.huimv.receive.common.token.TokenSign;
 import com.huimv.receive.common.utils.*;
+import com.huimv.receive.entity.BillGate;
 import com.huimv.receive.entity.SysAccountMultilevel;
 import com.huimv.receive.entity.dto.WeCahtVo;
+import com.huimv.receive.mapper.BillGateMapper;
 import com.huimv.receive.service.IBaseJobService;
 import com.huimv.receive.service.ILoginService;
 import com.huimv.receive.service.ISysAccountMultilevelService;
 import com.huimv.receive.session.AccessToken;
+import com.huimv.receive.timer.test.TestWeight;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.http.ResponseEntity;
@@ -27,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
@@ -45,6 +49,32 @@ public class LoginController {
 
     @Autowired
     private UploadImage uploadImage;
+    @Autowired
+    private BillGateMapper billGateMapper;
+
+    @PostMapping("/saveDiBang")
+    public String logout(@RequestBody Map<String, List<TestWeight>> map ) {
+        List<TestWeight> dibang = map.get("dibang");
+        for (TestWeight testWeight : dibang) {
+            System.out.println(testWeight);
+
+            BillGate billGate = billGateMapper.selectOne(new QueryWrapper<BillGate>().eq("stdno",testWeight.getFStdNo()));
+            if (ObjectUtil.isEmpty(billGate)) {
+                List<BillGate> billGate1 = billGateMapper.selectList(new QueryWrapper<BillGate>().eq("car_num", testWeight.getFCarNo())
+                        .between("check_date", testWeight.getBeginTime(), testWeight.getEndTime()).eq("check_location",testWeight.getDeviceCode()));
+                if (ObjectUtil.isNotEmpty(billGate1)) {
+                    billGate = billGate1.get(0);
+                    billGate.setGross(testWeight.getGross() + "");
+                    billGate.setTare(testWeight.getMoney() + "");
+                    billGate.setNet(testWeight.getNet() + "");
+                    billGate.setStdno(testWeight.getFStdNo());
+                    billGateMapper.insert(billGate);
+                }
+            }
+        }
+        return "";
+    }
+
 
     @RequestMapping("/logout")
     public Result logout(@RequestParam(name = "accountName", required = true) String accountName, @RequestParam(name = "password", required = true) String password) {