|  | @@ -6,10 +6,7 @@ import com.github.pagehelper.PageHelper;
 | 
		
	
		
			
			| 6 | 6 |  import com.github.pagehelper.PageInfo;
 | 
		
	
		
			
			| 7 | 7 |  import com.th.demo.mapping.maint.CustomerMapper;
 | 
		
	
		
			
			| 8 | 8 |  import com.th.demo.mapping.maint.StackMapper;
 | 
		
	
		
			
			| 9 |  | -import com.th.demo.mapping.ware.ChangeRecordMapper;
 | 
		
	
		
			
			| 10 |  | -import com.th.demo.mapping.ware.InRecordMapper;
 | 
		
	
		
			
			| 11 |  | -import com.th.demo.mapping.ware.MoveRecordMapper;
 | 
		
	
		
			
			| 12 |  | -import com.th.demo.mapping.ware.StoreMapper;
 | 
		
	
		
			
			|  | 9 | +import com.th.demo.mapping.ware.*;
 | 
		
	
		
			
			| 13 | 10 |  import com.th.demo.model.maint.Customer;
 | 
		
	
		
			
			| 14 | 11 |  import com.th.demo.model.maint.Stack;
 | 
		
	
		
			
			| 15 | 12 |  import com.th.demo.model.system.SysUser;
 | 
		
	
	
		
			
			|  | @@ -43,6 +40,8 @@ public class StoreServiceImpl implements StoreService {
 | 
		
	
		
			
			| 43 | 40 |      public MoveRecordMapper moveRecordMapper;
 | 
		
	
		
			
			| 44 | 41 |      @Autowired//自动注入Mapper
 | 
		
	
		
			
			| 45 | 42 |      public StackMapper stackMapper;
 | 
		
	
		
			
			|  | 43 | +    @Autowired//自动注入Mapper
 | 
		
	
		
			
			|  | 44 | +    public DistributionDetailMapper distributionDetailMapper;
 | 
		
	
		
			
			| 46 | 45 |      String result = Type.FAIL;
 | 
		
	
		
			
			| 47 | 46 |      int num = 0;
 | 
		
	
		
			
			| 48 | 47 |  
 | 
		
	
	
		
			
			|  | @@ -391,6 +390,39 @@ public class StoreServiceImpl implements StoreService {
 | 
		
	
		
			
			| 391 | 390 |          return result;
 | 
		
	
		
			
			| 392 | 391 |      }
 | 
		
	
		
			
			| 393 | 392 |  
 | 
		
	
		
			
			|  | 393 | +    @Override
 | 
		
	
		
			
			|  | 394 | +    public String lockAndUnlock(String json,String lockFlag,String userId,String belongId) {
 | 
		
	
		
			
			|  | 395 | +        List<Store> listStore = JSON.parseObject(json, new TypeReference<List<Store>>() {});
 | 
		
	
		
			
			|  | 396 | +        if (lockFlag.equals("0")  ){
 | 
		
	
		
			
			|  | 397 | +            for (int i = 0; i < listStore.size(); i++) {
 | 
		
	
		
			
			|  | 398 | +                List<DistributionDetail> distributionDetailList = distributionDetailMapper.selectByStoreId(listStore.get(i).getId());
 | 
		
	
		
			
			|  | 399 | +                if (distributionDetailList.size()>0){
 | 
		
	
		
			
			|  | 400 | +                    return JSONTools.toString(1,"存在配车封锁,此类封锁无法解封,请配车取消解除封锁");
 | 
		
	
		
			
			|  | 401 | +                }
 | 
		
	
		
			
			|  | 402 | +                listStore.get(i).setLockFlag(lockFlag);
 | 
		
	
		
			
			|  | 403 | +                num += storeMapper.updateByPrimaryKey(listStore.get(i));
 | 
		
	
		
			
			|  | 404 | +            }
 | 
		
	
		
			
			|  | 405 | +        } else if (lockFlag.equals("1")) {
 | 
		
	
		
			
			|  | 406 | +            for (int i = 0; i < listStore.size(); i++) {
 | 
		
	
		
			
			|  | 407 | +                listStore.get(i).setLockFlag(lockFlag);
 | 
		
	
		
			
			|  | 408 | +                num += storeMapper.updateByPrimaryKey(listStore.get(i));
 | 
		
	
		
			
			|  | 409 | +            }
 | 
		
	
		
			
			|  | 410 | +        }
 | 
		
	
		
			
			|  | 411 | +        result = Tools.moreThanZeroResultJSON(num);
 | 
		
	
		
			
			|  | 412 | +        return result;
 | 
		
	
		
			
			|  | 413 | +    }
 | 
		
	
		
			
			|  | 414 | +
 | 
		
	
		
			
			|  | 415 | +    @Override
 | 
		
	
		
			
			|  | 416 | +    public String Outbound(String json,String outbound,String userId,String belongId) {
 | 
		
	
		
			
			|  | 417 | +        List<Store> listStore = JSON.parseObject(json, new TypeReference<List<Store>>() {});
 | 
		
	
		
			
			|  | 418 | +        for (int i = 0; i < listStore.size(); i++) {
 | 
		
	
		
			
			|  | 419 | +            listStore.get(i).setOutBound(outbound);
 | 
		
	
		
			
			|  | 420 | +            num += storeMapper.updateOutBoundByPrimaryKey(listStore.get(i));
 | 
		
	
		
			
			|  | 421 | +        }
 | 
		
	
		
			
			|  | 422 | +        result = Tools.moreThanZeroResultJSON(num);
 | 
		
	
		
			
			|  | 423 | +        return result;
 | 
		
	
		
			
			|  | 424 | +    }
 | 
		
	
		
			
			|  | 425 | +
 | 
		
	
		
			
			| 394 | 426 |      private MoveRecord getMoveRecord(Store store, Stack fromStack, Stack toStack, int layerNew, int layerOld, String userId) {
 | 
		
	
		
			
			| 395 | 427 |          MoveRecord moveRecord = new MoveRecord();
 | 
		
	
		
			
			| 396 | 428 |          moveRecord.setWareNameOld(fromStack.getWare().getName());
 |