问题修改
This commit is contained in:
parent
031cfd1c1a
commit
3476f72d74
@ -147,5 +147,7 @@ public interface ErrorCodeConstants {
|
||||
/************责任人管理***********/
|
||||
ErrorCode OWNER_NOT_EXISTS = new ErrorCode(1_013_001, "人员配置主数据维护错误,请确认!");
|
||||
ErrorCode TRACK_NOT_EXISTS = new ErrorCode(1_013_002, "生产进度跟踪不存在");
|
||||
ErrorCode MAT_REQ_NOT_EXISTS = new ErrorCode(1_013_003, "领料单不存在");
|
||||
ErrorCode MAT_REQ_DETAIL_NOT_EXISTS = new ErrorCode(1_013_004, "领料单明细不存在");
|
||||
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public class bdgzsomthingController {
|
||||
BeanUtils.toBean(list, bdgzsomthingRespVO.class));
|
||||
}
|
||||
|
||||
// @Scheduled(fixedRate = 10800000)
|
||||
@Scheduled(fixedRate = 10800000)
|
||||
public void scheduledTask() {
|
||||
bdgzsomthingService.selectds();
|
||||
}
|
||||
@ -159,15 +159,15 @@ public class bdgzsomthingController {
|
||||
//@Scheduled(cron = "0 2 0 * * ?") //每天十天执行一次
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// selectHasPrice();
|
||||
// selectSafeStorageAndDeliverOneYear();
|
||||
selectHasPrice();
|
||||
selectSafeStorageAndDeliverOneYear();
|
||||
}
|
||||
// @Scheduled(cron = "0 0 2 * * ?")
|
||||
@Scheduled(cron = "0 0 2 * * ?")
|
||||
public void selectHasPrice(){
|
||||
bdgzsomthingService.selectHasPrice();
|
||||
}
|
||||
|
||||
// @Scheduled(cron = "0 0 0 * * ?")
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
public void selectSafeStorageAndDeliverOneYear(){bdgzsomthingService.selectSafeStorageAndDeliverOneYear();}
|
||||
@PostMapping("/getMessage")
|
||||
@Operation(summary = "小程序消息")
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.materialplan;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -154,4 +155,19 @@ public class MaterialPlanController {
|
||||
MaterialPlanDO materialPlan = materialPlanService.getProjectMaterialPlanNo(code);
|
||||
return success(BeanUtils.toBean(materialPlan, MaterialPlanRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getStandardPartsPages")
|
||||
@Operation(summary = "获得标准件库存")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:query')")
|
||||
public CommonResult<PageResult<MaterialPlanBoomDO>> getStandardPartsPages(@Valid MaterialPlanPageReqVO pageReqVO) {
|
||||
PageResult<MaterialPlanBoomDO> pageResult = materialPlanService.getStandardPartsPages(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
@GetMapping("/operation")
|
||||
@Operation(summary = "获得标准件库存")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:query')")
|
||||
public CommonResult<Boolean> operation(@Valid MaterialPlanPageReqVO pageReqVO) {
|
||||
return materialPlanService.operation(pageReqVO);
|
||||
}
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ public class MaterialPlanPageReqVO extends PageParam {
|
||||
private String projectCode;
|
||||
@Schema(description = "需求计划类型")
|
||||
private String matType;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreq;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreq.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreq.MatReqDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.matreq.MatReqService;
|
||||
|
||||
@Tag(name = "管理后台 - 领料单主")
|
||||
@RestController
|
||||
@RequestMapping("/heli/mat-req")
|
||||
@Validated
|
||||
public class MatReqController {
|
||||
|
||||
@Resource
|
||||
private MatReqService matReqService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建领料单主")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req:create')")
|
||||
public CommonResult<Long> createMatReq(@Valid @RequestBody MatReqSaveReqVO createReqVO) {
|
||||
return success(matReqService.createMatReq(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新领料单主")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req:update')")
|
||||
public CommonResult<Boolean> updateMatReq(@Valid @RequestBody MatReqSaveReqVO updateReqVO) {
|
||||
matReqService.updateMatReq(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除领料单主")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req:delete')")
|
||||
public CommonResult<Boolean> deleteMatReq(@RequestParam("id") Long id) {
|
||||
matReqService.deleteMatReq(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得领料单主")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req:query')")
|
||||
public CommonResult<MatReqRespVO> getMatReq(@RequestParam("id") Long id) {
|
||||
MatReqDO matReq = matReqService.getMatReq(id);
|
||||
return success(BeanUtils.toBean(matReq, MatReqRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得领料单主分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req:query')")
|
||||
public CommonResult<PageResult<MatReqRespVO>> getMatReqPage(@Valid MatReqPageReqVO pageReqVO) {
|
||||
PageResult<MatReqDO> pageResult = matReqService.getMatReqPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MatReqRespVO.class));
|
||||
}
|
||||
@PostMapping("/generate")
|
||||
@Operation(summary = "领料单生成")
|
||||
@PreAuthorize("@ss.hasPermission('heli:process-bom:create')")
|
||||
public CommonResult<Boolean> generate(@Valid @RequestBody List<MaterialPlanBoomDO> list) {
|
||||
return success(matReqService.generate(list));
|
||||
}
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出领料单主 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportMatReqExcel(@Valid MatReqPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MatReqDO> list = matReqService.getMatReqPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "领料单主.xls", "数据", MatReqRespVO.class,
|
||||
BeanUtils.toBean(list, MatReqRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreq.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 领料单主分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MatReqPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "领料单单号")
|
||||
private String matReqNo;
|
||||
|
||||
@Schema(description = "领料单类型,1物料,2加工件", example = "2")
|
||||
private Integer goodsType;
|
||||
|
||||
@Schema(description = "单据状态,0 未领料,1已领料 ,默认是0", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "订单id", example = "31962")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "生产计划id", example = "14788")
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "客户id", example = "23800")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "领料单日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] reqDate;
|
||||
|
||||
@Schema(description = "项目名称", example = "李四")
|
||||
private String projectName;
|
||||
@Schema(description = "项目名称", example = "李四")
|
||||
private String projectSubName;
|
||||
@Schema(description = "物料名称", example = "李四")
|
||||
private String materialName;
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreq.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 领料单主 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MatReqRespVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "15799")
|
||||
@ExcelProperty("自增字段,唯一")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "领料单单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("领料单单号")
|
||||
private String matReqNo;
|
||||
|
||||
@Schema(description = "领料单类型,1物料,2加工件", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("领料单类型,1物料,2加工件")
|
||||
private Integer goodsType;
|
||||
|
||||
@Schema(description = "单据状态,0 未领料,1已领料 ,默认是0", example = "1")
|
||||
@ExcelProperty("单据状态,0 未领料,1已领料 ,默认是0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "订单id", example = "31962")
|
||||
@ExcelProperty("订单id")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "生产计划id", example = "14788")
|
||||
@ExcelProperty("生产计划id")
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "客户id", example = "23800")
|
||||
@ExcelProperty("客户id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "领料单日期")
|
||||
@ExcelProperty("领料单日期")
|
||||
private Date reqDate;
|
||||
|
||||
@Schema(description = "项目名称", example = "李四")
|
||||
@ExcelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreq.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 领料单主新增/修改 Request VO")
|
||||
@Data
|
||||
public class MatReqSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "15799")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "领料单单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "领料单单号不能为空")
|
||||
private String matReqNo;
|
||||
|
||||
@Schema(description = "领料单类型,1物料,2加工件", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "领料单类型,1物料,2加工件不能为空")
|
||||
private Integer goodsType;
|
||||
|
||||
@Schema(description = "单据状态,0 未领料,1已领料 ,默认是0", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "订单id", example = "31962")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "生产计划id", example = "14788")
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "客户id", example = "23800")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "领料单日期")
|
||||
private LocalDate reqDate;
|
||||
|
||||
@Schema(description = "项目名称", example = "李四")
|
||||
private String projectName;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.matreqdetail.MatReqDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 领料单明细")
|
||||
@RestController
|
||||
@RequestMapping("/heli/mat-req-detail")
|
||||
@Validated
|
||||
public class MatReqDetailController {
|
||||
|
||||
@Resource
|
||||
private MatReqDetailService matReqDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建领料单明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req-detail:create')")
|
||||
public CommonResult<Long> createMatReqDetail(@Valid @RequestBody MatReqDetailSaveReqVO createReqVO) {
|
||||
return success(matReqDetailService.createMatReqDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新领料单明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req-detail:update')")
|
||||
public CommonResult<Boolean> updateMatReqDetail(@Valid @RequestBody MatReqDetailSaveReqVO updateReqVO) {
|
||||
matReqDetailService.updateMatReqDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除领料单明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMatReqDetail(@RequestParam("id") Long id) {
|
||||
matReqDetailService.deleteMatReqDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得领料单明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req-detail:query')")
|
||||
public CommonResult<MatReqDetailRespVO> getMatReqDetail(@RequestParam("id") Long id) {
|
||||
MatReqDetailDO matReqDetail = matReqDetailService.getMatReqDetail(id);
|
||||
return success(BeanUtils.toBean(matReqDetail, MatReqDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得领料单明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req-detail:query')")
|
||||
public CommonResult<PageResult<MatReqDetailRespVO>> getMatReqDetailPage(@Valid MatReqDetailPageReqVO pageReqVO) {
|
||||
PageResult<MatReqDetailDO> pageResult = matReqDetailService.getMatReqDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MatReqDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出领料单明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:mat-req-detail:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportMatReqDetailExcel(@Valid MatReqDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MatReqDetailDO> list = matReqDetailService.getMatReqDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "领料单明细.xls", "数据", MatReqDetailRespVO.class,
|
||||
BeanUtils.toBean(list, MatReqDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 领料单明细分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MatReqDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "采购单id", example = "29474")
|
||||
private Long matReqId;
|
||||
|
||||
@Schema(description = "加工件boom detail id", example = "3666")
|
||||
private Long boomDetailId;
|
||||
|
||||
@Schema(description = "零件名称", example = "赵六")
|
||||
private String boomName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String boomSpec;
|
||||
|
||||
@Schema(description = "系统单位")
|
||||
private String boomUnit;
|
||||
|
||||
@Schema(description = "材质")
|
||||
private String composition;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "需求数量")
|
||||
private BigDecimal boomAmount;
|
||||
|
||||
@Schema(description = "需求到货日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] requireTime;
|
||||
|
||||
@Schema(description = "订单子项目id", example = "3875")
|
||||
private Long projectPlanSubId;
|
||||
|
||||
@Schema(description = "子项目名称,唯一", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "子项目简码")
|
||||
private String nameSim;
|
||||
|
||||
@Schema(description = "子项目编码")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "物料id", example = "32088")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "物料需求计划主表id", example = "14306")
|
||||
private Long projectMaterialPlanId;
|
||||
|
||||
@Schema(description = "物料需求计划子表id", example = "20125")
|
||||
private Long projectMaterialPlanDetailId;
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 领料单明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MatReqDetailRespVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "1058")
|
||||
@ExcelProperty("自增字段,唯一")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29474")
|
||||
@ExcelProperty("采购单id")
|
||||
private Long matReqId;
|
||||
|
||||
@Schema(description = "加工件boom detail id", example = "3666")
|
||||
@ExcelProperty("加工件boom detail id")
|
||||
private Long boomDetailId;
|
||||
|
||||
@Schema(description = "零件名称", example = "赵六")
|
||||
@ExcelProperty("零件名称")
|
||||
private String boomName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
@ExcelProperty("规格型号")
|
||||
private String boomSpec;
|
||||
|
||||
@Schema(description = "系统单位")
|
||||
@ExcelProperty("系统单位")
|
||||
private String boomUnit;
|
||||
|
||||
@Schema(description = "材质")
|
||||
@ExcelProperty("材质")
|
||||
private String composition;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "需求数量")
|
||||
@ExcelProperty("需求数量")
|
||||
private BigDecimal boomAmount;
|
||||
|
||||
@Schema(description = "需求到货日期")
|
||||
@ExcelProperty("需求到货日期")
|
||||
private LocalDateTime requireTime;
|
||||
|
||||
@Schema(description = "订单子项目id", example = "3875")
|
||||
@ExcelProperty("订单子项目id")
|
||||
private Long projectPlanSubId;
|
||||
|
||||
@Schema(description = "子项目名称,唯一", example = "张三")
|
||||
@ExcelProperty("子项目名称,唯一")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "子项目简码")
|
||||
@ExcelProperty("子项目简码")
|
||||
private String nameSim;
|
||||
|
||||
@Schema(description = "子项目编码")
|
||||
@ExcelProperty("子项目编码")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "物料id", example = "32088")
|
||||
@ExcelProperty("物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "物料需求计划主表id", example = "14306")
|
||||
@ExcelProperty("物料需求计划主表id")
|
||||
private Long projectMaterialPlanId;
|
||||
|
||||
@Schema(description = "物料需求计划子表id", example = "20125")
|
||||
@ExcelProperty("物料需求计划子表id")
|
||||
private Long projectMaterialPlanDetailId;
|
||||
/**
|
||||
* 子项目编码
|
||||
*/
|
||||
@Schema(description = "物料编码", example = "32088")
|
||||
private String materialCode;
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 领料单明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class MatReqDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "1058")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29474")
|
||||
@NotNull(message = "采购单id不能为空")
|
||||
private Long matReqId;
|
||||
|
||||
@Schema(description = "加工件boom detail id", example = "3666")
|
||||
private Long boomDetailId;
|
||||
|
||||
@Schema(description = "零件名称", example = "赵六")
|
||||
private String boomName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String boomSpec;
|
||||
|
||||
@Schema(description = "系统单位")
|
||||
private String boomUnit;
|
||||
|
||||
@Schema(description = "材质")
|
||||
private String composition;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "需求数量")
|
||||
private BigDecimal boomAmount;
|
||||
|
||||
@Schema(description = "需求到货日期")
|
||||
private LocalDateTime requireTime;
|
||||
|
||||
@Schema(description = "订单子项目id", example = "3875")
|
||||
private Long projectPlanSubId;
|
||||
|
||||
@Schema(description = "子项目名称,唯一", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "子项目简码")
|
||||
private String nameSim;
|
||||
|
||||
@Schema(description = "子项目编码")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "物料id", example = "32088")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "物料需求计划主表id", example = "14306")
|
||||
private Long projectMaterialPlanId;
|
||||
|
||||
@Schema(description = "物料需求计划子表id", example = "20125")
|
||||
private Long projectMaterialPlanDetailId;
|
||||
|
||||
}
|
@ -75,7 +75,7 @@ public class PurchaseOrderNoPageReqVO extends PageParam {
|
||||
private LocalDate[] ordDate;
|
||||
|
||||
@Schema(description = "收货状态 未收货/收货中/收货完成 1/2/3", example = "1")
|
||||
private Boolean receivingStatus;
|
||||
private Integer receivingStatus;
|
||||
|
||||
@Schema(description = "结算币种", example = "2")
|
||||
private Integer currencyType;
|
||||
|
@ -28,7 +28,7 @@ public class PurchaseOrderNoRespVO {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty(value="单据日期", converter = TimestampToDateConvert.class)
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "供应商id")
|
||||
private Long supplierId;
|
||||
@ -107,4 +107,6 @@ public class PurchaseOrderNoRespVO {
|
||||
private String creator;
|
||||
@Schema(description = "是否打印")
|
||||
private String isPrint;
|
||||
@Schema(description = "收货状态")
|
||||
private Integer receivingStatus1;
|
||||
}
|
@ -98,7 +98,7 @@ public class PurchaseOrderNoDetailPageReqVO extends PageParam {
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "收货状态 未收货/收货中/收货完成 1/2/3", example = "2")
|
||||
private Boolean receivingStatus;
|
||||
private Integer receivingStatus;
|
||||
|
||||
@Schema(description = "入库单id", example = "28663")
|
||||
private Long storageId;
|
||||
|
@ -112,6 +112,10 @@ public class MaterialPlanBoomDO extends BaseDO {
|
||||
@TableField(exist = false)
|
||||
private String boomUnit;
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
@TableField(exist = false)
|
||||
private String projectSubName;
|
||||
@TableField(exist = false)
|
||||
private String compositionName;
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
@ -122,8 +126,12 @@ public class MaterialPlanBoomDO extends BaseDO {
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
@TableField(exist = false)
|
||||
private String blueprintNo;
|
||||
@TableField(exist = false)
|
||||
private Long matId;
|
||||
@TableField(exist = false)
|
||||
private Long projectId;
|
||||
@TableField(exist = false)
|
||||
private String matCode;
|
||||
@TableField(exist = false)
|
||||
private String matSpec;
|
||||
@ -134,4 +142,5 @@ public class MaterialPlanBoomDO extends BaseDO {
|
||||
@TableField(exist = false)
|
||||
private BigDecimal matRest;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.matreq;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 领料单主 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("project_mat_req")
|
||||
@KeySequence("project_mat_req_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MatReqDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 自增字段,唯一
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 领料单单号
|
||||
*/
|
||||
private String matReqNo;
|
||||
/**
|
||||
* 领料单类型,1物料,2加工件
|
||||
*/
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 单据状态,0 未领料,1已领料 ,默认是0
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 生产计划id
|
||||
*/
|
||||
private Long projectPlanId;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long customerId;
|
||||
/**
|
||||
* 领料单日期
|
||||
*/
|
||||
private LocalDate reqDate;
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 领料单明细 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("project_mat_req_detail")
|
||||
@KeySequence("project_mat_req_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MatReqDetailDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 自增字段,唯一
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 采购单id
|
||||
*/
|
||||
private Long matReqId;
|
||||
/**
|
||||
* 加工件boom detail id
|
||||
*/
|
||||
private Long boomDetailId;
|
||||
/**
|
||||
* 零件名称
|
||||
*/
|
||||
private String boomName;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String boomSpec;
|
||||
/**
|
||||
* 系统单位
|
||||
*/
|
||||
private String boomUnit;
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String composition;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
private BigDecimal boomAmount;
|
||||
/**
|
||||
* 需求到货日期
|
||||
*/
|
||||
private LocalDateTime requireTime;
|
||||
/**
|
||||
* 订单子项目id
|
||||
*/
|
||||
private Long projectPlanSubId;
|
||||
/**
|
||||
* 子项目名称,唯一
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 子项目简码
|
||||
*/
|
||||
private String nameSim;
|
||||
/**
|
||||
* 子项目编码
|
||||
*/
|
||||
private String projectSubCode;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private Long materialId;
|
||||
/**
|
||||
* 物料需求计划主表id
|
||||
*/
|
||||
private Long projectMaterialPlanId;
|
||||
/**
|
||||
* 物料需求计划子表id
|
||||
*/
|
||||
private Long projectMaterialPlanDetailId;
|
||||
|
||||
/**
|
||||
* 子项目编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String materialCode;
|
||||
|
||||
}
|
@ -6,6 +6,7 @@ import lombok.*;
|
||||
import java.time.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
@ -141,6 +142,8 @@ public class PurchaseOrderNoDO extends BaseDO {
|
||||
@TableField(exist = false)
|
||||
private String contactMobile;
|
||||
@TableField(exist = false)
|
||||
private Integer receivingStatus1;
|
||||
@TableField(exist = false)
|
||||
private List<PurchaseOrderNoDetailDO> PurchaseOrderNoDetailList;
|
||||
/**
|
||||
* 是否打印
|
||||
@ -153,5 +156,5 @@ public class PurchaseOrderNoDO extends BaseDO {
|
||||
/**
|
||||
* 订单日期
|
||||
*/
|
||||
private LocalDate ordDate;
|
||||
private Date ordDate;
|
||||
}
|
@ -188,4 +188,6 @@ public class PurchaseOrderNoDetailDO extends BaseDO {
|
||||
private BigDecimal purchaseRemAmounts;
|
||||
@TableField(exist = false)
|
||||
private String compositionName;
|
||||
@TableField(exist = false)
|
||||
private String procedureName;
|
||||
}
|
@ -6,14 +6,18 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplan.vo.MaterialPlanPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.BoomDetailTypeEnum;
|
||||
@ -110,6 +114,28 @@ public interface MaterialPlanBoomMapper extends BaseMapperX<MaterialPlanBoomDO>
|
||||
return selectPage(pageReqVO, query);
|
||||
}
|
||||
|
||||
default PageResult<MaterialPlanBoomDO> getStandardPartsPages(MaterialPlanPageReqVO pageReqVO){
|
||||
MPJLambdaWrapper<MaterialPlanBoomDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(MaterialPlanBoomDO.class)
|
||||
.select("p.project_name as projectName","p.project_id as projectId","p.name as projectSubName","mat.material_id as matId")
|
||||
.select("d.spec as boomSpec","d.blueprint_no as blueprintNo","d.unit as boomUnit")
|
||||
.leftJoin(MaterialPlanDO.class, "p", MaterialPlanDO::getId,MaterialPlanBoomDO::getProjectMaterialPlanId)
|
||||
.leftJoin(ProjectOrderDO.class,"b",ProjectOrderDO::getId,MaterialPlanDO::getProjectId)
|
||||
.leftJoin(ProcessBomDetailDO.class,"d",ProcessBomDetailDO::getId,MaterialPlanBoomDO::getBoomDetailId)
|
||||
.leftJoin(MatReqDetailDO.class,"mat",MatReqDetailDO::getProjectMaterialPlanDetailId,MaterialPlanBoomDO::getId)
|
||||
.disableSubLogicDel()
|
||||
.groupBy(MaterialPlanBoomDO::getId)
|
||||
.orderByDesc(MaterialPlanBoomDO::getCreateTime);
|
||||
query
|
||||
.like(!StringUtils.isEmpty(pageReqVO.getProjectName()),MaterialPlanDO::getProjectName, pageReqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), MaterialPlanDO::getName, pageReqVO.getProjectSubName())
|
||||
.like(!StringUtils.isEmpty(pageReqVO.getMaterialName()), MaterialPlanBoomDO::getMatName, pageReqVO.getMaterialName())
|
||||
.like(!StringUtils.isEmpty(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode())
|
||||
.eq(!StringUtils.isEmpty(pageReqVO.getMatType()), MaterialPlanDO::getMatType, pageReqVO.getMatType())
|
||||
.eq(!StringUtils.isEmpty(pageReqVO.getStatus()), MaterialPlanBoomDO::getIsPurYard, pageReqVO.getStatus());
|
||||
return selectPage(pageReqVO, query);
|
||||
}
|
||||
|
||||
// default PageResult<MaterialPlanBoomDO> selectPage(MaterialPlanBoomPageReqVO reqVO) {
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<MaterialPlanBoomDO>()
|
||||
// .eqIfPresent(MaterialPlanBoomDO::getId, reqVO.getId())
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.matreq;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.MatReqDetailController;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreq.MatReqDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreq.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 领料单主 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface MatReqMapper extends BaseMapperX<MatReqDO> {
|
||||
|
||||
default PageResult<MatReqDO> selectPage(MatReqPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<MatReqDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(MatReqDO.class)
|
||||
.leftJoin(MatReqDetailDO.class, "d", MatReqDetailDO::getMatReqId, MatReqDO::getId)
|
||||
.leftJoin(MaterialDO.class, "m", MaterialDO::getId, MatReqDetailDO::getMaterialId)
|
||||
.disableSubLogicDel()
|
||||
.groupBy(MatReqDO::getId)
|
||||
.orderByDesc(MatReqDO::getCreateTime);
|
||||
query.like(!StringUtils.isEmpty(reqVO.getMatReqNo()), MatReqDO::getMatReqNo, reqVO.getMatReqNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectName()),MatReqDO::getProjectName, reqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), MatReqDetailDO::getName,reqVO.getProjectSubName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getMaterialName()), MaterialDO::getName, reqVO.getMaterialName())
|
||||
.eq(!StringUtils.isEmpty(reqVO.getGoodsType()), MatReqDO::getGoodsType, reqVO.getGoodsType());
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.matreqdetail;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreq.MatReqDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 领料单明细 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface MatReqDetailMapper extends BaseMapperX<MatReqDetailDO> {
|
||||
|
||||
default PageResult<MatReqDetailDO> selectPage(MatReqDetailPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<MatReqDetailDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(MatReqDetailDO.class)
|
||||
.select("m.code as materialCode")
|
||||
.leftJoin(MaterialDO.class, "m", MaterialDO::getId, MatReqDetailDO::getMaterialId)
|
||||
.disableSubLogicDel()
|
||||
.groupBy(MatReqDetailDO::getId)
|
||||
.orderByDesc(MatReqDetailDO::getCreateTime);
|
||||
query.eq(!StringUtils.isEmpty(reqVO.getMatReqId()), MatReqDetailDO::getMatReqId, reqVO.getMatReqId());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
}
|
@ -33,6 +33,12 @@ public interface PurchaseOrderNoMapper extends BaseMapperX<PurchaseOrderNoDO> {
|
||||
|
||||
query.selectAll(PurchaseOrderNoDO.class)
|
||||
.select("s.name as supplierName","m.project_material_plan_no as materialPlanNo")
|
||||
.select("CASE " +
|
||||
" WHEN COUNT(d.id) = 0 THEN 1 " + // 无子记录
|
||||
" WHEN SUM(CASE d.receiving_status WHEN 3 THEN 0 ELSE 1 END) = 0 THEN 3 " + // 全部为3
|
||||
" WHEN SUM(CASE d.receiving_status WHEN 1 THEN 1 ELSE 0 END) = COUNT(d.id) THEN 1 " + // 全部为1
|
||||
" ELSE 2 " + // 其他情况
|
||||
"END AS receivingStatus1")
|
||||
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderNoDO::getSupplierId)
|
||||
.leftJoin(PurchaseOrderNoDetailDO.class,"d", PurchaseOrderNoDetailDO::getPurchaseOrderId, PurchaseOrderNoDO::getId)
|
||||
.leftJoin(MaterialPlanDO.class, "m", MaterialPlanDO::getId, PurchaseOrderNoDO::getProjectMaterialPlanId)
|
||||
@ -45,13 +51,13 @@ public interface PurchaseOrderNoMapper extends BaseMapperX<PurchaseOrderNoDO> {
|
||||
.like(!StringUtils.isEmpty(reqVO.getMaterialPlanNo()), "m.project_material_plan_no", reqVO.getMaterialPlanNo())
|
||||
.apply(!StringUtils.isEmpty(reqVO.getCreateTime()), "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", reqVO.getCreateTime())
|
||||
.eq(reqVO.getStatus() != null, PurchaseOrderNoDO::getStatus, reqVO.getStatus())
|
||||
.eq(reqVO.getReceivingStatus() != null, PurchaseOrderNoDO::getReceivingStatus, reqVO.getReceivingStatus())
|
||||
// .eq(reqVO.getReceivingStatus() != null, PurchaseOrderNoDO::getReceivingStatus, reqVO.getReceivingStatus())
|
||||
.eq(reqVO.getPurchaseType() != null, PurchaseOrderNoDO::getPurchaseType, reqVO.getPurchaseType())
|
||||
.eq(reqVO.getGoodsType() != null, PurchaseOrderNoDO::getGoodsType, reqVO.getGoodsType())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectName()), PurchaseOrderNoDetailDO::getProjectName, reqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), PurchaseOrderNoDetailDO::getName, reqVO.getProjectSubName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getUsername()), AdminUserDO::getNickname, reqVO.getUsername())
|
||||
|
||||
.having(reqVO.getReceivingStatus() != null,"receivingStatus1 = {0}", reqVO.getReceivingStatus())
|
||||
.in(reqVO.getIds() != null && !reqVO.getIds().isEmpty(),PurchaseOrderNoDO::getId,reqVO.getIds());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
|
@ -5,10 +5,14 @@ import java.util.*;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.ProcessBoomPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.PurchaseOrderMaterialPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO;
|
||||
@ -19,6 +23,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMate
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
||||
import org.springframework.beans.PropertyValues;
|
||||
|
||||
/**
|
||||
* 采购订单明细 Mapper
|
||||
@ -53,8 +58,11 @@ public interface PurchaseOrderNoDetailMapper extends BaseMapperX<PurchaseOrderNo
|
||||
MPJLambdaWrapper<PurchaseOrderNoDetailDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PurchaseOrderNoDetailDO.class)
|
||||
.select("com.name as compositionName","t.purchase_rem_amount as purchaseRemAmounts","mat.code as matCode")
|
||||
.select("com.name as compositionName","t.purchase_rem_amount as purchaseRemAmounts","mat.code as matCode","pro.name as procedureName")
|
||||
.leftJoin(PurchaseOrderNoDO.class, "pb", PurchaseOrderNoDO::getId, PurchaseOrderBoomDO::getPurchaseOrderId)
|
||||
.leftJoin(ProcessBomDetailDO.class,"bom", ProcessBomDetailDO::getId, PurchaseOrderNoDetailDO::getBoomDetailId)
|
||||
.leftJoin(MaterialPlanBoomDO.class,"plan", MaterialPlanBoomDO::getId, PurchaseOrderNoDetailDO::getProjectMaterialPlanBoomId)
|
||||
.leftJoin(ProcedureDO.class,"pro", ProcedureDO::getId, MaterialPlanBoomDO::getProcedureId)
|
||||
.leftJoin(CompositionDO.class, "com", CompositionDO::getId, PurchaseOrderNoDetailDO::getComposition)
|
||||
.leftJoin(ProjectOrderSubDO.class,"sub",ProjectOrderSubDO::getId, PurchaseOrderNoDetailDO::getProjectPlanSubId)
|
||||
.leftJoin(MaterialDO.class,"mat",MaterialDO::getId,PurchaseOrderNoDetailDO::getMaterialId)
|
||||
@ -64,4 +72,12 @@ public interface PurchaseOrderNoDetailMapper extends BaseMapperX<PurchaseOrderNo
|
||||
.orderByDesc(PurchaseOrderMaterialDO::getCreateTime);
|
||||
return selectList(query);
|
||||
}
|
||||
|
||||
default List<PurchaseOrderNoDetailDO> listStatusByOrderIds(List<Long> orderIds){
|
||||
MPJLambdaWrapper<PurchaseOrderNoDetailDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(PurchaseOrderNoDetailDO.class);
|
||||
query.in(PurchaseOrderNoDetailDO::getPurchaseOrderId, orderIds);
|
||||
query.eq(PurchaseOrderNoDetailDO::getDeleted, 0);
|
||||
return selectList(query);
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.TaskDispat
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||
|
||||
@ -70,4 +71,8 @@ public interface MaterialPlanService {
|
||||
PageResult<MaterialPlanDO> getBeiKuPage(MaterialPlanPageReqVO pageReqVO);
|
||||
|
||||
MaterialPlanDO getProjectMaterialPlanNo(String code);
|
||||
|
||||
PageResult<MaterialPlanBoomDO> getStandardPartsPages(MaterialPlanPageReqVO pageReqVO);
|
||||
|
||||
CommonResult<Boolean> operation(MaterialPlanPageReqVO pageReqVO);
|
||||
}
|
||||
|
@ -339,4 +339,36 @@ public class MaterialPlanServiceImpl implements MaterialPlanService {
|
||||
return materialPlanMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialPlanBoomDO> getStandardPartsPages(MaterialPlanPageReqVO pageReqVO) {
|
||||
return materialPlanBoomMapper.getStandardPartsPages(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> operation(MaterialPlanPageReqVO pageReqVO) {
|
||||
MaterialPlanBoomDO boomDO = materialPlanBoomMapper.selectById(pageReqVO.getId());
|
||||
if (ObjectUtil.isNotEmpty(boomDO)){
|
||||
switch (pageReqVO.getType()){
|
||||
case "del":
|
||||
if (boomDO.getIsPurYard()!=5||boomDO.getIsPurYard()!=2) return CommonResult.error(400,"该物料信息状态非确认状态,请刷新界面!");
|
||||
boomDO.setIsPurYard(1);
|
||||
break;
|
||||
case "queren":
|
||||
if (boomDO.getIsPurYard()!=1) return CommonResult.error(400,"该物料信息状态非库存状态,请刷新界面!");
|
||||
boomDO.setIsPurYard(2);
|
||||
break;
|
||||
case "bucong":
|
||||
if (boomDO.getIsPurYard()!=1) return CommonResult.error(400,"该物料信息状态非库存状态,请刷新界面!");
|
||||
boomDO.setIsPurYard(4);
|
||||
break;
|
||||
case "caigou":
|
||||
if (boomDO.getIsPurYard()!=1) return CommonResult.error(400,"该物料信息状态非库存状态,请刷新界面!");
|
||||
boomDO.setIsPurYard(5);
|
||||
break;
|
||||
}
|
||||
materialPlanBoomMapper.updateById(boomDO);
|
||||
}
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.matreq;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreq.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreq.MatReqDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 领料单主 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface MatReqService {
|
||||
|
||||
/**
|
||||
* 创建领料单主
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMatReq(@Valid MatReqSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新领料单主
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMatReq(@Valid MatReqSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除领料单主
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMatReq(Long id);
|
||||
|
||||
/**
|
||||
* 获得领料单主
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 领料单主
|
||||
*/
|
||||
MatReqDO getMatReq(Long id);
|
||||
|
||||
/**
|
||||
* 获得领料单主分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 领料单主分页
|
||||
*/
|
||||
PageResult<MatReqDO> getMatReqPage(MatReqPageReqVO pageReqVO);
|
||||
|
||||
Boolean generate(List<MaterialPlanBoomDO> list);
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.matreq;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom.MaterialPlanBoomMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.matreqdetail.MatReqDetailMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreq.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreq.MatReqDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.matreq.MatReqMapper;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 领料单主 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MatReqServiceImpl implements MatReqService {
|
||||
|
||||
@Resource
|
||||
private MatReqMapper matReqMapper;
|
||||
@Resource
|
||||
private MaterialPlanBoomMapper materialPlanBoomMapper;
|
||||
@Resource
|
||||
private MatReqDetailMapper matReqDetailMapper;
|
||||
|
||||
@Override
|
||||
public Long createMatReq(MatReqSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MatReqDO matReq = BeanUtils.toBean(createReqVO, MatReqDO.class);
|
||||
matReqMapper.insert(matReq);
|
||||
// 返回
|
||||
return matReq.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMatReq(MatReqSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMatReqExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MatReqDO updateObj = BeanUtils.toBean(updateReqVO, MatReqDO.class);
|
||||
matReqMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMatReq(Long id) {
|
||||
// 校验存在
|
||||
validateMatReqExists(id);
|
||||
MatReqDO matReqDO = matReqMapper.selectById(id);
|
||||
LambdaQueryWrapper<MatReqDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MatReqDetailDO::getMatReqId,id);
|
||||
List<MatReqDetailDO> matReqDetailDOS = matReqDetailMapper.selectList(wrapper);
|
||||
List<Long> detailIds = matReqDetailDOS.stream()
|
||||
.map(MatReqDetailDO::getProjectMaterialPlanDetailId)
|
||||
.collect(Collectors.toList());
|
||||
LambdaUpdateWrapper<MaterialPlanBoomDO> wrapper1 = new LambdaUpdateWrapper<>();
|
||||
wrapper1.in(MaterialPlanBoomDO::getId,detailIds);
|
||||
wrapper1.set(MaterialPlanBoomDO::getIsPurYard,1);
|
||||
materialPlanBoomMapper.update(wrapper1);
|
||||
LambdaUpdateWrapper<MatReqDetailDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(MatReqDetailDO::getMatReqId,id);
|
||||
matReqDetailMapper.delete(updateWrapper);
|
||||
// 删除
|
||||
matReqMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateMatReqExists(Long id) {
|
||||
if (matReqMapper.selectById(id) == null) {
|
||||
throw exception(MAT_REQ_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MatReqDO getMatReq(Long id) {
|
||||
return matReqMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MatReqDO> getMatReqPage(MatReqPageReqVO pageReqVO) {
|
||||
return matReqMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean generate(List<MaterialPlanBoomDO> list) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.matreqdetail;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 领料单明细 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface MatReqDetailService {
|
||||
|
||||
/**
|
||||
* 创建领料单明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMatReqDetail(@Valid MatReqDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新领料单明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMatReqDetail(@Valid MatReqDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除领料单明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMatReqDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得领料单明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 领料单明细
|
||||
*/
|
||||
MatReqDetailDO getMatReqDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得领料单明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 领料单明细分页
|
||||
*/
|
||||
PageResult<MatReqDetailDO> getMatReqDetailPage(MatReqDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.matreqdetail;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.matreqdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matreqdetail.MatReqDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.matreqdetail.MatReqDetailMapper;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 领料单明细 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MatReqDetailServiceImpl implements MatReqDetailService {
|
||||
|
||||
@Resource
|
||||
private MatReqDetailMapper matReqDetailMapper;
|
||||
|
||||
@Override
|
||||
public Long createMatReqDetail(MatReqDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MatReqDetailDO matReqDetail = BeanUtils.toBean(createReqVO, MatReqDetailDO.class);
|
||||
matReqDetailMapper.insert(matReqDetail);
|
||||
// 返回
|
||||
return matReqDetail.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMatReqDetail(MatReqDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMatReqDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MatReqDetailDO updateObj = BeanUtils.toBean(updateReqVO, MatReqDetailDO.class);
|
||||
matReqDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMatReqDetail(Long id) {
|
||||
// 校验存在
|
||||
validateMatReqDetailExists(id);
|
||||
// 删除
|
||||
matReqDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateMatReqDetailExists(Long id) {
|
||||
if (matReqDetailMapper.selectById(id) == null) {
|
||||
throw exception(MAT_REQ_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MatReqDetailDO getMatReqDetail(Long id) {
|
||||
return matReqDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MatReqDetailDO> getMatReqDetailPage(MatReqDetailPageReqVO pageReqVO) {
|
||||
return matReqDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -62,7 +62,7 @@ public class PartPurchaseOrderServiceImpl implements PartPurchaseOrderService{
|
||||
purchaseOrderNoDO.setPurchaseType(1);
|
||||
purchaseOrderNoDO.setGoodsType(2);
|
||||
purchaseOrderNoDO.setSupplierId(detailDO.getSupplierId());
|
||||
purchaseOrderNoDO.setOrdDate(LocalDate.now());
|
||||
purchaseOrderNoDO.setOrdDate(new Date());
|
||||
purchaseOrderNoMapper.insert(purchaseOrderNoDO);
|
||||
long purchaseOrderId = purchaseOrderNoDO.getId();
|
||||
|
||||
|
@ -42,6 +42,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
@ -245,6 +247,39 @@ public class PurchaseOrderNoServiceImpl implements PurchaseOrderNoService {
|
||||
|
||||
@Override
|
||||
public PageResult<PurchaseOrderNoDO> getPurchaseOrderNoPage(PurchaseOrderNoPageReqVO pageReqVO) {
|
||||
// PageResult<PurchaseOrderNoDO> orderNoDOPageResult =
|
||||
// // 获取分页结果中的主订单列表
|
||||
// List<PurchaseOrderNoDO> orderList = orderNoDOPageResult.getList();
|
||||
//
|
||||
//// 提取所有主订单ID
|
||||
// List<Long> orderIds = orderList.stream()
|
||||
// .map(PurchaseOrderNoDO::getId)
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
//// 批量查询子表收货状态(orderId -> 状态列表)
|
||||
// Map<Long, List<Integer>> statusMap = orderIds.isEmpty()
|
||||
// ? Collections.emptyMap()
|
||||
// : purchaseOrderNoDetailMapper.listStatusByOrderIds(orderIds).stream()
|
||||
// .collect(Collectors.groupingBy(
|
||||
// PurchaseOrderNoDetailDO::getPurchaseOrderId,
|
||||
// Collectors.mapping(PurchaseOrderNoDetailDO::getReceivingStatus, Collectors.toList())
|
||||
// ));
|
||||
//
|
||||
//// 遍历主订单并设置收货状态
|
||||
// orderList.forEach(order -> {
|
||||
// List<Integer> subStatuses = statusMap.getOrDefault(order.getId(), Collections.emptyList());
|
||||
//
|
||||
// if (subStatuses.isEmpty()) {
|
||||
// order.setReceivingStatus(1); // 无子记录视为未收货
|
||||
// } else if (subStatuses.stream().allMatch(status -> status == 3)) {
|
||||
// order.setReceivingStatus(3); // 全部为3:收货完成
|
||||
// } else if (subStatuses.stream().allMatch(status -> status == 1)) {
|
||||
// order.setReceivingStatus(1); // 全部为1:未收货
|
||||
// } else {
|
||||
// order.setReceivingStatus(2); // 其他情况:收货中
|
||||
// }
|
||||
// });
|
||||
// orderNoDOPageResult.setList(orderList);
|
||||
return purchaseOrderNoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@ -280,8 +315,12 @@ public class PurchaseOrderNoServiceImpl implements PurchaseOrderNoService {
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteForm(Long id) {
|
||||
PurchaseOrderNoDO purchaseOrderNoDO = purchaseOrderNoMapper.selectById(id);
|
||||
if (purchaseOrderNoDO.getReceivingStatus()!=1) {
|
||||
LambdaQueryWrapper<PurchaseOrderNoDetailDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PurchaseOrderNoDetailDO::getPurchaseOrderId, id);
|
||||
queryWrapper.eq(PurchaseOrderNoDetailDO::getDeleted,0);
|
||||
queryWrapper.ne(PurchaseOrderNoDetailDO::getReceivingStatus, 1);
|
||||
List<PurchaseOrderNoDetailDO> noDetailDOS = purchaseOrderNoDetailMapper.selectList(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(noDetailDOS)) {
|
||||
return CommonResult.error(400,"该订单已收货,请确认!");
|
||||
}
|
||||
LambdaQueryWrapper<PurchaseOrderNoDetailDO> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.purchaseordernodetail;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chanko.yunxi.mes.framework.common.exception.ErrorCode;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
@ -110,7 +111,7 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
||||
PurchaseOrderNoDetailDO byId = purchaseOrderNoDetailMapper.selectById(purchaseOrderNoDetailDO.getId());
|
||||
if (ObjectUtil.isNotEmpty(byId)){
|
||||
if (BigDecimal.ZERO.compareTo(byId.getPurchaseRemAmount())>=0) throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"剩余数量等于0,请确认!"));
|
||||
if (byId.getReceivingStatus()!=1) throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"已收货,请确认!"));
|
||||
if (byId.getReceivingStatus()==3) throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"已收货,请确认!"));
|
||||
if (byId.getPurchaseRemAmount().compareTo(purchaseOrderNoDetailDO.getPurchaseRemAmounts())<0) {
|
||||
throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"入库数量"+purchaseOrderNoDetailDO.getPurchaseRemAmounts()+"大于剩余数量"+byId.getPurchaseRemAmount()+"请确认!"));
|
||||
}
|
||||
@ -120,6 +121,7 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public CommonResult<Boolean> receiveGoods(List<PurchaseOrderNoDetailDO> list) {
|
||||
List<MaterialDO> materialDOList=new ArrayList<MaterialDO>();
|
||||
for (PurchaseOrderNoDetailDO detailDO : list) {
|
||||
@ -143,22 +145,34 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
||||
materialDO.setName(bomDetailDO.getMaterialName());
|
||||
ProcessBomDO processBomDO = pocessBomMapper.selectById(bomDetailDO.getBomId());
|
||||
if (ObjectUtil.isNotEmpty(processBomDO)){
|
||||
bomCode=processBomDO.getCode();
|
||||
if (ObjectUtil.isNotEmpty(processBomDO.getCode())){
|
||||
bomCode=processBomDO.getCode();
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bomDetailDO.getBlueprintNo())){
|
||||
blueprintNo=bomDetailDO.getBlueprintNo();
|
||||
if (ObjectUtil.isNotEmpty(processBomDO.getBlueprintNo())){
|
||||
blueprintNo=bomDetailDO.getBlueprintNo();
|
||||
}
|
||||
}
|
||||
MaterialPlanBoomDO boomDO = materialPlanBoomMapper.selectById(detailDO.getProjectMaterialPlanBoomId());
|
||||
if (ObjectUtil.isNotEmpty(boomDO)){
|
||||
ProcedureDO procedure = procedureService.getProcedure(boomDO.getProcedureId());
|
||||
if (ObjectUtil.isNotEmpty(procedure)){
|
||||
ProcedureName=procedure.getName();
|
||||
if (ObjectUtil.isNotEmpty(procedure.getName())){
|
||||
ProcedureName=procedure.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
materialDO.setCode(bomCode+blueprintNo+ProcedureName);
|
||||
String code=bomCode+blueprintNo+ProcedureName;
|
||||
materialDO.setCode(code);
|
||||
materialDO.setCompositionId(bomDetailDO.getCompositionId());
|
||||
materialDO.setMaterialType("1");
|
||||
materialDOList.add(materialDO);
|
||||
materialDO.setVirtualPart("Y");
|
||||
MaterialDO material = materialMapper.selectMaterial(code);
|
||||
if (ObjectUtil.isEmpty(material)){
|
||||
materialDOList.add(materialDO);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.chanko.yunxi.mes.module.heli.dal.mysql.matreq.MatReqMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.chanko.yunxi.mes.module.heli.dal.mysql.matreqdetail.MatReqDetailMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -75,3 +75,10 @@ export const getBeiKuPage = async (params) => {
|
||||
export const getProjectMaterialPlanNo = async (code:string) => {
|
||||
return await request.get({ url: `/heli/material-plan/getProjectMaterialPlanNo?code=` + code })
|
||||
}
|
||||
// 查询标准件库存
|
||||
export const getStandardPartsPages = async (params) => {
|
||||
return await request.get({ url: `/heli/material-plan/getStandardPartsPages`, params })
|
||||
}
|
||||
export const operation = async (params) => {
|
||||
return await request.get({ url: `/heli/material-plan/operation`, params })
|
||||
}
|
||||
|
48
mes-ui/mes-ui-admin-vue3/src/api/heli/matreq/index.ts
Normal file
48
mes-ui/mes-ui-admin-vue3/src/api/heli/matreq/index.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MatReqVO {
|
||||
id: number
|
||||
matReqNo: string
|
||||
goodsType: boolean
|
||||
status: boolean
|
||||
description: string
|
||||
projectId: number
|
||||
projectPlanId: number
|
||||
customerId: number
|
||||
reqDate: localdate
|
||||
projectName: string
|
||||
}
|
||||
|
||||
// 查询领料单主分页
|
||||
export const getMatReqPage = async (params) => {
|
||||
return await request.get({ url: `/heli/mat-req/page`, params })
|
||||
}
|
||||
|
||||
// 查询领料单主详情
|
||||
export const getMatReq = async (id: number) => {
|
||||
return await request.get({ url: `/heli/mat-req/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增领料单主
|
||||
export const createMatReq = async (data: MatReqVO) => {
|
||||
return await request.post({ url: `/heli/mat-req/create`, data })
|
||||
}
|
||||
|
||||
// 修改领料单主
|
||||
export const updateMatReq = async (data: MatReqVO) => {
|
||||
return await request.put({ url: `/heli/mat-req/update`, data })
|
||||
}
|
||||
|
||||
// 删除领料单主
|
||||
export const deleteMatReq = async (id: number) => {
|
||||
return await request.delete({ url: `/heli/mat-req/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出领料单主 Excel
|
||||
export const exportMatReq = async (params) => {
|
||||
return await request.download({ url: `/heli/mat-req/export-excel`, params })
|
||||
}
|
||||
// 新增领料单主
|
||||
export const generate = async (data) => {
|
||||
return await request.post({ url: `/heli/mat-req/generate`, data })
|
||||
}
|
51
mes-ui/mes-ui-admin-vue3/src/api/heli/matreqdetail/index.ts
Normal file
51
mes-ui/mes-ui-admin-vue3/src/api/heli/matreqdetail/index.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MatReqDetailVO {
|
||||
id: number
|
||||
matReqId: number
|
||||
boomDetailId: number
|
||||
boomName: string
|
||||
boomSpec: string
|
||||
boomUnit: string
|
||||
composition: string
|
||||
description: string
|
||||
boomAmount: number
|
||||
requireTime: Date
|
||||
projectPlanSubId: number
|
||||
name: string
|
||||
nameSim: string
|
||||
projectSubCode: string
|
||||
materialId: number
|
||||
projectMaterialPlanId: number
|
||||
projectMaterialPlanDetailId: number
|
||||
}
|
||||
|
||||
// 查询领料单明细分页
|
||||
export const getMatReqDetailPage = async (params) => {
|
||||
return await request.get({ url: `/heli/mat-req-detail/page`, params })
|
||||
}
|
||||
|
||||
// 查询领料单明细详情
|
||||
export const getMatReqDetail = async (id: number) => {
|
||||
return await request.get({ url: `/heli/mat-req-detail/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增领料单明细
|
||||
export const createMatReqDetail = async (data: MatReqDetailVO) => {
|
||||
return await request.post({ url: `/heli/mat-req-detail/create`, data })
|
||||
}
|
||||
|
||||
// 修改领料单明细
|
||||
export const updateMatReqDetail = async (data: MatReqDetailVO) => {
|
||||
return await request.put({ url: `/heli/mat-req-detail/update`, data })
|
||||
}
|
||||
|
||||
// 删除领料单明细
|
||||
export const deleteMatReqDetail = async (id: number) => {
|
||||
return await request.delete({ url: `/heli/mat-req-detail/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出领料单明细 Excel
|
||||
export const exportMatReqDetail = async (params) => {
|
||||
return await request.download({ url: `/heli/mat-req-detail/export-excel`, params })
|
||||
}
|
@ -3,11 +3,11 @@ import request from '@/config/axios'
|
||||
export interface PurchaseOrderNoVO {
|
||||
id: number
|
||||
purchaseNo: string
|
||||
purchaseType: boolean
|
||||
goodsType: boolean
|
||||
purchaseType: number
|
||||
goodsType: number
|
||||
estimatedPrice: number
|
||||
actualPrice: number
|
||||
status: boolean
|
||||
status: number
|
||||
submitUserId: number
|
||||
submitTime: Date
|
||||
auditor: number
|
||||
@ -17,7 +17,7 @@ export interface PurchaseOrderNoVO {
|
||||
isPrint: string
|
||||
printDtime: Date
|
||||
ordDate: Date
|
||||
receivingStatus: boolean
|
||||
receivingStatus: number
|
||||
currencyType: number
|
||||
taxRatio: number
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export interface PurchaseOrderNoDetailVO {
|
||||
projectName: string
|
||||
projectNameSim: string
|
||||
materialId: number
|
||||
receivingStatus: boolean
|
||||
receivingStatus: number
|
||||
storageId: number
|
||||
storageMatId: number
|
||||
purchaseRemAmount: number
|
||||
|
@ -285,5 +285,8 @@ export enum DICT_TYPE {
|
||||
HELI_PROJECT_MATERIAL_PLAN_BOOM_STATUS='heli_project_material_plan_boom_status',//物料需求计划Boon状态
|
||||
PART_PURCHASE_STATUS='part_purchase_status',
|
||||
HELI_IS_PRINT='heli_is_print',
|
||||
HELI_PART_PURCHASE_ORDER_TYPE='heli_part_purchase_order_type'
|
||||
HELI_PART_PURCHASE_ORDER_TYPE='heli_part_purchase_order_type',
|
||||
HELI_MAT_REQ_TYPE='heli_mat_req_type',
|
||||
HELI_MAT_REQ_STATUS='heli_mat_req_status',
|
||||
HELI_MATERIAL_STATUS='heli_material_status'
|
||||
}
|
||||
|
@ -118,9 +118,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<div class="hl-footer text-center">
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
139
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/MatReqForm.vue
Normal file
139
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/MatReqForm.vue
Normal file
@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="领料单单号" prop="matReqNo">
|
||||
<el-input v-model="formData.matReqNo" placeholder="请输入领料单单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="领料单类型,1物料,2加工件" prop="goodsType">
|
||||
<el-radio-group v-model="formData.goodsType">
|
||||
<el-radio label="1">请选择字典生成</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态,0 未领料,1已领料 ,默认是0" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio label="1">请选择字典生成</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="description">
|
||||
<Editor v-model="formData.description" height="150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单id" prop="projectId">
|
||||
<el-input v-model="formData.projectId" placeholder="请输入订单id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产计划id" prop="projectPlanId">
|
||||
<el-input v-model="formData.projectPlanId" placeholder="请输入生产计划id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户id" prop="customerId">
|
||||
<el-input v-model="formData.customerId" placeholder="请输入客户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="领料单日期" prop="reqDate">
|
||||
<el-date-picker
|
||||
v-model="formData.reqDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择领料单日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as MatReqApi from '@/api/heli/matreq'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
matReqNo: undefined,
|
||||
goodsType: undefined,
|
||||
status: undefined,
|
||||
description: undefined,
|
||||
projectId: undefined,
|
||||
projectPlanId: undefined,
|
||||
customerId: undefined,
|
||||
reqDate: undefined,
|
||||
projectName: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
matReqNo: [{ required: true, message: '领料单单号不能为空', trigger: 'blur' }],
|
||||
goodsType: [{ required: true, message: '领料单类型,1物料,2加工件不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await MatReqApi.getMatReq(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as MatReqApi.MatReqVO
|
||||
if (formType.value === 'create') {
|
||||
await MatReqApi.createMatReq(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await MatReqApi.updateMatReq(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
matReqNo: undefined,
|
||||
goodsType: undefined,
|
||||
status: undefined,
|
||||
description: undefined,
|
||||
projectId: undefined,
|
||||
projectPlanId: undefined,
|
||||
customerId: undefined,
|
||||
reqDate: undefined,
|
||||
projectName: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
153
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/detail.vue
Normal file
153
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/detail.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<el-card class="hl-card" style="position: relative">
|
||||
<template #header>
|
||||
<span>详情页</span>
|
||||
</template>
|
||||
<el-form ref="formRef" :model="formData" label-width="160px" v-loading="formLoading">
|
||||
<!-- 基础信息 -->
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span>
|
||||
</template>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="领料单号" prop="matReqNo">
|
||||
<el-input class="!w-300px" placeholder="系统自动生成" v-model="formData.matReqNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="领料单日期" prop="reqDate">
|
||||
<el-date-picker
|
||||
v-model="formData.reqDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择领料单日期"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 需求单信息 -->
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">需求单信息</span>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-card class="hl-incard">
|
||||
<el-table :data="formData.list" class="hl-table" v-loading="loading">
|
||||
<el-table-column type="index" label="序号" fixed align="center" min-width="60" />
|
||||
<el-table-column prop="name" min-width="200" label="子项目名称" align="center"/>
|
||||
<el-table-column prop="boomName" min-width="200" label="物料名称" align="center"/>
|
||||
<el-table-column prop="materialCode" min-width="200" label="物料编码" align="center"/>
|
||||
<el-table-column prop="boomSpec" min-width="120" label="规格型号" align="center"/>
|
||||
<el-table-column prop="boomUnit" label="系统单位">
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.HELI_MATERIAL_UNIT"
|
||||
:value="scope.row.boomUnit"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
<div class="hl-footer text-center">
|
||||
<el-button @click="closeForm" size="large">取 消</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 表单弹窗:物料列表 -->
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import * as MatReqApi from '@/api/heli/matreq'
|
||||
import * as MatReqDetailApi from '@/api/heli/matreqdetail'
|
||||
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
const reload: any = inject('reload')
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { query } = useRoute()
|
||||
const router = useRouter()
|
||||
const tagsViewStore = useTagsViewStore()
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
projectMaterialPlanNo: undefined,
|
||||
projectId: undefined,
|
||||
projectPlanId: undefined,
|
||||
projectPlanNo: undefined,
|
||||
projectCode: undefined,
|
||||
auditor: undefined,
|
||||
createTime: new Date(),
|
||||
status: undefined,
|
||||
description: undefined,
|
||||
boomItemDOList: [],
|
||||
boomItemRemoveList: [],
|
||||
matBoomDOList: [],
|
||||
matItemRemoveList: [],
|
||||
attachments: [],
|
||||
matReqNo:undefined,
|
||||
reqDate:undefined,
|
||||
list:[]
|
||||
})
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
const subFormRef = ref() // 表单 Ref
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const subBoomFormLoading = ref(false)
|
||||
const subBoomFormRef = ref()
|
||||
|
||||
|
||||
const closeForm = async () => {
|
||||
router.push({ path: '/purchase/matreq' })
|
||||
tagsViewStore.delVisitedView(router.currentRoute.value)
|
||||
}
|
||||
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
matReqId: query.id
|
||||
})
|
||||
// 页面数据加载初始化
|
||||
onMounted(async () => {
|
||||
// 获取物料需求计划信息
|
||||
formData.value = await MatReqApi.getMatReq(query.id)
|
||||
console.log(formData.value)
|
||||
getList();
|
||||
})
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await MatReqDetailApi.getMatReqDetailPage(queryParams)
|
||||
formData.value.list = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
214
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/index.vue
Normal file
214
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/index.vue
Normal file
@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="领料单单号" prop="matReqNo">
|
||||
<el-input
|
||||
v-model="queryParams.matReqNo"
|
||||
placeholder="请输入领料单单号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子项目名称" prop="projectSubName">
|
||||
<el-input
|
||||
v-model="queryParams.projectSubName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input
|
||||
v-model="queryParams.materialName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- @click="openForm('create')"-->
|
||||
<!-- v-hasPermi="['heli:mat-req:create']"-->
|
||||
<!-- >-->
|
||||
<!-- <Icon icon="ep:plus" class="mr-5px" /> 新增-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- :loading="exportLoading"-->
|
||||
<!-- v-hasPermi="['heli:mat-req:export']"-->
|
||||
<!-- >-->
|
||||
<!-- <Icon icon="ep:download" class="mr-5px" /> 导出-->
|
||||
<!-- </el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="领料单单号" align="center" prop="matReqNo" />
|
||||
<el-table-column label="领料单日期" align="center" prop="reqDate" :formatter="dateFormatter1"/>
|
||||
<el-table-column label="领料单类型" align="center" prop="goodsType" >
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MAT_REQ_TYPE" :value="scope.row.goodsType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="单据状态" align="center" prop="status" >
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MAT_REQ_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['heli:mat-req:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="openForm( scope.row.id)">
|
||||
查看详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<MatReqForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {dateFormatter, dateFormatter1} from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as MatReqApi from '@/api/heli/matreq'
|
||||
import MatReqForm from './MatReqForm.vue'
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
|
||||
defineOptions({ name: 'MatReq' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
matReqNo: undefined,
|
||||
goodsType: 1,
|
||||
status: undefined,
|
||||
description: undefined,
|
||||
createTime: [],
|
||||
projectId: undefined,
|
||||
projectPlanId: undefined,
|
||||
customerId: undefined,
|
||||
reqDate: [],
|
||||
projectName: undefined,
|
||||
projectSubName:undefined,
|
||||
materialName:undefined,
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const router = useRouter()
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await MatReqApi.getMatReqPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (id?: number) => {
|
||||
router.push({ path: '/purchase/matreqdetail', query: { id: id } })
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await MatReqApi.deleteMatReq(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await MatReqApi.exportMatReq(queryParams)
|
||||
download.excel(data, '领料单主.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
306
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/standardParts.vue
Normal file
306
mes-ui/mes-ui-admin-vue3/src/views/heli/matreq/standardParts.vue
Normal file
@ -0,0 +1,306 @@
|
||||
<template>
|
||||
<el-card class="hl-card">
|
||||
<template #header>
|
||||
<span>物料需求计划管理</span>
|
||||
</template>
|
||||
<ContentWrap class="borderxx">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="130px">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="queryParams.projectName" placeholder="项目名称" clearable @keyup.enter="handleQuery"
|
||||
class="!w-240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="子项目名称" prop="projectSubName">
|
||||
<el-input v-model="queryParams.projectSubName" placeholder="请输入子项目名称" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="零件名称" prop="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入零件名称" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择物料状态" clearable class="!w-240px">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_MATERIAL_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编码" prop="projectCode">
|
||||
<el-input v-model="queryParams.projectCode" placeholder="项目编码" clearable @keyup.enter="handleQuery"
|
||||
class="!w-240px" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left:15px">
|
||||
<el-button @click="handleQuery" type="primary">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExportDetail"
|
||||
:loading="exportLoading"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">标准件明细</span>
|
||||
<el-button style="margin-left: 20px" @click="submitForm()" type="primary" size="large">领料单生成</el-button>
|
||||
<el-button style="margin-left: 20px" @click="jump()" type="success" size="large">领料单管理</el-button>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-card class="hl-incard">
|
||||
<el-form ref="multipleTable" :model="list" v-loading="formLoading" label-width="0" >
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" class="hl-table" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="序号" type="index" align="center" fixed min-width="70px" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" min-width="180px" />
|
||||
<el-table-column label="子项目名称" align="center" prop="projectSubName" min-width="180px" />
|
||||
<el-table-column min-width="200px" align="center" >
|
||||
<template #header><span class="hl-table_header">*</span>物料编码</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.matId`" class="mb-0px!" >
|
||||
<!-- <UserSelect v-model="row.materialId" class="!w-265px" clearable @update:newValue="handleSelected($index, $event)"/>-->
|
||||
<MaterialSelect v-model="row.matId" @update:newValue="handleSelected($index, $event)" clearable/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" align="center" prop="matName" min-width="180px" />
|
||||
<el-table-column label="规格型号" align="center" prop="boomSpec" min-width="100px" />
|
||||
<el-table-column label="图号" align="center" prop="blueprintNo" min-width="100" />
|
||||
<el-table-column label="需求数量" align="center" prop="boomAmount" min-width="150" />
|
||||
<el-table-column prop="boomUnit" label="系统单位" min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.HELI_MATERIAL_UNIT"
|
||||
:value="scope.row.boomUnit"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="要求完成日期" align="center" prop="boomArriveDate" min-width="150" :formatter="dateFormatter1" />
|
||||
<el-table-column label="操作" align="center" fixed="right" min-width="280">
|
||||
<template #default="scope">
|
||||
<!-- <el-button link type="primary" @click="operation('queren', scope.row.id)" v-if="scope.row.isPurYard==1">-->
|
||||
<!-- 确认-->
|
||||
<!-- </el-button>-->
|
||||
<el-button link type="primary" @click="operation('bucong', scope.row.id)" v-if="scope.row.isPurYard==1">
|
||||
库存补充
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="operation('caigou', scope.row.id)" v-if="scope.row.isPurYard==1">
|
||||
采购
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="operation('del',scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {DICT_TYPE, getIntDictOptions} from '@/utils/dict'
|
||||
import { dateFormatter1} from '@/utils/formatTime'
|
||||
import * as MaterialPlanApi from '@/api/heli/materialplan'
|
||||
|
||||
|
||||
defineOptions({ name: 'MaterialPlan' })
|
||||
const router = useRouter()
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
import download from '@/utils/download'
|
||||
import UserSelect from "@/views/heli/materialplan/userSelectNew.vue";
|
||||
import MaterialSelect from "@/views/heli/hlvuestyle/materialSelect.vue";
|
||||
import {ref} from "vue";
|
||||
import {ElTable} from "element-plus";
|
||||
import {getStandardPartsPages} from "@/api/heli/materialplan";
|
||||
import * as MatReqApi from "@/api/heli/matreq";
|
||||
import {generate} from "@/api/heli/matreq";
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
id: undefined,
|
||||
projectMaterialPlanNo: undefined,
|
||||
projectId: undefined,
|
||||
projectPlanId: undefined,
|
||||
submitUserId: undefined,
|
||||
projectName: undefined,
|
||||
projectSubName: undefined,
|
||||
materialName:undefined,
|
||||
submitTime: [],
|
||||
auditor: undefined,
|
||||
auditTime: [],
|
||||
status: 1,
|
||||
description: undefined,
|
||||
createTime: [],
|
||||
matType:0,
|
||||
type:undefined,
|
||||
projectCode:undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const multipleTable = ref<InstanceType<typeof ElTable>>()
|
||||
|
||||
const handleSelected = (currentIndex, newValue: any) => {
|
||||
list.value[currentIndex].matId = newValue?.id
|
||||
}
|
||||
const jump = async () => {
|
||||
router.push({ path: '/purchase/matreq' })
|
||||
// tagsViewStore.delVisitedView(router.currentRoute.value)
|
||||
}
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await MaterialPlanApi.getStandardPartsPages(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const submitForm = async () => {
|
||||
try {
|
||||
console.log("开始提交"); // 调试点1:确认函数是否触发
|
||||
|
||||
const list = multipleTable.value|| []; // 安全获取数据
|
||||
console.log("明细数据:", list);
|
||||
console.log(list.length)
|
||||
// 1. 检查空数据
|
||||
if (!list || list.length==null) {
|
||||
message.error("提交明细不能为空,请确认");
|
||||
return;
|
||||
}
|
||||
const firstProjectSubId = list[0].projectId;
|
||||
for (let i = 1; i < list.length; i++) {
|
||||
if (list[i].projectId !== firstProjectSubId) {
|
||||
message.error("标准件明细不属于同一个项目,请确认");
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].matId== null) {
|
||||
message.error("物料" + list[i].matName + "未选择物料编码,请确认")
|
||||
return
|
||||
}
|
||||
}
|
||||
// 4. 添加加载状态(Element Plus 兼容处理)
|
||||
formLoading.value = true;
|
||||
const data = await MatReqApi.getMatReqPage(queryParams)
|
||||
|
||||
// 5. 提交数据(添加超时处理)
|
||||
const res = await Promise.race([
|
||||
MatReqApi.generate(list),
|
||||
new Promise((_, reject) =>
|
||||
setTimeout(() => reject(new Error("请求超时")), 30000)
|
||||
)
|
||||
]);
|
||||
|
||||
message.success("生成成功");
|
||||
getList(); // 确保刷新完成
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error("提交失败:", error);
|
||||
// message.error(`操作失败: ${error.message || "未知错误"}`);
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
const handleSelectionChange = (val) => {
|
||||
multipleTable.value=val
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 操作 */
|
||||
|
||||
const operation = async (type: string, id?: number) => {
|
||||
|
||||
queryParams.id=id
|
||||
queryParams.type=type
|
||||
await MaterialPlanApi.operation(queryParams)
|
||||
switch (type) {
|
||||
case 'del':
|
||||
message.success("删除成功")
|
||||
break;
|
||||
case 'queren':
|
||||
message.success("确认成功")
|
||||
break;
|
||||
case 'bucong':
|
||||
message.success("库存补充成功")
|
||||
break;
|
||||
case 'caigou':
|
||||
message.success("采购成功")
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
await getList()
|
||||
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
const handleExportDetail = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await MaterialPlanApi.exportStandard(queryParams)
|
||||
download.excel(data, '标准件物料需求计划.xlsx')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await MaterialPlanApi.delMaterialPlan(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch { }
|
||||
}
|
||||
|
||||
|
||||
const userInit = ref()
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
//用户列表数据
|
||||
// userInit.value = await UserApi.getSimpleUserList()
|
||||
getList()
|
||||
})
|
||||
</script>
|
@ -67,14 +67,14 @@
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['heli:order-yf:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- @click="openForm('create')"-->
|
||||
<!-- v-hasPermi="['heli:order-yf:create']"-->
|
||||
<!-- >-->
|
||||
<!-- <Icon icon="ep:plus" class="mr-5px" /> 新增-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
|
@ -15,13 +15,13 @@ v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.ente
|
||||
class="!w-240px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="采购物类型" prop="goodsType">
|
||||
<el-select v-model="queryParams.goodsType" placeholder="下拉选择" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PURCHASE_GOODS_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="采购物类型" prop="goodsType">-->
|
||||
<!-- <el-select v-model="queryParams.goodsType" placeholder="下拉选择" clearable class="!w-240px">-->
|
||||
<!-- <el-option-->
|
||||
<!--v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PURCHASE_GOODS_TYPE)" :key="dict.value"-->
|
||||
<!-- :label="dict.label" :value="dict.value" />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item style="margin-left:50px">
|
||||
<el-button @click="handleQuery" type="primary">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 查询
|
||||
@ -42,7 +42,7 @@ ref="purchaseOrderTable" v-loading="loading" :data="list" :stripe="true" :show-o
|
||||
<el-table-column fixed label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="采购单号" align="center" prop="purchaseNo" fixed min-width="190">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="openForm('detail', scope.row.id)">
|
||||
<el-button link type="primary" >
|
||||
{{ scope.row.purchaseNo }}
|
||||
</el-button>
|
||||
</template>
|
||||
@ -75,11 +75,11 @@ label="单据日期" align="center" prop="createTime" :formatter="dateFormatter"
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="center" prop="status" fixed="right" min-width="180">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_ORDER_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="单据状态" align="center" prop="status" fixed="right" min-width="180">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <dict-tag :type="DICT_TYPE.HELI_PURCHASE_ORDER_STATUS" :value="scope.row.status" />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
@ -99,6 +99,7 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as PurchaseOrderApi from '@/api/heli/purchaseorder'
|
||||
import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
||||
import PurchaseOrderForm from './PurchaseOrderForm.vue'
|
||||
import { ElTable } from 'element-plus'
|
||||
|
||||
@ -120,15 +121,15 @@ const queryParams = reactive({
|
||||
purchaseNo: undefined,
|
||||
supplierId: undefined,
|
||||
contractNo: undefined,
|
||||
purchaseType: undefined,
|
||||
purchaseType: 2,
|
||||
projectMaterialPlanId: undefined,
|
||||
goodsType: undefined,
|
||||
goodsType: 1,
|
||||
currencyType: undefined,
|
||||
taxRatio: undefined,
|
||||
estimatedPrice: undefined,
|
||||
actualPrice: undefined,
|
||||
status: 3,
|
||||
receivingStatus: 2,
|
||||
status: undefined,
|
||||
receivingStatus: undefined,
|
||||
submitUserId: undefined,
|
||||
submitTime: [],
|
||||
auditor: undefined,
|
||||
@ -145,7 +146,8 @@ const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
queryParams.ids = undefined
|
||||
const data = await PurchaseOrderApi.getPurchaseOrderPage(queryParams)
|
||||
// const data = await PurchaseOrderApi.getPurchaseOrderPage(queryParams)
|
||||
const data = await PurchaseOrderNoApi.getPurchaseOrderNoPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
@ -44,8 +44,14 @@
|
||||
<el-form ref="multipleTable" :model="formData.list" :rules="subMatPlanFormRules" v-loading="loading" label-width="0">
|
||||
<el-table :data="formData.list" class="hl-table" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectSubCode" min-width="150" label="子项目编码" align="center"/>
|
||||
<el-table-column prop="boomName" min-width="120" label="零件名称" align="center"/>
|
||||
<el-table-column prop="procedureName" min-width="120" label="工序" align="center"/>
|
||||
<el-table-column prop="compositionName" min-width="100" label="材质" align="center"/>
|
||||
<el-table-column prop="purchaseAmount" min-width="100" label="采购数量" align="center" />
|
||||
<el-table-column prop="purchaseRemAmount" min-width="100" label="剩余数量" align="center"/>
|
||||
@ -191,13 +197,13 @@ const receiveGoods = async () => {
|
||||
return;
|
||||
}
|
||||
await PurchaseOrderNoDetailApi.verification(list)
|
||||
loading.value = true;
|
||||
const res = await Promise.race([
|
||||
PurchaseOrderNoDetailApi.receiveGoods(list),
|
||||
new Promise((_, reject) =>
|
||||
setTimeout(() => reject(new Error("请求超时")), 30000)
|
||||
)
|
||||
]);
|
||||
loading.value = true;
|
||||
|
||||
message.success("收货成功");
|
||||
getList(); // 确保刷新完成
|
||||
|
@ -79,9 +79,9 @@ v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" cl
|
||||
<dict-tag :type="DICT_TYPE.HELI_IS_PRINT" :value="scope.row.isPrint" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus" fixed="right" min-width="180">
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus1" fixed="right" min-width="180">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" min-width="200">
|
||||
|
@ -61,9 +61,9 @@ v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" cl
|
||||
<dict-tag :type="DICT_TYPE.HELI_IS_PRINT" :value="scope.row.isPrint" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus" fixed="right" min-width="180">
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus1" fixed="right" min-width="180">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" min-width="200">
|
||||
|
@ -43,6 +43,11 @@
|
||||
<el-card class="hl-incard">
|
||||
<el-form ref="multipleTable" :model="formData.list" :rules="subMatPlanFormRules" v-loading="loading" label-width="0">
|
||||
<el-table :data="formData.list" class="hl-table" >
|
||||
<el-table-column label="收货状态" align="center" prop="receivingStatus" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectSubCode" min-width="150" label="子项目编码" align="center"/>
|
||||
<el-table-column prop="boomName" min-width="120" label="标准件名称" align="center"/>
|
||||
<el-table-column prop="matCode" min-width="100" label="物料编码" align="center"/>
|
||||
|
Loading…
Reference in New Issue
Block a user