| | |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.LocRevise; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreas; |
| | | import com.vincent.rsf.server.manager.service.LocReviseService; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasService; |
| | | import com.vincent.rsf.server.manager.service.impl.WarehouseAreasServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | |
| | | @Autowired |
| | | private LocReviseService locReviseService; |
| | | @Autowired |
| | | private WarehouseAreasService warehouseAreasService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/locRevise/page") |
| | |
| | | locRevise.setCreateTime(new Date()); |
| | | locRevise.setUpdateBy(getLoginUserId()); |
| | | locRevise.setUpdateTime(new Date()); |
| | | |
| | | if (Objects.isNull(locRevise.getId())) { |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_LOC_REVISE_CODE, null); |
| | | locRevise.setCode(ruleCode); |
| | | } |
| | | |
| | | WarehouseAreas areas = warehouseAreasService.getById(locRevise.getAreaId()); |
| | | if (!Objects.isNull(areas)) { |
| | | locRevise.setAreaId(areas.getId()) |
| | | .setAreaName(areas.getName()); |
| | | } |
| | | |
| | | if (!locReviseService.save(locRevise)) { |
| | | return R.error("Save Fail"); |
| | | } |