xieb 4 年 前
コミット
958bac808a
21 ファイル変更1083 行追加21 行削除
  1. 28 0
      src/main/java/com/jisco/ymtappoint/config/CorsConfig.java
  2. 90 0
      src/main/java/com/jisco/ymtappoint/controller/YMTGetController.java
  3. 118 0
      src/main/java/com/jisco/ymtappoint/demo.java
  4. 116 0
      src/main/java/com/jisco/ymtappoint/http/HttpResult.java
  5. 149 0
      src/main/java/com/jisco/ymtappoint/http/HttpStatus.java
  6. 156 0
      src/main/java/com/jisco/ymtappoint/medol/AppointToJL.java
  7. 42 0
      src/main/java/com/jisco/ymtappoint/service/impl/GetYMTAppoint.java
  8. 179 0
      src/main/java/com/jisco/ymtappoint/until/HttpUtil.java
  9. 1 1
      src/main/java/com/steerinfo/baseinfo/meterbasecalibrastandard/service/impl/MeterBaseCalibraStandardServiceImpl.java
  10. 1 1
      src/main/java/com/steerinfo/baseinfo/meterfilerecord/controller/MeterFileRecordController.java
  11. 36 9
      src/main/java/com/steerinfo/baseinfo/meterfilerecord/mapper/MeterFileRecordMapper.xml
  12. 15 0
      src/main/java/com/steerinfo/baseinfo/meterfilerecord/model/MeterFileRecord.java
  13. 1 1
      src/main/java/com/steerinfo/baseinfo/meterfilerecord/service/IMeterFileRecordService.java
  14. 1 1
      src/main/java/com/steerinfo/baseinfo/meterfilerecord/service/impl/MeterFileRecordServiceImpl.java
  15. 50 0
      src/main/java/com/steerinfo/meterwork/meterworkcarcheck/controller/MeterWorkCarCheckController.java
  16. 2 0
      src/main/java/com/steerinfo/meterwork/meterworkcarcheck/mapper/MeterWorkCarCheckMapper.java
  17. 6 0
      src/main/java/com/steerinfo/meterwork/meterworkcarcheck/mapper/MeterWorkCarCheckMapper.xml
  18. 5 0
      src/main/java/com/steerinfo/meterwork/meterworkcarcheck/service/IMeterWorkCarCheckService.java
  19. 69 3
      src/main/java/com/steerinfo/meterwork/meterworkcarcheck/service/impl/MeterWorkCarCheckServiceImpl.java
  20. 2 2
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/controller/MeterWorkRailwayActualController.java
  21. 16 3
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/impl/MeterWorkRailwayActualServiceImpl.java

+ 28 - 0
src/main/java/com/jisco/ymtappoint/config/CorsConfig.java

@@ -0,0 +1,28 @@
+package com.jisco.ymtappoint.config;
+
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @author Gd
+ * @description 跨域访问配置
+ * @date 2020/6/19 18:18
+ * @modify By:xx at 2020/6/19
+ */
+//@Configuration
+public class CorsConfig implements WebMvcConfigurer {
+
+    /**
+     * 页面跨域访问Controller过滤
+     *
+     * @return
+     */
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        WebMvcConfigurer.super.addCorsMappings(registry);
+        registry.addMapping("/**")
+                .allowedHeaders("*")
+                .allowedMethods("POST","GET","DELETE","PUT")
+                .allowedOrigins("*");
+    }
+}

+ 90 - 0
src/main/java/com/jisco/ymtappoint/controller/YMTGetController.java

@@ -0,0 +1,90 @@
+package com.jisco.ymtappoint.controller;
+
+
+import com.alibaba.fastjson.JSON;
+import com.jisco.ymtappoint.http.HttpResult;
+import com.jisco.ymtappoint.medol.AppointToJL;
+import com.jisco.ymtappoint.service.impl.GetYMTAppoint;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Api(value = "获取预约信息", tags = "预约信息")
+@RestController
+@RequestMapping("/v1/getAppointData")
+public class YMTGetController {
+
+//    @Autowired
+//    GetYMTAppoint getYMTAppoint;
+
+//    @Value ("${lcdate}")
+//    String lcdate;
+    //    @RequestMapping("/server/{ip}")
+
+//    @ApiOperation("获取token")
+//    @ResponseBody
+//    @RequestMapping("/getAppointData/{lcdate}")
+//    public HttpRequest getAppointData(@PathVariable("lcdate") String lcdate) {
+//        String ymtToken = getYMTToken.getAppointToken();
+//
+//
+//        RestTemplate client = new RestTemplate();
+//        String url = "http://10.1.213.157:8778/appoint/getAppointToJL?=" + lcdate; //质量一贯制测试机
+//        //定义请求参数类型,这里用json所以是MediaType.APPLICATION_JSON
+//        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+//         headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
+//        headers.add("Authorization", ymtToken);//质量一贯制测试机
+//        // headers.add("Authorization", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJJZGVTdHVkaW8iLCJ1c2VyVHlwZSI6IjEiLCJhY2NvdW50IjoiMTYzNTczMjAzNTc1MyJ9.qRBHRfEaHnKKZ3_7dwn5ImMg12en54bfk3vAdLqfSaQ");//质量一贯制生产机
+//
+////        HttpEntity<String> request = new HttpEntity<>(list.toString(), headers);
+//
+//        Map<String, Object> params = new HashMap<>();
+//        params.put("lcdate", "甘B-10505");
+//
+//        List<JSONObject> list = new ArrayList<>();
+//        HttpEntity<String> request = new HttpEntity<>(list.toString(), headers);
+//
+////        ResponseEntity<String> entity = client.postForEntity(url, request, String.class);
+//        ResponseEntity<String> entity = client.postForEntity(url, params, String.class);
+//        JSONObject jsonObject = JSONObject.parseObject(entity.getBody());
+//        //获取3方接口返回的数据通过entity.getBody();它返回的是一个字符串;
+////        System.out.println(jsonObject.get("access_token"));
+////        return jsonObject.get("access_token").toString();
+////        if(jsonObject.get("code").toString().equals("200")){
+////            return true;
+////        }
+////        else{
+//////            throw new CustomException("置入货位的结果回写碳钢MES失败!"+jsonObject.get("msg").toString());
+////            throw new NullPointerException("获取异常!");
+////        }
+//
+//
+//        return null;
+//
+//    }
+
+
+    @ApiOperation("获取token")
+    @ResponseBody
+    @PostMapping("/getAppointData/{lcdate}")
+    public HttpResult getAppointData(@PathVariable("lcdate") String lcdate) {
+
+        Assert.isTrue(StringUtils.isNotEmpty(lcdate),"请输入车号!");
+
+//       String appoint = new GetYMTAppoint.getAppointData(lcdate);
+       String appointYMT = new GetYMTAppoint().getAppointData(lcdate);
+
+//        JSONArray jsonArray = JSONArray.fromArray(new ArrayList[]{(ArrayList) appoint});
+
+//        JSONObject jsonObject = JSONObject.parseObject(appointYMT);
+//        String appoint = jsonObject.toString();
+
+        List<AppointToJL> appoint = JSON.parseArray(appointYMT,AppointToJL.class);
+//        return JSONObject.parseObject(appointYMT);
+        return HttpResult.ok(appoint);
+    }
+}

+ 118 - 0
src/main/java/com/jisco/ymtappoint/demo.java

@@ -0,0 +1,118 @@
+package com.jisco.ymtappoint;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class demo {
+    public static void main(String[] args) {
+//        getToken();
+
+        System.out.println(api2RebackStp2tgMES());
+        test02();
+
+    }
+    public static String api2RebackStp2tgMES(){
+        RestTemplate client = new RestTemplate();
+//        String url="http://10.1.213.242:8080/jiscoqs-mes-dev/api/mes/MesIfYmt99Kw"; //质量一贯制测试机
+        String url="http://10.1.213.213:8765/oauth/token?client_id=c1&client_secret=secret&grant_type=password&username=jk-jl&password=Jl123456";//质量一贯制生产机
+        //定义请求参数类型,这里用json所以是MediaType.APPLICATION_JSON
+        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+       // headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
+//        headers.add("Authorization", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJJZGVTdHVkaW8iLCJ1c2VyVHlwZSI6IjEiLCJhY2NvdW50IjoiMTYyNzkwMjk1NTU4MiJ9.4CnpLlzVPddVi8xXpjXKjzqQSTAwVtZFpszVO8hCE_s");//质量一贯制测试机
+       // headers.add("Authorization", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJJZGVTdHVkaW8iLCJ1c2VyVHlwZSI6IjEiLCJhY2NvdW50IjoiMTYzNTczMjAzNTc1MyJ9.qRBHRfEaHnKKZ3_7dwn5ImMg12en54bfk3vAdLqfSaQ");//质量一贯制生产机
+
+//        HttpEntity<String> request = new HttpEntity<>(list.toString(), headers);
+
+//        ResponseEntity<String> entity = client.postForEntity(url, request, String.class);
+        ResponseEntity<String> entity = client.postForEntity(url, null, String.class);
+        JSONObject jsonObject = JSONObject.parseObject(entity.getBody());
+        //获取3方接口返回的数据通过entity.getBody();它返回的是一个字符串;
+//        System.out.println(jsonObject.get("access_token"));
+//        if(jsonObject.get("code").toString().equals("200")){
+//            return true;
+//        }
+        return jsonObject.get("access_token").toString();
+//        else{
+////            throw new CustomException("置入货位的结果回写碳钢MES失败!"+jsonObject.get("msg").toString());
+//            throw new NullPointerException("获取异常!");
+//        }
+    }
+
+    public static void test(){
+        RestTemplate client = new RestTemplate();
+        String ymtToken = "Bearer "+api2RebackStp2tgMES();
+//        @Value("${lcdate}")
+        String lcdate;
+//        String url = "http://10.1.213.157:8778/appoint/getAppointToJL?lcdate=甘B-10505"; //质量一贯制测试机
+        String url = "http://10.1.213.157:8778/appoint/getAppointToJL?lcdate=蒙M-19449"; //质量一贯制测试机
+//        String lc = "甘B-10505";
+        //定义请求参数类型,这里用json所以是MediaType.APPLICATION_JSON
+//        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
+        headers.add("Authorization", ymtToken);//质量一贯制测试机
+
+//        Map<String, Object> params = new HashMap<>();
+//        List<JSONObject> list = new ArrayList<>();
+
+//        params.put("lcdate", "甘B-10505");
+
+//        params.put("name", "libai");
+        // headers.add("Authorization", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJJZGVTdHVkaW8iLCJ1c2VyVHlwZSI6IjEiLCJhY2NvdW50IjoiMTYzNTczMjAzNTc1MyJ9.qRBHRfEaHnKKZ3_7dwn5ImMg12en54bfk3vAdLqfSaQ");//质量一贯制生产机
+//         List<JSONObject> list = new List<JSONObject>;
+        List<JSONObject> list = new ArrayList<>();
+//        HttpEntity<String> request = new HttpEntity<>(list.toString(), headers);
+        HttpEntity<String> request = new HttpEntity<>(list.toString(), headers);
+
+//        ResponseEntity<String> entity = client.postForEntity(url, request, String.class);
+        ResponseEntity<String> entity = client.postForEntity(url, null, String.class);
+        JSONObject jsonObject = JSONObject.parseObject(entity.getBody());
+        System.out.println(jsonObject);
+        //获取3方接口返回的数据通过entity.getBody();它返回的是一个字符串;
+//        System.out.println(jsonObject.get("access_token"));
+//        return jsonObject.get("access_token").toString();
+//        if(jsonObject.get("code").toString().equals("200")){
+//            return true;
+//        }
+//        else{
+////            throw new CustomException("置入货位的结果回写碳钢MES失败!"+jsonObject.get("msg").toString());
+//            throw new NullPointerException("获取异常!");
+//        }
+    }
+
+
+   public static void test02(){
+        RestTemplate client = new RestTemplate();
+       String ymtToken = "Bearer "+api2RebackStp2tgMES();
+//        String url="http://10.1.213.242:8080/jiscoqs-mes-dev/api/mes/MesIfYmt99Kw"; //质量一贯制测试机
+//        String url="http://10.99.200.50:11480/jiscoqs-mes-dev/api/mes/MesIfYmt99Kw";//质量一贯制生产机
+        //定义请求参数类型,这里用json所以是MediaType.APPLICATION_JSON
+       String url = "http://10.1.213.157:8778/appoint/getAppointToJL?lcdate=蒙M-19449";
+       MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+        headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
+        headers.add("Authorization", ymtToken);//质量一贯制生产机
+
+        HttpEntity<String> request = new HttpEntity<>(headers);
+
+        ResponseEntity<String> entity = client.postForEntity(url, request, String.class);
+//        JSONObject jsonObject = JSONObject.parseObject(entity.getBody());
+        //获取3方接口返回的数据通过entity.getBody();它返回的是一个字符串;
+       JSONObject jsonObject = JSONObject.parseObject(entity.getBody());
+//       System.out.println(jsonObject.get("data").toString());
+//       return jsonObject.get("access_token").toString();
+//        if(jsonObject.get("code").toString().equals("200")){
+//            System.out.println("ssssssss");
+//        }
+
+    }
+}
+

+ 116 - 0
src/main/java/com/jisco/ymtappoint/http/HttpResult.java

@@ -0,0 +1,116 @@
+package com.jisco.ymtappoint.http;
+
+import org.springframework.util.Assert;
+
+import java.util.Objects;
+
+public class HttpResult {
+
+    private long code;
+    private String msg;
+    private Object data;
+
+    public static HttpResult error() {
+        return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
+    }
+
+    public static HttpResult error(String msg) {
+        return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg);
+    }
+
+    public static HttpResult error(long code, String msg) {
+        HttpResult r = new HttpResult();
+        r.setCode(code);
+        r.setMsg(msg);
+        return r;
+    }
+
+    //下方法与返回结果字符串(业务数据)时冲突,易被错误引用
+//    public static HttpResult ok(String msg) {
+//        HttpResult r = new HttpResult();
+//        r.setCode(0L);
+//        r.setMsg(msg);
+//        return r;
+//    }
+
+    public static HttpResult ok(Object data) {
+        HttpResult r = new HttpResult();
+        r.setCode(0L);
+        r.setData(data);
+        return r;
+    }
+
+    public static HttpResult okAndMsg(String msg) {
+        HttpResult r = new HttpResult();
+        r.setCode(0L);
+        r.setMsg(msg);
+        return r;
+    }
+
+    public static HttpResult ok(String msg, Object data) {
+        HttpResult r = new HttpResult();
+        r.setCode(0L);
+        r.setMsg(msg);
+        r.setData(data);
+        return r;
+    }
+
+//    public static HttpResult ok() {
+//        return new HttpResult();
+//    }
+
+    /*
+   获取httpresult返回的结果,出错时报错,结果为空的不报错,由后续处理代码自行处理
+   needCreateNullMsg:true,为空时报错,适用于获取结果不为空时直接转换,否则报错; false 为空时不报错,返回-适用于查询或自定义处理类场景
+   customMsg:需报错时使用的自定义消息,如:查询XX、反馈XX
+    */
+    public static Object getHttpResultInfo(boolean needCreateNullMsg, String customMsg, HttpResult httpResult) {
+        if (org.apache.commons.lang3.StringUtils.isBlank(customMsg)) customMsg = "接口调用";
+
+        if (Objects.isNull(httpResult)) {
+            if (needCreateNullMsg) {
+                Assert.isTrue(false, customMsg + "未返回结果");
+            } else return null;
+        }
+
+        Object data = null;
+        if (httpResult.getCode() == 0L) {
+            data = httpResult.getData();
+        } else//远程报错时,必须报错
+            Assert.isTrue(false, httpResult.getMsg());
+
+        if (Objects.isNull(data)) {
+            if (needCreateNullMsg) {
+                Assert.isTrue(false, customMsg + "返回结果中的数据为空");
+            } else return null;
+        }
+
+        //正常结果返回
+        return data;
+    }
+
+    public long getCode() {
+        return code;
+    }
+
+    public void setCode(long code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+}

+ 149 - 0
src/main/java/com/jisco/ymtappoint/http/HttpStatus.java

@@ -0,0 +1,149 @@
+package com.jisco.ymtappoint.http;
+
+/**
+ * Constants enumerating the HTTP status codes.
+ * All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1), and
+ * RFC2518 (WebDAV) are listed.
+ *
+ * @see StatusLine
+ *
+ * @since 4.0
+ */
+public interface HttpStatus {
+
+    // --- 1xx Informational ---
+
+    /** {@code 100 Continue} (HTTP/1.1 - RFC 2616) */
+    int SC_CONTINUE = 100;
+    /** {@code 101 Switching Protocols} (HTTP/1.1 - RFC 2616)*/
+    int SC_SWITCHING_PROTOCOLS = 101;
+    /** {@code 102 Processing} (WebDAV - RFC 2518) */
+    int SC_PROCESSING = 102;
+
+    // --- 2xx Success ---
+
+    /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
+    int SC_OK = 200;
+    /** {@code 201 Created} (HTTP/1.0 - RFC 1945) */
+    int SC_CREATED = 201;
+    /** {@code 202 Accepted} (HTTP/1.0 - RFC 1945) */
+    int SC_ACCEPTED = 202;
+    /** {@code 203 Non Authoritative Information} (HTTP/1.1 - RFC 2616) */
+    int SC_NON_AUTHORITATIVE_INFORMATION = 203;
+    /** {@code 204 No Content} (HTTP/1.0 - RFC 1945) */
+    int SC_NO_CONTENT = 204;
+    /** {@code 205 Reset Content} (HTTP/1.1 - RFC 2616) */
+    int SC_RESET_CONTENT = 205;
+    /** {@code 206 Partial Content} (HTTP/1.1 - RFC 2616) */
+    int SC_PARTIAL_CONTENT = 206;
+    /**
+     * {@code 207 Multi-Status} (WebDAV - RFC 2518)
+     * or
+     * {@code 207 Partial Update OK} (HTTP/1.1 - draft-ietf-http-v11-spec-rev-01?)
+     */
+    int SC_MULTI_STATUS = 207;
+
+    // --- 3xx Redirection ---
+
+    /** {@code 300 Mutliple Choices} (HTTP/1.1 - RFC 2616) */
+    int SC_MULTIPLE_CHOICES = 300;
+    /** {@code 301 Moved Permanently} (HTTP/1.0 - RFC 1945) */
+    int SC_MOVED_PERMANENTLY = 301;
+    /** {@code 302 Moved Temporarily} (Sometimes {@code Found}) (HTTP/1.0 - RFC 1945) */
+    int SC_MOVED_TEMPORARILY = 302;
+    /** {@code 303 See Other} (HTTP/1.1 - RFC 2616) */
+    int SC_SEE_OTHER = 303;
+    /** {@code 304 Not Modified} (HTTP/1.0 - RFC 1945) */
+    int SC_NOT_MODIFIED = 304;
+    /** {@code 305 Use Proxy} (HTTP/1.1 - RFC 2616) */
+    int SC_USE_PROXY = 305;
+    /** {@code 307 Temporary Redirect} (HTTP/1.1 - RFC 2616) */
+    int SC_TEMPORARY_REDIRECT = 307;
+
+    // --- 4xx Client Error ---
+
+    /** {@code 400 Bad Request} (HTTP/1.1 - RFC 2616) */
+    int SC_BAD_REQUEST = 400;
+    /** {@code 401 Unauthorized} (HTTP/1.0 - RFC 1945) */
+    int SC_UNAUTHORIZED = 401;
+    /** {@code 402 Payment Required} (HTTP/1.1 - RFC 2616) */
+    int SC_PAYMENT_REQUIRED = 402;
+    /** {@code 403 Forbidden} (HTTP/1.0 - RFC 1945) */
+    int SC_FORBIDDEN = 403;
+    /** {@code 404 Not Found} (HTTP/1.0 - RFC 1945) */
+    int SC_NOT_FOUND = 404;
+    /** {@code 405 Method Not Allowed} (HTTP/1.1 - RFC 2616) */
+    int SC_METHOD_NOT_ALLOWED = 405;
+    /** {@code 406 Not Acceptable} (HTTP/1.1 - RFC 2616) */
+    int SC_NOT_ACCEPTABLE = 406;
+    /** {@code 407 Proxy Authentication Required} (HTTP/1.1 - RFC 2616)*/
+    int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
+    /** {@code 408 Request Timeout} (HTTP/1.1 - RFC 2616) */
+    int SC_REQUEST_TIMEOUT = 408;
+    /** {@code 409 Conflict} (HTTP/1.1 - RFC 2616) */
+    int SC_CONFLICT = 409;
+    /** {@code 410 Gone} (HTTP/1.1 - RFC 2616) */
+    int SC_GONE = 410;
+    /** {@code 411 Length Required} (HTTP/1.1 - RFC 2616) */
+    int SC_LENGTH_REQUIRED = 411;
+    /** {@code 412 Precondition Failed} (HTTP/1.1 - RFC 2616) */
+    int SC_PRECONDITION_FAILED = 412;
+    /** {@code 413 Request Entity Too Large} (HTTP/1.1 - RFC 2616) */
+    int SC_REQUEST_TOO_LONG = 413;
+    /** {@code 414 Request-URI Too Long} (HTTP/1.1 - RFC 2616) */
+    int SC_REQUEST_URI_TOO_LONG = 414;
+    /** {@code 415 Unsupported Media Type} (HTTP/1.1 - RFC 2616) */
+    int SC_UNSUPPORTED_MEDIA_TYPE = 415;
+    /** {@code 416 Requested Range Not Satisfiable} (HTTP/1.1 - RFC 2616) */
+    int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+    /** {@code 417 Expectation Failed} (HTTP/1.1 - RFC 2616) */
+    int SC_EXPECTATION_FAILED = 417;
+
+    /**
+     * Static constant for a 418 error.
+     * {@code 418 Unprocessable Entity} (WebDAV drafts?)
+     * or {@code 418 Reauthentication Required} (HTTP/1.1 drafts?)
+     */
+    // not used
+    // public static final int SC_UNPROCESSABLE_ENTITY = 418;
+
+    /**
+     * Static constant for a 419 error.
+     * {@code 419 Insufficient Space on Resource}
+     * (WebDAV - draft-ietf-webdav-protocol-05?)
+     * or {@code 419 Proxy Reauthentication Required}
+     * (HTTP/1.1 drafts?)
+     */
+    int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
+    /**
+     * Static constant for a 420 error.
+     * {@code 420 Method Failure}
+     * (WebDAV - draft-ietf-webdav-protocol-05?)
+     */
+    int SC_METHOD_FAILURE = 420;
+    /** {@code 422 Unprocessable Entity} (WebDAV - RFC 2518) */
+    int SC_UNPROCESSABLE_ENTITY = 422;
+    /** {@code 423 Locked} (WebDAV - RFC 2518) */
+    int SC_LOCKED = 423;
+    /** {@code 424 Failed Dependency} (WebDAV - RFC 2518) */
+    int SC_FAILED_DEPENDENCY = 424;
+
+    // --- 5xx Server Error ---
+
+    /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
+    int SC_INTERNAL_SERVER_ERROR = 500;
+    /** {@code 501 Not Implemented} (HTTP/1.0 - RFC 1945) */
+    int SC_NOT_IMPLEMENTED = 501;
+    /** {@code 502 Bad Gateway} (HTTP/1.0 - RFC 1945) */
+    int SC_BAD_GATEWAY = 502;
+    /** {@code 503 Service Unavailable} (HTTP/1.0 - RFC 1945) */
+    int SC_SERVICE_UNAVAILABLE = 503;
+    /** {@code 504 Gateway Timeout} (HTTP/1.1 - RFC 2616) */
+    int SC_GATEWAY_TIMEOUT = 504;
+    /** {@code 505 HTTP Version Not Supported} (HTTP/1.1 - RFC 2616) */
+    int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
+
+    /** {@code 507 Insufficient Storage} (WebDAV - RFC 2518) */
+    int SC_INSUFFICIENT_STORAGE = 507;
+
+}

+ 156 - 0
src/main/java/com/jisco/ymtappoint/medol/AppointToJL.java

@@ -0,0 +1,156 @@
+package com.jisco.ymtappoint.medol;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 提货预约
+ * </p>
+ *
+ * @author yejianmin
+ * @since 2021-04-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "Appoint对象", description = "提货预约")
+public  class AppointToJL implements IBasePO<String> {
+
+    private static final long serialVersionUID = 1L;
+
+
+//    @TableId(value = "guid", type = IdType.UUID)
+    @ApiModelProperty(value = "标识ID", position = 1)
+    private String guid;
+
+
+    @ApiModelProperty(value = "预约单号", position = 3)
+    private String appointId;
+
+    @ApiModelProperty(value = "预约类型", position = 4)
+    private String appointType;
+
+
+    @ApiModelProperty(value = "提单类型", position = 7)
+    private String tmsWaybillType;
+
+    @ApiModelProperty(value = "提单编号", position = 8)
+    private String tmsWaybillId;
+
+    @ApiModelProperty(value = "装运类型", position = 9)
+    private String loadingType;
+
+
+    @ApiModelProperty(value = "车牌号", position = 11)
+    private String vehicleId;
+
+
+    @ApiModelProperty(value = "车型", position = 13)
+    private String vehicleType;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "预约提货时间", example = "2020-07-01 00:00:00", position = 14)
+    private LocalDateTime appointLoadTime;
+
+
+    @ApiModelProperty(value = "库房编码", position = 16)
+    private String storeroomId;
+
+    @ApiModelProperty(value = "库房名称", position = 17)
+    private String storeroomName;
+
+
+    @ApiModelProperty(value = "收货方", position = 20)
+    private String consigneeId;
+
+    @ApiModelProperty(value = "收货方名称", position = 21)
+    private String consigneeName;
+
+
+    @ApiModelProperty(value = "物料编码", position = 27)
+    private String materialId;
+
+    @ApiModelProperty(value = "物料名称", position = 28)
+    private String materialName;
+
+
+    @ApiModelProperty(value = "收货库房", position = 34)
+    private String receiveStoreroomId;
+
+    @ApiModelProperty(value = "收货库房名称", position = 35)
+    private String receiveStoreroomName;
+
+    @ApiModelProperty(value = " 总件数", example = "0", position = 36)
+    private Integer groupPackageAmount;
+
+    @ApiModelProperty(value = "总重量", example = "0", position = 37)
+    private BigDecimal amount;
+
+
+    @ApiModelProperty(value = "预约状态", position = 41)
+    private String appointState;
+
+    @ApiModelProperty(value = "承运人用户", position = 47)
+    private String carrierUserId;
+
+    @ApiModelProperty(value = "承运人", position = 45)
+    private String carrier;
+
+    @ApiModelProperty(value = "承运人名称", position = 46)
+    private String carrierName;
+
+
+    @ApiModelProperty(value = "承运人手机", position = 48)
+    private String carrierUserTelephone;
+
+    @ApiModelProperty(value = "司机真实姓名", position = 50)
+    private String truckDriverRealname;
+
+    @ApiModelProperty(value = "司机手机号", position = 51)
+    private String truckDriverTelephone;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "预约提交时间", example = "2020-07-01 00:00:00", position = 52)
+    private LocalDateTime appointSubmitTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "预约入门时间", example = "2020-07-01 00:00:00", position = 60)
+    private LocalDateTime indoorTime;
+
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "预约结束时间", example = "2020-07-01 00:00:00", position = 64)
+    private LocalDateTime appointOverTime;
+
+    @ApiModelProperty(value = "来源系统", position = 65)
+    private String orisysId;
+
+
+    @ApiModelProperty(value = "删除标记", example = "N", position = 67)
+    private String deletedTag;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "修改日期", example = "2020-07-01 00:00:00", position = 71)
+    private LocalDateTime changeDate;
+
+
+    @Override
+    public String getId() {
+        return null;
+    }
+
+    @Override
+    public void setId(String s) {
+
+    }
+}

+ 42 - 0
src/main/java/com/jisco/ymtappoint/service/impl/GetYMTAppoint.java

@@ -0,0 +1,42 @@
+package com.jisco.ymtappoint.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+public class GetYMTAppoint {
+
+//    获取token接口
+    String url="http://10.1.213.213:8765/oauth/token?client_id=c1&client_secret=secret&grant_type=password&username=jk-jl&password=Jl123456";
+
+    public  String getAppointToken(){
+        RestTemplate client = new RestTemplate();
+//        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+
+        ResponseEntity<String> entity = client.postForEntity(url, null, String.class);
+        JSONObject jsonObject = JSONObject.parseObject(entity.getBody());
+        return jsonObject.get("access_token").toString();
+    }
+
+    public String getAppointData(String lcdate){
+
+        RestTemplate client = new RestTemplate();
+        String ymtToken = "Bearer "+this.getAppointToken();
+//        获取预约信息接口  现为测试机,后需改为一码通生产机
+        String url = "http://10.1.213.213:8778/appoint/getAppointToJL?lcdate="+lcdate;
+        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+        headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
+        headers.add("Authorization", ymtToken);
+        HttpEntity<String> request = new HttpEntity<>(headers);
+
+        ResponseEntity<String> entity = client.postForEntity(url, request, String.class);
+        JSONObject jsonObject = JSONObject.parseObject(entity.getBody());
+        return jsonObject.get("data").toString();
+    }
+
+
+}

+ 179 - 0
src/main/java/com/jisco/ymtappoint/until/HttpUtil.java

@@ -0,0 +1,179 @@
+//package com.jisco.jwls.utils;
+//
+//import java.io.IOException;
+//import java.io.UnsupportedEncodingException;
+//import java.net.URI;
+//import java.net.URISyntaxException;
+//import java.nio.charset.Charset;
+//import java.util.ArrayList;
+//import java.util.Iterator;
+//import java.util.List;
+//import java.util.Map;
+//import java.util.Map.Entry;
+//import java.util.Set;
+//import java.util.concurrent.TimeUnit;
+//import org.apache.hc.client5.http.ClientProtocolException;
+//import org.apache.hc.client5.http.classic.methods.HttpGet;
+//import org.apache.hc.client5.http.classic.methods.HttpPost;
+//import org.apache.hc.client5.http.config.RequestConfig;
+//import org.apache.hc.client5.http.entity.UrlEncodedFormEntity;
+//import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
+//import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
+//import org.apache.hc.client5.http.impl.classic.HttpClients;
+//import org.apache.hc.core5.http.ContentType;
+//import org.apache.hc.core5.http.HttpEntity;
+//import org.apache.hc.core5.http.NameValuePair;
+//import org.apache.hc.core5.http.ParseException;
+//import org.apache.hc.core5.http.io.entity.EntityUtils;
+//import org.apache.hc.core5.http.io.entity.StringEntity;
+//import org.apache.hc.core5.http.message.BasicNameValuePair;
+//import org.apache.hc.core5.net.URIBuilder;
+//
+//import com.alibaba.fastjson.JSON;
+//
+//public class HttpUtil {
+//
+//    public static String doGet(String url, Map<String, Object> paramMap, String token) {
+//        CloseableHttpClient httpClient = null;
+//        CloseableHttpResponse response = null;
+//        String result = "";
+//        try {
+//            // 通过址默认配置创建一个httpClient实例
+//            httpClient = HttpClients.createDefault();
+//            URIBuilder uriBilder = new URIBuilder(url);
+//            RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(10, TimeUnit.SECONDS)// 设置连接主机服务超时时间
+//                    .setConnectionRequestTimeout(10, TimeUnit.SECONDS)// 设置连接请求超时时间
+//                    .setResponseTimeout(10, TimeUnit.SECONDS)// 设置读取数据连接超时时间
+//                    .build();
+//            URIBuilder uriBuilder = new URIBuilder(url);
+//            if (null != paramMap && paramMap.size() > 0) {
+//                List<NameValuePair> nvps = new ArrayList<NameValuePair>();
+//                // 通过map集成entrySet方法获取entity
+//                Set<Entry<String, Object>> entrySet = paramMap.entrySet();
+//                // 循环遍历,获取迭代器
+//                Iterator<Entry<String, Object>> iterator = entrySet.iterator();
+//                while (iterator.hasNext()) {
+//                    Entry<String, Object> mapEntry = iterator.next();
+//                    nvps.add(new BasicNameValuePair(mapEntry.getKey(), mapEntry.getValue().toString()));
+//                }
+//                uriBilder.setParameters(nvps);
+////				httpGet.setEntity(new UrlEncodedFormEntity(nvps, Charset.forName("UTF-8")));
+//            }
+//            // 创建httpGet远程连接实例
+//            HttpGet httpGet = new HttpGet(uriBilder.build());
+//            // 为httpGet实例设置配置
+//            httpGet.setConfig(requestConfig);
+//            // 为httpPost实例设置配置
+//            httpGet.setConfig(requestConfig);
+//            httpGet.addHeader("contentType", "application/json; charset=UTF-8");
+//            if(token != null) {
+//                httpGet.addHeader("Authorization","bearer " + token);
+//            }
+//            httpGet.setHeader("Accept", "application/json");
+//            response = httpClient.execute(httpGet);
+//            // 通过返回对象获取返回数据
+//            HttpEntity entity = response.getEntity();
+//            // 通过EntityUtils中的toString方法将结果转换为字符串
+//            result = EntityUtils.toString(entity);
+//        } catch (ClientProtocolException e) {
+//            e.printStackTrace();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        } catch (URISyntaxException e) {
+//            // TODO Auto-generated catch block
+//            e.printStackTrace();
+//        } catch (ParseException e) {
+//            // TODO Auto-generated catch block
+//            e.printStackTrace();
+//        } finally {
+//            // 关闭资源
+//            if (null != response) {
+//                try {
+//                    response.close();
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//            if (null != httpClient) {
+//                try {
+//                    httpClient.close();
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        }
+//        return result;
+//    }
+//
+//    public static String doPost(String url, Map<String, Object> paramMap, String token) {
+//        CloseableHttpClient httpClient = null;
+//        CloseableHttpResponse httpResponse = null;
+//        String result = "";
+//        // 创建httpClient实例
+//        httpClient = HttpClients.createDefault();
+//        // 创建httpPost远程连接实例
+//        HttpPost httpPost = new HttpPost(url);
+//        // 配置请求参数实例
+//        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(10, TimeUnit.SECONDS)// 设置连接主机服务超时时间
+//                .setConnectionRequestTimeout(10, TimeUnit.SECONDS)// 设置连接请求超时时间
+//                .setResponseTimeout(10, TimeUnit.SECONDS)// 设置读取数据连接超时时间
+//                .build();
+//        // 为httpPost实例设置配置
+//        httpPost.setConfig(requestConfig);
+//        httpPost.addHeader("contentType", "application/json; charset=UTF-8");
+//        if(token != null) {
+//            httpPost.addHeader("Authorization","bearer " + token);
+//        }
+//        httpPost.setHeader("Accept", "application/json");
+//        // 封装post请求参数
+//        if (null != paramMap && paramMap.size() > 0) {
+//            List<NameValuePair> nvps = new ArrayList<NameValuePair>();
+//            // 通过map集成entrySet方法获取entity
+//            Set<Entry<String, Object>> entrySet = paramMap.entrySet();
+//            // 循环遍历,获取迭代器
+//            Iterator<Entry<String, Object>> iterator = entrySet.iterator();
+//            while (iterator.hasNext()) {
+//                Entry<String, Object> mapEntry = iterator.next();
+//                nvps.add(new BasicNameValuePair(mapEntry.getKey(), mapEntry.getValue().toString()));
+//            }
+//            if(token == null) {
+//                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nvps, Charset.forName("UTF-8"));
+//                httpPost.setEntity(entity);
+//            } else {
+//                StringEntity entity = new StringEntity(JSON.toJSONString(paramMap), ContentType.APPLICATION_JSON);
+//                httpPost.setEntity(entity);
+//            }
+//        }
+//        try {
+//            // httpClient对象执行post请求,并返回响应参数对象
+//            httpResponse = httpClient.execute(httpPost);
+//            // 从响应对象中获取响应内容
+//            HttpEntity entity = httpResponse.getEntity();
+//            result = EntityUtils.toString(entity);
+//        } catch (ClientProtocolException e) {
+//            e.printStackTrace();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        } catch (ParseException e) {
+//            // TODO Auto-generated catch block
+//            e.printStackTrace();
+//        } finally {
+//            // 关闭资源
+//            if (null != httpResponse) {
+//                try {
+//                    httpResponse.close();
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//            if (null != httpClient) {
+//                try {
+//                    httpClient.close();
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        }
+//        return result;
+//    }
+//}

+ 1 - 1
src/main/java/com/steerinfo/baseinfo/meterbasecalibrastandard/service/impl/MeterBaseCalibraStandardServiceImpl.java

@@ -94,7 +94,7 @@ public class MeterBaseCalibraStandardServiceImpl extends BaseServiceImpl<MeterBa
 //        UserPayload payload = UserPayload.getCurrUser();
 //        String userId = payload.getId();
 //        String userName = payload.getUserName();
-        model.setUpdateTime(new Date());
+//        model.setUpdateTime(new Date());
 //        model.setUpdateManNo(userId);
 //        model.setUpdateManName(userName);
         meterBaseCalibraStandardMapper.updateByPrimaryKey(model);

+ 1 - 1
src/main/java/com/steerinfo/baseinfo/meterfilerecord/controller/MeterFileRecordController.java

@@ -23,7 +23,7 @@ import java.math.BigDecimal;
 /**
  * MeterFileRecord RESTful接口:
  * @author generator
- * @version 1.0-SNAPSHORT 2022-01-25 09:33
+ * @version 1.0-SNAPSHORT 2022-01-25 02:44
  * 类描述
  * 修订历史:
  * 日期:2022-01-25

+ 36 - 9
src/main/java/com/steerinfo/baseinfo/meterfilerecord/mapper/MeterFileRecordMapper.xml

@@ -8,13 +8,15 @@
     <result column="OPERATION_MAN_NAME" jdbcType="VARCHAR" property="operationManName" />
     <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
     <result column="MEMO" jdbcType="VARCHAR" property="memo" />
+    <result column="FILE_ID" jdbcType="VARCHAR" property="fileId" />
   </resultMap>
   <sql id="columns">
-    FILE_RECORD_ID, FILE_NAME, OPERATION_NAME, OPERATION_MAN_NAME, CREATE_TIME, MEMO
+    FILE_RECORD_ID, FILE_NAME, OPERATION_NAME, OPERATION_MAN_NAME, CREATE_TIME, MEMO, 
+    FILE_ID
   </sql>
   <sql id="columns_alias">
     t.FILE_RECORD_ID, t.FILE_NAME, t.OPERATION_NAME, t.OPERATION_MAN_NAME, t.CREATE_TIME, 
-    t.MEMO
+    t.MEMO, t.FILE_ID
   </sql>
   <sql id="select">
     SELECT <include refid="columns"/> FROM METER_FILE_RECORD
@@ -42,6 +44,9 @@
       <if test="memo != null and memo != ''">
         and MEMO = #{memo}
       </if>
+      <if test="fileId != null and fileId != ''">
+        and FILE_ID = #{fileId}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -64,6 +69,9 @@
       <if test="memo != null and memo != ''">
         and MEMO LIKE '%${memo}%'
       </if>
+      <if test="fileId != null and fileId != ''">
+        and FILE_ID LIKE '%${fileId}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
@@ -88,14 +96,17 @@
       <if test="memo != null and memo != ''">
         or MEMO = #{memo}
       </if>
+      <if test="fileId != null and fileId != ''">
+        or FILE_ID = #{fileId}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.baseinfo.meterfilerecord.model.MeterFileRecord">
     insert into METER_FILE_RECORD (FILE_RECORD_ID, FILE_NAME, OPERATION_NAME, 
-      OPERATION_MAN_NAME, CREATE_TIME, MEMO
-      )
+      OPERATION_MAN_NAME, CREATE_TIME, MEMO, 
+      FILE_ID)
     values (#{fileRecordId,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{operationName,jdbcType=VARCHAR}, 
-      #{operationManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{memo,jdbcType=VARCHAR}
-      )
+      #{operationManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{memo,jdbcType=VARCHAR}, 
+      #{fileId,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterfilerecord.model.MeterFileRecord">
     insert into METER_FILE_RECORD
@@ -118,6 +129,9 @@
       <if test="memo != null">
         MEMO,
       </if>
+      <if test="fileId != null">
+        FILE_ID,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="fileRecordId != null">
@@ -138,6 +152,9 @@
       <if test="memo != null">
         #{memo,jdbcType=VARCHAR},
       </if>
+      <if test="fileId != null">
+        #{fileId,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterfilerecord.model.MeterFileRecord">
@@ -146,7 +163,8 @@
       OPERATION_NAME = #{operationName,jdbcType=VARCHAR},
       OPERATION_MAN_NAME = #{operationManName,jdbcType=VARCHAR},
       CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
-      MEMO = #{memo,jdbcType=VARCHAR}
+      MEMO = #{memo,jdbcType=VARCHAR},
+      FILE_ID = #{fileId,jdbcType=VARCHAR}
     where FILE_RECORD_ID = #{fileRecordId,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterfilerecord.model.MeterFileRecord">
@@ -167,6 +185,9 @@
       <if test="memo != null">
         MEMO = #{memo,jdbcType=VARCHAR},
       </if>
+      <if test="fileId != null">
+        FILE_ID = #{fileId,jdbcType=VARCHAR},
+      </if>
     </set>
     where FILE_RECORD_ID = #{fileRecordId,jdbcType=VARCHAR}
   </update>
@@ -186,12 +207,14 @@
     insert into METER_FILE_RECORD 
       (FILE_RECORD_ID, 
       FILE_NAME, OPERATION_NAME, OPERATION_MAN_NAME, 
-      CREATE_TIME, MEMO)
+      CREATE_TIME, MEMO, FILE_ID
+      )
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.fileRecordId,jdbcType=VARCHAR}, 
       #{item.fileName,jdbcType=VARCHAR}, #{item.operationName,jdbcType=VARCHAR}, #{item.operationManName,jdbcType=VARCHAR}, 
-      #{item.createTime,jdbcType=TIMESTAMP}, #{item.memo,jdbcType=VARCHAR} from dual  
+      #{item.createTime,jdbcType=TIMESTAMP}, #{item.memo,jdbcType=VARCHAR}, #{item.fileId,jdbcType=VARCHAR}
+       from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -221,6 +244,10 @@
        <foreach collection="list" item="item" index="index" separator=" " open="case FILE_RECORD_ID" close="end">
           when #{item.fileRecordId,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
        </foreach>
+       ,FILE_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case FILE_RECORD_ID" close="end">
+          when #{item.fileRecordId,jdbcType=VARCHAR} then #{item.fileId,jdbcType=VARCHAR}
+       </foreach>
      where FILE_RECORD_ID in 
      <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
     #{item.fileRecordId,jdbcType=VARCHAR}

+ 15 - 0
src/main/java/com/steerinfo/baseinfo/meterfilerecord/model/MeterFileRecord.java

@@ -43,6 +43,12 @@ public class MeterFileRecord implements IBasePO<String> {
     @ApiModelProperty(value="备注",required=false)
     private String memo;
 
+    /**
+     * 文件id(FILE_ID,VARCHAR,30)
+     */
+    @ApiModelProperty(value="文件id",required=false)
+    private String fileId;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -103,6 +109,14 @@ public class MeterFileRecord implements IBasePO<String> {
         this.memo = memo == null ? null : memo.trim();
     }
 
+    public String getFileId() {
+        return fileId;
+    }
+
+    public void setFileId(String fileId) {
+        this.fileId = fileId == null ? null : fileId.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -115,6 +129,7 @@ public class MeterFileRecord implements IBasePO<String> {
         sb.append(", operationManName=").append(operationManName);
         sb.append(", createTime=").append(createTime);
         sb.append(", memo=").append(memo);
+        sb.append(", fileId=").append(fileId);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 1 - 1
src/main/java/com/steerinfo/baseinfo/meterfilerecord/service/IMeterFileRecordService.java

@@ -8,7 +8,7 @@ import java.math.BigDecimal;
 /**
  * MeterFileRecord服务接口:
  * @author generator
- * @version 1.0-SNAPSHORT 2022-01-25 09:33
+ * @version 1.0-SNAPSHORT 2022-01-25 02:44
  * 类描述
  * 修订历史:
  * 日期:2022-01-25

+ 1 - 1
src/main/java/com/steerinfo/baseinfo/meterfilerecord/service/impl/MeterFileRecordServiceImpl.java

@@ -13,7 +13,7 @@ import java.math.BigDecimal;
 /**
  * MeterFileRecord服务实现:
  * @author generator
- * @version 1.0-SNAPSHORT 2022-01-25 09:33
+ * @version 1.0-SNAPSHORT 2022-01-25 02:44
  * 类描述
  * 修订历史:
  * 日期:2022-01-25

+ 50 - 0
src/main/java/com/steerinfo/meterwork/meterworkcarcheck/controller/MeterWorkCarCheckController.java

@@ -1,5 +1,6 @@
 package com.steerinfo.meterwork.meterworkcarcheck.controller;
 
+import com.steerinfo.baseinfo.meterbasecalibrastandard.model.MeterBaseCalibraStandard;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
@@ -12,6 +13,8 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Arrays;
@@ -298,4 +301,51 @@ throw new MarkerMetException(500, "操作异常!!");
 throw new MarkerMetException(500, "操作异常!!");
         }
     }
+
+    @ApiOperation(value="创建", notes="根据MeterWorkCarCheck对象创建")
+    @ApiImplicitParam(name = "MeterWorkCarCheck", value = "详细实体meterWorkCarCheck", required = true, dataType = "MeterWorkCarCheck")
+    //@RequiresPermissions("meterbasecalibrastandard:create")
+    @Transactional
+    @PostMapping(value = "/insert")
+    public RESTfulResult addInsert(@RequestBody MeterWorkCarCheck model){
+//        System.out.println("grjtymkyk,uil"+model);
+//        MeterBaseCalibraStandard meterBaseCalibraStandard = meterBaseCalibraStandardService.checkandadd(model);
+//
+//        return success(meterBaseCalibraStandard);
+        try {
+            String msg = meterWorkCarCheckService.checkandadd(model);
+            if (msg != null && !msg.equals("")) {
+                return failed(null, msg);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return failed(null, "操作异常,请确认!");
+        }
+        return success();
+    }
+
+
+    @ApiOperation(value = "更新详细信息", notes = "根据url的id来指定更新对象,并根据传过来的MeterWorkCarCheck信息来更新详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "MeterWorkCarCheck", value = "详细实体MeterWorkCarCheck", required = true, dataType = "MeterWorkCarCheck")
+    })
+    //@RequiresPermissions("meterbasecalibrationtime:update")
+    @Transactional
+    @PutMapping(value = "/update/{id}", produces = "application/json;charset=UTF-8")
+    public RESTfulResult updateBody(@PathVariable String id,@RequestBody MeterWorkCarCheck model) {
+        try {
+            String msg = meterWorkCarCheckService.checkandupdate(id,model);
+            if (msg != null && !msg.equals("")) {
+                return failed(null, msg);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return failed(null, "操作异常,请确认!");
+        }
+
+        return success();
+    }
 }

+ 2 - 0
src/main/java/com/steerinfo/meterwork/meterworkcarcheck/mapper/MeterWorkCarCheckMapper.java

@@ -14,6 +14,8 @@ public interface MeterWorkCarCheckMapper extends IBaseMapper<MeterWorkCarCheck,
 
     String getNewID(@Param(value = "afl") String afl);
 
+    String GetNewID1();
+
     List<MeterWorkCarCheck> reSelectOut(Map<String,Object> parmas);
 }
 

+ 6 - 0
src/main/java/com/steerinfo/meterwork/meterworkcarcheck/mapper/MeterWorkCarCheckMapper.xml

@@ -746,4 +746,10 @@
       </if>
     </where>
   </select>
+  <select id="GetNewID1" parameterType="java.lang.String" resultType="java.lang.String">
+    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(PREDICTION_NO, LENGTH(PREDICTION_NO) - 4))),0) + 1,5,'0') PREDICTION_NO
+    FROM METER_WORK_CAR_CHECK
+  </select>
+
+
 </mapper>

+ 5 - 0
src/main/java/com/steerinfo/meterwork/meterworkcarcheck/service/IMeterWorkCarCheckService.java

@@ -1,5 +1,6 @@
 package com.steerinfo.meterwork.meterworkcarcheck.service;
 
+import com.steerinfo.baseinfo.meterbasecalibrastandard.model.MeterBaseCalibraStandard;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.IBaseService;
 import com.steerinfo.framework.service.pagehelper.PageList;
@@ -36,4 +37,8 @@ public interface IMeterWorkCarCheckService extends IBaseService<MeterWorkCarChec
     PageList<MeterWorkCarCheck> relationIn(Map<String,Object> parmas,Integer pageNum, Integer pageSize);
 
     RESTfulResult doQueryWf(MeterWorkCarCheck oci);
+//    核查记录添加
+    String checkandadd(MeterWorkCarCheck model);
+//    核查记录修改
+    String checkandupdate(String id,MeterWorkCarCheck model);
 }

+ 69 - 3
src/main/java/com/steerinfo/meterwork/meterworkcarcheck/service/impl/MeterWorkCarCheckServiceImpl.java

@@ -250,6 +250,72 @@ public class MeterWorkCarCheckServiceImpl extends BaseServiceImpl<MeterWorkCarCh
         return rm;
     }
 
+//    核查记录添加
+    @Override
+    public String checkandadd(MeterWorkCarCheck model) {
+        if (model == null ) {
+            return "请传入参数!";
+        }else {
+            String no=meterWorkCarCheckMapper.GetNewID1();
+            model.setPredictionNo(new SimpleDateFormat("yyyyMMdd").format(new Date()) +no);
+//            UserPayload payload = UserPayload.getCurrUser();
+//            String userId = payload.getId();
+//            String userName = payload.getUserName();
+            check(model);
+            if  (model.getValueFlag().equals(DbConstants.INFlAG)) {
+                model.setEnterCheckManNo(model.getEnterCheckManNo());
+                model.setEnterCheckManName(model.getEnterCheckManName());
+                model.setEnterCheckTime(new Date());
+                meterWorkCarCheckMapper.insertSelective(model);
+                return "";
+            }
+            if (model.getValueFlag().equals(DbConstants.OUTFlAG)) {
+                model.setLeaveCheckManNo(model.getLeaveCheckManNo());
+                model.setLeaveCheckManName(model.getLeaveCheckManName());
+                model.setLeaveCheckTime(new Date());
+                meterWorkCarCheckMapper.insertSelective(model);
+                return "";
+            }
+        }
+        return "";
+    }
+
+//  核查记录修改
+    @Override
+    public String checkandupdate(String id, MeterWorkCarCheck model) {
+        if (model == null ) {
+            return "请传入参数!";
+        }
+        if (StringUtils.isEmpty(model.getCarNo())) {
+            return "车号不能为空";
+        }
+        if (StringUtils.isEmpty(model.getDriverName())) {
+            return "司机姓名不能为空";
+        }
+        if (StringUtils.isEmpty(model.getIdNum())) {
+            return "身份证号不能为空";
+        }
+        if (StringUtils.isEmpty(model.getTelNum())) {
+            return "电话号码不能为空";
+        }
+        if (model.getValueFlag().equals(DbConstants.INFlAG)){
+            model.setEnterCheckManNo(model.getEnterCheckManNo());
+            model.setEnterCheckManName(model.getEnterCheckManName());
+            model.setEnterCheckTime(new Date());
+            meterWorkCarCheckMapper.updateByPrimaryKey(model);
+            return "";
+        }
+        if (model.getValueFlag().equals(DbConstants.OUTFlAG)){
+            model.setLeaveCheckManNo(model.getLeaveCheckManNo());
+            model.setLeaveCheckManName(model.getLeaveCheckManName());
+            model.setLeaveCheckTime(new Date());
+            meterWorkCarCheckMapper.updateByPrimaryKey(model);
+            return "";
+        }
+        return "";
+
+    }
+
     private void check(MeterWorkCarCheck model)
     {
         if (model.getPredictionNo() == null || model.getPredictionNo().equals("")) {
@@ -264,9 +330,9 @@ public class MeterWorkCarCheckServiceImpl extends BaseServiceImpl<MeterWorkCarCh
         if (model.getIdNum() == null || model.getIdNum().equals("")) {
             throw new MarkerMetException(500, "身份证号不能为空");
         }
-        if (model.getTransportChemical() == null || model.getTransportChemical().equals("")) {
-            throw new MarkerMetException(500, "是否可运危化品不能为空");
-        }
+//        if (model.getTransportChemical() == null || model.getTransportChemical().equals("")) {
+//            throw new MarkerMetException(500, "是否可运危化品不能为空");
+//        }
         if (model.getWaterBoxIsEmpty() == null || model.getWaterBoxIsEmpty().equals("")) {
             throw new MarkerMetException(500, "水箱为空是否不能为空");
         }

+ 2 - 2
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/controller/MeterWorkRailwayActualController.java

@@ -107,11 +107,11 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
         }
     }
 
-    @ApiOperation(value = "新增数据", notes = "根据选中的毛重数据和输入的皮重新增一条净重数据")
+    @ApiOperation(value = "新增数据-手输皮重", notes = "根据选中的毛重数据和输入的皮重新增一条净重数据")
     @ApiImplicitParam(name = "meterWorkRailwayActual", value = "详细实体meterWorkRailwayActual", required = true, dataType = "MeterWorkRailwayActual")
     //@RequiresPermissions("meterworkrailwayactual:create")
     @PostMapping(value = "/add")
-    public RESTfulResult addData(@ModelAttribute MeterWorkRailwayActual model) {
+    public RESTfulResult addData(@RequestBody MeterWorkRailwayActual model) {
         try {
             int num = meterWorkRailwayActualService.addData(model);
             if (num >= 1) {

+ 16 - 3
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/impl/MeterWorkRailwayActualServiceImpl.java

@@ -373,7 +373,9 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
         MeterWorkRailwayActFirst tarerow = new MeterWorkRailwayActFirst();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
         Date time = new Date();
-        tarerow.setActualFirstNo(meterWorkRailwayActFirstMapper.getNewID(sdf.format(time)));
+        String idNo = sdf.format(new Date()) + meterWorkRailwayActFirstMapper.getNewID(sdf.format(time));
+        tarerow.setActualFirstNo(idNo);
+        tarerow.setRailwayNo(model.getRailwayNo());
         tarerow.setMeterWeight(model.getTareWeight());
         tarerow.setCreateManName(userName);
         tarerow.setCreateManNo(userId);
@@ -382,10 +384,21 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
         tarerow.setDataSource(queryrow.getDataSource());
         tarerow.setMemo("静轨一次计量数据输入历史皮重洁净操作新增皮重数据");
         tarerow.setValueFlag("2");
-        meterWorkRailwayActFirstMapper.insertSelective(tarerow);
+        tarerow.setWeightType("3");
+        int num1 = meterWorkRailwayActFirstMapper.insertSelective(tarerow);
+
+        // 处理预报信息
+        PreRailwayScale pres = new PreRailwayScale();
+        pres.setPredictionNo(model.getPredictionNo());
+        pres.setValueFlag("2");
+        pres.setUpdateManName(userName+ ": 使用历史皮重洁净操作");
+        pres.setUpdateTime(new Date());
+        pres.setUpdateManNo(userId);
+        preRailwayScaleMapper.updateByPrimaryKeySelective(pres);
 
         // 新增净重数据
-        model.setActualNo(meterWorkRailwayActualMapper.getNewID(sdf.format(new Date())));
+        String idNo2 = sdf.format(new Date()) + meterWorkRailwayActFirstMapper.getNewID(sdf.format(time));
+        model.setActualNo(idNo2);
         model.setTareManName(userName);
         model.setTareManNo(userId);
         model.setTareTime(time);