| | |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.utils.RoleUtils; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @RequestMapping(value = "/manLocDetl/export/auth") |
| | | @ManagerAuth(memo = "库位明细导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<ManLocDetl> wrapper = new EntityWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("locDetl")); |
| | | String row = ""; |
| | | if (map.get("row") != null) { |
| | | String chooseRow = (String) map.get("row"); |
| | | if (chooseRow.length() == 1) { |
| | | row = "0" + chooseRow; |
| | | map.remove("row"); |
| | | }else { |
| | | row = chooseRow; |
| | | map.remove("row"); |
| | | } |
| | | } |
| | | convert(map, wrapper); |
| | | if (!row.equals("")){ |
| | | wrapper.and() |
| | | .where("loc_no like '" +row +"%'"); |
| | | } |
| | | List<ManLocDetl> list = manLocDetlService.selectList(wrapper); |
| | | List<String> fields = param.getJSONArray("fields") == null |
| | | ? Collections.emptyList() |
| | | : JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> searchParam = param.getJSONObject("locDetl") == null |
| | | ? new HashMap<>() |
| | | : excludeTrash(param.getJSONObject("locDetl")); |
| | | String condition = searchParam.get("condition") == null ? null : String.valueOf(searchParam.remove("condition")); |
| | | List<ManLocDetl> list = manLocDetlService.selectList(buildWrapper(searchParam, condition)); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | |
| | | EntityWrapper<ManLocDetl> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(ManLocDetl.class, param.keySet(), wrapper, condition); |
| | | EntityWrapper<ManLocDetl> wrapper = buildWrapper(param, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | |
| | | return R.ok(manLocDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | |
| | | } |
| | | } |
| | | |
| | | private EntityWrapper<ManLocDetl> buildWrapper(Map<String, Object> param, String condition) { |
| | | EntityWrapper<ManLocDetl> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(ManLocDetl.class, param.keySet(), wrapper, condition); |
| | | return wrapper; |
| | | } |
| | | |
| | | |
| | | } |