| 
					
				 | 
			
			
				@ -81,6 +81,13 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private MediicinewarrayDao mediicinewarrayDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 设备出货服务,创建设备,创建库存内容 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param deviceId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param layer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param wayer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String createDevice(String deviceId, String layer, String wayer) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject result = new JSONObject(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -134,7 +141,10 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventory.setState("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventory.setMerge(String.valueOf(i1+1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventory.setCargoCapacity(mediicinedevice.getCargoCapacity()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //默认下架 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventory.setShelfStatus("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //默认货道关闭 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventory.setCargoState("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventoryDao.save(inventory); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -604,6 +614,8 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (MediicinecabinetInventory inventory : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    inventory.setPic(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    inventory.setShelfStatus("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //关闭货道 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    inventory.setCargoState("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    inventory.setQty("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    inventory.setDrugCode(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    inventory.setDrugId(null); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -685,7 +697,29 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result.toJSONString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 货道开启与关闭 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param cargoIds 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param isMerge 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String openAndCloseCargo(String cargoIds, String cargoState){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isEmpty(cargoIds)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("msg","cargoIds is null"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("response", ConstantUtils.FAIL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return result.toJSONString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (String cargoId : cargoIds.split(",")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(!StringUtils.isEmpty(cargoId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                MediicinecabinetInventory inventory = inventoryDao.findOne(cargoId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventory.setCargoState(cargoState); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                inventoryDao.save(inventory); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("response",ConstantUtils.SUCCESS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result.toJSONString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 分页查询设备信息getDeviceListByPage 
			 |