|  | @@ -1,7 +1,6 @@
 | 
	
		
			
				|  |  |  package org.jeecg.modules.spapl.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.io.IOException;
 | 
	
		
			
				|  |  | -import java.lang.reflect.Array;
 | 
	
		
			
				|  |  |  import java.text.SimpleDateFormat;
 | 
	
		
			
				|  |  |  import java.util.*;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -12,14 +11,9 @@ import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 | 
	
		
			
				|  |  |  import com.google.gson.Gson;
 | 
	
		
			
				|  |  |  import com.google.gson.GsonBuilder;
 | 
	
		
			
				|  |  | -import org.jeecg.common.constant.CommonConstant;
 | 
	
		
			
				|  |  |  import org.jeecg.common.system.base.controller.JeecgController;
 | 
	
		
			
				|  |  | -import org.jeecg.common.system.util.JwtUtil;
 | 
	
		
			
				|  |  | -import org.jeecg.common.util.RedisUtil;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.documents.letterDeposit.entity.SyLetterDepositItem;
 | 
	
		
			
				|  |  | -import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
 | 
	
		
			
				|  |  | -import org.jeecg.modules.documents.shippingDetails.service.impl.SyShippingDetailsItemServiceImpl;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.openApi.entity.DxpDataPlan;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.openApi.service.IDxpDataPlanService;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.spapl.vo.PackingHeaderVo;
 | 
	
	
		
			
				|  | @@ -38,7 +32,6 @@ import org.jeecg.modules.spapl.service.ISyPreAssembledPackingListService;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.spapl.service.ISyPreAssembledPackingListItemService;
 | 
	
		
			
				|  |  |  import org.springframework.beans.BeanUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | -import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  |  import org.springframework.web.servlet.ModelAndView;
 | 
	
		
			
				|  |  |  import org.springframework.web.multipart.MultipartFile;
 | 
	
	
		
			
				|  | @@ -68,8 +61,6 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
 | 
	
		
			
				|  |  |  	private ISyPreAssembledPackingListItemService syPreAssembledPackingListItemService;
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private IDxpDataPlanService iDxpDataPlanService;
 | 
	
		
			
				|  |  | -	@Autowired
 | 
	
		
			
				|  |  | -	private RedisUtil redisUtil;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	/**
 | 
	
		
			
				|  |  |  	 * 分页列表查询
 | 
	
	
		
			
				|  | @@ -162,20 +153,38 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
 | 
	
		
			
				|  |  |  	 @ApiOperation(value="参照发运明细", notes="参照发运明细")
 | 
	
		
			
				|  |  |  	 @GetMapping(value = "/list3")
 | 
	
		
			
				|  |  |  	 public Result<IPage<SyShippingDetailsVo>> queryPageList3(
 | 
	
		
			
				|  |  | -	 								 @RequestParam(name="documentNo",required = false) String documentNo,
 | 
	
		
			
				|  |  | -									 @RequestParam(name="customer",required = false) String customer,
 | 
	
		
			
				|  |  | +	 								 @RequestParam(name="documentNo") String documentNo,
 | 
	
		
			
				|  |  | +									 @RequestParam(name="customer") String customer,
 | 
	
		
			
				|  |  | +									 @RequestParam(name="distributionPoint") String distributionPoint,
 | 
	
		
			
				|  |  | +									 @RequestParam(name="startDate") String startDate,
 | 
	
		
			
				|  |  | +									 @RequestParam(name="smallPo") String smallPo,
 | 
	
		
			
				|  |  | +									 @RequestParam(name="endDate") String endDate,
 | 
	
		
			
				|  |  |  									 @RequestParam(name="status", defaultValue="y") String status,
 | 
	
		
			
				|  |  |  									 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 | 
	
		
			
				|  |  |  									 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 | 
	
		
			
				|  |  |  									 HttpServletRequest req) {
 | 
	
		
			
				|  |  | -		//只有成衣才能被选中,筛选为成衣的订单,需要加个条件
 | 
	
		
			
				|  |  | +		 //只有成衣才能被选中,筛选为成衣的订单,需要加个条件
 | 
	
		
			
				|  |  | +		 //po  分销点 预发货日期 客户
 | 
	
		
			
				|  |  |  		 Result<IPage<SyShippingDetailsVo>> result = new Result<IPage<SyShippingDetailsVo>>();
 | 
	
		
			
				|  |  |  		 QueryWrapper<SyShippingDetailsVo> queryWrapper = new QueryWrapper<>();
 | 
	
		
			
				|  |  |  		 if(oConvertUtils.isNotEmpty(documentNo)) {
 | 
	
		
			
				|  |  |  			 queryWrapper.eq("t.documentNo", documentNo);//单据号
 | 
	
		
			
				|  |  |  		 }
 | 
	
		
			
				|  |  | -		 if(oConvertUtils.isNotEmpty(customer)){
 | 
	
		
			
				|  |  | -			 queryWrapper.eq("t.customer",customer);//客户
 | 
	
		
			
				|  |  | +		 if(oConvertUtils.isNotEmpty(customer)){//客户
 | 
	
		
			
				|  |  | +			 queryWrapper.eq("t.customer",customer).or().eq("t.customer_Abbreviation",customer);
 | 
	
		
			
				|  |  | +		 }
 | 
	
		
			
				|  |  | +		 if(oConvertUtils.isNotEmpty(distributionPoint)){//分销点
 | 
	
		
			
				|  |  | +			 queryWrapper.eq("t.distribution_Point",distributionPoint);
 | 
	
		
			
				|  |  | +		 }
 | 
	
		
			
				|  |  | +		 if(oConvertUtils.isNotEmpty(smallPo)){//小po
 | 
	
		
			
				|  |  | +			 queryWrapper.eq("t.small_Po",smallPo);
 | 
	
		
			
				|  |  | +		 }
 | 
	
		
			
				|  |  | +		 //预发货日期
 | 
	
		
			
				|  |  | +		 if(oConvertUtils.isNotEmpty(startDate)){//起始
 | 
	
		
			
				|  |  | +			 queryWrapper.ge("b.pre_Delivery_Date",startDate);
 | 
	
		
			
				|  |  | +		 }
 | 
	
		
			
				|  |  | +		 if(oConvertUtils.isNotEmpty(endDate)){//结束
 | 
	
		
			
				|  |  | +			 queryWrapper.le("b.pre_Delivery_Date",endDate);
 | 
	
		
			
				|  |  |  		 }
 | 
	
		
			
				|  |  |  		 if(oConvertUtils.isNotEmpty(status)){//选择正常或者超发状态
 | 
	
		
			
				|  |  |  		 	 if(status.equals("n")){
 | 
	
	
		
			
				|  | @@ -328,7 +337,7 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			 String url = resultList.get(0).getItemIp() + resultList.get(0).getItemUrl();//拼接url
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -			 String tokenUrl = resultList.get(1).getItemIp()+resultList.get(1).getItemUrl();//获取token
 | 
	
		
			
				|  |  | +			 String tokenUrl = resultList.get(1).getItemIp()+resultList.get(1).getItemUrl();//获取云工厂token
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			 if(oConvertUtils.isEmpty(url)||oConvertUtils.isEmpty(tokenUrl)){
 | 
	
		
			
				|  |  |  			 	log.warn("缺少推送接口信息" );
 | 
	
	
		
			
				|  | @@ -399,7 +408,7 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			String url = resultList.get(0).getItemIp() + resultList.get(0).getItemUrl();//拼接url
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -			String tokenUrl = resultList.get(1).getItemIp()+resultList.get(1).getItemUrl();//获取token
 | 
	
		
			
				|  |  | +			String tokenUrl = resultList.get(1).getItemIp()+resultList.get(1).getItemUrl();//获取云工厂token
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			if(oConvertUtils.isEmpty(url)||oConvertUtils.isEmpty(tokenUrl)){
 | 
	
		
			
				|  |  |  				log.warn("缺少推送接口信息" );
 | 
	
	
		
			
				|  | @@ -437,42 +446,6 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
 | 
	
		
			
				|  |  |  		return result;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -	/**
 | 
	
		
			
				|  |  | -	 * 获取token
 | 
	
		
			
				|  |  | -	 *
 | 
	
		
			
				|  |  | -	 * @param username,syspassword
 | 
	
		
			
				|  |  | -	 * @return
 | 
	
		
			
				|  |  | -	 */
 | 
	
		
			
				|  |  | -	@AutoLog(value = "获取token")
 | 
	
		
			
				|  |  | -	@ApiOperation(value="获取token", notes="获取token")
 | 
	
		
			
				|  |  | -	@RequestMapping(value = "/getToken", method = {RequestMethod.GET})
 | 
	
		
			
				|  |  | -	public String getToken(String username,String syspassword) {
 | 
	
		
			
				|  |  | -		String token = JwtUtil.sign(username, syspassword);
 | 
	
		
			
				|  |  | -		redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
 | 
	
		
			
				|  |  | -		redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
 | 
	
		
			
				|  |  | -		System.out.println("CommonConstant.PREFIX_USER_TOKEN"+CommonConstant.PREFIX_USER_TOKEN);
 | 
	
		
			
				|  |  | -		System.out.println("JwtUtil.EXPIRE_TIME"+JwtUtil.EXPIRE_TIME);
 | 
	
		
			
				|  |  | -		return token;
 | 
	
		
			
				|  |  | -	}
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -	/**
 | 
	
		
			
				|  |  | -	 * 类型转化
 | 
	
		
			
				|  |  | -	 *
 | 
	
		
			
				|  |  | -	 * @param syPreAssembledPackingListItem
 | 
	
		
			
				|  |  | -	 * @return
 | 
	
		
			
				|  |  | -	 */
 | 
	
		
			
				|  |  | -	@AutoLog(value = "类型转化")
 | 
	
		
			
				|  |  | -	@ApiOperation(value="类型转化", notes="类型转化")
 | 
	
		
			
				|  |  | -	@RequestMapping(value = "/typeConversion", method = {RequestMethod.POST})
 | 
	
		
			
				|  |  | -	public SyLetterDepositItem getToken(@RequestBody SyPreAssembledPackingListItem syPreAssembledPackingListItem) {
 | 
	
		
			
				|  |  | -		System.out.println(syPreAssembledPackingListItem.getBoxNumber());
 | 
	
		
			
				|  |  | -		SyLetterDepositItem po = new SyLetterDepositItem();
 | 
	
		
			
				|  |  | -		BeanUtils.copyProperties(syPreAssembledPackingListItem, po);
 | 
	
		
			
				|  |  | -		return po;
 | 
	
		
			
				|  |  | -	}
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  	 /**
 | 
	
		
			
				|  |  |  	  * 提交
 | 
	
		
			
				|  |  |  	  *
 | 
	
	
		
			
				|  | @@ -827,4 +800,17 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
 | 
	
		
			
				|  |  |  		syPreAssembledPackingListService.updateShipping();
 | 
	
		
			
				|  |  |  		return "true";
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/**
 | 
	
		
			
				|  |  | +	 * 类型转化
 | 
	
		
			
				|  |  | +	 *
 | 
	
		
			
				|  |  | +	 * @param syPreAssembledPackingListItem
 | 
	
		
			
				|  |  | +	 * @return
 | 
	
		
			
				|  |  | +	 */
 | 
	
		
			
				|  |  | +	@AutoLog(value = "类型转化")
 | 
	
		
			
				|  |  | +	@ApiOperation(value="类型转化", notes="类型转化")
 | 
	
		
			
				|  |  | +	@RequestMapping(value = "/typeConversion", method = {RequestMethod.POST})
 | 
	
		
			
				|  |  | +	public SyLetterDepositItem typeConversion(@RequestBody SyPreAssembledPackingListItem syPreAssembledPackingListItem) {
 | 
	
		
			
				|  |  | +		return syPreAssembledPackingListService.typeConversion(syPreAssembledPackingListItem);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  |  }
 |