| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/wrkMast/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | if (entry.getKey().equals("loc_no") || entry.getKey().equals("source_loc_no")) { |
| | | List<String> locNos = locMastService.selectLocNosByNoOrAlias(val); |
| | | if (locNos.isEmpty()) { |
| | | wrapper.eq(entry.getKey(), "__NO_MATCH__"); |
| | | } else { |
| | | wrapper.in(entry.getKey(), locNos); |
| | | } |
| | | } else if (entry.getKey().equals("area_id")) { |
| | | wrapper.eq(entry.getKey(), val); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<WrkMast> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("wrk_no", condition); |
| | | Page<WrkMast> page = wrkMastService.selectPage(new Page<>(0, 10), wrapper); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.where("CAST(wrk_no AS VARCHAR(20)) LIKE {0}", "%" + condition + "%"); |
| | | } |
| | | Page<WrkMast> page = wrkMastService.selectPage(new Page<>(1, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (WrkMast wrkMast : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |