计划管理相关功能实现
This commit is contained in:
@@ -46,14 +46,14 @@ public class PrchOrdDtlController implements BusinessControllerMarker {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购订单明细")
|
||||
@PreAuthorize("@ss.hasPermission('base:prch-ord-dtl:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('base:prch-ord-dtl:create','purchase:order:list:OrderList:add')")
|
||||
public CommonResult<PrchOrdDtlRespVO> createPrchOrdDtl(@Valid @RequestBody PrchOrdDtlSaveReqVO createReqVO) {
|
||||
return success(prchOrdDtlService.createPrchOrdDtl(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采购订单明细")
|
||||
@PreAuthorize("@ss.hasPermission('base:prch-ord-dtl:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('base:prch-ord-dtl:update','purchase:order:list:OrderList:edit')")
|
||||
public CommonResult<Boolean> updatePrchOrdDtl(@Valid @RequestBody PrchOrdDtlSaveReqVO updateReqVO) {
|
||||
prchOrdDtlService.updatePrchOrdDtl(updateReqVO);
|
||||
return success(true);
|
||||
@@ -62,7 +62,7 @@ public class PrchOrdDtlController implements BusinessControllerMarker {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采购订单明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('base:prch-ord-dtl:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('base:prch-ord-dtl:delete','purchase:order:list:OrderList:delete')")
|
||||
public CommonResult<Boolean> deletePrchOrdDtl(@RequestParam("id") Long id) {
|
||||
prchOrdDtlService.deletePrchOrdDtl(id);
|
||||
return success(true);
|
||||
@@ -71,7 +71,7 @@ public class PrchOrdDtlController implements BusinessControllerMarker {
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除采购订单明细")
|
||||
@PreAuthorize("@ss.hasPermission('base:prch-ord-dtl:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('base:prch-ord-dtl:delete','purchase:order:list:OrderList:delete')")
|
||||
public CommonResult<Boolean> deletePrchOrdDtlList(@RequestBody BatchDeleteReqVO req) {
|
||||
prchOrdDtlService.deletePrchOrdDtlListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -80,7 +80,7 @@ public class PrchOrdDtlController implements BusinessControllerMarker {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采购订单明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('base:prch-ord-dtl:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('base:prch-ord-dtl:query','purchase:order:list:OrderList:query')")
|
||||
public CommonResult<PrchOrdDtlRespVO> getPrchOrdDtl(@RequestParam("id") Long id) {
|
||||
PrchOrdDtlDO prchOrdDtl = prchOrdDtlService.getPrchOrdDtl(id);
|
||||
return success(BeanUtils.toBean(prchOrdDtl, PrchOrdDtlRespVO.class));
|
||||
@@ -88,7 +88,7 @@ public class PrchOrdDtlController implements BusinessControllerMarker {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采购订单明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:prch-ord-dtl:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('base:prch-ord-dtl:query','purchase:order:list:OrderList:query')")
|
||||
public CommonResult<PageResult<PrchOrdDtlRespVO>> getPrchOrdDtlPage(@Valid PrchOrdDtlPageReqVO pageReqVO) {
|
||||
PageResult<PrchOrdDtlDO> pageResult = prchOrdDtlService.getPrchOrdDtlPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PrchOrdDtlRespVO.class));
|
||||
@@ -96,7 +96,7 @@ public class PrchOrdDtlController implements BusinessControllerMarker {
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采购订单明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('base:prch-ord-dtl:export')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('base:prch-ord-dtl:export','purchase:order:list:OrderList:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPrchOrdDtlExcel(@Valid PrchOrdDtlPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,14 @@
|
||||
package com.zt.plat.module.erp.controller.admin.erp;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialPageReqDTO;
|
||||
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationPageReqDTO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.*;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpMaterialDO;
|
||||
@@ -31,7 +33,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/base/erp-material")
|
||||
@Validated
|
||||
public class ErpMaterialController {
|
||||
public class ErpMaterialController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
@@ -147,7 +149,7 @@ public class ErpMaterialController {
|
||||
@Operation(summary = "通过主物料查询子物料信息")
|
||||
@PreAuthorize("@ss.hasAnyPermissions({'sply:erp-material:query','basic:material-config:query'})")
|
||||
public CommonResult<List<ErpMaterialRespVO>> getErpMaterialByMainMaterial(@RequestParam("id") Long mainMaterialId) {
|
||||
List<ErpMaterialDO> erpMaterial = erpMaterialService.getErpMaterialByMainMaterial(mainMaterialId);
|
||||
List<ErpMaterialRespVO> erpMaterial = erpMaterialService.getErpMaterialByMainMaterial(mainMaterialId);
|
||||
return success(BeanUtils.toBean(erpMaterial, ErpMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@@ -156,11 +158,12 @@ public class ErpMaterialController {
|
||||
@Operation(summary = "通过接口查询物料")
|
||||
@PreAuthorize("@ss.hasAnyPermissions({'sply:erp-material:query','basic:material-config:query'})")
|
||||
public CommonResult<PageResult<ErpMaterialRespVO>> getErpMaterialByApi(@RequestBody MaterialInfomationApiVO vo) {
|
||||
MaterialInfomationPageReqDTO material = new MaterialInfomationPageReqDTO();
|
||||
material.setCode(vo.getMaterialNumber());
|
||||
material.setName(vo.getMaterialName());
|
||||
DepartmentMaterialPageReqDTO material = new DepartmentMaterialPageReqDTO();
|
||||
material.setMaterialNumber(vo.getMaterialNumber());
|
||||
material.setMaterialName(vo.getMaterialName());
|
||||
material.setPageSize(vo.getPageSize());
|
||||
material.setPageNo(vo.getPageNo());
|
||||
material.setDeptId(Long.valueOf(vo.getDeptId()));
|
||||
PageResult<ErpMaterialDO> erpMaterialByApi = erpMaterialService.getErpMaterialByApi(material);
|
||||
return success(BeanUtils.toBean(erpMaterialByApi, ErpMaterialRespVO.class));
|
||||
}
|
||||
@@ -168,16 +171,15 @@ public class ErpMaterialController {
|
||||
@GetMapping("/erpMaterial-mainMaterial-code")
|
||||
@Operation(summary = "通过主物料编号查询子物料信息")
|
||||
@PreAuthorize("@ss.hasAnyPermissions({'sply:erp-material:query','basic:material-config:query'})")
|
||||
public CommonResult<ErpMaterialRespVO> getErpMaterialByMainMaterialByCode(@RequestParam("materialNumber") String code) {
|
||||
return success(BeanUtils.toBean(erpMaterialService.getErpMaterialByMainMaterialByCode(code), ErpMaterialRespVO.class));
|
||||
public CommonResult<List<ErpMaterialRespVO>> getErpMaterialByMainMaterialByCode(@RequestParam("materialNumber") String code,@RequestParam(value = "deptId",required = false) String deptId) {
|
||||
return success(BeanUtils.toBean(erpMaterialService.getErpMaterialByMainMaterialByCode(code,deptId), ErpMaterialRespVO.class));
|
||||
}
|
||||
|
||||
//查询物料
|
||||
@GetMapping("/api-erp-material-code")
|
||||
@Operation(summary = "通过编号接口查询物料")
|
||||
@PreAuthorize("@ss.hasAnyPermissions({'sply:erp-material:query','basic:material-config:query'})")
|
||||
public CommonResult<List<ErpMaterialRespVO>> getErpMaterialByApiByCode(@RequestParam("materialNumber")String code) {
|
||||
|
||||
return success(BeanUtils.toBean(erpMaterialService.getErpMaterialByApiByCode(code), ErpMaterialRespVO.class));
|
||||
public CommonResult<List<ErpMaterialRespVO>> getErpMaterialByApiByCode(@RequestParam("materialNumber")String code,@RequestParam(value = "deptId",required = false) String deptId) {
|
||||
return success(BeanUtils.toBean(erpMaterialService.getErpMaterialByApiByCode(code,deptId), ErpMaterialRespVO.class));
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,8 @@ import java.util.List;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpMaterialRespVO {
|
||||
@Schema(description = "关联表主键,删除需要使用这个", requiredMode = Schema.RequiredMode.REQUIRED, example = "2038")
|
||||
private Long corrId;
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2038")
|
||||
@ExcelProperty("主键")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialRespDTO;
|
||||
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationRespDTO;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -78,7 +79,7 @@ public class MaterialAttributeUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料属性封装Record(Java 16+)
|
||||
* 物料属性封装Record
|
||||
* 包含所有属性的安全取值
|
||||
*/
|
||||
public record MaterialAttribute(
|
||||
@@ -117,7 +118,7 @@ public class MaterialAttributeUtils {
|
||||
* @param dto 物料信息DTO
|
||||
* @return 封装后的物料属性Record
|
||||
*/
|
||||
public static MaterialAttribute safeExtractAllAttributes(MaterialInfomationRespDTO dto) {
|
||||
public static MaterialAttribute safeExtractAllAttributes(DepartmentMaterialRespDTO dto) {
|
||||
// 1. 空值校验
|
||||
if (dto == null || dto.getFlatAttributes() == null) {
|
||||
return MaterialAttribute.empty();
|
||||
|
||||
@@ -16,5 +16,7 @@ public interface ErpErpMaterialCorrService {
|
||||
List<ErpMaterialCorrRspVO> create(@Valid ErpMaterialCorrSaveReqVO reqVO);
|
||||
void deleteBatch(BatchDeleteReqVO reqVO);
|
||||
|
||||
List<ErpMaterialCorrRspVO> getErpMaterialByMainMaterial(Long mainMaterialId);
|
||||
List<ErpMaterialCorrRspVO> getErpMaterialByMainMaterial(List<Long> mainMaterialIds);
|
||||
|
||||
List<ErpMaterialCorrRspVO> getErpMaterialByMainMaterialByCode(String code);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,12 @@ public class ErpErpMaterialCorrServiceImpl implements ErpErpMaterialCorrService{
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ErpMaterialCorrRspVO> getErpMaterialByMainMaterial(Long mainMaterialId) {
|
||||
return BeanUtils.toBean( erpErpMaterialCorrMapper.selectList(ErpMaterialCorrDO::getMaterialParentId, mainMaterialId), ErpMaterialCorrRspVO.class);
|
||||
public List<ErpMaterialCorrRspVO> getErpMaterialByMainMaterial(List<Long> mainMaterialIds) {
|
||||
return BeanUtils.toBean( erpErpMaterialCorrMapper.selectList(ErpMaterialCorrDO::getMaterialParentId, mainMaterialIds), ErpMaterialCorrRspVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ErpMaterialCorrRspVO> getErpMaterialByMainMaterialByCode(String code) {
|
||||
return BeanUtils.toBean(erpErpMaterialCorrMapper.selectList(ErpMaterialCorrDO::getMaterialParentCode, code), ErpMaterialCorrRspVO.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.erp.service.erp;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialPageReqDTO;
|
||||
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationPageReqDTO;
|
||||
import com.zt.plat.module.erp.api.dto.ErpMaterialDTO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpMaterialCorrSaveReqVO;
|
||||
@@ -77,11 +78,11 @@ public interface ErpMaterialService {
|
||||
|
||||
ErpMaterialDO getErpMaterialById(Long id);
|
||||
|
||||
List<ErpMaterialDO> getErpMaterialByMainMaterial(Long mainMaterialId);
|
||||
List<ErpMaterialRespVO> getErpMaterialByMainMaterial(Long mainMaterialId);
|
||||
|
||||
PageResult<ErpMaterialDO> getErpMaterialByApi( MaterialInfomationPageReqDTO material);
|
||||
PageResult<ErpMaterialDO> getErpMaterialByApi( DepartmentMaterialPageReqDTO material);
|
||||
|
||||
ErpMaterialDO getErpMaterialByMainMaterialByCode(String code);
|
||||
List<ErpMaterialDO> getErpMaterialByMainMaterialByCode(String code,String deptId);
|
||||
|
||||
List <ErpMaterialDO>getErpMaterialByApiByCode(String code);
|
||||
List <ErpMaterialDO>getErpMaterialByApiByCode(String code,String deptId);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user