From aea5a0cc3bbd5c2d131a504e5aa2a124d9f131b3 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期一, 10 四月 2023 11:46:54 +0800 Subject: [PATCH] 优化功能 --- management/guns-admin/src/main/resources/application.yml | 29 +--- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java | 18 -- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java | 25 --- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtils.java | 28 ++-- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverBackController.java | 1 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java | 24 --- /dev/null | 0 management/guns-admin/pom.xml | 54 +------ management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java | 10 - management/guns-admin/src/main/webapp/static/img/login.png | 0 management/guns-admin/src/main/webapp/static/favicon1.ico | 0 management/guns-admin/src/main/webapp/WEB-INF/view/login.html | 8 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java | 61 -------- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java | 14 - management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java | 84 ------------ management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java | 30 ---- management/guns-admin/src/main/webapp/static/img/logo.png | 0 17 files changed, 35 insertions(+), 351 deletions(-) diff --git a/management/guns-admin/pom.xml b/management/guns-admin/pom.xml index d4f4371..7a85d66 100644 --- a/management/guns-admin/pom.xml +++ b/management/guns-admin/pom.xml @@ -212,42 +212,6 @@ <version>3.1</version> </dependency> - <!--引入本地工行支付jar start--> - <dependency> - <groupId>com.icbc</groupId> - <artifactId>icbc</artifactId> - <version>v2</version> - <scope>system</scope> - <systemPath>${project.basedir}/lib/icbc-api-sdk-cop.jar</systemPath> - </dependency> - <dependency> - <groupId>com.icbc.api</groupId> - <artifactId>icbc</artifactId> - <version>v2</version> - <scope>system</scope> - <systemPath>${project.basedir}/lib/icbc-api-sdk-cop-io.jar</systemPath> - </dependency> - <dependency> - <groupId>cn.com.infosec</groupId> - <artifactId>icbc</artifactId> - <version>v2</version> - <scope>system</scope> - <systemPath>${project.basedir}/lib/icbc-ca.jar</systemPath> - </dependency> - <dependency> - <groupId>cn.com.infosecCrypto</groupId> - <artifactId>icbc</artifactId> - <version>v2</version> - <scope>system</scope> - <systemPath>${project.basedir}/lib/InfosecCrypto_Java1_02_JDK14+.jar</systemPath> - </dependency> - <dependency> - <groupId>proguard</groupId> - <artifactId>icbc</artifactId> - <version>v2</version> - <scope>system</scope> - <systemPath>${project.basedir}/lib/proguard.jar</systemPath> - </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> @@ -291,16 +255,16 @@ <failOnMissingWebXml>false</failOnMissingWebXml> <!--打包后的项目名--> <!--<warName>example</warName>--> - <webResources> - <resource> + <!--<webResources>--> + <!--<resource>--> <!--把本地lib里面的jar复制到lib--> - <directory>${project.basedir}/lib</directory> - <targetPath>WEB-INF/lib/</targetPath> - <includes> - <include>**/*.jar</include> - </includes> - </resource> - </webResources> + <!--<directory>${project.basedir}/lib</directory>--> + <!--<targetPath>WEB-INF/lib/</targetPath>--> + <!--<includes>--> + <!--<include>**/*.jar</include>--> + <!--</includes>--> + <!--</resource>--> + <!--</webResources>--> </configuration> </plugin> </plugins> diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java index 5039c59..2f13bf5 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java @@ -13,15 +13,12 @@ import com.stylefeng.guns.modular.system.dao.CarInsuranceMapper; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; -import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.apache.commons.lang.time.DateUtils; -import org.apache.poi.hdf.extractor.TC; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.ui.Model; @@ -79,14 +76,8 @@ @Autowired private ITServerCarmodelService itServerCarmodelService; - @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - @Resource private CarInsuranceMapper carInsuranceMapper; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; /** * 跳转到车辆管理首页 @@ -281,24 +272,8 @@ public ResultUtil saveCarInsurance(CarInsurance carInsurance){ if(carInsurance.getId() == null){ carInsuranceMapper.insert(carInsurance); - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 1); - } - } - }).start(); }else{ carInsuranceMapper.updateById(carInsurance); - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 2); - } - } - }).start(); } return ResultUtil.success(); @@ -349,14 +324,6 @@ @RequestMapping(value = "/delCarInsurance", method = RequestMethod.POST) public ResultUtil delCarInsurance(Integer id){ carInsuranceMapper.deleteById(id); - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.baseInfoVehicleInsurance(id, 3); - } - } - }).start(); return ResultUtil.success(); } @@ -448,16 +415,6 @@ } tCarServiceService.insert(service); } - - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.baseInfoCompanyStat(); - pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); - } - } - }).start(); return SUCCESS_TIP; } @@ -477,16 +434,6 @@ // obj.setCarId(null); tDriverService.updateById(obj); } - - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.baseInfoCompanyStat(); - pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); - } - } - }).start(); return SUCCESS_TIP; } @@ -544,14 +491,6 @@ } tCarService.updateById(tCar); - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){ - pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); - } - } - }).start(); return SUCCESS_TIP; } diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java index d1251e9..76f4eef 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java @@ -8,14 +8,11 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.common.constant.factory.PageFactory; import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.ITCompanyCityService; import com.stylefeng.guns.modular.system.service.ITRegionService; import com.stylefeng.guns.modular.system.service.IUserService; -import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -54,12 +51,6 @@ @Autowired private ITCompanyCityService tCompanyCityService; - - @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; /** * 跳转到修改平台信息 @@ -428,21 +419,6 @@ //添加经营区域 addSocpe(subArr,tCompany.getId()); - - TCompany tCompany1 = tCompanyService.selectById(tCompany.getId()); - if(tCompany1.getType() == 1){ - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传平台数据 - pushMinistryOfTransportUtil.baseInfoCompanyPay();//上传网约车平台公司支付信息 - pushMinistryOfTransportUtil.baseInfoCompany(tCompany.getId()); - pushMinistryOfTransportUtil.baseInfoCompanyService(); - pushMinistryOfTransportUtil.baseInfoCompanyPermit(tCompany.getId()); - } - } - }).start(); - } return SUCCESS_TIP; } diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverBackController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverBackController.java index 8928b8c..9191044 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverBackController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverBackController.java @@ -16,7 +16,6 @@ import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.HttpRequestUtil; -import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; import com.stylefeng.guns.modular.system.util.PushURL; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.apache.poi.ss.usermodel.Cell; diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java index f687a33..d55fa2b 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java @@ -7,11 +7,7 @@ import com.stylefeng.guns.core.common.constant.factory.PageFactory; import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.core.util.ToolUtil; -import com.stylefeng.guns.modular.system.model.TPubWithdrawal; import com.stylefeng.guns.modular.system.util.OssUploadUtil; -import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.ui.Model; @@ -43,12 +39,6 @@ @Autowired private ITVersionManagementService tVersionManagementService; - - @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; /** * 跳转到版本管理首页 diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java index afd7565..bfeb95d 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java @@ -12,7 +12,6 @@ import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.HttpRequestUtil; -import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; import com.stylefeng.guns.modular.system.util.PushURL; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.springframework.beans.factory.annotation.Value; @@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.*; import org.springframework.ui.Model; import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; import javax.annotation.Resource; import java.io.BufferedReader; @@ -53,14 +51,8 @@ @Autowired private ITDriverService tDriverService; - @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - @Resource private OrderCancelMapper orderCancelMapper; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; @Value("${filePath}") private String filePath; @@ -200,16 +192,6 @@ map.put("orderType", "1"); String result = HttpRequestUtil.postRequest(PushURL.cancel_order_url, map); System.out.println("专车取消:【orderId="+tOrderPrivateCar.getId().toString()+"】,调用接口:"+result); - - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.orderCancel(tOrderPrivateCarId); - } - } - }).start(); - return SUCCESS_TIP; } diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java index 454b087..abf3301 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java @@ -8,12 +8,8 @@ import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.TServerCarmodel; -import com.stylefeng.guns.modular.system.model.User; import com.stylefeng.guns.modular.system.service.ITServerCarmodelService; -import com.stylefeng.guns.modular.system.service.IUserService; -import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; import net.sf.json.JSONObject; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -21,7 +17,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TSystemPrice; import com.stylefeng.guns.modular.system.service.ITSystemPriceService; @@ -46,15 +41,6 @@ @Autowired private ITServerCarmodelService tServerCarmodelService; - - @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - - @Autowired - private IUserService userService; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; @@ -176,14 +162,6 @@ tSystemPrice.setType(1); tSystemPrice.setState(1); tSystemPriceService.insert(tSystemPrice); - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.baseInfoCompanyFare(tSystemPrice.getId()); - } - } - }).start(); return SUCCESS_TIP; } @@ -207,14 +185,6 @@ } } tSystemPriceService.updateById(tSystemPrice); - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport) {//上传数据 - pushMinistryOfTransportUtil.baseInfoCompanyFare(tSystemPrice.getId()); - } - } - }).start(); return SUCCESS_TIP; } diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java index f8f86c5..9978e45 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java @@ -50,12 +50,6 @@ @Autowired private IUserService userService; - private Map<String, Long> loginTime = new HashMap<>(); - - private Map<String, Integer> loginFailures = new HashMap<>(); - - private List<String> ips = Arrays.asList("127.0.0.1","192.168.0.247"); - /** @@ -121,82 +115,7 @@ */ @RequestMapping(value = "/login", method = RequestMethod.POST) public String loginVali(String username, String password, String remember, Model model, HttpServletRequest request) { - String ip = request.getHeader("x-forwarded-for"); - if (ip != null && ip.length() != 0 && !"unknown".equalsIgnoreCase(ip)) { - // 多次反向代理后会有多个ip值,第一个ip才是真实ip - if (ip.indexOf(",") != -1) { - ip = ip.split(",")[0]; - } - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getHeader("Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getHeader("WL-Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getHeader("HTTP_CLIENT_IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getHeader("HTTP_X_FORWARDED_FOR"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getHeader("X-Real-IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getRemoteAddr(); - } - if(!ips.contains(ip)){ - model.addAttribute("tips", "请在特定的网络下使用系统"); - return "/login.html"; - } - - Integer f = loginFailures.get(username); - f = f == null ? 0 : f; - // 校验账号,密码是否正确,如果错误,对次数进行加1 - IShiro shiroFactory = ShiroFactroy.me(); - User user = userService.getByAccount(username); - password = AESUtils.decrypt(password); - if(null == user){ - f++; - loginFailures.put(username, f); - }else { - // 校验密码 - ShiroUser shiroUser1 = shiroFactory.shiroUser(user); - SimpleAuthenticationInfo info = shiroFactory.info(shiroUser1, user, username); - String pass = ShiroKit.md5(password, user.getSalt()); - if(!info.getCredentials().equals(pass)){ - f++; - loginFailures.put(username, f); - if(f<5){ - model.addAttribute("number", "3"); - } - if(f==5){ - model.addAttribute("number", "5"); - } - return "/login.html"; - } - } model.addAttribute("number", "3"); - /*if(f > 5 ){ - model.addAttribute("tips", "登录次数过多,请等30分钟再试!"); - if (KaptchaUtil.getKaptchaOnOff()) { - String kaptcha = super.getPara("kaptcha").trim(); - String code = (String) super.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); - if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { - throw new InvalidKaptchaException(); - } - } - return "/login.html"; - }*/ - //验证验证码是否正确 -// if (KaptchaUtil.getKaptchaOnOff()) { -// String kaptcha = super.getPara("kaptcha").trim(); -// String code = (String) super.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); -// if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { -// throw new InvalidKaptchaException(); -// } -// } Subject currentUser = ShiroKit.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(username, password.toCharArray()); @@ -207,9 +126,6 @@ // } token.setRememberMe(false);//关闭记住我功能 currentUser.login(token); - - // 登录成功,错误次数值改0 - loginFailures.put(username, 0); ShiroUser shiroUser = ShiroKit.getUser(); super.getSession().setAttribute("shiroUser", shiroUser); diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtils.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtils.java index 040d6a4..62c3b21 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtils.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtils.java @@ -27,16 +27,16 @@ * @param context * @return */ - public static String encrypt(String context) { - try { - byte[] decode = context.getBytes(CHARSET); - byte[] bytes = createKeyAndIv(decode, Cipher.ENCRYPT_MODE); - return Base64.getEncoder().encodeToString(bytes); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } +// public static String encrypt(String context) { +// try { +// byte[] decode = context.getBytes(CHARSET); +// byte[] bytes = createKeyAndIv(decode, Cipher.ENCRYPT_MODE); +// return Base64.getEncoder().encodeToString(bytes); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// return null; +// } /** * 解密 @@ -96,9 +96,9 @@ public static void main(String[] args) { String context = "zhaors"; System.out.println("元数据" + context); - String encrypt = encrypt(context); - System.out.println("加密之后:" + encrypt); - String decrypt = decrypt(encrypt); - System.out.println("解密之后:" + decrypt); +// String encrypt = encrypt(context); +// System.out.println("加密之后:" + encrypt); +// String decrypt = decrypt(encrypt); +// System.out.println("解密之后:" + decrypt); } } diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java deleted file mode 100644 index 4a4ed3d..0000000 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java +++ /dev/null @@ -1,609 +0,0 @@ -package com.stylefeng.guns.modular.system.util; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.mapper.EntityWrapper; -import com.stylefeng.guns.modular.system.dao.CarInsuranceMapper; -import com.stylefeng.guns.modular.system.dao.DriverPunishMapper; -import com.stylefeng.guns.modular.system.dao.DriverTrainMapper; -import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; -import com.stylefeng.guns.modular.system.model.*; -import com.stylefeng.guns.modular.system.service.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.*; -import java.util.regex.Pattern; - -/** - * 上传安全平台数据 - */ -@Component -public class PushMinistryOfTransportUtil { - - @Autowired - private ITCarService carService; - - @Autowired - private ITDriverService driverService; - - @Autowired - private ITCompanyService companyService; - - @Autowired - private ITSystemPriceService systemPriceService; - - @Autowired - private ITCarModelService carModelService; - - @Autowired - private ITCarBrandService carBrandService; - - @Autowired - private ITCarServiceService carServiceService; - - @Autowired - private ITVersionManagementService versionManagementService; - - @Autowired - private ITOrderPrivateCarService orderPrivateCarService; - - @Autowired - private ITComplaintService complaintService; - - @Resource - private OrderCancelMapper orderCancelMapper; - - @Autowired - private GDMapGeocodingUtil gdMapGeocodingUtil; - - @Resource - private CarInsuranceMapper carInsuranceMapper; - - @Resource - private DriverTrainMapper driverTrainMapper; - - @Resource - private DriverPunishMapper driverPunishMapper; - - - /** - * 上传企业基础信息 - */ - public void baseInfoCompany(Integer id){ - TCompany tCompany = companyService.selectById(id); - String fileName = System.currentTimeMillis() + ".jpg"; - //上传图片文件 - Map<String, String> file = new HashMap<>(); - file.put("path", "/tmp"); - file.put("fileName", fileName); - file.put("url", tCompany.getLegalPhotoUrl()); - file.put("newFilePath", "/swapfiles"); - String result_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file); - System.out.println("上传图片文件:" + result_); - - //上传数据 - JSONObject jsonObject = new JSONObject(); - jsonObject.put("CompanyName", tCompany.getName());//公司名称 - jsonObject.put("Identifier", tCompany.getIdentifier());//统一社会信用代码 - jsonObject.put("Address", Integer.valueOf(tCompany.getAddressCode()));//注册地行政区划代码 - jsonObject.put("BusinessScope", tCompany.getBusinessScope());//经营范围 - jsonObject.put("ContactAddress", tCompany.getContactAddress());//通信地址 - jsonObject.put("EconomicType", tCompany.getEconomicType());//经营业户经济类型 - jsonObject.put("RegCapital", tCompany.getRegCapital());//注册资本 - jsonObject.put("LegalName", tCompany.getLegalName());//法人代表姓名 - jsonObject.put("LegalID", tCompany.getLegalId());//法人代表身份证号 - jsonObject.put("LegalPhone", tCompany.getLegalPhone());//法人代表电话 - jsonObject.put("LegalPhoto", fileName);//法人代表身份证扫描件文件编号(.jpg) - jsonObject.put("State", 0);//状态(0:有效,1:失效) - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoCompany", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompany", map); - System.out.println("上传企业基础信息:" + result); - } - - - - - /** - * 上传网约车平台公司营运规模信息 - */ - public void baseInfoCompanyStat(){ - int state = carService.selectCount(new EntityWrapper<TCar>().eq("state", 1)); - int i = driverService.selectCount(new EntityWrapper<TDriver>().eq("authState", 2).ne("flag", 3)); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("VehicleNum", state); - jsonObject.put("DriverNum", i); - jsonObject.put("Flag", 1); - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoCompanyStat", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyStat", map); - System.out.println("上传网约车平台公司营运规模信息:" + result); - - } - - - /** - * 上传网约车平台公司支付信息 - */ - public void baseInfoCompanyPay(){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("PayName", "支付宝(中国)网络技术有限公司");//银行或者非银行支付机构名称 - jsonObject.put("PayId", "2000133000019");//非银行支付机构支付业务许可证编号 - jsonObject.put("PayType", "1");//支付业务类型 - jsonObject.put("PayScope", "全国");//业务覆盖范围 - jsonObject.put("PrepareBank", "中国工商银行");//备付金存管银行 - jsonObject.put("CountDate", 15);//结算周期 - jsonObject.put("State", 0);//状态(0:有效,1:失效) - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoCompanyPay", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyPay", map); - System.out.println("上传网约车平台公司支付信息:" + result); - } - - - /** - * 网约车平台公司服务机构 - */ - public void baseInfoCompanyService(){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", 450204);//行政区划代码 - jsonObject.put("ServiceName", "广西云森科技有限公司");//服务机构名称 - jsonObject.put("ServiceNo", "45020401");//服务机构代码 - jsonObject.put("DetailAddress", "柳州市柳邕路新翔小区二区6栋11号");//服务机构地址 - jsonObject.put("ResponsibleName", "翁克顺");//服务机构负责人姓名 - jsonObject.put("ResponsiblePhone", "13907728585");//负责人联系电话 - jsonObject.put("ManagerName", "吴志武");//服务机构管理人姓名 - jsonObject.put("ManagerPhone", "15907720083");//管理人联系电话 - jsonObject.put("ContactPhone", "0772-3633333");//服务机构紧急联系电话 - jsonObject.put("MailAddress", "柳州市城中区滨江西路15栋2号OK充电站");//行政文书送达邮寄地址 - jsonObject.put("CreateDate", "2015年09月18日");//服务机构设立日期 - jsonObject.put("State", 0);//状态(0:有效,1:失效) - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoCompanyService", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyService", map); - System.out.println("网约车平台公司服务机构:" + result); - } - - - /** - * 网约车平台公司经营许可 - * @param id - */ - public void baseInfoCompanyPermit(Integer id){ - TCompany tCompany = companyService.selectById(id); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", tCompany.getAddressCode());//许可地行政区划代码 - jsonObject.put("Certificate", tCompany.getLicenseNumber());//网络预约出租车经营许可证号 - jsonObject.put("OperationArea", "广西壮族自治区柳州市城区");//经营区域 - jsonObject.put("OwnerName", tCompany.getName());//公司名称 - jsonObject.put("Organization", tCompany.getLicensingAgency());//发证机构名称 - jsonObject.put("StartDate", tCompany.getLicenseStartTime());//有效期起YYYYMMDD - jsonObject.put("StopDate", tCompany.getLicenseEndTime());//有效期止YYYYMMDD - jsonObject.put("CertifyDate", tCompany.getLicenseTime());//初次发证日期YYYYMMDD - jsonObject.put("State", 0);//状态(0:有效,1:失效) - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoCompanyPermit", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyPermit", map); - System.out.println("网约车平台公司经营许可:" + result); - } - - - - /** - * 网约车平台公司运价信息 - */ - public void baseInfoCompanyFare(Integer id){ - TSystemPrice tSystemPrice = systemPriceService.selectById(id); - String content = tSystemPrice.getContent(); - JSONObject price = JSON.parseObject(content); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", 450204);//运价适用地行政区划代码 - jsonObject.put("FareType", id);//运价类型编码(由网约车平台公司统一编码,应确保唯一性) - jsonObject.put("FareTypeNote", tSystemPrice.getFareTypeNote());//运价类型说明 - jsonObject.put("FareValidOn", new Date());//运价有效期起YYYYMMDDhhmmss - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); - calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) +1); - jsonObject.put("FareValidOff", calendar.getTime());//运价有效止YYYYMMDDhhmmss - jsonObject.put("StartFare", Double.valueOf(price.get("num1").toString()));//起步价(元) - jsonObject.put("StartMile", Double.valueOf(price.get("num2").toString()));//起步里程(km) - jsonObject.put("UnitPricePerMile", Double.valueOf(price.get("num4").toString()));//计程单价(按公里/元) - jsonObject.put("UnitPricePerMinute", Double.valueOf(price.get("num5").toString()));//计时单价(按分钟/元) - jsonObject.put("UpPrice", Double.valueOf(price.get("num10").toString()));//单程加价单价(元) - jsonObject.put("UpPriceStartMile", Double.valueOf(price.get("num8").toString()));//单程加价公里(km) - String[] num23s = price.get("num23").toString().split(" - "); - jsonObject.put("MorningPeakTimeOn", num23s[0]);//营运早高峰时间起(HHmm 24小时) - jsonObject.put("MorningPeakTimeOff", num23s[1]);//营运早高峰时间止(HHmm 24小时) - String[] num24s = price.get("num24").toString().split(" - "); - jsonObject.put("EveningPeakTimeOn", num24s[0]);//营运晚高峰时间起(HHmm 24小时) - jsonObject.put("EveningPeakTimeOff", num24s[1]);//营运晚高峰时间止(HHmm 24小时) - jsonObject.put("OtherPeakTimeOn", "");//其他营运高峰时间起(HHmm 24小时) - jsonObject.put("OtherPeakTineOff", "");//其他营运高峰时间止(HHmm 24小时) - jsonObject.put("PeakUnitPrice", Double.valueOf(price.get("num28").toString()));//高峰时间单程加价单价(元) - jsonObject.put("PeakPriceStartMile", Double.valueOf(price.get("num8").toString()));//高峰时间单程加价公里(km) - jsonObject.put("LowSpeedPriceMinute", 0);//低速计时加价(按分钟 元) - jsonObject.put("NightPricePerMile", Double.valueOf(price.get("num18").toString()));//夜间费(按公里 元) - jsonObject.put("NightPricePerMinute", Double.valueOf(price.get("num19").toString()));//夜间费(按分钟 元) - jsonObject.put("OtherPrice", 0);//其它加价金额(元) - - jsonObject.put("State", tSystemPrice.getState() != 1 ? 1 : 0);//状态(0:有效,1:失效) - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoCompanyFare", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyFare", map); - System.out.println("网约车平台公司运价信息:" + result); - } - - - /** - * 车辆基本信息 - * @param id - */ - public void baseInfoVehicle(Integer id){ - TCar tCar = carService.selectById(id); - TCarModel tCarModel = carModelService.selectById(tCar.getCarModelId()); - TCarBrand tCarBrand = carBrandService.selectById(tCar.getCarBrandId()); - TCarService tCarService = carServiceService.selectOne(new EntityWrapper<TCarService>().eq("carId", id).eq("type", 1)); - TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>() - .eq("type", 1) - .eq("serverCarModelId", tCarService.getServerCarModelId()) - .eq("companyId", (tCar.getFranchiseeId() == null || tCar.getFranchiseeId() == 0) ? tCar.getCompanyId() : tCar.getFranchiseeId()).eq("state", 1)); - - String fileName = System.currentTimeMillis() + ".jpg"; - //上传图片文件 - Map<String, String> file = new HashMap<>(); - file.put("path", "/tmp"); - file.put("fileName", fileName); - file.put("url", tCar.getCarPhoto()); - file.put("newFilePath", "/swapfiles"); - String result_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file); - System.out.println("上传图片文件:" + result_); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", 450204);//车辆所在城市行政区划代码 - jsonObject.put("VehicleNo", tCar.getCarLicensePlate());//车辆号牌 - jsonObject.put("PlateColor", tCar.getPlateColor());//车牌颜色 - jsonObject.put("Seats", tCarModel.getSeat());//核定载客位 - jsonObject.put("Brand", tCarBrand.getName());//车辆厂牌 - jsonObject.put("Model", tCarModel.getName());//车辆型号 - jsonObject.put("VehicleType", tCar.getVehicleType());//车辆类型(以机动车行驶证为准) - jsonObject.put("OwnerName", tCar.getOwnerName());//车辆所有人(以机动车行驶证为准) - jsonObject.put("VehicleColor", tCar.getCarColor());//车身颜色 - jsonObject.put("EngineId", tCar.getEngineId());//发动机号(以机动车行驶证为准) - jsonObject.put("VIN", tCar.getVIN());//车辆VIN码(以机动车行驶证为准) - jsonObject.put("CertifyDateA", tCar.getCertifyDateA());//车辆注册日期(以机动车行驶证为准)YYYY-MM-DD - jsonObject.put("FuelType", tCar.getFuelType());//车辆燃料类型 - jsonObject.put("EngineDisplace", tCar.getEngineDisplace());//发送机排量(毫升) - jsonObject.put("PhotoId", fileName);//车辆照片文件编号 - jsonObject.put("Certificate", tCar.getCertificate());//运输证字号 - jsonObject.put("TransAgency", tCar.getTransAgency());//车辆运输证发证机构 - jsonObject.put("TransArea", tCar.getTransArea());//车辆经营区域 - jsonObject.put("TransDateStart", tCar.getTransDateStart());//车辆运输证有效期起YYYYMMDD - jsonObject.put("TransDateStop", tCar.getTransDateStop());//车辆运输证有效期止YYYYMMDD - jsonObject.put("CertifyDateB", tCar.getCertifyDateB());//车辆初次登记日期YYYY-MM-DD - jsonObject.put("FixState", tCar.getFixState());//车辆维修状态(0:未检修,1:已检修,2:未知) - jsonObject.put("NextFixDate", tCar.getNextFixDate());//车辆下次年检时间YYYY-MM-DD - jsonObject.put("CheckState", tCar.getCheckState());//车辆年度审验状态 - jsonObject.put("FeePrintId", tCar.getFeePrintId());//发票打印设备序列号 - jsonObject.put("GPSBrand", tCar.getGPSBrand());//卫星定位装置品牌 - jsonObject.put("GPSModel", tCar.getGPSModel());//卫星定位装置型号 - jsonObject.put("GPSIMEI", tCar.getGPSIMEI());//卫星定位装置IMEI号 - jsonObject.put("GPSInstallDate", tCar.getGPSInstallDate());//卫星定位设备安装日期YYYYMMDD - jsonObject.put("RegisterDate", tCar.getRegisterDate());//报备日期(车辆信息向服务所在地出租车行政主管部门报备日期YYYYMMDD) - jsonObject.put("CommercialType", Integer.valueOf(tCar.getCommercialType()));//服务类型(1:网络预约出租车,2:巡游出租汽车,3:私人小客车合乘) - jsonObject.put("FareType", null == tSystemPrice ? "" : tSystemPrice.getId());//运价类型编码(与运价信息中一一对应) - jsonObject.put("State", tCar.getState() == 1 ? 0 : 1);//状态(0:有效,1:失效) - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date());//YYYYMMDDhhmmss - Map<String, String> map = new HashMap<>(); - map.put("baseInfoVehicle", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoVehicle", map); - System.out.println("车辆基本信息:" + result); - } - - - /** - * 车辆保险信息 - */ - public void baseInfoVehicleInsurance(Integer id, Integer flag){ - CarInsurance carInsurance = carInsuranceMapper.selectById(id); - TCar tCar = carService.selectById(carInsurance.getCarId()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("VehicleNo", tCar.getCarLicensePlate());//车辆号牌 - jsonObject.put("InsurCom", carInsurance.getInsurCom());//保险公司名称 - jsonObject.put("InsurNum", carInsurance.getInsurNum());//保险号 - jsonObject.put("InsurType", carInsurance.getInsurType());//保险类型 - jsonObject.put("InsurCount", carInsurance.getInsurCount());//保险金额(元) - jsonObject.put("InsurEff", carInsurance.getInsurEff());//保险生效时间YYYYMMDD - jsonObject.put("InsurExp", carInsurance.getInsurExp());//保险到期时间YYYYMMDD - jsonObject.put("Flag", flag);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoVehicleInsurance", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoVehicleInsurance", map); - System.out.println("车辆保险信息:" + result); - } - - - /** - * 驾驶员基本信息 - * @param driverId - */ - public void baseInfoDriver(Integer driverId){ - TDriver tDriver = driverService.selectById(driverId); - - //上传图片文件 - String fileName = System.currentTimeMillis() + ".jpg"; - Map<String, String> file = new HashMap<>(); - file.put("path", "/tmp"); - file.put("fileName", fileName); -// file.put("url", tDriver.getHeadImgUrl()); - file.put("newFilePath", "/swapfiles"); - String result_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file); - System.out.println("上传图片文件:" + result_); - - String fileName1 = System.currentTimeMillis() + ".jpg"; - Map<String, String> file1 = new HashMap<>(); - file1.put("path", "/tmp"); - file1.put("fileName", fileName1); -// file1.put("url", tDriver.getDriveCardImgUrl()); - file1.put("newFilePath", "/swapfiles"); - String result1_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file1); - System.out.println("上传图片文件:" + result1_); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", 450204);//注册地行政区划代码 - jsonObject.put("DriverName", tDriver.getName());//机动车驾驶员姓名 - jsonObject.put("DriverPhone", tDriver.getPhone());//驾驶员手机号 - jsonObject.put("DriverGender", (tDriver.getSex() == 1 ? "男" : "女"));//驾驶员性别 -// jsonObject.put("DriverBirthday", tDriver.getBirthday());//出生日期YYYYMMDD -// jsonObject.put("DriverNationality", tDriver.getDriverNationality());//国籍 -// jsonObject.put("DriverNation", tDriver.getDriverNation());//驾驶员民族 -// jsonObject.put("DriverMaritalStatus", (tDriver.getDriverMaritalStatus() == 1 ? "未婚" : tDriver.getDriverMaritalStatus() == 2 ? "已婚" : "离异"));//驾驶员婚姻状况(未婚,已婚,离异) -// jsonObject.put("DriverLanguageLevel", tDriver.getDriverLanguageLevel());//驾驶员外语能力 -// jsonObject.put("DriverEducation", tDriver.getDriverEducation());//驾驶员学历 -// jsonObject.put("DriverCensus", tDriver.getDriverCensus());//户口登记机关名称 -// jsonObject.put("DriverAddress", tDriver.getDriverAddress());//户口住址或长住地址 -// jsonObject.put("DriverContactAddress", tDriver.getDriverContactAddress());//驾驶员通信地址 -// jsonObject.put("PhotoId", fileName);//驾驶员照片文件编号 -// jsonObject.put("LicenseId", tDriver.getDriveCard());//机动车驾驶证号 -// jsonObject.put("LicensePhotoId", fileName1);//机动车驾驶证扫描件文件编号 -// jsonObject.put("DriverType", tDriver.getDriverType());//准驾车型 -// jsonObject.put("GetDriverLicenseDate", tDriver.getGetDriverLicenseDate());//初次领取驾驶证日期YYYYMMDD -// jsonObject.put("DriverLicenseOn", tDriver.getDriverLicenseOn());//驾驶证有效期限起YYYYMMDD -// jsonObject.put("DriverLicenseOff", tDriver.getDriverLicenseOff());//驾驶证有效期限止YYYYMMDD -// jsonObject.put("TaxiDriver", tDriver.getTaxiDriver() == 0 ? 2 : 1);//是否巡游出租汽车驾驶员(1:是,2:否) -// jsonObject.put("CertificateNo", tDriver.getTaxiAptitudeCard());//网络预约出租汽车驾驶员资格证号 -// jsonObject.put("NetworkCarIssueOrganization", tDriver.getNetworkCarlssueOrganization());//网络预约出租汽车驾驶员证发证机构 -// jsonObject.put("NetworkCarIssueDate", tDriver.getNetworkCarlssueDate());//资格证发证日期YYYYMMDD -// jsonObject.put("GetNetworkCarProofDate", tDriver.getGetNetworkCarProofDate());//初次领取资格证日期YYYYMMDD -// jsonObject.put("NetworkCarProofOn", tDriver.getNetworkCarProofOn());//资格证有效起始日期YYYYMMDD -// jsonObject.put("NetworkCarProofOff", tDriver.getNetworkCarProofOff());//资格证有截止日期YYYYMMDD -// jsonObject.put("RegisterDate", tDriver.getRegisterDate());//报备日期(驾驶员信息向服务所在地出租车行政主管部门报备日期) -// jsonObject.put("FullTimeDriver", tDriver.getFullTimeDriver());//是否专职驾驶员(1:是,0:否) -// jsonObject.put("InDriverBlacklist", tDriver.getInDriverBlacklist());//是否在驾驶员黑名单内(1:是,0:否) -// jsonObject.put("CommercialType", tDriver.getCommercialType());//服务类型(1:网络预约出租汽车,2:巡游出租汽车,3:私人小客车合乘) -// jsonObject.put("ContractCompany", tDriver.getContractCompany());//驾驶员合同签署公司 -// jsonObject.put("ContractOn", tDriver.getContractOn());//合同有效期起YYYYMMDD -// jsonObject.put("ContractOff", tDriver.getContractOff());//合同有效期止YYYYMMDD -// jsonObject.put("EmergencyContact", tDriver.getEmergencyContact());//紧急情况联系人 -// jsonObject.put("EmergencyContactPhone", tDriver.getEmergencyContactPhone());//紧急情况联系人电话 -// jsonObject.put("EmergencyContactAddress", tDriver.getEmergencyContactAddress());//紧急情况联系人通信地址 -// -// jsonObject.put("State", tDriver.getAuthState() == 2 ? 0 : 1);//状态(0:有效,1:失效) -// jsonObject.put("Flag", tDriver.getFlag());//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoDriver", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriver", map); - System.out.println("驾驶员基本信息:" + result); - } - - - /** - * 网约车驾驶员培训信息 - * @param id - * @param id - */ - public void baseInfoDriverEducate(Integer id, Integer flag){ - DriverTrain driverTrain = driverTrainMapper.selectById(id); - TDriver driver = driverService.selectById(driverTrain.getDriverId()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", 450204);//注册地行政区划代码 -// jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 - jsonObject.put("CourseName", driverTrain.getCourseName());//驾驶员培训课程名称 - jsonObject.put("CourseDate", driverTrain.getCourseDate());//培训课程日期YYYYMMDD - jsonObject.put("StartTime", driverTrain.getStartTime());//培训开始时间 - jsonObject.put("StopTime", driverTrain.getStopTime());//培训结束时间 - jsonObject.put("Duration", driverTrain.getDuration());//培训时长 - jsonObject.put("Flag", flag);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoDriverEducate", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriverEducate", map); - System.out.println("网约车驾驶员培训信息:" + result); - } - - - /** - * 驾驶员移动终端信息 - * @param driverId - */ - public void baseInfoDriverApp(Integer driverId){ - TDriver tDriver = driverService.selectById(driverId); - TVersionManagement type = versionManagementService.selectOne(new EntityWrapper<TVersionManagement>().eq("type", 2).orderBy("insertTime desc limit 0, 1")); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", 450204);//注册地行政区划代码 -// jsonObject.put("LicenseId", tDriver.getDriveCard());//机动车驾驶证号 - jsonObject.put("DriverPhone", tDriver.getPhone());//驾驶员手机号 - jsonObject.put("NetType", phoneExp(tDriver.getPhone()));//手机运营商(1:中国联通,2:中国移动,3:中国电信,4:其他) - jsonObject.put("AppVersion", type.getVersion());//使用APP版本号 - jsonObject.put("MapType", 2);//使用地图类型(1:百度地图,2:高德地图,3:其他) - jsonObject.put("State", 0);//状态(0:有效,1:失效) - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoDriverApp", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriverApp", map); - System.out.println("驾驶员移动终端信息:" + result); - } - - - /** - * 驾驶员统计信息 - * @param driverId - */ - public void baseInfoDriverStat(Integer driverId){ - TDriver tDriver = driverService.selectById(driverId); - Calendar s = Calendar.getInstance(); - s.setTime(new Date()); - s.set(s.get(Calendar.YEAR), s.get(Calendar.MONTH) - 1, 1, 0, 0, 0); - - Calendar e = Calendar.getInstance(); - e.setTime(new Date()); - e.set(e.get(Calendar.YEAR), e.get(Calendar.MONTH) - 1, e.getActualMaximum(Calendar.DAY_OF_MONTH), 23, 59, 59); - - int i = orderPrivateCarService.selectCount( - new EntityWrapper<TOrderPrivateCar>() - .eq("driverId", driverId) - .in("state", Arrays.asList(6, 7, 8, 9)) - .between("travelTime", s.getTime(), e.getTime()) - ); - int i1 = complaintService.selectCount( - new EntityWrapper<TComplaint>() - .eq("driverId", driverId) - .between("insert_time", s.getTime(), e.getTime()) - ); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", 450204);//注册地行政区划代码 -// jsonObject.put("LicenseId", tDriver.getDriveCard());//机动车驾驶证号 - jsonObject.put("Cycle", s.getTime());//统计周期(统计周期按月,内容填写统计月份YYYYMM) - jsonObject.put("OrderCount", i);//完成订单次数 - jsonObject.put("TrafficViolationCount", 0);//交通违章次数 - jsonObject.put("ComplainedCount", i1);//被投诉次数 - jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) - jsonObject.put("UpdateTime", new Date()); - Map<String, String> map = new HashMap<>(); - map.put("baseInfoDriverStat", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriverStat", map); - System.out.println("驾驶员统计信息:" + result); - } - - - /** - * 订单撤销接口 - * @param orderId - */ - public void orderCancel(Integer orderId){ - TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(orderId); - TDriver driver = driverService.selectById(tOrderPrivateCar.getDriverId()); - OrderCancel query = orderCancelMapper.query(orderId, 1, null, null, 2); - Map<String, String> geocode = null; - try { - geocode = gdMapGeocodingUtil.geocode(tOrderPrivateCar.getBoardingLon().toString(), - tOrderPrivateCar.getBoardingLat().toString()); - } catch (Exception e) { - e.printStackTrace(); - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("Address", Integer.valueOf(geocode.get("districtCode")));//上车地点行政区划代码 - jsonObject.put("OrderId", tOrderPrivateCar.getOrderNum());//订单编号 - jsonObject.put("OrderTime", tOrderPrivateCar.getOrderNum());//订单时间YYYYMMDDhhmmss - jsonObject.put("CancelTime", query.getInsertTime());//订单撤销时间YYYYMMDDhhmmss - jsonObject.put("Operator", "3");//撤销发起方(1:乘客,2:驾驶员,3:平台公司) -// jsonObject.put("CancelTypeCode", null != driver ? driver.getDriveCard() : "");//机动车驾驶证编号 - jsonObject.put("CancelReason", query.getReason());//撤销或违约原因 - Map<String, String> map = new HashMap<>(); - map.put("orderCancel", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/orderCancel", map); - System.out.println("订单撤销接口:" + result); - } - - - /** - * 乘客投诉信息 - * @param id - */ - /*public void ratedPassengerComplaint(Integer id){ - TComplaint tComplaint = complaintService.selectById(id); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("OrderId", "");//订单号 - jsonObject.put("ComplaintTime", tComplaint.getInsertTime());//投诉时间YYYYMMDDhhmms - jsonObject.put("Detail", tComplaint.getReason());//投诉内容 - jsonObject.put("Result", tComplaint.getHandleResult());//处理结果 - Map<String, String> map = new HashMap<>(); - map.put("ratedPassengerComplaint", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/ratedPassengerComplaint", map); - System.out.println("乘客投诉信息:" + result); - }*/ - - - /** - * 驾驶员处罚信息 - * @param id - */ - public void ratedDriverPunish(Integer id){ - DriverPunish driverPunish = driverPunishMapper.selectById(id); - TDriver driver = driverService.selectById(driverPunish.getDriverId()); - JSONObject jsonObject = new JSONObject(); -// jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证编号 - jsonObject.put("PunishTime", driverPunish.getPunishTime());//处罚时间YYYYMMDDhhmms - jsonObject.put("PunishReason", driverPunish.getPunishReason());//处罚原因 - jsonObject.put("PunishReault", driverPunish.getPunishReault());//处罚结果 - Map<String, String> map = new HashMap<>(); - map.put("ratedDriverPunish", jsonObject.toJSONString()); - String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/ratedDriverPunish", map); - System.out.println("驾驶员处罚信息:" + result); - } - - - - - - - private int phoneExp(String phone){ - /** - * 中国移动号码正则 - * 139、138、137、136、135、134、147、150、151、152、157、158、159、178、182、183、184、187、188、198、195 - * 虚拟运营商号段: 1703、1705、1706、165 - **/ - String MOBILE_PATTERN = "(^1(3[4-9]|47|5[0-27-9]|65|78|8[2-478]|98)\\d{8}$)|(^170[356]\\d{7}$)"; - - /** - * 中国电信号码正则 - * 133、149、153、173、177、180、181、189、199、191 - * 虚拟运营商号段: 162、1700、1701、1702 - **/ - String TELECOM_PATTERN = "(^1(33|49|53|62|7[37]|8[019]|9[19])\\d{8}$)|(^170[012]\\d{7}$)"; - - /** - * 中国联通号码正则 - * 130、131、132、155、156、185、186、145、175、176、166、140 - * 虚拟运营商号段: 171、1707、1708、1709、167 - **/ - String UNICOM_PATTERN = "(^1(3[0-2]|4[05]|5[56]|6[67]|7[156]|8[56])\\d{8}$)|(^170[7-9]\\d{7}$)"; - if(Pattern.matches(UNICOM_PATTERN, phone)){ - return 1; - } - if(Pattern.matches(MOBILE_PATTERN, phone)){ - return 2; - } - if(Pattern.matches(TELECOM_PATTERN, phone)){ - return 3; - } - return 4; - } -} diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java index 411a367..e2fa3af 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java @@ -1,22 +1,10 @@ package com.stylefeng.guns.modular.system.util; public class PushURL { - public static String zull_user_url = "https://okyueche.com:443"; + public static String zull_user_url = "http://127.0.0.1:81"; public static String order_push_url = zull_user_url + "/driver/base/order/pushOrderState"; public static String driver_auth_url = zull_user_url + "/driver/base/driver/sendsms"; public static String withdraw_auth_url = zull_user_url + "/driver/base/withdrawal/withdrawalAudit"; public static String cancel_order_url = zull_user_url + "/user/base/order/sendOrderState"; public static String freeze_user_url = zull_user_url + "/user/base/user/freeze"; - public static String ministry_of_transport_data = "http://120.77.11.218:8868/ministryOfTransport"; - public static String ministry_of_transport_ftp = "http://120.77.11.218:8868/ftp"; - - -// public static String zull_user_url = "http://127.0.0.1:80"; -// public static String order_push_url = zull_user_url + "/driver/base/order/pushOrderState"; -// public static String driver_auth_url = zull_user_url + "/driver/base/driver/sendsms"; -// public static String withdraw_auth_url = zull_user_url + "/driver/base/withdrawal/withdrawalAudit"; -// public static String cancel_order_url = zull_user_url + "/user/base/order/sendOrderState"; -// public static String freeze_user_url = zull_user_url + "/user/base/user/freeze"; -// public static String ministry_of_transport_data = "http://120.77.11.218:8868/ministryOfTransport"; -// public static String ministry_of_transport_ftp = "http://120.77.11.218:8868/ftp"; } diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java index fe42e7e..cccc60c 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java @@ -24,12 +24,6 @@ private ITLocationService locationService; @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; - - @Autowired private ITDriverService driverService; @@ -53,25 +47,6 @@ public void taskDay(){ try { locationService.updateFence();//更新线上电子围栏 - }catch (Exception e){ - e.printStackTrace(); - } - } - - - - /** - * 每月第一天的1点执行的任务 - */ - @Scheduled(cron = "0 0 1 1 * *") - public void taskMonth(){ - try { - if(pushMinistryOfTransport){ - List<TDriver> tDrivers = driverService.selectList(new EntityWrapper<TDriver>().eq("authState", 2).ne("flag", 3)); - for(TDriver driver : tDrivers){ - pushMinistryOfTransportUtil.baseInfoDriverStat(driver.getId()); - } - } }catch (Exception e){ e.printStackTrace(); } diff --git a/management/guns-admin/src/main/resources/application.yml b/management/guns-admin/src/main/resources/application.yml index e85eaca..ff217c0 100644 --- a/management/guns-admin/src/main/resources/application.yml +++ b/management/guns-admin/src/main/resources/application.yml @@ -16,12 +16,6 @@ spring: profiles: active: local -# datasource: -# url: jdbc:mysql://192.168.0.80:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 -# username: root -# password: 123456 -# db-name: super_save_driving #用来搜集数据库的所有表 -# filters: wall,mergeStat mvc: static-path-pattern: /static/** view: @@ -52,8 +46,8 @@ log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl #输出Sql,如需打印Sql注释该配置 wx: conf: - appId: wx3613e8d4c8624ea1 - secret: 25782eabe39e796a92d2fcb38947e7dc + appId: wx8a9af3889395d0e1 + secret: 95a34f114973298cce4297a20bb59bc3 #eureka: # client: @@ -65,22 +59,13 @@ --- -#spring: -# profiles: local -# datasource: -# url: jdbc:mysql://Rm-wz9rpe0t74ys3b1h8go.mysql.rds.aliyuncs.com:3306/oktravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai -# username: root -# password: Root2020! -# db-name: guns #用来搜集数据库的所有表 -# filters: wall,mergeStat - - spring: profiles: local datasource: - url: jdbc:mysql://192.168.110.80:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 + url: jdbc:mysql://127.0.0.1:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 username: root - password: 123456 + password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj +# password: 123456 db-name: super_save_driving #用来搜集数据库的所有表 filters: wall,mergeStat @@ -110,9 +95,9 @@ --- -filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 +filePath: /usr/local/server/app/orderPostionFile/ #存储订单轨迹文件路径 #filePath: C:/orderPostionFile/ #存储订单轨迹文件路径 #交通部推送数据功能开关 -pushMinistryOfTransport: true \ No newline at end of file +pushMinistryOfTransport: false \ No newline at end of file diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/login.html b/management/guns-admin/src/main/webapp/WEB-INF/view/login.html index c7c9ea8..9c823f5 100644 --- a/management/guns-admin/src/main/webapp/WEB-INF/view/login.html +++ b/management/guns-admin/src/main/webapp/WEB-INF/view/login.html @@ -55,7 +55,7 @@ <div style="display: flex;align-items: center;justify-content: center;height: 100%"> -<!--<img src="${ctxPath}/static/img/index4.png" style="width: 300px;height: 400px;z-index: 1000">--> +<img src="${ctxPath}/static/img/login.png" style="width: 300px;height: 400px;z-index: 1000;border-radius: 10px;"> <div style="position: relative;left: -20px; max-width: 300px;min-height: 300px;background: white;border-radius: 8px;box-sizing: border-box;padding: 0 30px 0 50px;display: flex;align-items: center;justify-content: center;"> <div style="max-height: 100%"> <h3 style="color: black;"><img src="${ctxPath}/static/img/logo.png" width="30px" height="30px"/> 超省新代驾管理后台</h3> @@ -145,9 +145,9 @@ return decryptedStr.toString(); } function login(){ - let password = $('#password').val(); - password = encrypt(password); - $('#password').val(password); + // let password = $('#password').val(); + // password = encrypt(password); + // $('#password').val(password); $('#submit').submit(); } diff --git a/management/guns-admin/src/main/webapp/static/favicon1.ico b/management/guns-admin/src/main/webapp/static/favicon1.ico index f628e5d..44af479 100644 --- a/management/guns-admin/src/main/webapp/static/favicon1.ico +++ b/management/guns-admin/src/main/webapp/static/favicon1.ico Binary files differ diff --git a/management/guns-admin/src/main/webapp/static/img/icon100.png b/management/guns-admin/src/main/webapp/static/img/icon100.png deleted file mode 100644 index adcfcb6..0000000 --- a/management/guns-admin/src/main/webapp/static/img/icon100.png +++ /dev/null Binary files differ diff --git a/management/guns-admin/src/main/webapp/static/img/index4.png b/management/guns-admin/src/main/webapp/static/img/index4.png deleted file mode 100644 index ece22c7..0000000 --- a/management/guns-admin/src/main/webapp/static/img/index4.png +++ /dev/null Binary files differ diff --git a/management/guns-admin/src/main/webapp/static/img/login.png b/management/guns-admin/src/main/webapp/static/img/login.png new file mode 100644 index 0000000..a64548b --- /dev/null +++ b/management/guns-admin/src/main/webapp/static/img/login.png Binary files differ diff --git a/management/guns-admin/src/main/webapp/static/img/logo.png b/management/guns-admin/src/main/webapp/static/img/logo.png index f628e5d..995e034 100644 --- a/management/guns-admin/src/main/webapp/static/img/logo.png +++ b/management/guns-admin/src/main/webapp/static/img/logo.png Binary files differ -- Gitblit v1.7.1