| | |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.OrderUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.AddAccountInfoRequest; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.ModifyTravelItineraryRequest; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.ZhengLianUtil; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.model.TradeTerminalInfo; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.model.ZLUserInfo; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.net.InetAddress; |
| | | import java.net.NetworkInterface; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryOrderList(Integer state, Integer pageNum, Integer size, Integer uid) throws Exception { |
| | | Driver driver = driverService.selectById(uid); |
| | | //获取证联数据 |
| | | if(null == driver.getCustId() || 0 == driver.getAccOpenFlag()){ |
| | | TradeTerminalInfo tradeTerminalInfo = new TradeTerminalInfo(); |
| | | tradeTerminalInfo.setTerminal("1"); |
| | | InetAddress inetAddress = InetAddress.getLocalHost(); |
| | | String ip = inetAddress.getHostAddress(); |
| | | tradeTerminalInfo.setIp(ip); |
| | | NetworkInterface networkInterface = NetworkInterface.getByInetAddress(inetAddress); |
| | | byte[] mac = networkInterface.getHardwareAddress(); |
| | | StringBuilder macAddress = new StringBuilder(); |
| | | for (int i = 0; i < mac.length; i++) { |
| | | macAddress.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); |
| | | } |
| | | |
| | | tradeTerminalInfo.setMac(macAddress.toString()); |
| | | ZLUserInfo userInfo = ZhengLianUtil.getUserInfo(driver.getEmpId().toString(), tradeTerminalInfo); |
| | | if(null != userInfo){ |
| | | driver.setCustId(userInfo.getCustId()); |
| | | driver.setAccOpenFlag(userInfo.getAccOpenFlag()); |
| | | driverService.updateById(driver); |
| | | } |
| | | } |
| | | //同步到中台 |
| | | if(null != driver.getAccOpenFlag() && 1 == driver.getAccOpenFlag() && 0 == driver.getIsSynchronous()){ |
| | | AddAccountInfoRequest request = new AddAccountInfoRequest(); |
| | | request.setCustId(driver.getCustId()); |
| | | request.setAccountNo(driver.getEmpId().toString()); |
| | | request.setAccountName(driver.getName()); |
| | | request.setMobile(driver.getPhone()); |
| | | Integer status = EmployeeUtil.addAccountInfo(request); |
| | | if(0 == status){ |
| | | driver.setIsSynchronous(1); |
| | | driverService.updateById(driver); |
| | | } |
| | | } |
| | | |
| | | |
| | | Integer page = pageNum; |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> datas = new ArrayList<>(); |