wangzhuo 2 rokov pred
rodič
commit
bc63fb0c8c
25 zmenil súbory, kde vykonal 1344 pridanie a 3 odobranie
  1. 348 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/plugin/BulkWareHouseController.java
  2. 5 0
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
  3. 1 0
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  4. 147 0
      ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/BulkWareHouseInterceptor.java
  5. 2 3
      ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/SignInterceptor.java
  6. 30 0
      ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/ForeignHttpService.java
  7. 45 0
      ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/impl/ForeignHttpServiceImpl.java
  8. 5 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TCorpsMapper.java
  9. 16 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TWarehouseMapper.java
  10. 29 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java
  11. 70 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java
  12. 62 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/CustomerVerifyRequest.java
  13. 59 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/InventoryQueryRequest.java
  14. 5 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptCancelRequest.java
  15. 89 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptOperationBaseRequest.java
  16. 7 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptRegisterRequest.java
  17. 156 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptTransferRequest.java
  18. 45 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/CustomerVerifyResponse.java
  19. 54 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/InventoryQueryResponse.java
  20. 5 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptCancelResponse.java
  21. 73 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptOperationBaseResponse.java
  22. 5 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptRegisterResponse.java
  23. 5 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptTransferResponse.java
  24. 6 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml
  25. 75 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

+ 348 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/plugin/BulkWareHouseController.java

@@ -0,0 +1,348 @@
+package com.ruoyi.web.controller.plugin;
+
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ruoyi.basicData.domain.TCorps;
+import com.ruoyi.ccb.service.ForeignHttpService;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.request.InventoryQueryRequest;
+import com.ruoyi.warehouseBusiness.request.ReceiptRegisterRequest;
+import com.ruoyi.warehouseBusiness.response.*;
+import lombok.AllArgsConstructor;
+import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.security.*;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 大宗仓库接⼝
+ */
+@AllArgsConstructor
+@RestController
+@RequestMapping("/bulkWareHouse")
+public class BulkWareHouseController extends BaseController {
+
+    @Autowired
+    private ForeignHttpService foreignHttpService;
+
+    /**
+     * 获取仓库详细信息
+     */
+    @PostMapping("/inventory/queries")
+    public void queries(HttpServletRequest request, HttpServletResponse response) throws InvalidKeySpecException, SignatureException, NoSuchAlgorithmException, InvalidKeyException {
+
+        String bizContentStr = (String) request.getAttribute("bizContentStr");
+
+        JSONObject jsonObject = JSONObject.parseObject(bizContentStr);
+        String ownerName = jsonObject.getString("currentOwnerName");//现存货人名称
+        String identifier = jsonObject.getString("currentOwnerSocialIdentifier");//现存货人识别号
+
+        JSONArray jsonArray = jsonObject.getJSONArray("warehouseSerialNumbers");//仓库编号
+
+        List<String> numbersList = new ArrayList<>();
+        for(int i=0;i<jsonArray.size();i++){
+            String numbers = jsonArray.getString(i);
+            numbersList.add(numbers);
+            System.out.println(numbers);
+        }
+
+        InventoryQueryRequest inventoryQueryRequest = new InventoryQueryRequest();
+        inventoryQueryRequest.setCurrentOwnerName(ownerName);
+        inventoryQueryRequest.setCurrentOwnerSocialIdentifier(identifier);
+        inventoryQueryRequest.setWarehouseSerialNumbers(numbersList);
+
+        List<InventoryQueryResponse> list = foreignHttpService.inventoryQueries(inventoryQueryRequest);
+
+        sendRequest(Collections.singletonList(list),response);
+
+    }
+
+    /**
+     * 仓单注册指令
+     */
+    @PostMapping("/receipt/register")
+    public void receiptRegister(HttpServletRequest request, HttpServletResponse response) throws InvalidKeySpecException, SignatureException, NoSuchAlgorithmException, InvalidKeyException {
+
+        String bizContentStr = (String) request.getAttribute("bizContentStr");
+        JSONObject jsonObject = JSONObject.parseObject(bizContentStr);
+
+        String ownerName = jsonObject.getString("currentOwnerName");//现存货人名称
+        String identifier = jsonObject.getString("currentOwnerSocialIdentifier");//现存货人识别号
+        JSONArray jsonArray = jsonObject.getJSONArray("receipts");//编号
+
+        List<ReceiptRegisterResponse> list = new ArrayList<>();
+        for(int i=0;i<jsonArray.size();i++){
+            JSONObject object = jsonArray.getJSONObject(i);
+            String numbers = object.getString("warehouseSerialNumber");
+
+            ReceiptRegisterResponse registerResponse = new ReceiptRegisterResponse();
+            int count = foreignHttpService.receiptRegister(ownerName, identifier, numbers);
+            if (ObjectUtil.isNull(count) || count == 0){
+                registerResponse.setStatus("ABNORMAL");
+                registerResponse.setComments("参数错误,检查参数");
+            }else {
+                registerResponse.setStatus("SUCCESS");
+            }
+            registerResponse.setWarehouseSerialNumber(numbers);
+            list.add(registerResponse);
+        }
+
+        sendRequest(Collections.singletonList(list),response);
+
+    }
+
+    /**
+     * 客户检验指令
+     */
+    @PostMapping("/customer/verification")
+    public void verification(HttpServletRequest request, HttpServletResponse response) throws InvalidKeySpecException, SignatureException, NoSuchAlgorithmException, InvalidKeyException {
+
+        String bizContentStr = (String) request.getAttribute("bizContentStr");
+
+        JSONObject jsonObject = JSONObject.parseObject(bizContentStr);
+        JSONArray jsonArray = jsonObject.getJSONArray("customers");//客户
+
+        List<CustomerVerifyResponse> list = new ArrayList<>();
+        for(int i=0;i<jsonArray.size();i++){
+            JSONObject object = jsonArray.getJSONObject(i);
+            String name = object.getString("name");
+            String identifier = object.getString("socialIdentifier");
+
+            TCorps corps = foreignHttpService.verification(name, identifier);
+
+            CustomerVerifyResponse verifyResponse = new CustomerVerifyResponse();
+            if (ObjectUtil.isNull(corps)){
+                verifyResponse.setStatus("ABNORMAL");
+                verifyResponse.setComments("参数错误,检查参数");
+            }else {
+                verifyResponse.setStatus("SUCCESS");
+                verifyResponse.setSocialIdentifier(corps.getUscc());
+            }
+            list.add(verifyResponse);
+        }
+
+        sendRequest(Collections.singletonList(list),response);
+
+    }
+
+    /**
+     * 仓单过户指令
+     */
+    @PostMapping("/receipt/transfer")
+    public void receiptTransfer(HttpServletRequest request, HttpServletResponse response) throws InvalidKeySpecException, SignatureException, NoSuchAlgorithmException, InvalidKeyException, ParseException {
+
+        String bizContentStr = (String) request.getAttribute("bizContentStr");
+
+        JSONObject jsonObject = JSONObject.parseObject(bizContentStr);
+
+        List<ReceiptTransferResponse> list = new ArrayList<>();
+
+        String number = jsonObject.getString("warehouseSerialNumber");//仓库编码
+        String ownerName = jsonObject.getString("currentOwnerName");//现存货人名称
+        String identifier = jsonObject.getString("currentOwnerSocialIdentifier");//现存货人编码
+        JSONArray jsonArray = jsonObject.getJSONArray("targetOwners");//目标存货人数组
+
+        for(int i=0;i<jsonArray.size();i++){
+            TWarehouseBills warehouseBills = new TWarehouseBills();
+            ReceiptTransferResponse transferResponse = new ReceiptTransferResponse();
+
+            JSONObject object = jsonArray.getJSONObject(i);//目标存货人
+            if (jsonArray.size() == 1){
+                //现存货人
+                TCorps corps = foreignHttpService.verification(ownerName, identifier);
+                if (ObjectUtil.isNull(corps)){
+                    transferResponse.setStatus("ABNORMAL");
+                    transferResponse.setComments("参数错误,检查参数");
+                    transferResponse.setWarehouseSerialNumber(number);
+                    list.add(transferResponse);
+                    break;
+                }
+                warehouseBills.setfCorpid(corps.getfId());
+
+            }else if (jsonArray.size() > 1 && i > 0){
+                //现存货人
+                TCorps corps = foreignHttpService.verification(jsonArray.getJSONObject(i - 1).getString("name"),
+                        jsonArray.getJSONObject(i - 1).getString("socialIdentifier"));
+                if (ObjectUtil.isNull(corps)){
+                    transferResponse.setStatus("ABNORMAL");
+                    transferResponse.setComments("参数错误,检查参数");
+                    transferResponse.setWarehouseSerialNumber(number);
+                    list.add(transferResponse);
+                    break;
+                }
+                warehouseBills.setfCorpid(corps.getfId());
+            }
+
+            String name = object.getString("name");//目标存货人名称
+            String socialIdentifier = object.getString("socialIdentifier");//目标存货人编码
+
+            TCorps toCorps = foreignHttpService.verification(name, socialIdentifier);
+
+            if (ObjectUtil.isNull(toCorps)){
+                transferResponse.setStatus("ABNORMAL");
+                transferResponse.setComments("参数错误,检查参数");
+                transferResponse.setWarehouseSerialNumber(number);
+                list.add(transferResponse);
+                break;
+            }
+
+            warehouseBills.setfTocorpid(toCorps.getfId());
+
+            int count = foreignHttpService.receiptTransfer(warehouseBills);
+
+            if (count == 0){
+                transferResponse.setStatus("ABNORMAL");
+                transferResponse.setComments("参数错误,检查参数");
+            }else {
+                transferResponse.setStatus("SUCCESS");
+            }
+            transferResponse.setCompletionTimestamp(new Date().getTime());
+            transferResponse.setWarehouseSerialNumber(number);
+
+            list.add(transferResponse);
+        }
+
+        sendRequest(Collections.singletonList(list),response);
+
+    }
+
+    /**
+     * 仓单解锁指令
+     */
+    @PostMapping("/receipt/cancel")
+    public void receiptCancel(HttpServletRequest request, HttpServletResponse response) throws InvalidKeySpecException, SignatureException, NoSuchAlgorithmException, InvalidKeyException {
+
+        String bizContentStr = (String) request.getAttribute("bizContentStr");
+
+        JSONObject jsonObject = JSONObject.parseObject(bizContentStr);
+
+        String ownerName = jsonObject.getString("currentOwnerName");//现存货人名称
+        String identifier = jsonObject.getString("currentOwnerSocialIdentifier");//现存货人识别号
+        JSONArray jsonArray = jsonObject.getJSONArray("receipts");//编号
+
+        List<ReceiptCancelResponse> list = new ArrayList<>();
+        for(int i=0;i<jsonArray.size();i++){
+            JSONObject object = jsonArray.getJSONObject(i);
+            String numbers = object.getString("warehouseSerialNumber");
+
+            ReceiptCancelResponse cancelResponse = new ReceiptCancelResponse();
+            int count = foreignHttpService.receiptCancel(ownerName, identifier, numbers);
+            if (count == 0){
+                cancelResponse.setStatus("ABNORMAL");
+                cancelResponse.setComments("参数错误,检查参数");
+            }else {
+                cancelResponse.setStatus("SUCCESS");
+            }
+            cancelResponse.setWarehouseSerialNumber(numbers);
+            list.add(cancelResponse);
+        }
+
+        sendRequest(Collections.singletonList(list),response);
+
+    }
+
+    public void sendRequest(List<Object> list, HttpServletResponse response) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException {
+        String responseBizContext;
+        try {
+            responseBizContext = new ObjectMapper().writeValueAsString(list);
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException(e);
+        }
+
+
+        String nonceStr = UUID.randomUUID().toString().replaceAll("-", ""); // 随机串  UUID
+        long timestamp = System.currentTimeMillis(); // 当前系统的时间戳    精度 毫秒
+
+        String data = assembleResponseData(nonceStr, timestamp, responseBizContext);
+
+        String privateKeyBase64 = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDNftymM/qRWbLyVjHz5mTsPxZ/Owh9c9YC7wzSF4EA1lJY5TCd8v9rEoLFkH2YIrcsjNKVXNEZesAkwDDTAnntNyrP/4TOoGBwMYhjlkjje9zPNdI71VovEwwR6EFGbzK2XqWe3t8lLRMhZso5gQCI52UGPFWyWHD7n5a1QXNuwK+waLzecX7wuWvKeVmh0FVczmHAhiDmGgFeUaCI47q89/2KlxnhrbZjZCKl9fakohZuiZ4PHmH0ONjs5SCQPgeiLXlo1BZ8rN/GUYzqNZUJ1s8YtWwu+17G16MHrHlkN3iCIeSV5LOAZdyj/beTYog1j9EZheluoYr6FpAF4jonAgMBAAECggEACPoky4HzzUu83IdVcVE8UXHEGtTKXyijTceBqN/r+8xhFo8Um6HU9Kl/WwAf7Hh/xgt025+NZu6M3E4lE+LEzs8dKK8B70DkVaJkUe1ry7xKfibcw05jvTC400NxLpGHBp6F37Xey7H3ZvsllHOFQXXSXP5fxAXHEcb7/3kXgNwH9rF9jto8BmULYuKR2OmX6BN0hN1jiMD9DflMiZABIYiu/RTHmHHwjwxG7Z/8hN+/uJfMEdWw10AI5lhG4R3C5M/M0/hXPByQ/SODMPS6rbPYjQwFWNSx90jePkEJBzpRkNdvRBok2aulKWE3R67obNnKZMitkdyXIehoQqqFSQKBgQD4KfZ6FTu/XZMfDcZsUpoKyCLzILoI30+iF+fccGkn0JHe5XPlAcDNUkH/0k9pnh7iiUHhq7UTpi1oYlj096H2xjziutxFgqOyMiqU7ZeKJEaQugr1/ksDa3VULWHxK4YqVLnN+6DcD5HJyx2/Ty1iXW14wSEhikhsDwwz6LFxfQKBgQDT+/0aP+JsRYeazd7xpdFEQv/3lPxuv3qKSbCgsvFB3SAPSVPJ6YjaUHR9rtGMJM0B+HVeWtlI2xDhcMecwzRAjnFhf0cFbIHKzLVKYxiTfKF6d6bCp5v870tH3gWRDNjveIQ+s+QUnkwV+XpsP7hP+yqMsS2UQBNJb5jf/0FrcwKBgQDubLqe/omByTCRVFXAOvg+xZw2hMnXvl0u+dLNCr8s/ok3YrIfYrjPS2mXlIKxkbZQpdjDLYpyj2Tu9hZLfSOCCWHz393Ddsk5alNY9JB0q3eUkvn279M4POTj9Bo2cD+dqfs9+LTK2LaT7u7sn/CVofeMXdkr9USxdR+fO8BHrQKBgFCHKV8PZbQ7tYfZLRgfJaAI07P5pOttUd+2nqJtV7jth4BHGs1ZKePFLHuSLYhPcpGNEQkG+gPzNDZv4WRrwy3C7s9aymAFGEkx+qyHeI6Oick8Kt1HTrqHLNHgRb0UZFSUM6ieLcanW7/9RcRZcGrxvvgzVl06+hirjCeLkA6BAoGAba3JHPMxAlWzYTYUoGUka/dpZUNBZueJT1d2bKXS7rP4SHmnnJKjPmuFBukvktG2Z0VCll1FcvKET4ywEvLb4APAXKup5RQYad7WGAsUOEORVZcoMpDZyi8uGB575xjyzsixk+6A06G/JdZ/6jJOzQeT6UZuxAfL33w8/KUbE0U=";
+
+        byte[] signature = signRSA2(data.getBytes(StandardCharsets.UTF_8), privateKeyBase64);
+
+        String authorization = assembleResponseAuthorizationToken(nonceStr, timestamp, Base64.getEncoder().encodeToString(signature));
+
+        response.setStatus(HttpStatus.OK.value());
+        response.setHeader("Request-ID", UUID.randomUUID().toString());
+        response.setHeader("Authorization", authorization);
+        response.setCharacterEncoding(StandardCharsets.UTF_8.name());
+        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
+
+        try {
+            response.getWriter().print(responseBizContext);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     *签名头: 无先后顺序
+     * 请求随机串nonce_str
+     * 时间戳timestamp  精度 毫秒
+     * Base64编码得到签名值  signature
+     *
+     * @param nonceStr
+     * @param timestamp
+     * @param signature
+     * @return
+     */
+    private static String assembleResponseAuthorizationToken(String nonceStr, long timestamp, String signature) {
+        return "nonce_str=" + nonceStr + ","
+                + "timestamp=" + timestamp + ","
+                + "signature=" + signature + "";
+    }
+
+    /**
+     * 响应数据签名生成规则:
+     * 签名串一共有三行,每一行为一个参数。
+     * 行尾以 \n(换行符,ASCII编码值为0x0A)结束,包括最后一行。
+     * 若应答报文主体为空(如HTTP状态码为204 No Content),最后一行仅为一个\n换行符。
+     *
+     * 应答时间戳\n
+     * 应答随机串\n
+     * 应答报文主体\n
+     *
+     * @param nonceStr
+     * @param timestamp
+     * @param bizContentStr
+     * @return
+     */
+    private static String assembleResponseData(String nonceStr, long timestamp, String bizContentStr) {
+        return timestamp + "\n"
+                + nonceStr + "\n"
+                + bizContentStr + "\n";
+    }
+
+    private static final String DEFAULT_RSA = "RSA";
+    private static final String DEFAULT_RSA2 = "SHA256withRSA";
+
+    public static byte[] signRSA2(byte[] data, String privateKeyBase64) throws InvalidKeySpecException, SignatureException, NoSuchAlgorithmException, InvalidKeyException {
+        PrivateKey privateKey = KeyFactory.getInstance(DEFAULT_RSA).generatePrivate(new PKCS8EncodedKeySpec(Base64.getDecoder().decode(privateKeyBase64)));
+
+        Signature sign = Signature.getInstance(DEFAULT_RSA2);
+
+        sign.initSign(privateKey);
+
+        sign.update(data);
+
+        return sign.sign();
+    }
+}

+ 5 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java

@@ -1,5 +1,6 @@
 package com.ruoyi.framework.config;
 
+import com.ruoyi.framework.interceptor.BulkWareHouseInterceptor;
 import com.ruoyi.framework.interceptor.SignInterceptor;
 import com.ruoyi.framework.interceptor.TSeapriceQueryLogInterceptor;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +33,9 @@ public class ResourcesConfig implements WebMvcConfigurer
     @Autowired
     private SignInterceptor signInterceptor;
 
+    @Autowired
+    private BulkWareHouseInterceptor bulkWareHouseInterceptor;
+
     @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry)
     {
@@ -49,6 +53,7 @@ public class ResourcesConfig implements WebMvcConfigurer
     @Override
     public void addInterceptors(InterceptorRegistry registry)
     {
+        registry.addInterceptor(bulkWareHouseInterceptor).addPathPatterns("/bulkWareHouse/**");
         registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
         registry.addInterceptor(tSeapriceQueryLogInterceptor).addPathPatterns("/**");
         registry.addInterceptor(signInterceptor).addPathPatterns("/open/wms/**").addPathPatterns("/api/open/wareHouse/**");

+ 1 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -116,6 +116,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/druid/**").anonymous()
                 .antMatchers("/api/**").anonymous()
                 .antMatchers("/open/wms/**").anonymous()
+                .antMatchers("/bulkWareHouse/**").anonymous()
 //                .antMatchers("/ccb/**").anonymous()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()

+ 147 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/BulkWareHouseInterceptor.java

@@ -0,0 +1,147 @@
+package com.ruoyi.framework.interceptor;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.support.RequestContextUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
+import java.security.*;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 森能山东大宗接口拦截器
+ */
+@Component
+public class BulkWareHouseInterceptor implements HandlerInterceptor {
+
+    private static final String DEFAULT_RSA = "RSA";
+    private static final String DEFAULT_RSA2 = "SHA256withRSA";
+
+    private static final String AUTHORIZATION_FLAG = "token";
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        System.out.println("===========拦截进来了===========");
+        if (handler instanceof HandlerMethod)
+        {
+            String authorization = request.getHeader(AUTHORIZATION_FLAG);
+
+            if (Objects.isNull(authorization)) {
+                return false;
+            }
+
+            Map<String, String> headerParams = Arrays.stream(authorization.split(",")).filter(it -> it.length() > 1).map(it -> it.split("=", 2)).collect(Collectors.toMap(it -> it[0], it -> it[1]));
+
+            String platformId = headerParams.get("platform_id");
+            String nonceStr = headerParams.get("nonce_str");
+            String timestamp = headerParams.get("timestamp");
+            String signType = headerParams.get("sign_type"); // if
+            String signature = headerParams.get("signature");
+
+            if (Objects.isNull(platformId)
+                    || Objects.isNull(nonceStr)
+                    || Objects.isNull(timestamp)
+                    || Objects.isNull(signature)
+                    || Objects.isNull(signType)) {
+                return false;
+            }
+
+
+            String httpUrl = request.getRequestURI();
+            String httpMethod = request.getMethod();
+
+            byte[] bytes = new byte[request.getContentLength()];
+
+            request.getInputStream().read(bytes);
+
+            String characterEncoding = request.getCharacterEncoding();
+
+            String bizContentStr = new String(bytes, Objects.isNull(characterEncoding) ? StandardCharsets.UTF_8.name() : request.getCharacterEncoding());
+
+            request.setAttribute("bizContentStr", bizContentStr);
+
+            String data = assembleRequestData(httpMethod, httpUrl, nonceStr, Long.valueOf(timestamp), bizContentStr);
+
+
+            // TODO  配置文件
+            String publicKeyBase64 = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzX7cpjP6kVmy8lYx8+Zk7D8WfzsIfXPWAu8M0heBANZSWOUwnfL/axKCxZB9mCK3LIzSlVzRGXrAJMAw0wJ57Tcqz/+EzqBgcDGIY5ZI43vczzXSO9VaLxMMEehBRm8ytl6lnt7fJS0TIWbKOYEAiOdlBjxVslhw+5+WtUFzbsCvsGi83nF+8LlrynlZodBVXM5hwIYg5hoBXlGgiOO6vPf9ipcZ4a22Y2QipfX2pKIWbomeDx5h9DjY7OUgkD4Hoi15aNQWfKzfxlGM6jWVCdbPGLVsLvtextejB6x5ZDd4giHkleSzgGXco/23k2KINY/RGYXpbqGK+haQBeI6JwIDAQAB";
+
+            //  String signType = headerParams.get("sign_type");  RSA2 才调用这个方法,  其他算法  调用其他的
+            boolean result = verifyRSA2(data.getBytes(StandardCharsets.UTF_8), publicKeyBase64, Base64.getDecoder().decode(signature));
+
+            if (!result){
+                try {
+                    response.setCharacterEncoding("UTF-8");
+                    response.setContentType("application/json; charset=utf-8");
+                    PrintWriter out = null;
+                    JSONObject res = new JSONObject();
+                    res.put("code", "SIGN_ERROR");
+                    res.put("msg", "签名错误,检查签名");
+                    out = response.getWriter();
+                    out.append(res.toString());
+                    response.setStatus(200);
+                    return false;
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    response.sendError(200);
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * 请求数据签名生成规则:
+     * 签名串一共有五行,每一行为一个参数。
+     * 行尾以 \n(换行符,ASCII编码值为0x0A)结束,包括最后一行。
+     * 如果参数本身以\n结束,也需要附加一个\n
+     *
+     *
+     * HTTP请求方法\n
+     * URL\n
+     * 请求时间戳\n
+     * 请求随机串\n
+     * 请求报文主体\n
+     *
+     * @param httpMethod
+     * @param httpUrl
+     * @param nonceStr
+     * @param timestamp
+     * @param bizContentStr
+     * @return
+     */
+    private static String assembleRequestData(String httpMethod, String httpUrl, String nonceStr, long timestamp, String bizContentStr) {
+        return httpMethod + "\n"
+                + httpUrl + "\n"
+                + timestamp + "\n"
+                + nonceStr + "\n"
+                + bizContentStr + "\n";
+    }
+
+
+    public static boolean verifyRSA2(byte[] data, String publicKeyBase64, byte[] signature) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, SignatureException {
+        PublicKey publicKey = KeyFactory.getInstance(DEFAULT_RSA).generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(publicKeyBase64)));
+
+        Signature instance = Signature.getInstance(DEFAULT_RSA2);
+
+        instance.initVerify(publicKey);
+
+        instance.update(data);
+
+        return instance.verify(signature);
+    }
+}

+ 2 - 3
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/SignInterceptor.java

@@ -23,7 +23,6 @@ public class SignInterceptor implements HandlerInterceptor {
 
         if (handler instanceof HandlerMethod)
         {
-            System.out.println("请求头======>"+request);
             String appKey = request.getHeader("appKey");
             String timestamp = request.getHeader("timestamp");
             String uri = request.getHeader("uri");
@@ -31,9 +30,9 @@ public class SignInterceptor implements HandlerInterceptor {
 
             String mdUrl = "appKey="+appKey+"&timestamp="+timestamp+"&uri="+uri+"&appSecret=Qrgx3tn2tGqdIkvwIK0rcdckdYDG3caF";//森能正式
             //String mdUrl = "appKey="+appKey+"&timestamp="+timestamp+"&uri="+uri+"&appSecret=irf6DdRkEdR6whj4";
-            System.out.println("MD5加密======>"+mdUrl);
+
             String md5Upper = this.encrypt3ToMD5(mdUrl);
-            System.out.println("加密后======>"+md5Upper);
+
             if (md5Upper.equals(sign)){
                 return true;
             }else {

+ 30 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/ForeignHttpService.java

@@ -1,7 +1,11 @@
 package com.ruoyi.ccb.service;
 
 import cn.hutool.json.JSONObject;
+import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.ccb.domain.*;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.request.InventoryQueryRequest;
+import com.ruoyi.warehouseBusiness.response.InventoryQueryResponse;
 
 import java.util.List;
 import java.util.Map;
@@ -89,4 +93,30 @@ public interface ForeignHttpService {
      *  WMS作业通知数字仓库系统接
      */
     Map<String, Object> workNoticeV1(JSONObject jsonObject);
+
+    /**
+     * 获取仓库详细信息
+     */
+    List<InventoryQueryResponse> inventoryQueries(InventoryQueryRequest inventoryQueryRequest);
+
+    /**
+     * 仓单注册指令
+     */
+    int receiptRegister(String ownerName, String identifier, String numbers);
+
+
+    /**
+     * 客户检验指令
+     */
+    TCorps verification(String name, String identifier);
+
+    /**
+     * 仓单过户指令
+     */
+    int receiptTransfer(TWarehouseBills warehouseBills);
+
+    /**
+     * 仓单解锁指令
+     */
+    int receiptCancel(String ownerName, String identifier, String numbers);
 }

+ 45 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/impl/ForeignHttpServiceImpl.java

@@ -2,10 +2,15 @@ package com.ruoyi.ccb.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.json.JSONObject;
+import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.service.ITWarehouseService;
 import com.ruoyi.ccb.domain.*;
 import com.ruoyi.ccb.service.ForeignHttpService;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.request.InventoryQueryRequest;
+import com.ruoyi.warehouseBusiness.response.InventoryQueryResponse;
+import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -366,4 +371,44 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         mapR.put("msg","OK");
         return mapR;
     }
+
+    /**
+     * 获取仓库详细信息
+     */
+    @Override
+    public List<InventoryQueryResponse> inventoryQueries(InventoryQueryRequest inventoryQueryRequest) {
+        return itWarehouseService.inventoryQueries(inventoryQueryRequest);
+    }
+
+    /**
+     * 仓单注册指令
+     */
+    @Override
+    public int receiptRegister(String ownerName, String identifier, String numbers) {
+        return itWarehouseService.receiptRegister(ownerName,identifier,numbers);
+    }
+
+    /**
+     * 客户检验指令
+     */
+    @Override
+    public TCorps verification(String name, String identifier) {
+        return itWarehouseService.verification(name,identifier);
+    }
+
+    /**
+     * 仓单过户指令
+     */
+    @Override
+    public int receiptTransfer(TWarehouseBills warehouseBills) {
+        return itWarehouseService.receiptTransfer(warehouseBills);
+    }
+
+    /**
+     * 仓单解锁指令
+     */
+    @Override
+    public int receiptCancel(String ownerName, String identifier, String numbers) {
+        return itWarehouseService.receiptCancel(ownerName,identifier,numbers);
+    }
 }

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TCorpsMapper.java

@@ -201,4 +201,9 @@ public interface TCorpsMapper extends BaseMapper<TCorps> {
     @MapKey(value = "fId")
     public List<Map<String, Object>> getSyncCorpList(String time);
 
+    /**
+     * 客户检验指令
+     */
+    public TCorps verification(@Param("FName") String FName,@Param("identifier") String identifier);
+
 }

+ 16 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TWarehouseMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.basicData.mapper;
 
 
 import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.ruoyi.warehouseBusiness.response.InventoryQueryResponse;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -272,6 +273,21 @@ public interface TWarehouseMapper {
      */
     List<Map<String, Object>> getWorkTrend(@Param("wareHouseId")String wareHouseId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("countType") String countType);
 
+    /**
+     *  获取仓库详细信息
+     */
+    List<InventoryQueryResponse> inventoryQueries(@Param("ownerName")String ownerName, @Param("identifier") String identifier, @Param("numbersList") List<String > numbersList);
+
+    /**
+     * 仓单注册指令
+     */
+    public int receiptRegister(@Param("ownerName") String ownerName,@Param("identifier") String identifier,@Param("numbers") String numbers);
+
+    /**
+     * 仓单解锁指令
+     */
+    public int receiptCancel(@Param("ownerName") String ownerName,@Param("identifier") String identifier,@Param("numbers") String numbers);
+
     TWarehouse selectByPidANDName(@Param("stringCellValue")String stringCellValue, @Param("fWarehouseid")Long fWarehouseid);
 }
 

+ 29 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java

@@ -1,13 +1,17 @@
 package com.ruoyi.basicData.service;
 
 
+import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.domain.TWarehouseArea;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.TreeSelect;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
 import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;
+import com.ruoyi.warehouseBusiness.request.InventoryQueryRequest;
+import com.ruoyi.warehouseBusiness.response.InventoryQueryResponse;
 
 import java.util.List;
 import java.util.Map;
@@ -268,4 +272,29 @@ public interface ITWarehouseService {
      *  作业统计趋势数据
      */
     List<Map<String, Object>> getWorkTrend(String wareHouseId,  String startTime, String endTime, String countType);
+
+    /**
+     *  获取仓库详细信息
+     */
+    List<InventoryQueryResponse> inventoryQueries(InventoryQueryRequest inventoryQueryRequest);
+
+    /**
+     * 仓单注册指令
+     */
+    public int receiptRegister(String ownerName, String identifier, String numbers);
+
+    /**
+     * 客户检验指令
+     */
+    public TCorps verification(String name, String identifier);
+
+    /**
+     * 仓单过户指令
+     */
+    public int receiptTransfer(TWarehouseBills warehouseBills);
+
+    /**
+     * 仓单解锁指令
+     */
+    public int receiptCancel(String ownerName, String identifier, String numbers);
 }

+ 70 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java

@@ -3,8 +3,10 @@ package com.ruoyi.basicData.service.impl;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.domain.TCustomerContact;
 import com.ruoyi.basicData.domain.TWarehouseArea;
+import com.ruoyi.basicData.mapper.TCorpsMapper;
 import com.ruoyi.basicData.mapper.TCustomerContactMapper;
 import com.ruoyi.basicData.mapper.TWarehouseAreaMapper;
 import com.ruoyi.basicData.mapper.TWarehouseMapper;
@@ -26,6 +28,9 @@ import com.ruoyi.warehouseBusiness.domain.enums.AnnexActEnum;
 import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;
 import com.ruoyi.warehouseBusiness.mapper.TAnnexMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
+import com.ruoyi.warehouseBusiness.request.InventoryQueryRequest;
+import com.ruoyi.warehouseBusiness.response.InventoryQueryResponse;
+import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -60,6 +65,12 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     @Autowired
     private TCustomerContactMapper customerContactMapper;
 
+    @Autowired
+    private TCorpsMapper tCorpsMapper;
+
+    @Autowired
+    private BillnoSerialServiceImpl billnoSerialServiceImpl;
+
 
     /**
      * 查询仓库
@@ -585,6 +596,65 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         return tWarehouseMapper.getWorkTrend(wareHouseId, startTime, endTime, countType);
     }
 
+    /**
+     *  获取仓库详细信息
+     */
+    @Override
+    public List<InventoryQueryResponse> inventoryQueries(InventoryQueryRequest inventoryQueryRequest) {
+        return tWarehouseMapper.inventoryQueries(inventoryQueryRequest.getCurrentOwnerName(),
+                inventoryQueryRequest.getCurrentOwnerSocialIdentifier(),
+                inventoryQueryRequest.getWarehouseSerialNumbers());
+    }
+
+    /**
+     * 仓单注册指令
+     */
+    @Override
+    public int receiptRegister(String ownerName, String identifier, String numbers) {
+        return tWarehouseMapper.receiptRegister(ownerName, identifier, numbers);
+    }
+
+    /**
+     * 客户检验指令
+     */
+    @Override
+    public TCorps verification(String name, String identifier) {
+        return tCorpsMapper.verification(name, identifier);
+    }
+
+    /**
+     * 仓单过户指令
+     */
+    @Override
+    public int receiptTransfer(TWarehouseBills warehouseBills) {
+        warehouseBills.setfBilltype("HQZY");
+        warehouseBills.setfBillstatus(2L);
+        warehouseBills.setfDeptid(100L);
+        warehouseBills.setfBsdeptid(100L);
+        warehouseBills.setCreateTime(new Date());
+        warehouseBills.setCreateBy("admin");
+        Date time = new Date();
+        // 业务编码
+        String billNo = billnoSerialServiceImpl.getBillNo("HQZY", time);
+        warehouseBills.setfBillno(billNo);
+        // 存货编码
+        String bscorpno = billnoSerialServiceImpl.getCorpNo(warehouseBills.getfCorpid(), time);
+        warehouseBills.setfBscorpno(bscorpno);
+        warehouseBills.setfChargedate(time);
+        warehouseBills.setfBsdate(time);
+        warehouseBills.setfTrademodeid(1L);
+        warehouseBills.setfItemsStatus(2L);
+        return tWarehouseBillsMapper.insertTWarehousebills(warehouseBills);
+    }
+
+    /**
+     * 仓单解锁指令
+     */
+    @Override
+    public int receiptCancel(String ownerName, String identifier, String numbers) {
+        return tWarehouseMapper.receiptCancel(ownerName, identifier, numbers);
+    }
+
     @Override
     public String checkUFNoUnique(TWarehouse tWarehouse) {
         TWarehouse tWarehouse1 = tWarehouseMapper.checkFNoUnique(tWarehouse.getfNo());

+ 62 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/CustomerVerifyRequest.java

@@ -0,0 +1,62 @@
+package com.ruoyi.warehouseBusiness.request;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class CustomerVerifyRequest implements Serializable {
+
+    /**
+     * 回调通知URL  必填  String[1,255]
+     */
+    private String notify_url;
+
+
+    private List<Customer> customers;
+
+    public String getNotify_url() {
+        return notify_url;
+    }
+
+    public void setNotify_url(String notify_url) {
+        this.notify_url = notify_url;
+    }
+
+    public List<Customer> getCustomers() {
+        return customers;
+    }
+
+    public void setCustomers(List<Customer> customers) {
+        this.customers = customers;
+    }
+
+    public static class Customer {
+
+        /**
+         * 客户名称  必填  String[1,80]  公司名称|个人姓名
+         */
+        private String name;
+
+        /**
+         * 客户识别码 必填  String[1,30]  公司统一社会信用代码|个人身份证号
+         */
+        private String socialIdentifier;
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getSocialIdentifier() {
+            return socialIdentifier;
+        }
+
+        public void setSocialIdentifier(String socialIdentifier) {
+            this.socialIdentifier = socialIdentifier;
+        }
+    }
+
+
+}

+ 59 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/InventoryQueryRequest.java

@@ -0,0 +1,59 @@
+package com.ruoyi.warehouseBusiness.request;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class InventoryQueryRequest implements Serializable {
+
+    /**
+     * 回调通知URL  必填  String[1,255]
+     */
+    private String notify_url;
+
+    /**
+     * 现存货人名称  必填  String[1,80]  公司名称|个人姓名
+     */
+    private String currentOwnerName;
+
+    /**
+     * 现存货人识别码 必填  String[1,30]  公司统一社会信用代码|个人身份证号
+     */
+    private String currentOwnerSocialIdentifier;
+
+    /**
+     * 提单号 特殊必填 String[1,30]  与提单号二选一作为查询标识,与仓库商议
+     */
+    private List<String> warehouseSerialNumbers;
+
+    public String getNotify_url() {
+        return notify_url;
+    }
+
+    public void setNotify_url(String notify_url) {
+        this.notify_url = notify_url;
+    }
+
+    public String getCurrentOwnerName() {
+        return currentOwnerName;
+    }
+
+    public void setCurrentOwnerName(String currentOwnerName) {
+        this.currentOwnerName = currentOwnerName;
+    }
+
+    public String getCurrentOwnerSocialIdentifier() {
+        return currentOwnerSocialIdentifier;
+    }
+
+    public void setCurrentOwnerSocialIdentifier(String currentOwnerSocialIdentifier) {
+        this.currentOwnerSocialIdentifier = currentOwnerSocialIdentifier;
+    }
+
+    public List<String> getWarehouseSerialNumbers() {
+        return warehouseSerialNumbers;
+    }
+
+    public void setWarehouseSerialNumbers(List<String> warehouseSerialNumbers) {
+        this.warehouseSerialNumbers = warehouseSerialNumbers;
+    }
+}

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptCancelRequest.java

@@ -0,0 +1,5 @@
+package com.ruoyi.warehouseBusiness.request;
+
+public class ReceiptCancelRequest extends ReceiptOperationBaseRequest {
+
+}

+ 89 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptOperationBaseRequest.java

@@ -0,0 +1,89 @@
+package com.ruoyi.warehouseBusiness.request;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+public class ReceiptOperationBaseRequest implements Serializable {
+
+    /**
+     * 回调通知URL  必填  String[1,255]
+     */
+    private String notify_url;
+
+    /**
+     * 现存货人名称  必填  String[1,80]  公司名称|个人姓名
+     */
+    private String currentOwnerName;
+
+    /**
+     * 现存货人识别码 必填  String[1,30]  公司统一社会信用代码|个人身份证号
+     */
+    private String currentOwnerSocialIdentifier;
+
+    /**
+     * 编号 特殊必填 String[1,30]  与提单号二选一作为查询标识,与仓库商议
+     */
+    private List<ReceiptInfo> receipts;
+
+    public String getNotify_url() {
+        return notify_url;
+    }
+
+    public void setNotify_url(String notify_url) {
+        this.notify_url = notify_url;
+    }
+
+    public String getCurrentOwnerName() {
+        return currentOwnerName;
+    }
+
+    public void setCurrentOwnerName(String currentOwnerName) {
+        this.currentOwnerName = currentOwnerName;
+    }
+
+    public String getCurrentOwnerSocialIdentifier() {
+        return currentOwnerSocialIdentifier;
+    }
+
+    public void setCurrentOwnerSocialIdentifier(String currentOwnerSocialIdentifier) {
+        this.currentOwnerSocialIdentifier = currentOwnerSocialIdentifier;
+    }
+
+    public List<ReceiptInfo> getReceipts() {
+        return receipts;
+    }
+
+    public void setReceipts(List<ReceiptInfo> receipts) {
+        this.receipts = receipts;
+    }
+
+    public static class ReceiptInfo implements Serializable {
+
+        /**
+         * 编号 特殊必填 String[1,30]  与提单号二选一作为查询标识,与仓库商议
+         */
+        private String warehouseSerialNumber;
+
+        /**
+         * 编号 特殊必填 String[1,30]  与提单号二选一作为查询标识,与仓库商议
+         */
+        private BigDecimal weight;
+
+        public String getWarehouseSerialNumber() {
+            return warehouseSerialNumber;
+        }
+
+        public void setWarehouseSerialNumber(String warehouseSerialNumber) {
+            this.warehouseSerialNumber = warehouseSerialNumber;
+        }
+
+        public BigDecimal getWeight() {
+            return weight;
+        }
+
+        public void setWeight(BigDecimal weight) {
+            this.weight = weight;
+        }
+    }
+}

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptRegisterRequest.java

@@ -0,0 +1,7 @@
+package com.ruoyi.warehouseBusiness.request;
+
+public class ReceiptRegisterRequest extends ReceiptOperationBaseRequest {
+
+
+
+}

+ 156 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/request/ReceiptTransferRequest.java

@@ -0,0 +1,156 @@
+package com.ruoyi.warehouseBusiness.request;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+public class ReceiptTransferRequest implements Serializable {
+
+    /**
+     * 回调通知URL  必填  String[1,255]
+     */
+    private String notify_url;
+
+    /**
+     * 现存货人名称  必填  String[1,80]  公司名称|个人姓名
+     */
+    private String currentOwnerName;
+
+    /**
+     * 现存货人识别码 必填  String[1,30]  公司统一社会信用代码|个人身份证号
+     */
+    private String currentOwnerSocialIdentifier;
+
+    /**
+     * 编号 特殊必填 String[1,30]  与提单号二选一作为查询标识,与仓库商议
+     */
+    private String warehouseSerialNumber;
+
+    /**
+     * 重量    TODO
+     */
+    private BigDecimal weight;
+
+    /**
+     * 目标客户,一个值为一对一货转,多个值为链式的货转
+     */
+    private List<TargetOwner> targetOwners;
+
+    public String getNotify_url() {
+        return notify_url;
+    }
+
+    public void setNotify_url(String notify_url) {
+        this.notify_url = notify_url;
+    }
+
+    public String getCurrentOwnerName() {
+        return currentOwnerName;
+    }
+
+    public void setCurrentOwnerName(String currentOwnerName) {
+        this.currentOwnerName = currentOwnerName;
+    }
+
+    public String getCurrentOwnerSocialIdentifier() {
+        return currentOwnerSocialIdentifier;
+    }
+
+    public void setCurrentOwnerSocialIdentifier(String currentOwnerSocialIdentifier) {
+        this.currentOwnerSocialIdentifier = currentOwnerSocialIdentifier;
+    }
+
+    public String getWarehouseSerialNumber() {
+        return warehouseSerialNumber;
+    }
+
+    public void setWarehouseSerialNumber(String warehouseSerialNumber) {
+        this.warehouseSerialNumber = warehouseSerialNumber;
+    }
+
+    public BigDecimal getWeight() {
+        return weight;
+    }
+
+    public void setWeight(BigDecimal weight) {
+        this.weight = weight;
+    }
+
+    public List<TargetOwner> getTargetOwners() {
+        return targetOwners;
+    }
+
+    public void setTargetOwners(List<TargetOwner> targetOwners) {
+        this.targetOwners = targetOwners;
+    }
+
+    public static class TargetOwner implements Serializable {
+
+        /**
+         * 目标名称 企业为公司名称,个人为名字
+         */
+        private String name;
+
+        /**
+         * 目标识别号  企业为统一社会信用代码,个人为身份证号
+         */
+        private String socialIdentifier;
+
+        /**
+         * 时间戳  毫秒级。1970年0时0分到现在的毫秒数
+         */
+        private Long transferEntrustTimestamp;
+
+        /**
+         * 仓租起始日期  yyyy-MM-dd
+         */
+        private String rentBeginDate;
+
+        /**
+         * 仓租止付日期  yyyy-MM-dd
+         */
+        private String rentEndDate;
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getSocialIdentifier() {
+            return socialIdentifier;
+        }
+
+        public void setSocialIdentifier(String socialIdentifier) {
+            this.socialIdentifier = socialIdentifier;
+        }
+
+        public Long getTransferEntrustTimestamp() {
+            return transferEntrustTimestamp;
+        }
+
+        public void setTransferEntrustTimestamp(Long transferEntrustTimestamp) {
+            this.transferEntrustTimestamp = transferEntrustTimestamp;
+        }
+
+        public String getRentBeginDate() {
+            return rentBeginDate;
+        }
+
+        public void setRentBeginDate(String rentBeginDate) {
+            this.rentBeginDate = rentBeginDate;
+        }
+
+        public String getRentEndDate() {
+            return rentEndDate;
+        }
+
+        public void setRentEndDate(String rentEndDate) {
+            this.rentEndDate = rentEndDate;
+        }
+    }
+
+}

+ 45 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/CustomerVerifyResponse.java

@@ -0,0 +1,45 @@
+package com.ruoyi.warehouseBusiness.response;
+
+import java.io.Serializable;
+
+public class CustomerVerifyResponse implements Serializable {
+
+    /**
+     * 客户识别码 必填  String[1,30]  公司统一社会信用代码|个人身份证号
+     */
+    private String socialIdentifier;
+
+    /**
+     * 是否成功 SUCCESS 成功 ABNORMAL 异常
+     */
+    private String status;
+
+    /**
+     * 异常备注,  当 status 为 ABNORMAL时填写
+     */
+    private String comments;
+
+    public String getSocialIdentifier() {
+        return socialIdentifier;
+    }
+
+    public void setSocialIdentifier(String socialIdentifier) {
+        this.socialIdentifier = socialIdentifier;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getComments() {
+        return comments;
+    }
+
+    public void setComments(String comments) {
+        this.comments = comments;
+    }
+}

+ 54 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/InventoryQueryResponse.java

@@ -0,0 +1,54 @@
+package com.ruoyi.warehouseBusiness.response;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+public class InventoryQueryResponse implements Serializable {
+
+
+    // TODO  待补充
+
+    /**
+     * 仓库编号
+     */
+    private String warehouseSerialNumber;
+
+    /**
+     * 原始进仓日期 yyyy-MM-dd
+     */
+    private String originalWarehousingDate;
+
+
+    private String cargoName;
+
+    private String cargoModel;
+
+    private String cargoSpec;
+
+    private BigDecimal cargoQuantity;
+
+    /**
+     * 净重  吨
+     */
+    private BigDecimal netWeight;
+
+    /**
+     * 毛重  吨
+     */
+    private BigDecimal grossWeight;
+
+
+    private String warehouseAddress;
+    private String sourceOwnerName;
+    private String sourceOwnerSocialIdentifier;
+    private String currentOwnerName;
+    private String currentOwnerSocialIdentifier;
+
+    private String rentBeginDate;
+
+
+
+
+
+
+}

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptCancelResponse.java

@@ -0,0 +1,5 @@
+package com.ruoyi.warehouseBusiness.response;
+
+public class ReceiptCancelResponse extends ReceiptOperationBaseResponse {
+
+}

+ 73 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptOperationBaseResponse.java

@@ -0,0 +1,73 @@
+package com.ruoyi.warehouseBusiness.response;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+public class ReceiptOperationBaseResponse implements Serializable {
+
+    /**
+     * 操作完成时间  时间戳  毫秒级。1970年0时0分到现在的毫秒数
+     */
+    private Long completionTimestamp;
+
+    /**
+     * 是否成功 SUCCESS 成功 ABNORMAL 异常
+     */
+    private String status;
+
+    /**
+     * 异常备注,  当 status 为 ABNORMAL时填写
+     */
+    private String comments;
+
+    /**
+     * 编号 特殊必填 String[1,30]  与提单号二选一作为查询标识,与仓库商议
+     */
+    private String warehouseSerialNumber;
+
+    /**
+     * 编号 特殊必填 String[1,30]  与提单号二选一作为查询标识,与仓库商议
+     */
+    private BigDecimal weight;
+
+    public Long getCompletionTimestamp() {
+        return completionTimestamp;
+    }
+
+    public void setCompletionTimestamp(Long completionTimestamp) {
+        this.completionTimestamp = completionTimestamp;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getComments() {
+        return comments;
+    }
+
+    public void setComments(String comments) {
+        this.comments = comments;
+    }
+
+    public String getWarehouseSerialNumber() {
+        return warehouseSerialNumber;
+    }
+
+    public void setWarehouseSerialNumber(String warehouseSerialNumber) {
+        this.warehouseSerialNumber = warehouseSerialNumber;
+    }
+
+    public BigDecimal getWeight() {
+        return weight;
+    }
+
+    public void setWeight(BigDecimal weight) {
+        this.weight = weight;
+    }
+}

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptRegisterResponse.java

@@ -0,0 +1,5 @@
+package com.ruoyi.warehouseBusiness.response;
+
+public class ReceiptRegisterResponse extends ReceiptOperationBaseResponse {
+
+}

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/response/ReceiptTransferResponse.java

@@ -0,0 +1,5 @@
+package com.ruoyi.warehouseBusiness.response;
+
+public class ReceiptTransferResponse extends ReceiptOperationBaseResponse {
+
+}

+ 6 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml

@@ -542,4 +542,10 @@
             and create_time &gt; #{time}
     </select>
 
+    <select id="verification" parameterType="String" resultMap="TCorpsResult">
+        <include refid="selectTCorpsVo"/>
+        where f_name = #{FName}
+        and uscc = #{identifier}
+        limit 1
+    </select>
 </mapper>

+ 75 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -698,6 +698,81 @@
             </if>
         </where>
     </select>
+
+    <select id="inventoryQueries" resultType="com.ruoyi.warehouseBusiness.response.InventoryQueryResponse">
+        SELECT
+            TW.f_originalbillno as warehouse_serial_number,
+            TW.f_originalbilldate as original_warehousing_date,
+            TW.f_mblno as bl_no,
+            TG.f_name AS cargo_name,
+            TW.f_marks AS cargo_model,
+            TG.f_specs AS cargo_spec,
+            TW.f_qtyblc AS cargo_quantity,
+            TW.f_netweightblc AS net_weight,
+            TW.f_grossweightblc AS gross_weight,
+            TWH.f_addr AS warehouse_address,
+            TC.f_name AS source_owner_name,
+            TC.uscc AS source_owner_social_identifier,
+            TC.f_name AS current_owner_name,
+            TC.uscc AS current_owner_social_identifier,
+            TW.f_originalbilldate AS rent_begin_date
+        FROM t_whgenleg TW
+        LEFT JOIN t_goods TG ON TG.f_id = TW.f_goodsid
+        LEFT JOIN t_warehouse TWH ON TW.f_warehouseid = TWH.f_id
+        LEFT JOIN t_corps TC ON TC.f_id = TW.f_corpid
+        <where>
+            TW.del_flag = '0'
+            <if test="ownerName != null and ownerName != ''">
+                and TC.f_name = #{ownerName}
+            </if>
+            <if test="identifier != null and identifier != ''">
+                and TC.uscc = #{identifier}
+            </if>
+            <if test="numbersList != null and numbersList != ''">
+                and TW.f_originalbillno in
+                <foreach item="number" collection="numbersList" open="(" separator="," close=")">
+                    #{number}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <update id="receiptRegister">
+        update t_warehousebills TW
+        LEFT JOIN t_corps TC ON TC.f_id = TW.f_corpid
+        SET TW.f_ifpledge = 'T'
+        <where>
+            TW.del_flag = '0'
+            <if test="ownerName != null and ownerName != ''">
+                and TC.f_name = #{ownerName}
+            </if>
+            <if test="identifier != null and identifier != ''">
+                and TC.uscc = #{identifier}
+            </if>
+            <if test="numbers != null and numbers != ''">
+                and  TW.f_billno = #{numbers}
+            </if>
+        </where>
+    </update>
+
+    <update id="receiptCancel">
+        update t_warehousebills TW
+        LEFT JOIN t_corps TC ON TC.f_id = TW.f_corpid
+        SET TW.f_ifpledge = 'F'
+        <where>
+            TW.del_flag = '0'
+            <if test="ownerName != null and ownerName != ''">
+                and TC.f_name = #{ownerName}
+            </if>
+            <if test="identifier != null and identifier != ''">
+                and TC.uscc = #{identifier}
+            </if>
+            <if test="numbers != null and numbers != ''">
+                and  TW.f_billno = #{numbers}
+            </if>
+        </where>
+    </update>
+
     <select id="selectByPidANDName" resultMap="TWarehouseResult">
         <include refid="selectTWarehouseVo"/>
         <where>