|  | @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ruoyi.common.annotation.DataSource;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.core.domain.AjaxResult;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.core.redis.RedisCache;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.enums.DataSourceType;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.SecurityUtils;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.SnowFlakeUtil;
 | 
	
	
		
			
				|  | @@ -12,6 +13,7 @@ import com.ruoyi.system.domain.vo.LoadFeeItemsVo;
 | 
	
		
			
				|  |  |  import com.ruoyi.system.domain.vo.OrderBillsPlansVo;
 | 
	
		
			
				|  |  |  import com.ruoyi.system.mapper.EmplsMapper;
 | 
	
		
			
				|  |  |  import com.ruoyi.system.mapper.OrderBillsPlansMapper;
 | 
	
		
			
				|  |  | +import com.ruoyi.system.mapper.SysConfigMapper;
 | 
	
		
			
				|  |  |  import com.ruoyi.system.service.IOrderBillsPlansService;
 | 
	
		
			
				|  |  |  import org.springframework.beans.BeanUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
	
		
			
				|  | @@ -41,6 +43,10 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private EmplsMapper emplsMapper;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private RedisCache redisCache;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 查询业务表数据List
 | 
	
		
			
				|  |  |       *
 | 
	
	
		
			
				|  | @@ -67,17 +73,28 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |              orderNo = "%" + orderNo + "%";
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        Object actId = redisCache.getCacheObject("sys_config:risk.actId");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          map.put("emplId", emplId);
 | 
	
		
			
				|  |  |          map.put("dataStart", dataStart);
 | 
	
		
			
				|  |  |          map.put("dataEnd", dataEnd);
 | 
	
		
			
				|  |  |          map.put("orderNo", orderNo);
 | 
	
		
			
				|  |  | +        map.put("actId", actId.toString());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          List<WfTaskList> orderBillsPlansList = orderBillsPlansMapper.getOrderBillsPlansLsit(map);
 | 
	
		
			
				|  |  |          for (WfTaskList wfTaskList : orderBillsPlansList) {
 | 
	
		
			
				|  |  | -            if (wfTaskList.getBillStatus() == 6) {
 | 
	
		
			
				|  |  | -                wfTaskList.setBillStatusName("禁止修改");
 | 
	
		
			
				|  |  | -            } else if (wfTaskList.getBillStatus() == 2) {
 | 
	
		
			
				|  |  | -                wfTaskList.setBillStatusName("允许修改");
 | 
	
		
			
				|  |  | +            Long status317 = wfTaskList.getStatus317();
 | 
	
		
			
				|  |  | +            Long status376 = wfTaskList.getStatus376();
 | 
	
		
			
				|  |  | +            if (status317 == null || status376 == null) {
 | 
	
		
			
				|  |  | +                break;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if (status317 == 2) {
 | 
	
		
			
				|  |  | +                wfTaskList.setBillStatusName("里程待提交");
 | 
	
		
			
				|  |  | +            } else if (status376 == 2 || status376 == 0) {
 | 
	
		
			
				|  |  | +                wfTaskList.setBillStatusName("费用待提交");
 | 
	
		
			
				|  |  | +            } else if (status376 == 6) {
 | 
	
		
			
				|  |  | +                wfTaskList.setBillStatusName("报单完成");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return orderBillsPlansList;
 | 
	
	
		
			
				|  | @@ -106,6 +123,10 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |              vo.setUnLoadDateString(ft.format(unLoadDate));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        Object actId = redisCache.getCacheObject("sys_config:risk.actId");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        orderBillsPlans.setActId(Long.valueOf(actId.toString()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          // 查找照片List
 | 
	
		
			
				|  |  |          List<Long> attachIdList = orderBillsPlansMapper.getAttachMngsAttachIdBySysIdAndEntityIdAndActId(orderBillsPlans);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -144,9 +165,13 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |              String unLoadDateString = orderBillsPlansVo.getUnLoadDateString();
 | 
	
		
			
				|  |  |              if (loadDateString != null && !"".equals(loadDateString)) {
 | 
	
		
			
				|  |  |                  orderBillsPlans.setLoadDate(ft.parse(loadDateString));
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                orderBillsPlans.setLoadDate(null);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (unLoadDateString != null && !"".equals(unLoadDateString)) {
 | 
	
		
			
				|  |  |                  orderBillsPlans.setUnLoadDate(ft.parse(unLoadDateString));
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                orderBillsPlans.setUnLoadDate(null);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          } catch (Exception e) {
 | 
	
		
			
				|  |  |              System.out.println(e.getMessage());
 | 
	
	
		
			
				|  | @@ -184,6 +209,8 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 更新业务表
 | 
	
		
			
				|  |  |          Integer i = orderBillsPlansMapper.updateOrderBillsPlansByOrderNo(orderBillsPlansVo);
 | 
	
		
			
				|  |  | +        // 更新LoadBills
 | 
	
		
			
				|  |  | +        Integer y = orderBillsPlansMapper.updateLoadBillsByEntityID(orderBillsPlansVo);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 根据登录名去匹配EMPLS 里面的EMPL  找到 EMPLID
 | 
	
		
			
				|  |  |          String userName = SecurityUtils.getLoginUser().getUsername();
 | 
	
	
		
			
				|  | @@ -237,8 +264,29 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |       * @return 数据
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public OrderBillsPlansVo getLoadFeeItems(Long orderNo) {
 | 
	
		
			
				|  |  | +    public OrderBillsPlansVo getLoadFeeItems(Long orderNo, HttpServletRequest request) {
 | 
	
		
			
				|  |  |          OrderBillsPlansVo data = orderBillsPlansMapper.getOrderBillsPlansByOrder(orderNo);
 | 
	
		
			
				|  |  | +        // 图片
 | 
	
		
			
				|  |  | +        Object actId = redisCache.getCacheObject("sys_config:risk.actId");
 | 
	
		
			
				|  |  | +        data.setActId(Long.valueOf(actId.toString()));
 | 
	
		
			
				|  |  | +        // 查找照片List
 | 
	
		
			
				|  |  | +        List<Long> attachIdList = orderBillsPlansMapper.getAttachMngsAttachIdBySysIdAndEntityIdAndActId(data);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<ImgVo> fileList1 = new ArrayList<>();
 | 
	
		
			
				|  |  | +        for (Long attachId : attachIdList) {
 | 
	
		
			
				|  |  | +            ImgVo imgVo = new ImgVo();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            String serverName = request.getServerName();
 | 
	
		
			
				|  |  | +            int serverPort = request.getServerPort();
 | 
	
		
			
				|  |  | +            String url = "http://" + serverName + ":" + serverPort + "/attachmngs/img/" + attachId;
 | 
	
		
			
				|  |  | +            imgVo.setUrl(url);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            fileList1.add(imgVo);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        data.setFileList1(fileList1);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          List<LoadFeeItems> loadFeeItemsList = orderBillsPlansMapper.getLoadFeeItemsByEntityId(data.getLoadBillsEntityId());
 | 
	
		
			
				|  |  |          data.setLoadFeeItemsList(loadFeeItemsList);
 | 
	
		
			
				|  |  |          return data;
 | 
	
	
		
			
				|  | @@ -246,6 +294,7 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 插入主库图片数据
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  |       * @param tmsAttachMngs
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
	
		
			
				|  | @@ -257,7 +306,8 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          String username = SecurityUtils.getLoginUser().getUsername();
 | 
	
		
			
				|  |  |          tmsAttachMngs.setActId(375L);
 | 
	
		
			
				|  |  | -        tmsAttachMngs.setAttachName(UUID.randomUUID().toString().replace("-", ""));
 | 
	
		
			
				|  |  | +        String replace = UUID.randomUUID().toString().replace("-", "");
 | 
	
		
			
				|  |  | +        tmsAttachMngs.setAttachName(replace + ".jpg");
 | 
	
		
			
				|  |  |          tmsAttachMngs.setLineNo(lineNo == null ? 1L : lineNo + 1);
 | 
	
		
			
				|  |  |          tmsAttachMngs.setUserName(username);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -270,6 +320,7 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 根据attachId在Tms库的AttachMngs表删除数据
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  |       * @param attachId
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 |