| | |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.controller.params.LocToTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.Loc; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import com.vincent.rsf.server.manager.enums.TaskResouceType; |
| | |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.manager.enums.LocStsType; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<LocItem, BaseParam> pageParam = new PageParam<>(baseParam, LocItem.class); |
| | | |
| | | // 库位状态筛选:关联 man_loc,不能作为 man_loc_item 字段参与 buildWrapper |
| | | Object useStatus = map.get("useStatus"); |
| | | if (pageParam.getWhere() != null && pageParam.getWhere().getMap() != null) { |
| | | pageParam.getWhere().getMap().remove("useStatus"); |
| | | } |
| | | QueryWrapper<LocItem> wrapper = pageParam.buildWrapper(true); |
| | | if (useStatus != null && StringUtils.isNotBlank(useStatus.toString())) { |
| | | String status = useStatus.toString().replace("'", "''"); |
| | | wrapper.apply("EXISTS (SELECT 1 FROM man_loc ml WHERE ml.id = man_loc_item.loc_id AND ml.use_status = '" + status + "')"); |
| | | } |
| | | FieldsUtils.setFieldsFilters(wrapper, pageParam, LocItem.class); |
| | | |
| | | /**拼接扩展字段*/ |
| | |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | // 填充库位状态,便于列表展示 |
| | | if (record.getLocId() != null) { |
| | | Loc loc = locService.getById(record.getLocId()); |
| | | if (loc != null) { |
| | | record.setLocUseStatus(loc.getUseStatus()); |
| | | record.setLocUseStatus$(loc.getUseStatus$()); |
| | | } |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | if (record.getLocId() != null) { |
| | | Loc loc = locService.getById(record.getLocId()); |
| | | if (loc != null) { |
| | | record.setLocUseStatus(loc.getUseStatus()); |
| | | record.setLocUseStatus$(loc.getUseStatus$()); |
| | | } |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | |