|  | @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
	
		
			
				|  |  |  import org.apache.shiro.SecurityUtils;
 | 
	
		
			
				|  |  | +import org.jeecg.common.exception.JeecgBootException;
 | 
	
		
			
				|  |  |  import org.jeecg.common.system.vo.LoginUser;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements;
 | 
	
	
		
			
				|  | @@ -14,6 +15,7 @@ import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsItemMapper;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.documents.shippingDetails.service.impl.SyShippingDetailsItemServiceImpl;
 | 
	
		
			
				|  |  | +import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.openApi.entity.DxpDataPlan;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.openApi.service.IDxpDataPlanService;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
 | 
	
	
		
			
				|  | @@ -25,6 +27,7 @@ import org.jeecg.modules.splfi.entity.SyPackingListFabricItem;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.splfi.mapper.SyPackingListFabricItemMapper;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.splfi.mapper.SyPackingListFabricMapper;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.splfi.service.ISyPackingListFabricService;
 | 
	
		
			
				|  |  | +import org.jeecg.modules.splt.entity.SyPackingListTailoring;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.entity.SysUser;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.util.JsonChangeUtils;
 | 
	
		
			
				|  |  |  import org.jeecg.modules.system.util.oConvertUtils;
 | 
	
	
		
			
				|  | @@ -33,6 +36,8 @@ import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  | +import org.springframework.transaction.interceptor.TransactionAspectSupport;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import java.io.Serializable;
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.text.ParseException;
 | 
	
	
		
			
				|  | @@ -373,4 +378,53 @@ return null;
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		//return sys;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Override
 | 
	
		
			
				|  |  | +	@Transactional
 | 
	
		
			
				|  |  | +	public boolean submitBatch(String[] ids) {
 | 
	
		
			
				|  |  | +		boolean bool=false;
 | 
	
		
			
				|  |  | +		try{
 | 
	
		
			
				|  |  | +			for(String id:ids){
 | 
	
		
			
				|  |  | +				SyPackingListFabric syPackingListFabric=syPackingListFabricMapper.selectById(id);
 | 
	
		
			
				|  |  | +				syPackingListFabric.setStatus("1");//提交
 | 
	
		
			
				|  |  | +				syPackingListFabricMapper.updateById(syPackingListFabric);//修改
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			bool=true;
 | 
	
		
			
				|  |  | +		}catch (Exception e){
 | 
	
		
			
				|  |  | +			log.error(e.getMessage());
 | 
	
		
			
				|  |  | +			bool=false;
 | 
	
		
			
				|  |  | +		}finally {
 | 
	
		
			
				|  |  | +			return bool;
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Override
 | 
	
		
			
				|  |  | +	@Transactional
 | 
	
		
			
				|  |  | +	public String cancelSubmitBatch(String[] ids) {
 | 
	
		
			
				|  |  | +		String str="";
 | 
	
		
			
				|  |  | +		try{
 | 
	
		
			
				|  |  | +			for (String id : ids){
 | 
	
		
			
				|  |  | +				SyPackingListFabric syPackingListFabric=syPackingListFabricMapper.selectById(id);
 | 
	
		
			
				|  |  | +				if (syPackingListFabric.getIsReference()>0){//至少已被参照的数据进行查询
 | 
	
		
			
				|  |  | +					SyShippingOrder syShippingOrder=syPackingListFabricMapper.querySyShippingOrder(id);
 | 
	
		
			
				|  |  | +					if(syShippingOrder!=null){
 | 
	
		
			
				|  |  | +						str+=id+",";
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				syPackingListFabric.setStatus("0");//取消提交
 | 
	
		
			
				|  |  | +				syPackingListFabricMapper.updateById(syPackingListFabric);
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			if(str.length()>0){
 | 
	
		
			
				|  |  | +				throw new JeecgBootException("已被托书参照并提交");
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}catch (Exception e){
 | 
	
		
			
				|  |  | +			log.error(e.getMessage());
 | 
	
		
			
				|  |  | +			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
 | 
	
		
			
				|  |  | +		}finally {
 | 
	
		
			
				|  |  | +			if(str.length()==0){
 | 
	
		
			
				|  |  | +				return str;
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			return str.substring(0,str.length()-1);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  |  }
 |