| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.asrs.entity.BasLocSts; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | import com.zy.asrs.service.BasLocStsService; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.core.annotations.ManagerAuth; |
| | |
| | | |
| | | @Autowired |
| | | private BasWrkIotypeService basWrkIotypeService; |
| | | |
| | | @Autowired |
| | | private BasLocStsService basLocStsService; |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(basWrkIotypeService.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.eq(entry.getKey(), String.valueOf(entry.getValue())); |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locStacQuery/auth") |
| | | @ManagerAuth |
| | | public R queryloc(String condition) { |
| | | EntityWrapper<BasLocSts> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("lo_sts", condition); |
| | | Page<BasLocSts> page = basLocStsService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasLocSts basLocSts : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basLocSts.getLocSts()); |
| | | map.put("value", basLocSts.getLocDesc()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |