rk
7 天以前 832e40a8249ae15a5b2a7f01c78da4edc06cd55e
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkSketchServiceImpl.java
@@ -1,37 +1,40 @@
package com.doumee.service.business.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.annotation.excel.ExcelImporter;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.admin.request.JkCustomerImport;
import com.doumee.core.tsp.*;
import com.doumee.core.utils.*;
import com.doumee.core.wms.model.response.WmsBaseDataResponse;
import com.doumee.core.wms.model.response.WmsBaseResponse;
import com.doumee.dao.admin.request.JkOrdersImport;
import com.doumee.dao.business.*;
import com.doumee.dao.business.model.*;
import com.doumee.service.business.third.model.LoginUserInfo;
import com.doumee.service.business.third.model.PageData;
import com.doumee.service.business.third.model.PageWrap;
import com.doumee.core.utils.Utils;
import com.doumee.service.business.JkSketchService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import netscape.javascript.JSObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
@@ -85,10 +88,366 @@
        }
        jkSketchMapper.deleteBatchIds(ids);
    }
    //线路优化
    @Override
    public JkSketch updateById(JkSketch jkSketch ) {
        JkSketch model = jkSketchMapper.selectById(jkSketch.getId());
        if(model == null ||Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if( model.getDateInfo() ==  null){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该线路日期信息不正确,不支持优化!");
        }
       if(Constants.equalsInteger(Constants.ZERO,jkSketch.getForceUpdate()) && Constants.equalsInteger(model.getStatus(),Constants.ONE)){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该线路存在正在优化中,请耐心等待优化完成或者选择强制优化操作!");
        }
         if(  jkSketch.getLineIdList() ==null || jkSketch.getLineIdList().size()==0 ){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请选择有效合理的线路进行优化操作!");
        }
        //当前所有线路(符合条件的线路)
        List<JkLine> lineList =  jkLineMapper.selectJoinList(JkLine.class,new MPJLambdaWrapper<JkLine>()
                .selectAll(JkLine.class)
                .eq(JkLine::getWeeks,DateUtil.getWeekZhouOfDate(model.getDateInfo()))//只能选择当前的线路
                .eq(JkLine::getIsdeleted,Constants.ZERO)
                .in(JkLine::getId,jkSketch.getLineIdList())
        );
        Integer totalCus = 0,totalNum =0;
        for(JkLine line :lineList){
            totalCus += Constants.formatIntegerNum(line.getMaxCustomer());//总客户量
            totalNum += Constants.formatIntegerNum(line.getMaxOrder());//总送货量
        }
        if( totalCus < Constants.formatIntegerNum(model.getOrderNum())  ){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"该线路订单客户数量超过了线路总客户量限制,无法进行优化!");
        }
        if( totalNum < Constants.formatBigdecimal(model.getTotalNum()).doubleValue()){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"该线路订单送货量超过了线路总送货量限制,无法进行优化!");
        }
        model.setLineList(lineList);//线路集合
        model.setCustomerList(checkJketchCustomerLocation(model));//订单集合
        model.setStatus(Constants.ONE);
        model.setPlanLineNum(lineList.size());
        model.setEditDate(new Date());
        model.setEditor(jkSketch.getLoginUserInfo().getId());
        model.setPlanLineDate(model.getEditDate());
        model.setPlanLineUserId(jkSketch.getLoginUserInfo().getId());
        model.setJobId(UUID.randomUUID().toString());
        redisTemplate.opsForValue().set(Constants.RedisKeys.JKLINE_JOB+model.getJobId(),true );//做异步处理
        jkSketchMapper.updateById(model);
        return model;
    }
    @Override
    public void updateById(JkSketch jkSketch) {
        jkSketchMapper.updateById(jkSketch);
    @Async
    public void startUpdateLineAsync(JkSketch model) {
        try {
            initCustomerDistance(model);
            List<JkSketchCustomer> customerList = model.getCustomerList();
            List<JkLine> lineList = model.getLineList();
            TspSolver.DataModel dataModel = new TspSolver.DataModel();
            int vehicleNumber1 = lineList.size();//线路数量
            long[] vehicleCapacities1=new long[lineList.size()];//每辆车的最大订单量限制
            long[] demands1 = new long[customerList.size()+1]; //各个点的订单量
            long[][] distanceMatrix1 = new long[customerList.size()+1][customerList.size()+1];
            demands1[0] =0;//原点
            double cLatitude =0;
            double cLongitude =0;
            String location = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.COMPANY_LOCATION).getCode();
            try {
                String[] ss = location.split(",");
                cLongitude = Double.parseDouble(ss[0]);
                cLatitude = Double.parseDouble(ss[1]);
            }catch (Exception e){
            }
            for (int i = 0; i < customerList.size(); i++) {
                distanceMatrix1[0][i] =  DistanceCalculator.calculateDistance(cLatitude,cLongitude,customerList.get(i).getLatitude().doubleValue(),customerList.get(i).getLongitude().doubleValue())/1000;
                distanceMatrix1[i][0] = distanceMatrix1[0][i];
                demands1[i+1] = Constants.formatBigdecimal( customerList.get(i).getTotalNum()).longValue();  //各个点的订单量
                List<Map<String,Object>> disList = customerList.get(i).getDistanceList();
                for (int j = 0; j< disList.size(); j++) {
                    if(disList.size()>j){
                        distanceMatrix1[i+1][j+1]  = (Long) disList.get(j).get("b")/1000;//构造距离矩阵
                    }else{
                        distanceMatrix1[i+1][j+1]  = 1l;
                    }
                }
            }
            for (int i = 0; i < lineList.size(); i++) {
                vehicleCapacities1[i] = lineList.get(i).getMaxOrder();//每辆车的最大订单量限制
            }
            //构造优化数据模型
            dataModel.initDataInfo(vehicleNumber1,demands1,vehicleCapacities1,distanceMatrix1);
            TspSolver.startSearch(dataModel);
            dealSearchSolution(model,dataModel);
        }catch (Exception e){
            e.printStackTrace();
            jkSketchMapper.update(null,new UpdateWrapper<JkSketch>().lambda()
                    .eq(JkSketch::getId,model.getId() )
                    .eq(JkSketch::getJobId,model.getJobId() )
                    .set(JkSketch::getPlanLineInfo,"最近一次线路优化失败!")
                    .set(JkSketch::getStatus,Constants.THREE)
                    .set(JkSketch::getPlanLineEndDate,new Date()));
        }
    }
    private void initCustomerDistance(JkSketch model) {
        String url = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.GAODE_LOCATION_GEOAPI_URL).getCode();
        List<JkCustomer> updateCustomerList = new ArrayList<>();
        List<JkSketchCustomer> customerList = model.getCustomerList();
        for(JkSketchCustomer c : customerList){
            List<DistanceMapParam> tmpList = new ArrayList<>();
            List<DistanceMapParam> distanceMapParamList  = getListFromJsonStr(c.getDistanceJson());
            for(JkSketchCustomer cm : customerList){
                boolean isNew = false;
                DistanceMapParam t = new DistanceMapParam();
                t.setId(cm.getId());
                DistanceMapParam param = getParamByCustomerIds( cm.getId(),distanceMapParamList);
                if(param!=null){//如果之前已经获取过
                    t = param;
                }else{
                    isNew = true;
                    if(Constants.equalsInteger(c.getCustomerId(),cm.getCustomerId())){
                        t.setDistance(0l);
                    }else{
                        DistanceModel dm = DistanceCalculator.calculateDistanceGaode(url,c,cm);
                        t.setDistance(dm.getDistance() );
                        if(dm.getLocations().size()>0){
                            //如果有路径信息
                        }
                    }
                }
                tmpList.add(t);
                if(isNew){//
                    JkCustomer u =new JkCustomer();
                    u.setId(c.getId());
                    u.setDistance(JSONObject.toJSONString(tmpList));
                }
            }
            c.setDistanceMapParamList(tmpList);
        }
        if(updateCustomerList.size()>0){
            for(JkCustomer c : updateCustomerList){
                jkCustomerMapper.updateById(c);//更新客户与其他点之间的距离
            }
        }
    }
    private DistanceMapParam getParamByCustomerIds(  Integer id1, List<DistanceMapParam> distanceMapParamList) {
        if(distanceMapParamList!=null){
            for(DistanceMapParam p :distanceMapParamList){
                if(Constants.equalsInteger(p.getId(),id1)){
                    return p;
                }
            }
        }
        return null;
    }
    private List<DistanceMapParam> getListFromJsonStr(String distanceJson) {
        try {
            return  JSONObject.parseObject(distanceJson, new TypeReference<List<DistanceMapParam>>(){}.getType());
        }catch (Exception e){
        }
        return new ArrayList<>();
    }
    private void dealSearchSolution(JkSketch model, TspSolver.DataModel dataModel) {
        Date date = new Date();
        List<TspSolverSolutions> solutions = dataModel.getSolutions();
        List<JkSketchLine> sketchLineList = new ArrayList<>();
        List<JkSketchCustomer> sketchCustomerList  = new ArrayList<>();
        long totalDistance = 0l;
        if(solutions!=null && solutions.size()>0){
            for(TspSolverSolutions so : solutions){
                List<Integer> routes = so.getRouteIndex();
                if(routes.size() <=2) {
                    continue;//无客户的非有效路线
                }
                totalDistance+= so.getDistance();
                JkLine  line =model.getLineList().get(so.getLineIndex());
                JkSketchLine tModel =  new JkSketchLine();
                tModel.setSketchId(model.getId());
                tModel.setCreator(model.getEditor());
                tModel.setCreateDate(date);
                tModel.setLineId(line.getId());
                tModel.setTotalNum(new BigDecimal(0));
                tModel.setOrderNum(routes.size()-2);
                tModel.setDateInfo(model.getDateInfo());
                tModel.setSortnum(sketchLineList.size()+1);
                tModel.setEditDate(tModel.getCreateDate());
                tModel.setEditor(tModel.getCreator());
                tModel.setIsdeleted(Constants.ZERO);
                tModel.setDistance(so.getDistance());//
                sketchLineList.add(tModel);
                tModel.setCustomerList( new ArrayList<>());
                //有效路径
                for (Integer cIndex : routes){
                    if(cIndex ==0 || cIndex == routes.size()-1){
                        continue; //起始点不处理
                    }
                    JkSketchCustomer customer = model.getCustomerList().get(cIndex-1);
                    tModel.setTotalNum(tModel.getTotalNum().add(Constants.formatBigdecimal(customer.getTotalNum())));//送货量
                    JkSketchCustomer cModel =  new JkSketchCustomer();
                    cModel.setCreator(tModel.getCreator());
                    cModel.setOrderId(customer.getOrderId());
                    cModel.setCreateDate(tModel.getCreateDate());
                    cModel.setTotalNum(customer.getTotalNum());
                    cModel.setDateInfo(model.getDateInfo());
                    cModel.setSortnum(tModel.getCustomerList().size()+1);
                    cModel.setEditDate(tModel.getCreateDate());
                    cModel.setEditor(tModel.getCreator());
                    cModel.setIsdeleted(Constants.ZERO);
                    cModel.setSketchId(model.getId());
                    cModel.setCustomerId(customer.getCustomerId());
                    tModel.getCustomerList().add(cModel);
                    if(cIndex ==0 || cIndex == routes.size()-1){
                        continue; //起始点不处理
                    }
                }
            }
        }
        if(sketchLineList!=null && sketchLineList.size()>0){
            jkSketchLineMapper.update(null,new UpdateWrapper<JkSketchLine>().lambda()
                    .set(JkSketchLine::getIsdeleted,Constants.ONE)
                    .eq(JkSketchLine::getIsdeleted,Constants.ZERO)
                    .eq(JkSketchLine::getDateInfo,model.getDateInfo()));
            jkSketchCustomerMapper.update(null,new UpdateWrapper<JkSketchCustomer>().lambda()
                    .set(JkSketchCustomer::getIsdeleted,Constants.ONE)
                    .eq(JkSketchCustomer::getIsdeleted,Constants.ZERO)
                    .eq(JkSketchCustomer::getDateInfo,model.getDateInfo()));
            if(sketchLineList.size()>0){
                jkSketchLineMapper.insert(sketchLineList);
            }
            for(JkSketchLine l : sketchLineList){
                if(l.getCustomerList()!=null ){
                    for(JkSketchCustomer c :l.getCustomerList()){
                        c.setSketchLineId(l.getId());
                    }
                    sketchCustomerList.addAll(l.getCustomerList());
                }
            }
            if(sketchCustomerList.size()>0){
                jkSketchCustomerMapper.insert(sketchCustomerList);
            }
            jkSketchMapper.update(null,new UpdateWrapper<JkSketch>().lambda()
                    .eq(JkSketch::getId,model.getId() )
                    .eq(JkSketch::getJobId,model.getJobId() )
                    .set(JkSketch::getLineNum,sketchLineList.size() )
                    .set(JkSketch::getDistance,totalDistance)
                    .set(JkSketch::getPlanLineInfo,"最近一次线路优化成功,优化后总距离:"+(totalDistance/1000)+"公里!")
                    .set(JkSketch::getStatus,Constants.TWO)
                    .set(JkSketch::getPlanLineEndDate,date));
        }else{
            jkSketchMapper.update(null,new UpdateWrapper<JkSketch>().lambda()
                    .eq(JkSketch::getId,model.getId() )
                    .eq(JkSketch::getJobId,model.getJobId() )
                    .set(JkSketch::getPlanLineInfo,"最近一次线路优化失败,未找到最优路线!")
                    .set(JkSketch::getStatus,Constants.THREE)
                    .set(JkSketch::getPlanLineEndDate,date));
        }
    }
    private   List<JkSketchCustomer>  checkJketchCustomerLocation(JkSketch model) {
        MPJLambdaWrapper<JkSketchCustomer> queryWrapper = new MPJLambdaWrapper<>();
        queryWrapper.selectAll(JkSketchCustomer.class )
                .selectAs(JkCustomer::getName,JkSketchCustomer::getName)
                .selectAs(JkCustomer::getCode,JkSketchCustomer::getCode)
                .selectAs(JkCustomer::getDistance,JkSketchCustomer::getDistanceJson)
                .selectAs(JkCustomer::getLongitude,JkSketchCustomer::getLongitude)
                .selectAs(JkCustomer::getLatitude,JkSketchCustomer::getLatitude)
                .leftJoin(JkCustomer.class,JkCustomer::getId,JkSketchCustomer::getCustomerId )
                .eq(JkSketchCustomer::getSketchId, model.getId())
                .eq(JkSketchCustomer::getIsdeleted,Constants.ZERO)
                .orderByAsc(JkSketchCustomer::getSortnum);
        List<JkSketchCustomer> customerList = jkSketchCustomerMapper.selectJoinList(JkSketchCustomer.class,queryWrapper);
        if(customerList == null ||customerList.size() ==0){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该线路客户信息为空,不满足优化条件!");
        }
        String errorMsg ="";
        for(JkSketchCustomer c : customerList){
            if(c.getLatitude()==null || c.getLongitude() ==null){
                errorMsg += c.getName()+"-"+c.getName()+";";
            }
        }
        if(StringUtils.isNotBlank(errorMsg)){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该线路客户:"+errorMsg+"定位信息不完整,不满足优化条件!");
        }
       /* for(JkSketchCustomer c : customerList){
            List<Map<String,Object>> tmpList = new ArrayList<>();
            for(JkSketchCustomer cm : customerList){
                Map<String,Object> t = new HashMap<>();
                t.put("a",cm.getId());
                if(Constants.equalsInteger(c.getCustomerId(),cm.getCustomerId())){
                    t.put("b",0l);
                }else{
                    t.put("b", DistanceCalculator.calculateDistance(
                            Constants.formatBigdecimal(c.getLatitude()).doubleValue(),
                            Constants.formatBigdecimal(c.getLongitude()).doubleValue(),
                            Constants.formatBigdecimal(cm.getLatitude()).doubleValue(),
                            Constants.formatBigdecimal(cm.getLongitude()).doubleValue()));
                }
                tmpList.add(t);
            }
            c.setDistanceList(tmpList);
        }
        */
        /*if(Constants.equalsInteger(Constants.ZERO,model.getStatus())){
            //如果是未优化状态,计算原始距离
            long totalDistance = 0;
            MPJLambdaWrapper<JkSketchLine> queryWrapper1 = new MPJLambdaWrapper<>();
            queryWrapper1.selectAll(JkSketchLine.class )
                    .eq(JkSketchLine::getSketchId, model.getId())
                    .eq(JkSketchLine::getIsdeleted,Constants.ZERO);
            List<JkSketchLine> lineList = jkSketchLineMapper.selectJoinList(JkSketchLine.class,queryWrapper1);//
            if(lineList!=null ||lineList.size()>0){
                double cLatitude =0;
                double cLongitude =0;
                String location = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.COMPANY_LOCATION).getCode();
                try {
                    String[] ss = location.split(",");
                    cLongitude = Double.parseDouble(ss[0]);
                    cLatitude = Double.parseDouble(ss[1]);
                }catch (Exception e){
                }
                for(JkSketchLine line : lineList){
                    boolean isFirst =true;
                    JkSketchCustomer last = null;
                    for(JkSketchCustomer c : customerList){
                        if(Constants.equalsInteger(c.getSketchLineId(),line.getId())){
                            if(isFirst){
                                totalDistance += DistanceCalculator.calculateDistance(cLatitude,cLongitude
                                        ,Constants.formatBigdecimal(c.getLatitude()).doubleValue()
                                        ,Constants.formatBigdecimal(c.getLongitude()).doubleValue());
                            }else{
                                totalDistance += DistanceCalculator.calculateDistance(
                                         Constants.formatBigdecimal(c.getLatitude()).doubleValue()
                                        ,Constants.formatBigdecimal(c.getLongitude()).doubleValue()
                                        ,Constants.formatBigdecimal(last.getLatitude()).doubleValue()
                                        ,Constants.formatBigdecimal(last.getLongitude()).doubleValue());
                            }
                            last = c;
                            isFirst=false;
                        }
                        if(last!=null){
                            totalDistance += DistanceCalculator.calculateDistance(cLatitude,cLongitude
                                    ,Constants.formatBigdecimal(last.getLatitude()).doubleValue()
                                    ,Constants.formatBigdecimal(last.getLongitude()).doubleValue());
                        }
                    }
                }
            }
            model.setOriginDistance(totalDistance);
        }*/
        return customerList;
    }
    @Override
@@ -185,6 +544,7 @@
        return jkSketchMapper.selectCount(wrapper);
    }
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public List<JkSketch> importBatch(MultipartFile file, String dateInfoStr, LoginUserInfo loginUser){
@@ -216,9 +576,11 @@
                    .selectAll(JkCustomer.class)
                    .eq(JkCustomer::getIsdeleted,Constants.ZERO)
            );
            String week =  DateUtil.getWeekZhouOfDate(dateInfo);
            //当前所有线路
            List<JkLine> lineList =  jkLineMapper.selectJoinList(JkLine.class,new MPJLambdaWrapper<JkLine>()
                    .selectAll(JkLine.class)
                    .eq(JkLine::getWeeks,week)//只能选择当前的线路
                    .eq(JkLine::getIsdeleted,Constants.ZERO)
            );
            List<JkOrders> newOrderList = new ArrayList<>();
@@ -256,7 +618,7 @@
                jkOrdersMapper.insert(newOrderList);
            }
            List<JkSketchLine> sketchLineList = initNewSketchLineList(newList,newOrderList);
            List<JkSketchLine> sketchLineList = initNewSketchLineList(newList,newOrderList,lineList);
            jkSketchLineMapper.update(null,new UpdateWrapper<JkSketchLine>().lambda()
                    .set(JkSketchLine::getIsdeleted,Constants.ONE)
                    .eq(JkSketchLine::getIsdeleted,Constants.ZERO)
@@ -285,6 +647,8 @@
    }
    private List<JkSketchCustomer> initNewSketchCustomerList(List<JkSketchLine> sketchLineList, List<JkOrders> newOrderList) {
        List<JkSketchCustomer> list =new ArrayList<>();
        for(JkOrders orders : newOrderList){
@@ -308,9 +672,25 @@
        }
        return list;
    }
    private List<JkSketchLine> initNewSketchLineList(List<JkSketch> newList, List<JkOrders> newOrderList) {
    private List<JkSketchLine> initNewSketchLineList(List<JkSketch> newList, List<JkOrders> newOrderList,List<JkLine> lineList) {
        List<JkSketchLine> list =new ArrayList<>();
        for(JkOrders orders : newOrderList){
        for (JkLine line : lineList){
            JkSketchLine tModel =  new JkSketchLine();
            tModel.setSketchId(getSKetchIdByyCategoryId(line.getCategoryId(),newList));
            tModel.setCreator(newList.get(0).getCreator());
            tModel.setCreateDate(newList.get(0).getCreateDate());
            tModel.setLineId(line.getId());
            initOrderAndTotalNum(tModel,line.getId(),newOrderList);
            tModel.setDateInfo(newList.get(0).getDateInfo());
            tModel.setSortnum(list.size()+1);
            tModel.setEditDate(tModel.getCreateDate());
            tModel.setEditor(tModel.getCreator());
            tModel.setIsdeleted(Constants.ZERO);
            if(tModel.getSketchId()!=null && Constants.formatIntegerNum(tModel.getOrderNum()) >0){
                list.add(tModel);
            }
        }
        /*for(JkOrders orders : newOrderList){
            JkSketchLine tModel = findModelFromListByLineId(orders.getLineId(),list);
            if(tModel!=null){
                tModel.setTotalNum(  tModel.getTotalNum().add(orders.getNum()));//订单量累计
@@ -332,8 +712,17 @@
                    list.add(tModel);
                }
            }
        }
        }*/
        return list;
    }
    private void initOrderAndTotalNum(JkSketchLine tModel, Integer id, List<JkOrders> newOrderList) {
        for(JkOrders orders : newOrderList){
            if(Constants.equalsInteger(orders.getLineId(),id)){
                tModel.setOrderNum(Constants.formatIntegerNum(tModel.getOrderNum())+1);
                tModel.setTotalNum(Constants.formatBigdecimal(tModel.getTotalNum()).add(Constants.formatBigdecimal(orders.getNum())));
            }
        }
    }
    private Integer getSKetchIdByyCategoryId(Integer categoryId, List<JkSketch> newList) {
@@ -430,7 +819,7 @@
        }
        JkLine line = findLineFromListByName(model.getLineName(),lineList);
        if(line == null){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,第" + (index + 3) + "行线路【" + model.getLineName() + "】不存在,请检查表格内容!");
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,第" + (index + 3) + "行线路【" + model.getLineName() + "】不存在或者配送周期不符合,请检查表格内容!");
        }
        JkOrders tModel =   new JkOrders();
@@ -441,6 +830,8 @@
        tModel.setNum(getDecimalByVal(model.getNum()));
        tModel.setCustomerId(customer.getId());
        tModel.setDateInfo(dateInfo);
        tModel.setLatitude(customer.getLatitude());
        tModel.setLongitude(customer.getLongitude());
        tModel.setSortnum(model.getSortnum());
        tModel.setLineId(line.getId());
        tModel.setCategoryId(line.getCategoryId());