gongdecai 1 ano atrás
pai
commit
6064894b8f
23 arquivos alterados com 1230 adições e 74 exclusões
  1. 2 0
      winsea-haixin-platform-backend/src/main/resources/application.yml
  2. 143 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java
  3. 74 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CarInfoController.java
  4. 258 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CarPostionController.java
  5. 0 9
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonUserController.java
  6. 20 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FuelFillingInfoController.java
  7. 81 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CarInfo.java
  8. 7 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FuelFillingInfo.java
  9. 42 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/shexaingView.java
  10. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java
  11. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CarInfoMapper.java
  12. 27 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICarInfoService.java
  13. 9 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFuelFillingInfoService.java
  14. 86 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CarInfoServiceImpl.java
  15. 157 59
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FuelFillingInfoServiceImpl.java
  16. 3 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/Const.java
  17. 49 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/Imageys.java
  18. 104 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/SignUtils.java
  19. 135 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/StringUtil.java
  20. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/FuelFingListener.java
  21. 9 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/FuelFingProvider.java
  22. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CarInfoMapper.xml
  23. 1 4
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/FuelFillingInfoMapper.xml

+ 2 - 0
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -100,6 +100,8 @@ auth:
     - /photoFrameController/**/*
     - /transactionExchangeInfo/*
     - /transactionExchangeInfo/**/*
+    - /httpServletlx/*
+    - /httpServletlx/**/*
   expire-in: 2592000
   login-url: /login.html
   logout-url: /auth/api/logout

+ 143 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java

@@ -1566,6 +1566,149 @@ public class BiInfoController {
         return biViewInfoList;
     }
 
+
+    /**
+     * 仓库 纯重  烘干
+     *
+     * @param compId
+     * @param baseId
+     * @return
+     */
+    @GetMapping("/quantityChunHongByWare")
+    public List<BiViewInfo> quantityChunHongByWare(String compId, String baseId) {
+        List<BiViewInfo> biViewInfoList = new ArrayList<>();
+        String userId = "";
+        if (AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null) {
+            userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+        }
+        String jointVentureParties = null;
+        if ("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)) {
+            jointVentureParties = "洮南市鸿胜粮贸有限公司";
+        }
+        List<BiViewInfo> biViewInfoList1 = warehousePositionStorageInfoMapper.selectSumWareNewByGoods(compId, baseId, "2", null, jointVentureParties);
+        List<BiViewInfo> biViewInfoList2 = warehousePositionStorageInfoMapper.selectSumWareNewByGoods(compId, baseId, "1", null, jointVentureParties);
+        List<BiViewInfo> biViewInfochaoList1 = warehousePositionStorageInfoMapper.selectSumWareChaoByGoods(compId, baseId, "2", null, jointVentureParties);
+        List<BiViewInfo> biViewInfochaoList2 = warehousePositionStorageInfoMapper.selectSumWareChaoByGoods(compId, baseId, "1", null, jointVentureParties);
+        List<BiViewInfo> biViewInfos = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(biViewInfoList1)) {
+            for (int i = 0; i < biViewInfoList1.size(); i++) {
+                BiViewInfo biViewInfo = new BiViewInfo();
+                biViewInfo.setName(biViewInfoList1.get(i).getName());
+                biViewInfo.setWeight(biViewInfoList1.get(i).getWeight());
+                if (CollectionUtils.isNotEmpty(biViewInfoList2)) {
+                    for (int j = 0; j < biViewInfoList2.size(); j++) {
+                        if (biViewInfoList1.get(i).getName().equals(biViewInfoList2.get(j).getName())) {
+                            if(biViewInfoList1.get(i).getWeight() - biViewInfoList2.get(j).getWeight() <= 0){
+                                biViewInfo.setWeight(0d);
+                            }else{
+                                biViewInfo.setWeight(biViewInfoList1.get(i).getWeight() - biViewInfoList2.get(j).getWeight());
+                            }
+                            break;
+                        }
+
+                    }
+
+                }
+                if(biViewInfo.getWeight() == 0){
+                    continue;
+                }
+                biViewInfos.add(biViewInfo);
+            }
+        }
+
+        // 计算潮粮折干后的剩余量
+        List<BiViewInfo> biViewInfos1 = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(biViewInfochaoList1)) {
+            for (int i = 0; i < biViewInfochaoList1.size(); i++) {
+                BiViewInfo biViewInfo = new BiViewInfo();
+                biViewInfo.setName(biViewInfochaoList1.get(i).getName());
+                biViewInfo.setWeight(biViewInfochaoList1.get(i).getWeight());
+                if (CollectionUtils.isNotEmpty(biViewInfochaoList2)) {
+                    for (int j = 0; j < biViewInfochaoList2.size(); j++) {
+                        if (biViewInfochaoList1.get(i).getName().equals(biViewInfochaoList2.get(j).getName())) {
+                            if(biViewInfochaoList1.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0) <= 0){
+                                biViewInfo.setWeight(0d);
+                            }else{
+                                biViewInfo.setWeight(biViewInfochaoList1.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0));
+                            }
+                            break;
+                        }
+
+                    }
+
+                }
+                if(biViewInfo.getWeight() == 0){
+                    continue;
+                }
+                biViewInfos1.add(biViewInfo);
+            }
+        }
+
+
+
+        if(CollectionUtils.isNotEmpty(biViewInfos)){
+            for(int i=0;i<biViewInfos.size();i++){
+                if(biViewInfos.get(i).getName().contains("潮粮")){
+                    biViewInfos.remove(i);
+                    continue;
+                }
+                if(CollectionUtils.isNotEmpty(biViewInfos1)){
+                    for(int j=0;j<biViewInfos1.size();j++){
+                        if(biViewInfos1.get(j).getName().contains(biViewInfos.get(i).getName())){
+                            biViewInfos.get(i).setWeight(biViewInfos.get(i).getWeight()+biViewInfos1.get(j).getWeight());
+                        }
+                    }
+
+                }
+            }
+
+        }
+
+        BiViewInfo biViewInfo1 = new BiViewInfo();
+        biViewInfo1.setName("纯重");
+        biViewInfo1.setBiViewInfoList(biViewInfos);
+        biViewInfoList.add(biViewInfo1);
+
+        //烘干     烘干入库量
+        List<BiViewInfo> biViewInfos2 = new ArrayList<>();
+        List<BiViewInfo> biViewInfohongganList = dryWarehouseMapper.selectSumWareHongByGoods(companyId, baseId,  null, jointVentureParties);
+        if(CollectionUtils.isNotEmpty(biViewInfohongganList)){
+            for(int i=0;i<biViewInfohongganList.size();i++){
+                BiViewInfo biViewInfo = new BiViewInfo();
+                biViewInfo.setName(biViewInfohongganList.get(i).getName());
+                biViewInfo.setWeight(biViewInfohongganList.get(i).getWeight());
+                if(CollectionUtils.isNotEmpty(biViewInfochaoList2)){
+                    for (int j = 0; j < biViewInfochaoList2.size(); j++) {
+                        if (biViewInfohongganList.get(i).getName().equals(biViewInfochaoList2.get(j).getName())) {
+                            if(biViewInfohongganList.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0) <= 0){
+                                biViewInfo.setWeight(0d);
+                            }else{
+                                biViewInfo.setWeight(biViewInfohongganList.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0));
+                            }
+                            break;
+
+                        }
+
+                    }
+                }
+
+                biViewInfos2.add(biViewInfo);
+            }
+
+        }
+        BiViewInfo biViewInfo2 = new BiViewInfo();
+        biViewInfo2.setName("烘干");
+        biViewInfo2.setBiViewInfoList(biViewInfos2);
+        biViewInfoList.add(biViewInfo2);
+
+
+        return biViewInfoList;
+    }
+
+
+
+
+
     /**
      * 库存数量
      *

+ 74 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CarInfoController.java

@@ -0,0 +1,74 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.CarInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.ClockInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.ICarInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 车辆信息 前端控制器
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-22
+ */
+@RestController
+@RequestMapping("/carInfo")
+public class CarInfoController {
+    @Autowired
+    private ICarInfoService carInfoService;
+
+
+    /**
+     * 添加信息
+     *
+     * @param carInfo
+     * @return
+     */
+    @PostMapping("/api/addInfo")
+    public String addInfo(@RequestBody CarInfo carInfo) {
+        return carInfoService.addInfo(carInfo);
+    }
+
+    /**
+     * 编辑信息
+     *
+     * @param carInfo
+     * @return
+     */
+    @PostMapping("/api/editInfo")
+    public String editInfo(@RequestBody CarInfo carInfo) {
+        return carInfoService.editInfo(carInfo);
+    }
+
+    /**
+     * 删除信息
+     *
+     * @param carInfo
+     * @return
+     */
+    @PostMapping("/api/deleteInfo")
+    public void deleteInfo(@RequestBody CarInfo carInfo) {
+        carInfoService.deleteInfo(carInfo.getId());
+    }
+
+
+    /**
+     * 查询
+     *
+     * @param carInfo
+     * @return
+     */
+    @GetMapping("/selectCars")
+    public Page<CarInfo> selectCars(CarInfo carInfo) {
+        return carInfoService.selectCars(carInfo);
+    }
+
+
+}
+

+ 258 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CarPostionController.java

@@ -0,0 +1,258 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.yh.saas.plugin.yiliangyiyun.entity.CacheComponent;
+import com.yh.saas.plugin.yiliangyiyun.entity.CarInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.BiViewInfo;
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
+import com.yh.saas.plugin.yiliangyiyun.util.SignUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.http.Header;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicHeader;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+@RestController
+@RequestMapping("/CarPostionController")
+public class CarPostionController {
+    @Autowired
+    private CacheComponent cacheComponent;
+
+    private static final String openapi_url = "http://open.aichezaixian.com/route/rest";
+
+    // 申请来的appKey和appSecret
+    private static final String app_key = "8FB345B8693CCD0066D0B7AACB06A271";
+    private static final String app_secret = "7f1457dc02744cc99f9856a649eed309";
+
+    @PostMapping("/api/getlocation")
+    public String getlocation() throws IOException {
+        String token ="";
+        String tokenRedis = cacheComponent.getRaw(Const.ADMIN_CARPOSTIONTOKEN);;
+        if (StringUtils.isEmpty(tokenRedis)) {
+            token = gettoken();
+        }
+        else{
+            token  = tokenRedis;
+        }
+        Map<String, String> headerMap = new HashMap<String, String>();
+        headerMap.put("Content-Type", "application/x-www-form-urlencoded");
+
+        Map<String, String> paramMap = new HashMap<String, String>();
+        // 公共参数
+        paramMap.put("access_token", token);
+        paramMap.put("imeis", "868120299541554");
+        paramMap.put("map_type", "GOOGLE");
+        paramMap.put("method", "jimi.device.location.get");
+        paramMap.put("app_key", app_key);
+        paramMap.put("v", "0.9");
+        paramMap.put("timestamp", getCurrentDate());
+        paramMap.put("format", "json");
+        paramMap.put("sign_method", "md5");
+        // 获取token
+        HttpEntity entity = sendPost(headerMap, paramMap);
+        JSONObject jsonObject = JSONObject.parseObject(EntityUtils.toString(entity, "utf-8"));
+        if ("0".equals(jsonObject.getString("code"))) {
+            String data = jsonObject.getString("result");
+            return data;
+        }
+        return null;
+    }
+    String token ="";
+    @PostMapping("/api/gettrack")
+    public String gettrack(@RequestBody CarInfo carInfo) throws IOException {
+
+        String tokenRedis = cacheComponent.getRaw(Const.ADMIN_CARPOSTIONTOKEN);
+        if (StringUtils.isEmpty(tokenRedis)) {
+            token = gettoken();
+        }
+        else{
+            token  = tokenRedis;
+        }
+        Map<String, String> headerMap = new HashMap<String, String>();
+        headerMap.put("Content-Type", "application/x-www-form-urlencoded");
+
+        Map<String, String> paramMap = new HashMap<String, String>();
+        // 公共参数
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String a = formatter.format(carInfo.getStartDate());
+        paramMap.put("access_token", token);
+        paramMap.put("imei", "868120299541554");
+        paramMap.put("begin_time", formatter.format(carInfo.getStartDate()));
+        paramMap.put("end_time", formatter.format(carInfo.getEndDate()));
+        paramMap.put("map_type", "GOOGLE");
+        paramMap.put("method", "jimi.device.track.list");
+        paramMap.put("sign_method", "md5");
+        paramMap.put("app_key", app_key);
+        paramMap.put("v", "0.9");
+        paramMap.put("timestamp", getCurrentDate());
+        paramMap.put("format", "json");
+        // 获取token
+        HttpEntity entity = sendPost(headerMap, paramMap);
+        JSONObject jsonObject = JSONObject.parseObject(EntityUtils.toString(entity, "utf-8"));
+        if ("0".equals(jsonObject.getString("code"))) {
+            String data = jsonObject.getString("result");
+//            JSONObject data = JSONObject.parseObject(jsonObject.getString("result"));
+            return data;
+        }
+        else if("1004".equals(jsonObject.getString("code"))){
+            token= refresh(token);
+            gettrack(carInfo);
+        }
+        return null;
+    }
+
+
+
+
+
+    public String gettoken() throws IOException {
+        Map<String, String> headerMap = new HashMap<String, String>();
+        headerMap.put("Content-Type", "application/x-www-form-urlencoded");
+
+        Map<String, String> paramMap = new HashMap<String, String>();
+        // 公共参数
+        paramMap.put("app_key", app_key);
+        paramMap.put("v", "1.0");
+        paramMap.put("timestamp", getCurrentDate());
+        paramMap.put("sign_method", "md5");
+        paramMap.put("format", "json");
+        paramMap.put("method", "jimi.oauth.token.get");
+
+        // 私有参数
+        paramMap.put("user_id", "HLJZTHYMY");
+        paramMap.put("user_pwd_md5", DigestUtils.md5Hex("Zthy888888"));
+        paramMap.put("expires_in", "7200");
+
+        // 计算签名
+        String sign = "";
+        try {
+            sign = SignUtils.signTopRequest(paramMap, app_secret, "md5");
+            paramMap.put("sign", sign);
+        } catch (IOException e) {
+            System.err.println(e);
+        }
+
+        // 获取token
+        HttpEntity entity = sendPost(headerMap, paramMap);
+        String body = EntityUtils.toString(entity, "utf-8");
+        JSONObject jsonObject = JSONObject.parseObject(body);
+        if ("0".equals(jsonObject.getString("code"))) {
+            JSONObject data = JSONObject.parseObject(jsonObject.getString("result"));
+            String accessToken = data.getString("accessToken");
+            cacheComponent.putRaw(Const.ADMIN_CARPOSTIONTOKEN, accessToken, 5400);
+            return accessToken;
+        }
+        return null;
+    }
+
+
+
+
+    public String refresh(String token) throws IOException {
+        Map<String, String> headerMap = new HashMap<String, String>();
+        headerMap.put("Content-Type", "application/x-www-form-urlencoded");
+
+        Map<String, String> paramMap = new HashMap<String, String>();
+        // 公共参数
+        paramMap.put("app_key", app_key);
+        paramMap.put("v", "1.0");
+        paramMap.put("timestamp", getCurrentDate());
+        paramMap.put("sign_method", "md5");
+        paramMap.put("format", "json");
+        paramMap.put("method", "jimi.oauth.token.refresh");
+
+        // 私有参数
+        paramMap.put("access_token", token);
+        paramMap.put("refresh_token", token);
+        paramMap.put("expires_in", "7200");
+
+        // 计算签名
+        String sign = "";
+        try {
+            sign = SignUtils.signTopRequest(paramMap, app_secret, "md5");
+            paramMap.put("sign", sign);
+        } catch (IOException e) {
+            System.err.println(e);
+        }
+
+        // 获取token
+        HttpEntity entity = sendPost(headerMap, paramMap);
+        String body = EntityUtils.toString(entity, "utf-8");
+        JSONObject jsonObject = JSONObject.parseObject(body);
+        if ("0".equals(jsonObject.getString("code"))) {
+            JSONObject data = JSONObject.parseObject(jsonObject.getString("result"));
+            String accessToken = data.getString("accessToken");
+            cacheComponent.putRaw(Const.ADMIN_CARPOSTIONTOKEN, accessToken, 5400);
+            return accessToken;
+        }
+        return null;
+    }
+
+    private HttpEntity sendPost(Map<String, String> headerMap, Map<String, String> paramMap) {
+        try {
+            HttpPost post = new HttpPost(openapi_url);
+            List<NameValuePair> list = new ArrayList<NameValuePair>();
+            for (String key : paramMap.keySet()) {
+                list.add(new BasicNameValuePair(key, paramMap.get(key)));
+            }
+            post.setEntity(new UrlEncodedFormEntity(list, "UTF-8"));
+            if (null != headerMap) {
+                post.setHeaders(assemblyHeader(headerMap));
+            }
+
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            HttpResponse response = httpClient.execute(post);
+            HttpEntity entity = response.getEntity();
+//            System.out.println(EntityUtils.toString(entity, "utf-8"));
+            return entity;
+
+        } catch (IOException e) {
+            System.err.println(e);
+        }
+        return  null;
+    }
+
+    /**
+     * 组装头部信息
+     *
+     * @param headers
+     * @return
+     */
+    private static Header[] assemblyHeader(Map<String, String> headers) {
+        Header[] allHeader = new BasicHeader[headers.size()];
+        int i = 0;
+        for (String str : headers.keySet()) {
+            allHeader[i] = new BasicHeader(str, headers.get(str));
+            i++;
+        }
+        return allHeader;
+    }
+
+    public static String getCurrentDate() {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String result = formatter.format(new Date());
+        return result;
+    }
+}

+ 0 - 9
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonUserController.java

@@ -209,12 +209,6 @@ public class CommonUserController {
                     }
                 }
             }
-//            List<Boolean> idList=workflowHistoricTasks.stream().map(WorkflowHistoricTask::getApproved).collect(Collectors.toList());
-//            if(idList.contains(false)){
-//                for(int i=0;i<workflowHistoricTasks.size();i++){
-//
-//                }
-//            }
 
 
         }
@@ -227,9 +221,6 @@ public class CommonUserController {
             for (int i = 0; i < workflowSteps.size(); i++) {
                 if (!StringUtils.isEmpty(branch)) {
                     if ("zt".equals(branch)) {
-//                        if(i == 0 && workflow.getBusinessCode().equals("FEIYONGGUANLI-APPROVE")){
-//                            i= 4;
-//                        }
                         if (workflowSteps.get(i).getBranchNodeLocation()!= null
                                 &&"BEGIN".equals(workflowSteps.get(i).getBranchNodeLocation().name())
                                 && !StringUtils.isEmpty(workflowSteps.get(i).getBranchExpression())

+ 20 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FuelFillingInfoController.java

@@ -31,6 +31,16 @@ public class FuelFillingInfoController {
     public String addFilling(@RequestBody FuelFillingInfo fuelFillingInfo) {
         return fuelFillingInfoService.addFilling(fuelFillingInfo);
     }
+    /**
+     * shanchu
+     *
+     * @param fuelFillingInfo
+     * @return
+     */
+    @PostMapping("/api/deleteFilling")
+    public String deleteFilling(@RequestBody FuelFillingInfo fuelFillingInfo) {
+        return fuelFillingInfoService.deleteFilling(fuelFillingInfo.getId());
+    }
     /**
      * 长途加油列表
      *
@@ -51,6 +61,16 @@ public class FuelFillingInfoController {
     public FuelFillingInfo getFilling(@RequestParam String id) {
         return fuelFillingInfoService.getFilling(id);
     }
+    /**
+     * 查看日期
+     *
+     * @param carNo
+     * @return
+     */
+    @GetMapping("/gettime")
+    public String gettime(@RequestParam String carNo) {
+        return fuelFillingInfoService.gettime(carNo);
+    }
 
     /**
      * 加油管理列表(PC)

+ 81 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CarInfo.java

@@ -0,0 +1,81 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * <p>
+ * 车辆信息
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("car_info")
+public class CarInfo extends BaseModel<CarInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 车牌号
+     */
+    private String carNo;
+    /**
+     * IMEI
+     */
+    private String iemi;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 上班打卡时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(exist = false)
+    private Date startDate;
+    /**
+     * 下班打卡时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(exist = false)
+    private Date endDate;
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 7 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FuelFillingInfo.java

@@ -219,6 +219,11 @@ public class FuelFillingInfo extends BaseModel<FuelFillingInfo> {
      */
     @TableField(exist = false)
     private List<FillingDetailInfo> fillingDetailInfoList;
+    /**
+     * 加油明细列表
+     */
+    @TableField(exist = false)
+    private FillingDetailInfo fillingDetailInfo;
     /**
      * 加油信息列表
      */
@@ -250,6 +255,8 @@ public class FuelFillingInfo extends BaseModel<FuelFillingInfo> {
     private String searchKeyWord;
     @TableField(exist = false)
     private String taskId;
+    @TableField(exist = false)
+    private String flag;
     /**
      * 发起人
      */

+ 42 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/shexaingView.java

@@ -0,0 +1,42 @@
+package com.yh.saas.plugin.yiliangyiyun.entity.view;
+
+public class shexaingView {
+
+    private String flag;
+
+    public String getFlag() {
+        return flag;
+    }
+
+    public void setFlag(String flag) {
+        this.flag = flag;
+    }
+
+    public String getIp1() {
+        return ip1;
+    }
+
+    public void setIp1(String ip1) {
+        this.ip1 = ip1;
+    }
+
+    public String getIp2() {
+        return ip2;
+    }
+
+    public void setIp2(String ip2) {
+        this.ip2 = ip2;
+    }
+
+    private String ip1;
+    private String ip2;
+    private String userId;
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+}

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java

@@ -56,6 +56,7 @@ public enum YExceptionEnum {
 	PETTY_ACCOUNT_ERROR("ERROR", "当前账户备用金余额不足!"),
 	PETTY_ERROR("ERROR", "所有备用金账户余额剩余小于0!"),
 	CLOCK_ERROR("ERROR", "上班时间未打卡"),
+	CARNO_ERROR("ERROR", "当前车牌号有未通过审核的申请,请通过审核后继续添加!"),
 	;
 	@Getter
 	private String value;

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CarInfoMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.CarInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 车辆信息 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-22
+ */
+public interface CarInfoMapper extends BaseMapper<CarInfo> {
+
+}

+ 27 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICarInfoService.java

@@ -0,0 +1,27 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.CarInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 车辆信息 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-22
+ */
+public interface ICarInfoService extends IService<CarInfo> {
+
+
+    Page<CarInfo> selectCars(CarInfo carInfo);
+
+
+    String addInfo(CarInfo carInfo);
+
+
+    String editInfo(CarInfo carInfo);
+
+    void deleteInfo(String id);
+}

+ 9 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFuelFillingInfoService.java

@@ -35,6 +35,15 @@ public interface IFuelFillingInfoService extends IService<FuelFillingInfo> {
      * @param id
      */
     FuelFillingInfo getFilling(String id);
+    /**
+     * shanchu
+     * @param id
+     */
+    String deleteFilling(String id);
+
+
+
+    String gettime(String carNo);
     /**
      * 加油管理列表(PC)
      *

+ 86 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CarInfoServiceImpl.java

@@ -0,0 +1,86 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.winsea.svc.base.workflow.entity.Workflow;
+import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.base.entity.CommonBillOperateHis;
+import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
+import com.yh.saas.plugin.yiliangyiyun.mapper.CarInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.ICarInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 车辆信息 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-22
+ */
+@Service
+public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> implements ICarInfoService {
+
+
+    @Override
+    public Page<CarInfo> selectCars(CarInfo carInfo) {
+        Page<CarInfo> carInfoPage = this.selectPage(carInfo.getQueryPage(), new EntityWrapper<CarInfo>()
+                .eq("comp_id", carInfo.getCompId()));
+        List<CarInfo> carInfos = carInfoPage.getRecords();
+        carInfoPage.setRecords(carInfos);
+        //查询总数
+        Integer count = this.selectCount(new EntityWrapper<CarInfo>()
+                .eq("comp_id", carInfo.getCompId()));
+        carInfoPage.setSize(count);
+        return carInfoPage;
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param carInfo
+     * @return
+     */
+    @Override
+    public String addInfo(CarInfo carInfo) {
+        carInfo.setId(IdGenerator.generateUUID());
+        this.insert(carInfo);
+        return "ok";
+    }
+
+    /**
+     * 编辑
+     *
+     * @param carInfo
+     * @return
+     */
+    @Override
+    public String editInfo(CarInfo carInfo) {
+        this.updateById(carInfo);
+        return "ok";
+    }
+
+    /**
+     * 删除
+     *
+     * @param id
+     */
+    @Override
+    public void deleteInfo(String id) {
+        CarInfo carInfo = this.selectById(id);
+        this.deleteById(carInfo.getId());
+
+    }
+
+}

+ 157 - 59
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FuelFillingInfoServiceImpl.java

@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
 import com.winsea.svc.base.base.entity.CommonStaff;
 import com.winsea.svc.base.base.service.ICommonStaffService;
+import com.winsea.svc.base.workflow.entity.Workflow;
 import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.base.entity.CommonBillOperateHis;
+import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
@@ -23,10 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * <p>
@@ -49,7 +49,8 @@ public class FuelFillingInfoServiceImpl extends ServiceImpl<FuelFillingInfoMappe
     private INewWorkflowService workflowService;
     @Autowired
     private ICommonStaffService staffService;
-
+    @Autowired
+    private ICommonBillOperateHisService commonBillOperateHisService;
     /**
      * 添加长途加油信息
      *
@@ -58,66 +59,107 @@ public class FuelFillingInfoServiceImpl extends ServiceImpl<FuelFillingInfoMappe
      */
     @Override
     public String addFilling(FuelFillingInfo fuelFillingInfo) {
-        String id = "";
-        //判断开始/结束轨迹(0开始1结束)
-        if ("0".equals(fuelFillingInfo.getTrackFlag())) {
+        if("1".equals(fuelFillingInfo.getFlag())){
             //新增主键id
             fuelFillingInfo.setId(IdGenerator.generateUUID());
-            //行程状态改为已开始
-            fuelFillingInfo.setTravelStatus(StatusEnum.TRACK_START.getName());
-            fuelFillingInfo.setTravelStatusFlag(StatusEnum.TRACK_START.getFlag());
-            //获取当前年月日
-            SimpleDateFormat f = new SimpleDateFormat("yyyyMMdd");//设置日期格式
-            String date = f.format(new Date(System.currentTimeMillis()));
-            //查询信息数量包括已删除的集合
-            List<FuelFillingInfo> fuelFillingInfoList = this.selectFillingNoList(fuelFillingInfo);//调用Service中的方法
-            //生成请假编号
-            if (fuelFillingInfoList.size() > 0) {
-                //取第一条数据的编号
-                String n = fuelFillingInfoList.get(0).getFillingNo();
-                //截取编号后4位
-                int intNumber = Integer.parseInt(n.substring(13));
-                intNumber++;
-                String Number = String.valueOf(intNumber);
-                for (int i = 0; i < 4; i++) {
-                    Number = Number.length() < 4 ? "0" + Number : Number;
+
+            this.insert(fuelFillingInfo);
+            FillingDetailInfo fillingDetailInfo = fuelFillingInfo.getFillingDetailInfo();
+            if(fillingDetailInfo != null){
+                fillingDetailInfo.setId(IdGenerator.generateUUID());
+                fillingDetailInfo.setFillingId(fuelFillingInfo.getId());
+                fillingDetailInfoService.insert(fillingDetailInfo);
+            }
+
+
+            boolean isStartWorkflow = com.alipay.sofa.rpc.common.utils.StringUtils.isBlank(fuelFillingInfo.getWorkflowId());
+            // 不是退回的单子
+            if (isStartWorkflow) {
+                Workflow workflow = workflowService
+                        .findLatestWorkflowByBusinessCodeByApp(fuelFillingInfo.getCompId(), "JIAYOU-SHENHE-APPROVE");
+                // 没配置审核流程,直接结束并处理信息
+                if (workflow == null) {
+                    throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+                }
+                // 开启审核流
+                else {
+                    // 设置状态 已提交审核
+                    fuelFillingInfo.setWorkflowId(workflow.getId());
+                    fuelFillingInfoService.updateById(fuelFillingInfo);
+                    workflowService.startInstance(workflow.getId(), fuelFillingInfo.getId());
                 }
-                //编号自增
-                Number = "JY" + date + Number;
-                fuelFillingInfo.setFillingNo(Number);
-            } else {
-                //如果当天数据为空,生成第一条数据
-                String Number = "JY" + date + "0001";
-                fuelFillingInfo.setFillingNo(Number);
             }
-            if (fuelFillingInfo.getFillingNo().contains("null")) {
-                throw new YException(YExceptionEnum.QUALITY_HAVE_ERROR);
+            // 退回的单子 再启用
+            else {
+                fuelFillingInfoService.updateById(fuelFillingInfo);
+                workflowService.activateInstance(fuelFillingInfo.getWorkflowId(), fuelFillingInfo.getId());
             }
 
-            this.insert(fuelFillingInfo);
-            id = fuelFillingInfo.getId();
-        } else {
-//            FuelFillingInfo fuelFillingInfo1 = fuelFillingInfoService.selectOne(new EntityWrapper<FuelFillingInfo>()
-//                    .eq("comp_id", fuelFillingInfo.getCompId())
-//                    .eq("common_id", fuelFillingInfo.getCommonId())
-//                    .eq("car_no", fuelFillingInfo.getCarNo()));
-            FuelFillingInfo fuelFillingInfo1 = this.selectById(fuelFillingInfo.getId());
-            if (fuelFillingInfo1 != null) {
-                //行程状态改为已结束
-                fuelFillingInfo1.setTravelStatusFlag(StatusEnum.TRACK_END.getFlag());
-                fuelFillingInfo1.setTravelStatus(StatusEnum.TRACK_END.getName());
-                fuelFillingInfo1.setCarNo(fuelFillingInfo.getCarNo());
-                fuelFillingInfo1.setDestinationProvince(fuelFillingInfo.getDestinationProvince());
-                fuelFillingInfo1.setDestinationCity(fuelFillingInfo.getDestinationCity());
-                fuelFillingInfo1.setDestinationArea(fuelFillingInfo.getDestinationArea());
-                fuelFillingInfo1.setDestinationAddress(fuelFillingInfo.getDestinationAddress());
-                fuelFillingInfo1.setDestinationLongitude(fuelFillingInfo.getDestinationLongitude());
-                fuelFillingInfo1.setDestinationLatitude(fuelFillingInfo.getDestinationLatitude());
-                this.updateById(fuelFillingInfo1);
-                id = fuelFillingInfo1.getId();
+            //  添加提交历史
+            CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
+            commonBillOperateHis.setBillId(fuelFillingInfo.getId());
+            commonBillOperateHis.setId(IdGenerator.generateUUID());
+            commonBillOperateHis.setBillType("JIAYOU-SHENHE-APPROVE");
+            commonBillOperateHis.setOperateDate(new Date());
+            commonBillOperateHis.setOperateUser(fuelFillingInfo.getCreateUserId());
+            JSONObject jsonObject = (JSONObject) JSONObject.toJSON(fuelFillingInfo);
+            commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
+            commonBillOperateHisService.create(commonBillOperateHis);
+
+        }
+        else{
+            this.updateById(fuelFillingInfo);
+            FillingDetailInfo fillingDetailInfo = fuelFillingInfo.getFillingDetailInfo();
+            if(fillingDetailInfo != null){
+                fillingDetailInfoService.delete(new EntityWrapper<FillingDetailInfo>()
+                        .eq("filling_id",fuelFillingInfo.getId()));
+                fillingDetailInfo.setId(IdGenerator.generateUUID());
+                fillingDetailInfo.setFillingId(fuelFillingInfo.getId());
+                fillingDetailInfoService.insert(fillingDetailInfo);
+            }
+
+            boolean isStartWorkflow = StringUtils.isBlank(fuelFillingInfo.getWorkflowId());
+            // 不是退回的单子
+            if (isStartWorkflow) {
+                Workflow workflow = workflowService
+                        .findLatestWorkflowByBusinessCodeByApp(fuelFillingInfo.getCompId(), "JIAYOU-SHENHE-APPROVE");
+                // 没配置审核流程,直接结束并处理信息
+                if (workflow == null) {
+                    throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+                }
+                // 开启审核流
+                else {
+                    // 设置状态 已提交审核
+                    fuelFillingInfo.setWorkflowId(workflow.getId());
+                    this.updateById(fuelFillingInfo);
+                    workflowService.startInstance(workflow.getId(), fuelFillingInfo.getId());
+                }
+            }
+            // 退回的单子 再启用
+            else {
+                if ("发起人撤回".equals(fuelFillingInfo.getApproveStatus())) {
+                    Workflow workflow = workflowService
+                            .findLatestWorkflowByBusinessCodeByApp(fuelFillingInfo.getCompId(), "JIAYOU-SHENHE-APPROVE");
+                    // 没配置审核流程,直接结束并处理信息
+                    if (workflow == null) {
+                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+                    }
+                    // 开启审核流
+                    else {
+                        // 设置状态 已提交审核
+                        fuelFillingInfo.setWorkflowId(workflow.getId());
+                        this.updateById(fuelFillingInfo);
+                        workflowService.startInstance(workflow.getId(), fuelFillingInfo.getId());
+                    }
+                } else {
+
+                    this.updateById(fuelFillingInfo);
+                    workflowService.activateInstance(fuelFillingInfo.getWorkflowId(), fuelFillingInfo.getId());
+                }
             }
         }
-        return id;
+
+        return fuelFillingInfo.getId();
     }
 
     /**
@@ -140,6 +182,11 @@ public class FuelFillingInfoServiceImpl extends ServiceImpl<FuelFillingInfoMappe
         // 查询总数
         Integer dataCount = baseMapper.getCountByCondition(pageView);
         List<FuelFillingInfo> dataList = baseMapper.getListByCondition(pageView);
+        for(int i=0;i<dataList.size();i++){
+            dataList.get(i).setFillingDetailInfo(fillingDetailInfoService.selectOne(new EntityWrapper<FillingDetailInfo>()
+                    .eq("filling_id",dataList.get(i).getId())));
+
+        }
         Page<FuelFillingInfo> page = new Page<>();
         page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
         page.setTotal(dataCount == null ? 0 : dataCount);
@@ -161,8 +208,8 @@ public class FuelFillingInfoServiceImpl extends ServiceImpl<FuelFillingInfoMappe
         if(fuelFillingInfo != null){
            CommonStaff commonStaff = staffService.getInfo(fuelFillingInfo.getCreateUserId());
            fuelFillingInfo.setCreater(commonStaff.getStaffName());
-           List<FillingDetailInfo> fillingDetailInfos = fillingDetailInfoService.selectList(new EntityWrapper<FillingDetailInfo>().eq("filling_id",id).orderBy("serial_number"));
-           fuelFillingInfo.setFillingDetailInfoList(fillingDetailInfos);
+            fuelFillingInfo.setFillingDetailInfo(fillingDetailInfoService.selectOne(new EntityWrapper<FillingDetailInfo>()
+                    .eq("filling_id",fuelFillingInfo.getId())));
             //短途行程列表
             List<ShortFillingInfo> shortFillingInfoList = shortFillingInfoService.selectList(new EntityWrapper<ShortFillingInfo>()
                     .eq("filling_id", id)
@@ -181,6 +228,57 @@ public class FuelFillingInfoServiceImpl extends ServiceImpl<FuelFillingInfoMappe
         return fuelFillingInfo;
     }
 
+
+    /**
+     * 查看长途加油信息
+     *
+     * @param carNo
+     * @return
+     */
+    @Override
+    public String gettime(String carNo) {
+        //根据id查询加油信息
+        List<FuelFillingInfo> fuelFillingInfoList = this.selectList(new EntityWrapper<FuelFillingInfo>()
+        .eq("car_no",carNo).orderBy("create_date",false));
+        if(CollectionUtils.isNotEmpty(fuelFillingInfoList)){
+            if("3".equals(fuelFillingInfoList.get(0).getStatusFlag())){
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                String time = simpleDateFormat.format(fuelFillingInfoList.get(0).getCreateDate());
+                return time;
+
+            }
+            else{
+                throw new YException(YExceptionEnum.CARNO_ERROR);
+
+            }
+
+        }
+        else{
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(new Date());
+            calendar.add(Calendar.MONTH, -1);
+            Date m = calendar.getTime();
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            String mon = format.format(m);
+            return mon;
+        }
+    }
+
+
+    /**
+     * 查看长途加油信息
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public String deleteFilling(String id) {
+        this.deleteById(id);
+        fillingDetailInfoService.delete(new EntityWrapper<FillingDetailInfo>()
+                .eq("filling_id",id));
+        return "ok";
+    }
+
     /**
      * 加油管理列表(PC)
      *

+ 3 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/Const.java

@@ -45,4 +45,7 @@ public class Const {
     public static final String ADMIN_WAREHOUSEINFOCHAR = "ADMIN_WAREHOUSEINFOCHAR_";
     public static final String ADMIN_WAREHOUSEINFOFORM = "ADMIN_WAREHOUSEINFOFORM_";
     public static final String ADMIN_REPEATLIST = "ADMIN_REPEATLIST_";
+
+
+    public static final String ADMIN_CARPOSTIONTOKEN = "ADMIN_CARPOSTIONTOKEN_";
 }

+ 49 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/Imageys.java

@@ -0,0 +1,49 @@
+//package com.yh.saas.plugin.yiliangyiyun.util;
+//
+//import net.coobird.thumbnailator.Thumbnails;
+//import org.springframework.stereotype.Service;
+//import sun.misc.BASE64Decoder;
+//
+//import javax.imageio.ImageIO;
+//import java.awt.image.BufferedImage;
+//import java.io.ByteArrayInputStream;
+//import java.io.InputStream;
+//import org.apache.commons.codec.binary.Base64;
+//import java.io.*;
+//public class Imageys {
+//
+//    /**
+//     * 压缩base64编码至40K以内
+//     * @param base64Img
+//     * @return
+//     */
+//    public   String resizeImageTo40K(String base64Img) {
+//        try{
+//            BASE64Decoder decoder = new BASE64Decoder();
+//            byte[] bytes1 = decoder.decodeBuffer(base64Img);
+//            InputStream stream = new ByteArrayInputStream(bytes1);
+//            BufferedImage src = ImageIO.read(stream);
+//            //BufferedImage output = Thumbnails.of(src).size(src.getWidth() / 3, src.getHeight() / 3).asBufferedImage();
+//            BufferedImage output = Thumbnails.of(src).size(500 , 300 ).asBufferedImage();
+//            String base64 = imageToBase64(output);
+//            if (base64.length() - base64.length() / 8 * 2 > 40000) {
+//                output = Thumbnails.of(output).scale(1 / (base64.length() / 40000)).asBufferedImage();
+//                base64 = imageToBase64(output);
+//            }
+//            return base64;
+//        } catch (Exception e) {
+//            return base64Img;
+//        }
+//    }
+//
+//    // BufferedImage转换成base64,在这里需要设置图片格式,如下是jpg格式图片:
+//    public static String imageToBase64(BufferedImage bufferedImage) {
+//        Base64 encoder = new Base64();
+//        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+//        try {
+//            ImageIO.write(bufferedImage, "jpg", baos);
+//        } catch (IOException e) {
+//        }
+//        return new String(encoder.encode((baos.toByteArray())));
+//    }
+//}

+ 104 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/SignUtils.java

@@ -0,0 +1,104 @@
+/*
+ * COPYRIGHT. ShenZhen JiMi Technology Co., Ltd. 2017.
+ * ALL RIGHTS RESERVED.
+ *
+ * No part of this publication may be reproduced, stored in a retrieval system, or transmitted,
+ * on any form or by any means, electronic, mechanical, photocopying, recording, 
+ * or otherwise, without the prior written permission of ShenZhen JiMi Network Technology Co., Ltd.
+ *
+ * Amendment History:
+ * 
+ * Date                   By              Description
+ * -------------------    -----------     -------------------------------------------
+ * 2017年4月5日    yaojianping         Create the class
+ * http://www.jimilab.com/
+ */
+
+package com.yh.saas.plugin.yiliangyiyun.util;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+import java.util.Map;
+
+import javax.crypto.Mac;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * @FileName CodeUtils.java
+ * @Description: 服务器签名工具类
+ *
+ * @Date 2017年4月5日 下午4:59:06
+ * @author yaojianping
+ * @version 1.0
+ */
+public class SignUtils {
+
+	public static String signTopRequest(Map<String, String> params, String secret, String signMethod) throws IOException {
+		// 第一步:检查参数是否已经排序
+		String[] keys = params.keySet().toArray(new String[0]);
+		Arrays.sort(keys);
+
+		// 第二步:把所有参数名和参数值串在一起
+		StringBuilder query = new StringBuilder();
+		if ("md5".equals(signMethod)) {
+			query.append(secret);
+		}
+		for (String key : keys) {
+			String value = params.get(key);
+			if (StringUtil.areNotEmpty(key, value)) {
+				query.append(key).append(value);
+			}
+		}
+
+		// 第三步:使用MD5/HMAC加密
+		query.append(secret);
+		byte[] bytes = encryptMD5(query.toString());
+
+		// 第四步:把二进制转化为大写的十六进制
+		return byte2hex(bytes);
+	}
+
+	public static byte[] encryptHMAC(String data, String secret) throws IOException {
+		byte[] bytes = null;
+		try {
+			SecretKey secretKey = new SecretKeySpec(secret.getBytes("utf-8"), "HmacMD5");
+			Mac mac = Mac.getInstance(secretKey.getAlgorithm());
+			mac.init(secretKey);
+			bytes = mac.doFinal(data.getBytes("utf-8"));
+		} catch (GeneralSecurityException gse) {
+			throw new IOException(gse.toString());
+		}
+		return bytes;
+	}
+
+	public static byte[] encryptMD5(String data) throws IOException {
+		return encryptMD5(data.getBytes("utf-8"));
+	}
+
+	private static byte[] encryptMD5(byte[] bytes) throws IOException {
+		MessageDigest md = null;
+		try {
+			md = MessageDigest.getInstance("MD5");
+		} catch (NoSuchAlgorithmException e) {
+			throw new IOException(e.toString());
+		}
+		return md.digest(bytes);
+	}
+
+	public static String byte2hex(byte[] bytes) {
+		StringBuilder sign = new StringBuilder();
+		for (int i = 0; i < bytes.length; i++) {
+			String hex = Integer.toHexString(bytes[i] & 0xFF);
+			if (hex.length() == 1) {
+				sign.append("0");
+			}
+			sign.append(hex.toUpperCase());
+		}
+		return sign.toString();
+	}
+
+}

+ 135 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/StringUtil.java

@@ -0,0 +1,135 @@
+/*
+ * COPYRIGHT. ShenZhen JiMi Technology Co., Ltd. 2017.
+ * ALL RIGHTS RESERVED.
+ *
+ * No part of this publication may be reproduced, stored in a retrieval system, or transmitted,
+ * on any form or by any means, electronic, mechanical, photocopying, recording, 
+ * or otherwise, without the prior written permission of ShenZhen JiMi Network Technology Co., Ltd.
+ *
+ * Amendment History:
+ * 
+ * Date                   By              Description
+ * -------------------    -----------     -------------------------------------------
+ * 2017年4月5日    yaojianping         Create the class
+ * http://www.jimilab.com/
+ */
+
+package com.yh.saas.plugin.yiliangyiyun.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @FileName StringUtil.java
+ * @Description:
+ *
+ * @Date 2017年4月5日 下午5:36:34
+ * @author yaojianping
+ * @version 1.0
+ */
+public final class StringUtil {
+	
+	public static boolean areNotEmpty(String... values) {
+		boolean result = true;
+		if ((values == null) || (values.length == 0))
+			result = false;
+		else {
+			for (String value : values) {
+				result &= !isEmpty(value);
+			}
+		}
+		return result;
+	}
+
+	public static boolean isEmpty(String value) {
+		int strLen;
+		if ((value == null) || ((strLen = value.length()) == 0))
+			return true;
+		for (int i = 0; i < strLen; i++) {
+			if (!Character.isWhitespace(value.charAt(i))) {
+				return false;
+			}
+		}
+		return true;
+	}
+	
+	public static final char UNDERLINE = '_';
+
+    /**
+     * 驼峰格式字符串转换为下划线格式字符串
+     * 
+     * @param param
+     * @return
+     */
+    public static String camelToUnderline(String param) {
+        if (param == null || "".equals(param.trim())) {
+            return "";
+        }
+        int len = param.length();
+        StringBuilder sb = new StringBuilder(len);
+        for (int i = 0; i < len; i++) {
+            char c = param.charAt(i);
+            if (Character.isUpperCase(c)) {
+                sb.append(UNDERLINE);
+                sb.append(Character.toLowerCase(c));
+            } else {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 下划线格式字符串转换为驼峰格式字符串
+     * 
+     * @param param
+     * @return
+     */
+    public static String underlineToCamel(String param) {
+        if (param == null || "".equals(param.trim())) {
+            return "";
+        }
+        int len = param.length();
+        StringBuilder sb = new StringBuilder(len);
+        for (int i = 0; i < len; i++) {
+            char c = param.charAt(i);
+            if (c == UNDERLINE) {
+                if (++i < len) {
+                    sb.append(Character.toUpperCase(param.charAt(i)));
+                }
+            } else {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 下划线格式字符串转换为驼峰格式字符串2
+     * 
+     * @param param
+     * @return
+     */
+    public static String underlineToCamel2(String param) {
+        if (param == null || "".equals(param.trim())) {
+            return "";
+        }
+        StringBuilder sb = new StringBuilder(param);
+        Matcher mc = Pattern.compile("_").matcher(param);
+        int i = 0;
+        while (mc.find()) {
+            int position = mc.end() - (i++);
+            sb.replace(position - 1, position + 1, sb.substring(position, position + 1).toUpperCase());
+        }
+        return sb.toString();
+    }
+
+    public static void main(String[] args) {
+        String aaa = "app_version_fld";
+        System.out.println(underlineToCamel(aaa));
+        System.out.println(underlineToCamel2(aaa));
+        aaa = "appVersionFld";
+        System.out.println(camelToUnderline(aaa));
+    
+    }
+}

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/FuelFingListener.java

@@ -90,6 +90,7 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
             }
         } else {
             fuelFillingInfo.setApproveStatus(status);
+            fuelFillingInfo.setStatus(status);
             if(statusRecord1 != null){
                 statusRecord1.setStatus(status);
                 statusRecordMapper.updateById(statusRecord1);

+ 9 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/FuelFingProvider.java

@@ -1,9 +1,12 @@
 package com.yh.saas.plugin.yiliangyiyun.workflow;
 
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.winsea.svc.base.base.entity.CommonStaff;
 import com.winsea.svc.base.base.service.ICommonStaffService;
 import com.winsea.svc.base.base.util.provider.BeanWorkFlowProvider;
+import com.yh.saas.plugin.yiliangyiyun.entity.FillingDetailInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FuelFillingInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.IFillingDetailInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IFuelFillingInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -14,7 +17,8 @@ import java.text.MessageFormat;
 public class FuelFingProvider implements BeanWorkFlowProvider {
     @Autowired
     private ICommonStaffService staffService;
-
+    @Autowired
+    private IFillingDetailInfoService fillingDetailInfoService;
     @Autowired
     private IFuelFillingInfoService fuelFillingInfoService;
     // 工作通知信息
@@ -41,6 +45,9 @@ public class FuelFingProvider implements BeanWorkFlowProvider {
     @Override
     public String getNotificeTask(String businessId) {
         FuelFillingInfo info = fuelFillingInfoService.selectById(businessId);
+
+        FillingDetailInfo fillingDetailInfo = fillingDetailInfoService.selectOne(new EntityWrapper<FillingDetailInfo>()
+                .eq("filling_id",businessId));
         if (info == null) {
             return null;
         }
@@ -52,6 +59,6 @@ public class FuelFingProvider implements BeanWorkFlowProvider {
                     ? commitUserInfo.getMajorRole().getRoleName() + " " + commitUserInfo.getStaffName()
                     : commitUserInfo.getStaffName();
         }
-        return MessageFormat.format(MESSAGE_CONTENT, commitUserInfo.getStaffName(),info.getTfc(),info.getTotalCost());
+        return MessageFormat.format(MESSAGE_CONTENT, commitUserInfo.getStaffName(),fillingDetailInfo.getOilConsumption(),fillingDetailInfo.getCurrentConsumption());
     }
 }

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CarInfoMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.CarInfoMapper">
+
+</mapper>

+ 1 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/FuelFillingInfoMapper.xml

@@ -10,10 +10,8 @@
         COUNT(ff.id)
         FROM fuel_filling_info ff
         left join filling_detail_info fd on ff.id = fd.filling_id and fd.delete_flag = '0'
-        left join track_detail_info td on ff.id = td.filling_id and td.delete_flag = '0'
         WHERE
         ff.comp_id = #{compId}
-        and ff.common_id = #{commonId}
         and ff.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <!--未完成-->
@@ -56,6 +54,7 @@
         ff.total_cost as totalCost,
         ff.status_flag as statusFlag,
         ff.status as status,
+        ff.workflow_id as workflowId,
         ff.tfc,
         ff.travel_status as travelStatus,
         ff.travel_status_flag as travelStatusFlag,
@@ -65,10 +64,8 @@
         fd.address_url as addressUrl
         FROM fuel_filling_info ff
         left join filling_detail_info fd on ff.id = fd.filling_id and fd.delete_flag = '0'
-        left join track_detail_info td on ff.id = td.filling_id and td.delete_flag = '0'
         WHERE
         ff.comp_id = #{compId}
-        and ff.common_id = #{commonId}
         and ff.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <!--未完成-->