|  | @ -161,9 +161,10 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     //orderNum, equNum, contact, startTime, endTime, sellState, orderState, dispensingWindow
 | 
	
		
			
				|  |  |     public JSONObject queryOrderListFullInfo(String orderNum, String equNum, String contact,
 | 
	
		
			
				|  |  |     public JSONObject queryOrderListFullInfo(String content,String orderNum, String equNum, String contact,
 | 
	
		
			
				|  |  |                                              String startTime, String endTime, String sellState,
 | 
	
		
			
				|  |  |                                              String orderState, String dispensingWindow, String community, String userId, int page, int size, String wechatId) throws Exception {
 | 
	
		
			
				|  |  |                                              String orderState, String dispensingWindow, String community,
 | 
	
		
			
				|  |  |                                              String userId, int page, int size, String wechatId) throws Exception {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -226,6 +227,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String sencodSql = "SELECT\n" +
 | 
	
		
			
				|  |  |                 "    tmd.equ_name as equName,\n" +
 | 
	
		
			
				|  |  |                 "    t.id as id,\n" +
 | 
	
		
			
				|  |  |                 "    t.address as address,\n" +
 | 
	
		
			
				|  |  |                 "    t.age as age,\n" +
 | 
	
	
		
			
				|  | @ -276,12 +278,15 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
 | 
	
		
			
				|  |  |                 "    t.social_security_card_num AS socialSecurityCardNum,\n" +
 | 
	
		
			
				|  |  |                 "    t.belong_community AS belongCommunity\n" +
 | 
	
		
			
				|  |  |                 "FROM\n" +
 | 
	
		
			
				|  |  |                 "    t_mediicine_order AS t where 1=1 \n";
 | 
	
		
			
				|  |  |                 "    t_mediicine_order AS t left join t_mediicine_device tmd on t.shipping_equ = tmd.equ_num where 1=1 \n";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if (!StringUtils.isEmpty(belongCommunitys)) {
 | 
	
		
			
				|  |  |             conditionSql += " and '," + belongCommunitys + ",' LIKE CONCAT('%,',t.belong_community,',%')\n";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (!StringUtils.isEmpty(content)) {
 | 
	
		
			
				|  |  |             conditionSql += " and CONCAT(IFNULL(t.`prescribe_num`,''),IFNULL(t.`contact`,''),IFNULL(t.`shipping_equ`,'')) like '%" + content + "%'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (!StringUtils.isEmpty(community)) {
 | 
	
		
			
				|  |  |             conditionSql += " and t.belong_community = '" + community + "'";
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -757,7 +762,8 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
 | 
	
		
			
				|  |  |                     medicineShipmentLog.getDeviceId(),              //equNum
 | 
	
		
			
				|  |  |                     medicineShipmentLog.getLayerNo(),
 | 
	
		
			
				|  |  |                     medicineShipmentLog.getWayerNo().split(",")[0]);
 | 
	
		
			
				|  |  |             inventory.setQty(String.valueOf((Integer.parseInt(inventory.getQty()) - 1)<0 ? 0 :(Integer.parseInt(inventory.getQty()) - 1)));
 | 
	
		
			
				|  |  | //            inventory.setQty(String.valueOf((Integer.parseInt(inventory.getQty()) - 1)<0 ? 0 :(Integer.parseInt(inventory.getQty()) - 1)));
 | 
	
		
			
				|  |  |             inventory.setQty((Integer.parseInt(inventory.getQty()) - 1<0 ? "0" :String.valueOf((Integer.parseInt(inventory.getQty()) - 1))));
 | 
	
		
			
				|  |  |             if (Integer.parseInt(inventory.getQty()) < Integer.parseInt(inventory.getNum())) {
 | 
	
		
			
				|  |  |                 Mediicinedevice mediicinedevice = deviceDao.findOne(inventory.getIdDevice());
 | 
	
		
			
				|  |  |                 //0缺货,1不缺货
 |