|  |  | 
 |  |  | import com.zy.asrs.entity.AdjDetl; | 
 |  |  | import com.zy.asrs.service.AdjDetlService; | 
 |  |  | import com.zy.common.web.BaseController; | 
 |  |  | import com.zy.system.entity.SaasLog; | 
 |  |  | import com.zy.system.service.SaasLogService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private AdjDetlService adjDetlService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private SaasLogService saasLogService; | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/adjDetl/{id}/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  | 
 |  |  |                   @RequestParam(required = false)String orderByType, | 
 |  |  |                   @RequestParam(required = false)String condition, | 
 |  |  |                   @RequestParam Map<String, Object> param){ | 
 |  |  |         //以前是立库库存调整接口,后改为平库调整接口 | 
 |  |  |         excludeTrash(param); | 
 |  |  |         EntityWrapper<AdjDetl> wrapper = new EntityWrapper<>(); | 
 |  |  |         EntityWrapper<SaasLog> wrapper = new EntityWrapper<>(); | 
 |  |  |         convert(param, wrapper); | 
 |  |  |         allLike(AdjDetl.class, param.keySet(), wrapper, condition); | 
 |  |  |         wrapper.eq("type",2); | 
 |  |  |         allLike(SaasLog.class, param.keySet(), wrapper, condition); | 
 |  |  |         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} | 
 |  |  |         return R.ok(adjDetlService.selectPage(new Page<>(curr, limit), wrapper)); | 
 |  |  |         return R.ok(saasLogService.selectPage(new Page<>(curr, limit), wrapper)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private void convert(Map<String, Object> map, EntityWrapper wrapper){ | 
 |  |  |     private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ | 
 |  |  |         for (Map.Entry<String, Object> entry : map.entrySet()){ | 
 |  |  |             if (entry.getKey().endsWith(">")) { | 
 |  |  |                 wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); | 
 |  |  |             } else if (entry.getKey().endsWith("<")) { | 
 |  |  |                 wrapper.le(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); | 
 |  |  |             String val = String.valueOf(entry.getValue()); | 
 |  |  |             if (val.contains(RANGE_TIME_LINK)){ | 
 |  |  |                 String[] dates = val.split(RANGE_TIME_LINK); | 
 |  |  |                 wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); | 
 |  |  |                 wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); | 
 |  |  |             } else { | 
 |  |  |                 wrapper.like(entry.getKey(), String.valueOf(entry.getValue())); | 
 |  |  |                 wrapper.like(entry.getKey(), val); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } |