commit
fc924825aa
@ -0,0 +1,42 @@
|
||||
package com.chanko.yunxi.mes.framework.excel.core.convert;
|
||||
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 日期转换器
|
||||
*
|
||||
* @author chenxi
|
||||
* @date 2024-02-28 09:01
|
||||
*/
|
||||
public class TimestampToDateConvert implements Converter<Object> {
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(Object value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
|
||||
try {
|
||||
String date = "";
|
||||
if(value instanceof Long){
|
||||
long timestamp = (Long) value;
|
||||
date = new SimpleDateFormat("yyyy-MM-dd").format(new Date(timestamp));
|
||||
}else if(value instanceof String){
|
||||
long timestamp = Long.parseLong((String) value);
|
||||
date = new SimpleDateFormat("yyyy-MM-dd").format(new Date(timestamp));
|
||||
}else if(value instanceof LocalDateTime){
|
||||
LocalDateTime local = (LocalDateTime) value;
|
||||
date = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(local);
|
||||
}
|
||||
return new WriteCellData<>(date);
|
||||
}catch (Exception e){
|
||||
}
|
||||
return Converter.super.convertToExcelData(value, contentProperty, globalConfiguration);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.chanko.yunxi.mes.module.heli.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 工艺bom状态枚举
|
||||
* @author chenxi
|
||||
* @date 2024-02-26 11:25
|
||||
*/
|
||||
@Getter
|
||||
public enum ProcessBomStatusEnum {
|
||||
|
||||
SAVE(1, "已保存"),
|
||||
SUBMIT(2, "已提交"),
|
||||
CANCEL_SUBMIT(1, "取消提交"),
|
||||
TERMINATE(3, "已终止");
|
||||
|
||||
private int code;
|
||||
private String description;
|
||||
|
||||
ProcessBomStatusEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.chanko.yunxi.mes.module.heli.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 工艺设计类型枚举
|
||||
* @author chenxi
|
||||
* @date 2024-02-21 01:09
|
||||
*/
|
||||
@Getter
|
||||
public enum ProcessDesignTypeEnum {
|
||||
|
||||
BLUEPRINT_FOUNDRY_TECHNOLOGY("铸造工艺"),
|
||||
BLUEPRINT_3D("3D图纸"),
|
||||
BLUEPRINT_2D("2D图纸"),
|
||||
BLUEPRINT_WORKBLANK("毛坯图纸");
|
||||
|
||||
private String description;
|
||||
|
||||
ProcessDesignTypeEnum(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.chanko.yunxi.mes.module.heli.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 项目订单状态枚举
|
||||
* @author chenxi
|
||||
* @date 2024-01-18 01:19
|
||||
*/
|
||||
@Getter
|
||||
public enum ProjectPlanStatusEnum {
|
||||
START(1, "未开始"),
|
||||
PRODUCING(2, "生产中"),
|
||||
COMPLETE(3, "已完成"),
|
||||
TERMINATE(4, "已终止"),
|
||||
CHANGE(5, "已变更"),
|
||||
;
|
||||
|
||||
private int code;
|
||||
private String description;
|
||||
|
||||
ProjectPlanStatusEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.chanko.yunxi.mes.module.heli.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 项目订单状态枚举
|
||||
* @author chenxi
|
||||
* @date 2024-01-18 01:19
|
||||
*/
|
||||
@Getter
|
||||
public enum PurchaseStatusEnum {
|
||||
START(1, "已保存"),
|
||||
SUBMIT(2, "已送审"),
|
||||
AUDIT(3, "已审核"),
|
||||
REFUSE(4, "已打回"),
|
||||
;
|
||||
|
||||
private int code;
|
||||
private String description;
|
||||
|
||||
PurchaseStatusEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.chanko.yunxi.mes.module.heli.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 有效状态枚举
|
||||
* @author chenxi
|
||||
* @date 2024-02-27 10:28
|
||||
*/
|
||||
@Getter
|
||||
public enum ValidStatusEnum {
|
||||
VALID(1, "有效"),
|
||||
INVALID(2, "无效");
|
||||
|
||||
private int code;
|
||||
private String description;
|
||||
|
||||
ValidStatusEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.chanko.yunxi.mes.module.heli.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 预警类型
|
||||
* @author chenxi
|
||||
* @date 2024-02-23 10:15
|
||||
*/
|
||||
@Getter
|
||||
public enum WarningEnum {
|
||||
|
||||
PROCESS_DESIGN_DEFERRED_WARNING("工艺设计延期预警");
|
||||
|
||||
private String description;
|
||||
|
||||
WarningEnum(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.chanko.yunxi.mes.module.heli.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预警信息
|
||||
*
|
||||
* @author chenxi
|
||||
* @date 2024-02-23 09:54
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class WarningMessageVO {
|
||||
|
||||
@Schema(description = "是否包含预警信息")
|
||||
private boolean hasWarning = false;
|
||||
|
||||
@Schema(description = "预警信息")
|
||||
private List<WarningVO> warnings;
|
||||
|
||||
|
||||
public static abstract class WarningVO {}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class ProcessDesignDeferredWarningVO extends WarningVO {
|
||||
|
||||
/**
|
||||
* {@link com.chanko.yunxi.mes.module.heli.enums.WarningEnum}
|
||||
*/
|
||||
@Schema(description = "预警类型")
|
||||
private String warningType;
|
||||
|
||||
/**
|
||||
* {@link com.chanko.yunxi.mes.module.heli.enums.ProcessDesignTypeEnum}
|
||||
*/
|
||||
@Schema(description = "工艺设计类型")
|
||||
private String processDesignType;
|
||||
|
||||
@Schema(description = "预警接收人")
|
||||
private String ownerName;
|
||||
|
||||
@Schema(description = "项目编号")
|
||||
private String projectCode;
|
||||
|
||||
@Schema(description = "子项目编号")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "剩余时间")
|
||||
private long remainingTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.materialplan;
|
||||
|
||||
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.materialplan.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.materialplan.MaterialPlanService;
|
||||
|
||||
@Tag(name = "管理后台 - 物料需求计划")
|
||||
@RestController
|
||||
@RequestMapping("/heli/material-plan")
|
||||
@Validated
|
||||
public class MaterialPlanController {
|
||||
|
||||
@Resource
|
||||
private MaterialPlanService materialPlanService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料需求计划")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:create')")
|
||||
public CommonResult<Long> createMaterialPlan(@Valid @RequestBody MaterialPlanSaveReqVO createReqVO) {
|
||||
return success(materialPlanService.createMaterialPlan(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料需求计划")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:update')")
|
||||
public CommonResult<Boolean> updateMaterialPlan(@Valid @RequestBody MaterialPlanSaveReqVO updateReqVO) {
|
||||
materialPlanService.updateMaterialPlan(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料需求计划")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialPlan(@RequestParam("id") Long id) {
|
||||
materialPlanService.deleteMaterialPlan(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料需求计划")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:query')")
|
||||
public CommonResult<MaterialPlanRespVO> getMaterialPlan(@RequestParam("id") Long id) {
|
||||
MaterialPlanDO materialPlan = materialPlanService.getMaterialPlan(id);
|
||||
return success(BeanUtils.toBean(materialPlan, MaterialPlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料需求计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:query')")
|
||||
public CommonResult<PageResult<MaterialPlanRespVO>> getMaterialPlanPage(@Valid MaterialPlanPageReqVO pageReqVO) {
|
||||
PageResult<MaterialPlanDO> pageResult = materialPlanService.getMaterialPlanPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialPlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出物料需求计划 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportMaterialPlanExcel(@Valid MaterialPlanPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialPlanDO> list = materialPlanService.getMaterialPlanPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "物料需求计划.xls", "数据", MaterialPlanRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialPlanRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail;
|
||||
|
||||
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.materialplandetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.materialplandetail.MaterialPlanDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 物料需求计划物料详情")
|
||||
@RestController
|
||||
@RequestMapping("/heli/material-plan-detail")
|
||||
@Validated
|
||||
public class MaterialPlanDetailController {
|
||||
|
||||
@Resource
|
||||
private MaterialPlanDetailService materialPlanDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料需求计划物料详情")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan-detail:create')")
|
||||
public CommonResult<Long> createMaterialPlanDetail(@Valid @RequestBody MaterialPlanDetailSaveReqVO createReqVO) {
|
||||
return success(materialPlanDetailService.createMaterialPlanDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料需求计划物料详情")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan-detail:update')")
|
||||
public CommonResult<Boolean> updateMaterialPlanDetail(@Valid @RequestBody MaterialPlanDetailSaveReqVO updateReqVO) {
|
||||
materialPlanDetailService.updateMaterialPlanDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料需求计划物料详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialPlanDetail(@RequestParam("id") Long id) {
|
||||
materialPlanDetailService.deleteMaterialPlanDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料需求计划物料详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan-detail:query')")
|
||||
public CommonResult<MaterialPlanDetailRespVO> getMaterialPlanDetail(@RequestParam("id") Long id) {
|
||||
MaterialPlanDetailDO materialPlanDetail = materialPlanDetailService.getMaterialPlanDetail(id);
|
||||
return success(BeanUtils.toBean(materialPlanDetail, MaterialPlanDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料需求计划物料详情分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan-detail:query')")
|
||||
public CommonResult<PageResult<MaterialPlanDetailRespVO>> getMaterialPlanDetailPage(@Valid MaterialPlanDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialPlanDetailDO> pageResult = materialPlanDetailService.getMaterialPlanDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialPlanDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出物料需求计划物料详情 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:material-plan-detail:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportMaterialPlanDetailExcel(@Valid MaterialPlanDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialPlanDetailDO> list = materialPlanDetailService.getMaterialPlanDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "物料需求计划物料详情.xls", "数据", MaterialPlanDetailRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialPlanDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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 MaterialPlanDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "自增字段,唯一")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "物料需求采购计划id")
|
||||
private Long projectMaterialPlanId;
|
||||
|
||||
@Schema(description = "物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "子项目编号")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "需求数量")
|
||||
private BigDecimal requireAmount;
|
||||
|
||||
@Schema(description = "需求到货日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] requireArriveTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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 MaterialPlanDetailRespVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("自增字段,唯一")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "物料需求采购计划id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料需求采购计划id")
|
||||
private Long projectMaterialPlanId;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "子项目编号")
|
||||
@ExcelProperty("子项目编号")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "需求数量")
|
||||
@ExcelProperty("需求数量")
|
||||
private BigDecimal requireAmount;
|
||||
|
||||
@Schema(description = "需求到货日期")
|
||||
@ExcelProperty("需求到货日期")
|
||||
private LocalDateTime requireArriveTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料id")
|
||||
private Long matId;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料名称")
|
||||
private String matName;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料编码")
|
||||
private String matCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料规格型号")
|
||||
private String matSpec;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料单位")
|
||||
private String matUnit;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料类型")
|
||||
private String matType;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 物料需求计划物料详情新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialPlanDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "物料需求采购计划id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "物料需求采购计划id不能为空")
|
||||
private Long projectMaterialPlanId;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "物料id不能为空")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "子项目编号")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "需求数量")
|
||||
private BigDecimal requireAmount;
|
||||
|
||||
@Schema(description = "需求到货日期")
|
||||
private LocalDateTime requireArriveTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plan;
|
||||
|
||||
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.plan.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.plan.PlanService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产计划")
|
||||
@RestController
|
||||
@RequestMapping("/heli/plan")
|
||||
@Validated
|
||||
public class PlanController {
|
||||
|
||||
@Resource
|
||||
private PlanService planService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产计划")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan:create')")
|
||||
public CommonResult<Long> createPlan(@Valid @RequestBody PlanSaveReqVO createReqVO) {
|
||||
return success(planService.createPlan(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产计划")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan:update')")
|
||||
public CommonResult<Boolean> updatePlan(@Valid @RequestBody PlanSaveReqVO updateReqVO) {
|
||||
planService.updatePlan(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产计划")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan:delete')")
|
||||
public CommonResult<Boolean> deletePlan(@RequestParam("id") Long id) {
|
||||
planService.deletePlan(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产计划")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan:query')")
|
||||
public CommonResult<PlanRespVO> getPlan(@RequestParam("id") Long id) {
|
||||
PlanDO plan = planService.getPlan(id);
|
||||
return success(BeanUtils.toBean(plan, PlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan:query')")
|
||||
public CommonResult<PageResult<PlanRespVO>> getPlanPage(@Valid PlanPageReqVO pageReqVO) {
|
||||
PageResult<PlanDO> pageResult = planService.getPlanPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page-by-status")
|
||||
@Operation(summary = "获得生产计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan:query')")
|
||||
public CommonResult<PageResult<PlanRespVO>> getPlanPageByStatus(@Valid PlanPageReqVO pageReqVO) {
|
||||
PageResult<PlanDO> pageResult = planService.getPlanPageByStatus(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产计划 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPlanExcel(@Valid PlanPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlanDO> list = planService.getPlanPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产计划.xls", "数据", PlanRespVO.class,
|
||||
BeanUtils.toBean(list, PlanRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansub;
|
||||
|
||||
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.plansub.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.plansub.PlanSubService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产计划子项目")
|
||||
@RestController
|
||||
@RequestMapping("/heli/plan-sub")
|
||||
@Validated
|
||||
public class PlanSubController {
|
||||
|
||||
@Resource
|
||||
private PlanSubService planSubService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产计划子项目")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub:create')")
|
||||
public CommonResult<Long> createPlanSub(@Valid @RequestBody PlanSubSaveReqVO createReqVO) {
|
||||
return success(planSubService.createPlanSub(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产计划子项目")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub:update')")
|
||||
public CommonResult<Boolean> updatePlanSub(@Valid @RequestBody PlanSubSaveReqVO updateReqVO) {
|
||||
planSubService.updatePlanSub(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产计划子项目")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub:delete')")
|
||||
public CommonResult<Boolean> deletePlanSub(@RequestParam("id") Long id) {
|
||||
planSubService.deletePlanSub(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产计划子项目")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub:query')")
|
||||
public CommonResult<PlanSubRespVO> getPlanSub(@RequestParam("id") Long id) {
|
||||
PlanSubDO planSub = planSubService.getPlanSub(id);
|
||||
return success(BeanUtils.toBean(planSub, PlanSubRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产计划子项目分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub:query')")
|
||||
public CommonResult<PageResult<PlanSubRespVO>> getPlanSubPage(@Valid PlanSubPageReqVO pageReqVO) {
|
||||
PageResult<PlanSubDO> pageResult = planSubService.getPlanSubPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanSubRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产计划子项目 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPlanSubExcel(@Valid PlanSubPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlanSubDO> list = planSubService.getPlanSubPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产计划子项目.xls", "数据", PlanSubRespVO.class,
|
||||
BeanUtils.toBean(list, PlanSubRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo;
|
||||
|
||||
import lombok.*;
|
||||
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 PlanSubPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "自增字段,唯一")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "计划id")
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "子项目id")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "模具类型id")
|
||||
private Long mouldId;
|
||||
|
||||
@Schema(description = "设备id")
|
||||
private Long equipId;
|
||||
|
||||
@Schema(description = "毛坯结束日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] blankDate;
|
||||
|
||||
@Schema(description = "毛坯负责人")
|
||||
private String blankOwner;
|
||||
|
||||
@Schema(description = "2D结束日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] twoDimDate;
|
||||
|
||||
@Schema(description = "2D负责人")
|
||||
private String twoDimOwner;
|
||||
|
||||
@Schema(description = "3D结束日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] threeDimDate;
|
||||
|
||||
@Schema(description = "3D负责人")
|
||||
private String threeDimOwner;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
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 PlanSubRespVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("自增字段,唯一")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "计划id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计划id")
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目id")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "子项目id")
|
||||
@ExcelProperty("子项目id")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "子项目简称")
|
||||
@ExcelProperty("子项目简称")
|
||||
private String projectSubShortName;
|
||||
|
||||
@Schema(description = "子项目编码")
|
||||
@ExcelProperty("子项目编码")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "模具类型id")
|
||||
@ExcelProperty("模具类型id")
|
||||
private Long mouldId;
|
||||
|
||||
@Schema(description = "设备id")
|
||||
@ExcelProperty("设备id")
|
||||
private Long equipId;
|
||||
|
||||
@Schema(description = "毛坯结束日期")
|
||||
@ExcelProperty("毛坯结束日期")
|
||||
private LocalDateTime blankDate;
|
||||
|
||||
@Schema(description = "毛坯负责人")
|
||||
@ExcelProperty("毛坯负责人")
|
||||
private Long blankOwner;
|
||||
|
||||
@Schema(description = "2D结束日期")
|
||||
@ExcelProperty("2D结束日期")
|
||||
private LocalDateTime twoDimDate;
|
||||
|
||||
@Schema(description = "2D负责人")
|
||||
@ExcelProperty("2D负责人")
|
||||
private Long twoDimOwner;
|
||||
|
||||
@Schema(description = "3D结束日期")
|
||||
@ExcelProperty("3D结束日期")
|
||||
private LocalDateTime threeDimDate;
|
||||
|
||||
@Schema(description = "3D负责人")
|
||||
@ExcelProperty("3D负责人")
|
||||
private Long threeDimOwner;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 生产计划子项目新增/修改 Request VO")
|
||||
@Data
|
||||
public class PlanSubSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "计划id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "子项目id")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "子项目简称")
|
||||
private String projectSubShortName;
|
||||
|
||||
@Schema(description = "子项目编号")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "模具类型id")
|
||||
private Long mouldId;
|
||||
|
||||
@Schema(description = "设备id")
|
||||
private Long equipId;
|
||||
|
||||
@Schema(description = "毛坯结束日期")
|
||||
private LocalDateTime blankDate;
|
||||
|
||||
@Schema(description = "毛坯负责人")
|
||||
private String blankOwner;
|
||||
|
||||
@Schema(description = "2D结束日期")
|
||||
private LocalDateTime twoDimDate;
|
||||
|
||||
@Schema(description = "2D负责人")
|
||||
private String twoDimOwner;
|
||||
|
||||
@Schema(description = "3D结束日期")
|
||||
private LocalDateTime threeDimDate;
|
||||
|
||||
@Schema(description = "3D负责人")
|
||||
private String threeDimOwner;
|
||||
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.PlanPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.PlanRespVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
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.math.BigDecimal;
|
||||
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.purchaseorder.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.purchaseorder.PurchaseOrderService;
|
||||
|
||||
@Tag(name = "管理后台 - 采购订单")
|
||||
@RestController
|
||||
@RequestMapping("/heli/purchase-order")
|
||||
@Validated
|
||||
public class PurchaseOrderController {
|
||||
|
||||
@Resource
|
||||
private PurchaseOrderService purchaseOrderService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购订单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:create')")
|
||||
public CommonResult<Long> createPurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO createReqVO) {
|
||||
return success(purchaseOrderService.createPurchaseOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采购订单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:update')")
|
||||
public CommonResult<Boolean> updatePurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO updateReqVO) {
|
||||
purchaseOrderService.updatePurchaseOrder(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采购订单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:delete')")
|
||||
public CommonResult<Boolean> deletePurchaseOrder(@RequestParam("id") Long id) {
|
||||
purchaseOrderService.deletePurchaseOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采购订单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:query')")
|
||||
public CommonResult<PurchaseOrderRespVO> getPurchaseOrder(@RequestParam("id") Long id) {
|
||||
PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id);
|
||||
return success(BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采购订单分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:query')")
|
||||
public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) {
|
||||
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page-by-status")
|
||||
@Operation(summary = "获得生产计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:query')")
|
||||
public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPageByStatus(@Valid PurchaseOrderPageReqVO pageReqVO) {
|
||||
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPageByStatus(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采购订单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PurchaseOrderDO> list = purchaseOrderService.getPurchaseOrderPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采购订单.xls", "数据", PurchaseOrderRespVO.class,
|
||||
BeanUtils.toBean(list, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel-with-tax")
|
||||
@Operation(summary = "导出采购订单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPurchaseOrderExcelWithTax(@Valid PurchaseOrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PurchaseOrderDO> list = purchaseOrderService.getPurchaseOrderPageWithTax(pageReqVO).getList();
|
||||
|
||||
for(PurchaseOrderDO item : list) {
|
||||
|
||||
if(item.getEstimatedPrice() != null && item.getTaxRatio() !=null) {
|
||||
item.setEstimatedPrice(item.getEstimatedPrice().multiply(BigDecimal.valueOf(item.getTaxRatio())).divide(BigDecimal.valueOf(100)));
|
||||
}else{
|
||||
item.setEstimatedPrice(BigDecimal.ZERO);
|
||||
}
|
||||
if(item.getActualPrice() != null && item.getTaxRatio() !=null) {
|
||||
item.setActualPrice(item.getActualPrice().multiply(BigDecimal.valueOf(item.getTaxRatio())).divide(BigDecimal.valueOf(100)));
|
||||
}else{
|
||||
item.setActualPrice(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
}
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采购订单.xls", "数据", PurchaseOrderRespVO.class,
|
||||
BeanUtils.toBean(list, PurchaseOrderRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial;
|
||||
|
||||
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.purchaseordermaterial.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.purchaseordermaterial.PurchaseOrderMaterialService;
|
||||
|
||||
@Tag(name = "管理后台 - 采购单物料")
|
||||
@RestController
|
||||
@RequestMapping("/heli/purchase-order-material")
|
||||
@Validated
|
||||
public class PurchaseOrderMaterialController {
|
||||
|
||||
@Resource
|
||||
private PurchaseOrderMaterialService purchaseOrderMaterialService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购单物料")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order-material:create')")
|
||||
public CommonResult<Long> createPurchaseOrderMaterial(@Valid @RequestBody PurchaseOrderMaterialSaveReqVO createReqVO) {
|
||||
return success(purchaseOrderMaterialService.createPurchaseOrderMaterial(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采购单物料")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order-material:update')")
|
||||
public CommonResult<Boolean> updatePurchaseOrderMaterial(@Valid @RequestBody PurchaseOrderMaterialSaveReqVO updateReqVO) {
|
||||
purchaseOrderMaterialService.updatePurchaseOrderMaterial(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采购单物料")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order-material:delete')")
|
||||
public CommonResult<Boolean> deletePurchaseOrderMaterial(@RequestParam("id") Long id) {
|
||||
purchaseOrderMaterialService.deletePurchaseOrderMaterial(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采购单物料")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order-material:query')")
|
||||
public CommonResult<PurchaseOrderMaterialRespVO> getPurchaseOrderMaterial(@RequestParam("id") Long id) {
|
||||
PurchaseOrderMaterialDO purchaseOrderMaterial = purchaseOrderMaterialService.getPurchaseOrderMaterial(id);
|
||||
return success(BeanUtils.toBean(purchaseOrderMaterial, PurchaseOrderMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采购单物料分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order-material:query')")
|
||||
public CommonResult<PageResult<PurchaseOrderMaterialRespVO>> getPurchaseOrderMaterialPage(@Valid PurchaseOrderMaterialPageReqVO pageReqVO) {
|
||||
PageResult<PurchaseOrderMaterialDO> pageResult = purchaseOrderMaterialService.getPurchaseOrderMaterialPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PurchaseOrderMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采购单物料 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:purchase-order-material:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPurchaseOrderMaterialExcel(@Valid PurchaseOrderMaterialPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PurchaseOrderMaterialDO> list = purchaseOrderMaterialService.getPurchaseOrderMaterialPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采购单物料.xls", "数据", PurchaseOrderMaterialRespVO.class,
|
||||
BeanUtils.toBean(list, PurchaseOrderMaterialRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.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 PurchaseOrderMaterialPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "采购单编号")
|
||||
private Long purchaseOrderId;
|
||||
|
||||
@Schema(description = "物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "采购数量")
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
@Schema(description = "暂估价金额")
|
||||
private BigDecimal estimatedPrice;
|
||||
|
||||
@Schema(description = "实际价金额")
|
||||
private BigDecimal actualPrice;
|
||||
|
||||
@Schema(description = "预计到期日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] arriveTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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 PurchaseOrderMaterialRespVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("自增字段,唯一")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("采购单编号")
|
||||
private Long purchaseOrderId;
|
||||
|
||||
@Schema(description = "物料id")
|
||||
@ExcelProperty("物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "采购数量")
|
||||
@ExcelProperty("采购数量")
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
@Schema(description = "暂估价金额")
|
||||
@ExcelProperty("暂估价金额")
|
||||
private BigDecimal estimatedPrice;
|
||||
|
||||
@Schema(description = "实际价金额")
|
||||
@ExcelProperty("实际价金额")
|
||||
private BigDecimal actualPrice;
|
||||
|
||||
@Schema(description = "预计到期日期")
|
||||
@ExcelProperty("预计到期日期")
|
||||
private LocalDateTime arriveTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料id")
|
||||
private Long matId;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料名称")
|
||||
private String matName;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料编码")
|
||||
private String matCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料规格型号")
|
||||
private String matSpec;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料单位")
|
||||
private String matUnit;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("物料类型")
|
||||
private String matType;
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.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 PurchaseOrderMaterialSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "采购单编号不能为空")
|
||||
private Long purchaseOrderId;
|
||||
|
||||
@Schema(description = "物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "采购数量")
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
@Schema(description = "暂估价金额")
|
||||
private BigDecimal estimatedPrice;
|
||||
|
||||
@Schema(description = "实际价金额")
|
||||
private BigDecimal actualPrice;
|
||||
|
||||
@Schema(description = "预计到期日期")
|
||||
private LocalDateTime arriveTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch;
|
||||
|
||||
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.taskdispatch.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetail.TaskDispatchDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.taskdispatch.TaskDispatchService;
|
||||
|
||||
@Tag(name = "管理后台 - 派工单")
|
||||
@RestController
|
||||
@RequestMapping("/heli/task-dispatch")
|
||||
@Validated
|
||||
public class TaskDispatchController {
|
||||
|
||||
@Resource
|
||||
private TaskDispatchService taskDispatchService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建派工单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:create')")
|
||||
public CommonResult<Long> createTaskDispatch(@Valid @RequestBody TaskDispatchSaveReqVO createReqVO) {
|
||||
return success(taskDispatchService.createTaskDispatch(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新派工单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:update')")
|
||||
public CommonResult<Boolean> updateTaskDispatch(@Valid @RequestBody TaskDispatchSaveReqVO updateReqVO) {
|
||||
taskDispatchService.updateTaskDispatch(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除派工单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:delete')")
|
||||
public CommonResult<Boolean> deleteTaskDispatch(@RequestParam("id") Long id) {
|
||||
taskDispatchService.deleteTaskDispatch(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得派工单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')")
|
||||
public CommonResult<TaskDispatchRespVO> getTaskDispatch(@RequestParam("id") Long id) {
|
||||
TaskDispatchDO taskDispatch = taskDispatchService.getTaskDispatch(id);
|
||||
return success(BeanUtils.toBean(taskDispatch, TaskDispatchRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得派工单分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')")
|
||||
public CommonResult<PageResult<TaskDispatchRespVO>> getTaskDispatchPage(@Valid TaskDispatchPageReqVO pageReqVO) {
|
||||
PageResult<TaskDispatchDO> pageResult = taskDispatchService.getTaskDispatchPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TaskDispatchRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出派工单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportTaskDispatchExcel(@Valid TaskDispatchPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TaskDispatchDO> list = taskDispatchService.getTaskDispatchPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "派工单.xls", "数据", TaskDispatchRespVO.class,
|
||||
BeanUtils.toBean(list, TaskDispatchRespVO.class));
|
||||
}
|
||||
|
||||
// ==================== 子表(派工明细) ====================
|
||||
|
||||
@GetMapping("/task-dispatch-detail/list-by-dispatch-id")
|
||||
@Operation(summary = "获得派工明细列表")
|
||||
@Parameter(name = "dispatchId", description = "派工单id")
|
||||
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')")
|
||||
public CommonResult<List<TaskDispatchDetailDO>> getTaskDispatchDetailListByDispatchId(@RequestParam("dispatchId") Long dispatchId) {
|
||||
return success(taskDispatchService.getTaskDispatchDetailListByDispatchId(dispatchId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.materialplan;
|
||||
|
||||
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.plan.vo.PlanPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplan.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 物料需求计划 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialPlanMapper extends BaseMapperX<MaterialPlanDO> {
|
||||
|
||||
default PageResult<MaterialPlanDO> selectPage(MaterialPlanPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<MaterialPlanDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(MaterialPlanDO.class)
|
||||
.select("p.project_name as projectName","pl.plan_no as planNo")
|
||||
.leftJoin(PlanDO.class, "pl", PlanDO::getId, MaterialPlanDO::getProjectPlanId)
|
||||
.leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, MaterialPlanDO::getProjectId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(MaterialPlanDO::getCreateTime);
|
||||
query.like(!StringUtils.isEmpty(reqVO.getProjectMaterialPlanNo()), MaterialPlanDO::getProjectMaterialPlanNo, reqVO.getProjectMaterialPlanNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectName()), "p.project_name", reqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getPlanNo()), "pl.plan_no", reqVO.getPlanNo())
|
||||
.apply(reqVO.getCreateTime() != null && !reqVO.getCreateTime().equals("Invalid Date"), "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", reqVO.getCreateTime())
|
||||
.eq(reqVO.getStatus() != null, MaterialPlanDO::getStatus, reqVO.getStatus());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
// default PageResult<MaterialPlanDO> selectPage(MaterialPlanPageReqVO reqVO) {
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<MaterialPlanDO>()
|
||||
// .eqIfPresent(MaterialPlanDO::getId, reqVO.getId())
|
||||
// .likeIfPresent(MaterialPlanDO::getProjectMaterialPlanNo, reqVO.getProjectMaterialPlanNo())
|
||||
// .eqIfPresent(MaterialPlanDO::getProjectId, reqVO.getProjectId())
|
||||
// .eqIfPresent(MaterialPlanDO::getProjectPlanId, reqVO.getProjectPlanId())
|
||||
// .eqIfPresent(MaterialPlanDO::getSubmitUserId, reqVO.getSubmitUserId())
|
||||
// .betweenIfPresent(MaterialPlanDO::getSubmitTime, reqVO.getSubmitTime())
|
||||
// .eqIfPresent(MaterialPlanDO::getAuditor, reqVO.getAuditor())
|
||||
// .betweenIfPresent(MaterialPlanDO::getAuditTime, reqVO.getAuditTime())
|
||||
// .eqIfPresent(MaterialPlanDO::getStatus, reqVO.getStatus())
|
||||
// .eqIfPresent(MaterialPlanDO::getDescription, reqVO.getDescription())
|
||||
// .betweenIfPresent(MaterialPlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
// .orderByDesc(MaterialPlanDO::getId));
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.materialplandetail;
|
||||
|
||||
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.materialplan.vo.MaterialPlanPageReqVO;
|
||||
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.materialplandetail.MaterialPlanDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 物料需求计划物料详情 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialPlanDetailMapper extends BaseMapperX<MaterialPlanDetailDO> {
|
||||
|
||||
default PageResult<MaterialPlanDetailDO> selectPage(MaterialPlanDetailPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<MaterialPlanDetailDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(MaterialPlanDetailDO.class)
|
||||
.select("mat.id as matId","mat.name as matName","mat.code as matCode","mat.spec as matSpec","mat.unit as matUnit","mat.material_type as matType")
|
||||
.leftJoin(MaterialDO.class, "mat", MaterialDO::getId, MaterialPlanDetailDO::getMaterialId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(MaterialPlanDetailDO::getCreateTime);
|
||||
query.eq(reqVO.getProjectMaterialPlanId()!=null,MaterialPlanDetailDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()).orderByAsc(MaterialPlanDetailDO::getCreateTime);
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
// default PageResult<MaterialPlanDetailDO> selectPage(MaterialPlanDetailPageReqVO reqVO) {
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<MaterialPlanDetailDO>()
|
||||
// .eqIfPresent(MaterialPlanDetailDO::getId, reqVO.getId())
|
||||
// .eqIfPresent(MaterialPlanDetailDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId())
|
||||
// .eqIfPresent(MaterialPlanDetailDO::getMaterialId, reqVO.getMaterialId())
|
||||
// .eqIfPresent(MaterialPlanDetailDO::getProjectSubId, reqVO.getProjectSubId())
|
||||
// .eqIfPresent(MaterialPlanDetailDO::getRequireAmount, reqVO.getRequireAmount())
|
||||
// .betweenIfPresent(MaterialPlanDetailDO::getRequireArriveTime, reqVO.getRequireArriveTime())
|
||||
// .eqIfPresent(MaterialPlanDetailDO::getDescription, reqVO.getDescription())
|
||||
// .betweenIfPresent(MaterialPlanDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
// .orderByDesc(MaterialPlanDetailDO::getId));
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.plan;
|
||||
|
||||
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.customer.CustomerDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.ProjectPlanStatusEnum;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 生产计划 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
|
||||
default PageResult<PlanDO> selectPage(PlanPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<PlanDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PlanDO.class)
|
||||
.select("u.nickname as businessManName", "e.name as customerName","p.code as projectCode","p.project_name as projectName","p.project_start_time as projectStartTime","p.project_end_time as projectEndTime","p.business_line as businessLine","p.property","p.is_urgency as isUrgency","p.has_alter as hasAlter")
|
||||
.leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, PlanDO::getProjectId)
|
||||
.leftJoin(AdminUserDO.class, "u", AdminUserDO::getId, ProjectOrderDO::getBusinessMan)
|
||||
.leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(PlanDO::getPlanNo);
|
||||
query.like(!StringUtils.isEmpty(reqVO.getPlanNo()), PlanDO::getPlanNo, reqVO.getPlanNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectCode()), "p.code", reqVO.getProjectCode())
|
||||
.like(!StringUtils.isEmpty(reqVO.getCustomerName()), "e.name", reqVO.getCustomerName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getBusinessManName()), "u.nickname", reqVO.getBusinessManName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectOwner()), PlanDO::getProjectOwner, reqVO.getProjectOwner())
|
||||
.eq(reqVO.getBusinessLine() != null, ProjectOrderDO::getBusinessLine, reqVO.getBusinessLine())
|
||||
.eq(reqVO.getProperty() != null, ProjectOrderDO::getProperty, reqVO.getProperty())
|
||||
.eq(reqVO.getStatus() != null, PlanDO::getStatus, reqVO.getStatus());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
default PageResult<PlanDO> selectPageByStatus(PlanPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<PlanDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PlanDO.class)
|
||||
.select("u.nickname as businessManName", "e.name as customerName","p.code as projectCode","p.project_name as projectName","p.project_start_time as projectStartTime","p.project_end_time as projectEndTime","p.business_line as businessLine","p.property","p.is_urgency as isUrgency","p.has_alter as hasAlter")
|
||||
.leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, PlanDO::getProjectId)
|
||||
.leftJoin(AdminUserDO.class, "u", AdminUserDO::getId, ProjectOrderDO::getBusinessMan)
|
||||
.leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(PlanDO::getPlanNo);
|
||||
query.like(!StringUtils.isEmpty(reqVO.getPlanNo()), PlanDO::getPlanNo, reqVO.getPlanNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectCode()), "p.code", reqVO.getProjectCode())
|
||||
.like(!StringUtils.isEmpty(reqVO.getCustomerName()), "e.name", reqVO.getCustomerName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getBusinessManName()), "u.nickname", reqVO.getBusinessManName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectOwner()), PlanDO::getProjectOwner, reqVO.getProjectOwner())
|
||||
.eq(reqVO.getBusinessLine() != null, ProjectOrderDO::getBusinessLine, reqVO.getBusinessLine())
|
||||
.eq(reqVO.getProperty() != null, ProjectOrderDO::getProperty, reqVO.getProperty())
|
||||
.ne(true, PlanDO::getStatus, ProjectPlanStatusEnum.COMPLETE.getCode())
|
||||
.ne(true,PlanDO::getStatus,ProjectPlanStatusEnum.TERMINATE.getCode());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
// default PageResult<PlanDO> selectPage(PlanPageReqVO reqVO) {
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<PlanDO>()
|
||||
// .eqIfPresent(PlanDO::getId, reqVO.getId())
|
||||
// .likeIfPresent(PlanDO::getPlanNo, reqVO.getPlanNo())
|
||||
// .eqIfPresent(PlanDO::getProjectId, reqVO.getProjectId())
|
||||
// .likeIfPresent(PlanDO::getProjectOwner, reqVO.getProjectOwner())
|
||||
// .eqIfPresent(PlanDO::getHasCraft, reqVO.getHasCraft())
|
||||
// .likeIfPresent(PlanDO::getCraftOwner, reqVO.getCraftOwner())
|
||||
// .betweenIfPresent(PlanDO::getCraftStartDate, reqVO.getCraftStartDate())
|
||||
// .betweenIfPresent(PlanDO::getCraftEndDate, reqVO.getCraftEndDate())
|
||||
// .likeIfPresent(PlanDO::getEditor, reqVO.getEditor())
|
||||
// .betweenIfPresent(PlanDO::getEditorDate, reqVO.getEditorDate())
|
||||
// .likeIfPresent(PlanDO::getAuditor, reqVO.getAuditor())
|
||||
// .betweenIfPresent(PlanDO::getAuditDate, reqVO.getAuditDate())
|
||||
// .likeIfPresent(PlanDO::getApprover, reqVO.getApprover())
|
||||
// .betweenIfPresent(PlanDO::getApproveDate, reqVO.getApproveDate())
|
||||
// .eqIfPresent(PlanDO::getDescription, reqVO.getDescription())
|
||||
// .eqIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
||||
// .eqIfPresent(PlanDO::getChangeNum, reqVO.getChangeNum())
|
||||
// .betweenIfPresent(PlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
// .orderByDesc(PlanDO::getId));
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.plansub;
|
||||
|
||||
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.plansub.PlanSubDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.*;
|
||||
|
||||
/**
|
||||
* 生产计划子项目 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PlanSubMapper extends BaseMapperX<PlanSubDO> {
|
||||
|
||||
default PageResult<PlanSubDO> selectPage(PlanSubPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PlanSubDO>()
|
||||
.eqIfPresent(PlanSubDO::getId, reqVO.getId())
|
||||
.eqIfPresent(PlanSubDO::getProjectPlanId, reqVO.getProjectPlanId())
|
||||
.eqIfPresent(PlanSubDO::getProjectId, reqVO.getProjectId())
|
||||
.eqIfPresent(PlanSubDO::getProjectSubId, reqVO.getProjectSubId())
|
||||
.eqIfPresent(PlanSubDO::getMouldId, reqVO.getMouldId())
|
||||
.eqIfPresent(PlanSubDO::getEquipId, reqVO.getEquipId())
|
||||
.betweenIfPresent(PlanSubDO::getBlankDate, reqVO.getBlankDate())
|
||||
.betweenIfPresent(PlanSubDO::getTwoDimDate, reqVO.getTwoDimDate())
|
||||
.eqIfPresent(PlanSubDO::getBlankOwner, reqVO.getBlankOwner())
|
||||
.eqIfPresent(PlanSubDO::getTwoDimOwner, reqVO.getTwoDimOwner())
|
||||
.betweenIfPresent(PlanSubDO::getThreeDimDate, reqVO.getThreeDimDate())
|
||||
.eqIfPresent(PlanSubDO::getThreeDimOwner, reqVO.getThreeDimOwner())
|
||||
.betweenIfPresent(PlanSubDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByAsc(PlanSubDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.processbom;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工艺bom明细 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO> {
|
||||
|
||||
default List<ProcessBomDetailDO> selectListByBomId(Long bomId) {
|
||||
return selectList(ProcessBomDetailDO::getBomId, bomId);
|
||||
}
|
||||
|
||||
default int deleteByBomId(Long bomId) {
|
||||
return delete(ProcessBomDetailDO::getBomId, bomId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.processbom;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 工艺bom Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessBomMapper extends BaseMapperX<ProcessBomDO> {
|
||||
|
||||
default PageResult<ProcessBomDO> selectPage(ProcessBomPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<ProcessBomDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(ProcessBomDO.class)
|
||||
.select("concat('BOM-', e.project_sub_code) as code")
|
||||
.select("a.plan_no as planCode", "b.code as projectCode", "c.name as customerName", "b.project_name as projectName")
|
||||
.select("d.name as projectSubName")
|
||||
.leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessBomDO::getPlanId)
|
||||
.leftJoin(PlanSubDO.class, "e", PlanSubDO::getProjectSubId, ProcessBomDO::getProjectSubId)
|
||||
.leftJoin(ProjectOrderDO.class, "b", ProjectOrderDO::getId, ProcessBomDO::getProjectId)
|
||||
.leftJoin(CustomerDO.class, "c", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
||||
.leftJoin(ProjectOrderSubDO.class, "d", ProjectOrderSubDO::getId, ProcessBomDO::getProjectSubId)
|
||||
.orderByDesc(ProcessBomDO::getId)
|
||||
.disableSubLogicDel()
|
||||
;
|
||||
|
||||
query.like(!StringUtils.isEmpty(reqVO.getCode()), ProcessBomDO::getCode, reqVO.getCode())
|
||||
.like(!StringUtils.isEmpty(reqVO.getPlanCode()), PlanDO::getPlanNo, reqVO.getPlanCode())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode())
|
||||
.like(!StringUtils.isEmpty(reqVO.getCustomerName()), CustomerDO::getName, reqVO.getCustomerName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName())
|
||||
.eq(reqVO.getBomStatus() != null, ProcessBomDO::getBomStatus, reqVO.getBomStatus())
|
||||
;
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
default ProcessBomDO selectById(Long id) {
|
||||
MPJLambdaWrapper<ProcessBomDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(ProcessBomDO.class)
|
||||
.select("concat('BOM-', e.project_sub_code) as code")
|
||||
.select("a.plan_no as planCode", "b.code as projectCode", "c.name as customerName", "b.project_name as projectName")
|
||||
.select("d.name as projectSubName")
|
||||
.leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessBomDO::getPlanId)
|
||||
.leftJoin(PlanSubDO.class, "e", PlanSubDO::getProjectSubId, ProcessBomDO::getProjectSubId)
|
||||
.leftJoin(ProjectOrderDO.class, "b", ProjectOrderDO::getId, ProcessBomDO::getProjectId)
|
||||
.leftJoin(CustomerDO.class, "c", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
||||
.leftJoin(ProjectOrderSubDO.class, "d", ProjectOrderSubDO::getId, ProcessBomDO::getProjectSubId)
|
||||
.eq(ProcessBomDO::getId, id)
|
||||
.last("LIMIT 1")
|
||||
.disableSubLogicDel()
|
||||
;
|
||||
return selectOne(query);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorder;
|
||||
|
||||
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.materialplan.vo.MaterialPlanPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.PurchaseStatusEnum;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 采购订单 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
||||
|
||||
default PageResult<PurchaseOrderDO> selectPage(PurchaseOrderPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<PurchaseOrderDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PurchaseOrderDO.class)
|
||||
.select("s.name as supplierName","m.project_material_plan_no as materialPlanNo")
|
||||
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderDO::getSupplierId)
|
||||
.leftJoin(MaterialPlanDO.class, "m", MaterialPlanDO::getId, PurchaseOrderDO::getProjectMaterialPlanId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(PurchaseOrderDO::getCreateTime);
|
||||
query.like(!StringUtils.isEmpty(reqVO.getPurchaseNo()), PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getSupplierName()), "s.name", reqVO.getSupplierName())
|
||||
.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, PurchaseOrderDO::getStatus, reqVO.getStatus())
|
||||
.eq(reqVO.getPurchaseType() != null, PurchaseOrderDO::getPurchaseType, reqVO.getPurchaseType())
|
||||
.eq(reqVO.getGoodsType() != null, PurchaseOrderDO::getGoodsType, reqVO.getGoodsType())
|
||||
.in(reqVO.getIds() != null && !reqVO.getIds().isEmpty(),PurchaseOrderDO::getId,reqVO.getIds());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
default PageResult<PurchaseOrderDO> selectPageByStatus(PurchaseOrderPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<PurchaseOrderDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PurchaseOrderDO.class)
|
||||
.select("s.name as supplierName","m.project_material_plan_no as materialPlanNo")
|
||||
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderDO::getSupplierId)
|
||||
.leftJoin(MaterialPlanDO.class, "m", MaterialPlanDO::getId, PurchaseOrderDO::getProjectMaterialPlanId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(PurchaseOrderDO::getCreateTime);
|
||||
query.like(!StringUtils.isEmpty(reqVO.getPurchaseNo()), PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getSupplierName()), "s.name", reqVO.getSupplierName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getMaterialPlanNo()), "m.project_material_plan_no", reqVO.getMaterialPlanNo())
|
||||
.apply(reqVO.getCreateTime() != null, "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", reqVO.getCreateTime())
|
||||
.eq(reqVO.getStatus() != null, PurchaseOrderDO::getStatus, reqVO.getStatus())
|
||||
.ne(true, PurchaseOrderDO::getStatus, PurchaseStatusEnum.START.getCode())
|
||||
.eq(reqVO.getPurchaseType() != null, PurchaseOrderDO::getPurchaseType, reqVO.getPurchaseType())
|
||||
.eq(reqVO.getGoodsType() != null, PurchaseOrderDO::getGoodsType, reqVO.getGoodsType());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
default PageResult<PurchaseOrderDO> selectListWithTax(PurchaseOrderPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<PurchaseOrderDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PurchaseOrderDO.class)
|
||||
.select("s.name as supplierName","m.project_material_plan_no as materialPlanNo","(case when t.tax_ratio!=Null and t.estimated_price!=null then t.estimated_price*t.tax_ratio else '' end) as estimated_price","(case when t.tax_ratio!=Null and t.actual_price!=null then t.actual_price*t.tax_ratio else '' end) as actual_price")
|
||||
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderDO::getSupplierId)
|
||||
.leftJoin(MaterialPlanDO.class, "m", MaterialPlanDO::getId, PurchaseOrderDO::getProjectMaterialPlanId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(PurchaseOrderDO::getCreateTime);
|
||||
query.like(!StringUtils.isEmpty(reqVO.getPurchaseNo()), PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getSupplierName()), "s.name", reqVO.getSupplierName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getMaterialPlanNo()), "m.project_material_plan_no", reqVO.getMaterialPlanNo())
|
||||
.apply(reqVO.getCreateTime() != null, "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", reqVO.getCreateTime())
|
||||
.eq(reqVO.getStatus() != null, PurchaseOrderDO::getStatus, reqVO.getStatus())
|
||||
.eq(reqVO.getPurchaseType() != null, PurchaseOrderDO::getPurchaseType, reqVO.getPurchaseType())
|
||||
.eq(reqVO.getGoodsType() != null, PurchaseOrderDO::getGoodsType, reqVO.getGoodsType())
|
||||
.in(reqVO.getIds() != null && !reqVO.getIds().isEmpty(),PurchaseOrderDO::getId,reqVO.getIds());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
// default PageResult<PurchaseOrderDO> selectPage(PurchaseOrderPageReqVO reqVO) {
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseOrderDO>()
|
||||
// .eqIfPresent(PurchaseOrderDO::getId, reqVO.getId())
|
||||
// .eqIfPresent(PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
||||
// .eqIfPresent(PurchaseOrderDO::getSupplierId, reqVO.getSupplierId())
|
||||
// .eqIfPresent(PurchaseOrderDO::getContractNo, reqVO.getContractNo())
|
||||
// .eqIfPresent(PurchaseOrderDO::getPurchaseType, reqVO.getPurchaseType())
|
||||
// .eqIfPresent(PurchaseOrderDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId())
|
||||
// .eqIfPresent(PurchaseOrderDO::getGoodsType, reqVO.getGoodsType())
|
||||
// .eqIfPresent(PurchaseOrderDO::getCurrencyType, reqVO.getCurrencyType())
|
||||
// .eqIfPresent(PurchaseOrderDO::getTaxRatio, reqVO.getTaxRatio())
|
||||
// .eqIfPresent(PurchaseOrderDO::getEstimatedPrice, reqVO.getEstimatedPrice())
|
||||
// .eqIfPresent(PurchaseOrderDO::getActualPrice, reqVO.getActualPrice())
|
||||
// .eqIfPresent(PurchaseOrderDO::getStatus, reqVO.getStatus())
|
||||
// .eqIfPresent(PurchaseOrderDO::getSubmitUserId, reqVO.getSubmitUserId())
|
||||
// .betweenIfPresent(PurchaseOrderDO::getSubmitTime, reqVO.getSubmitTime())
|
||||
// .eqIfPresent(PurchaseOrderDO::getAuditor, reqVO.getAuditor())
|
||||
// .betweenIfPresent(PurchaseOrderDO::getAuditTime, reqVO.getAuditTime())
|
||||
// .eqIfPresent(PurchaseOrderDO::getDescription, reqVO.getDescription())
|
||||
// .eqIfPresent(PurchaseOrderDO::getCreator, reqVO.getCreator())
|
||||
// .betweenIfPresent(PurchaseOrderDO::getCreateTime, reqVO.getCreateTime())
|
||||
// .orderByDesc(PurchaseOrderDO::getId));
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordermaterial;
|
||||
|
||||
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.materialplandetail.vo.MaterialPlanDetailPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*;
|
||||
|
||||
/**
|
||||
* 采购单物料 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseOrderMaterialMapper extends BaseMapperX<PurchaseOrderMaterialDO> {
|
||||
|
||||
default PageResult<PurchaseOrderMaterialDO> selectPage(PurchaseOrderMaterialPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<PurchaseOrderMaterialDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PurchaseOrderMaterialDO.class)
|
||||
.select("mat.id as matId","mat.name as matName","mat.code as matCode","mat.spec as matSpec","mat.unit as matUnit","mat.material_type as matType")
|
||||
.leftJoin(MaterialDO.class, "mat", MaterialDO::getId, PurchaseOrderMaterialDO::getMaterialId)
|
||||
.disableSubLogicDel()
|
||||
.orderByAsc(PurchaseOrderMaterialDO::getId);
|
||||
query.eq(reqVO.getPurchaseOrderId()!=null,PurchaseOrderMaterialDO::getPurchaseOrderId, reqVO.getPurchaseOrderId()).orderByAsc(PurchaseOrderMaterialDO::getCreateTime);
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
// default PageResult<PurchaseOrderMaterialDO> selectPage(PurchaseOrderMaterialPageReqVO reqVO) {
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseOrderMaterialDO>()
|
||||
// .eqIfPresent(PurchaseOrderMaterialDO::getPurchaseOrderId, reqVO.getPurchaseOrderId())
|
||||
// .eqIfPresent(PurchaseOrderMaterialDO::getMaterialId, reqVO.getMaterialId())
|
||||
// .eqIfPresent(PurchaseOrderMaterialDO::getPurchaseAmount, reqVO.getPurchaseAmount())
|
||||
// .eqIfPresent(PurchaseOrderMaterialDO::getEstimatedPrice, reqVO.getEstimatedPrice())
|
||||
// .eqIfPresent(PurchaseOrderMaterialDO::getActualPrice, reqVO.getActualPrice())
|
||||
// .betweenIfPresent(PurchaseOrderMaterialDO::getArriveTime, reqVO.getArriveTime())
|
||||
// .eqIfPresent(PurchaseOrderMaterialDO::getDescription, reqVO.getDescription())
|
||||
// .betweenIfPresent(PurchaseOrderMaterialDO::getCreateTime, reqVO.getCreateTime())
|
||||
// .orderByDesc(PurchaseOrderMaterialDO::getId));
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatchdetail;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
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.taskdispatchdetail.TaskDispatchDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 派工明细 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetailDO> {
|
||||
|
||||
default List<TaskDispatchDetailDO> selectListByDispatchId(Long dispatchId) {
|
||||
return selectList(TaskDispatchDetailDO::getDispatchId, dispatchId);
|
||||
}
|
||||
|
||||
default int deleteByDispatchId(Long dispatchId) {
|
||||
return delete(TaskDispatchDetailDO::getDispatchId, dispatchId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch;
|
||||
|
||||
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.taskdispatch.TaskDispatchDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*;
|
||||
|
||||
/**
|
||||
* 派工单 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskDispatchMapper extends BaseMapperX<TaskDispatchDO> {
|
||||
|
||||
default PageResult<TaskDispatchDO> selectPage(TaskDispatchPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TaskDispatchDO>()
|
||||
.eqIfPresent(TaskDispatchDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(TaskDispatchDO::getDispatchType, reqVO.getDispatchType())
|
||||
.eqIfPresent(TaskDispatchDO::getTaskId, reqVO.getTaskId())
|
||||
.eqIfPresent(TaskDispatchDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(TaskDispatchDO::getProjectId, reqVO.getProjectId())
|
||||
.eqIfPresent(TaskDispatchDO::getProjectSubId, reqVO.getProjectSubId())
|
||||
.eqIfPresent(TaskDispatchDO::getBomDetailId, reqVO.getBomDetailId())
|
||||
.eqIfPresent(TaskDispatchDO::getDispatchStatus, reqVO.getDispatchStatus())
|
||||
.eqIfPresent(TaskDispatchDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(TaskDispatchDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(TaskDispatchDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(TaskDispatchDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.materialplan;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplan.vo.*;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 物料需求计划 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface MaterialPlanService {
|
||||
|
||||
/**
|
||||
* 创建物料需求计划
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMaterialPlan(@Valid MaterialPlanSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新物料需求计划
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialPlan(@Valid MaterialPlanSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除物料需求计划
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialPlan(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料需求计划
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 物料需求计划
|
||||
*/
|
||||
MaterialPlanDO getMaterialPlan(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料需求计划分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 物料需求计划分页
|
||||
*/
|
||||
PageResult<MaterialPlanDO> getMaterialPlanPage(MaterialPlanPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.materialplan;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplan.vo.*;
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplan.MaterialPlanMapper;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.MATERIAL_PLAN;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.PROJECT_PLAN;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 物料需求计划 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialPlanServiceImpl implements MaterialPlanService {
|
||||
|
||||
@Resource
|
||||
private MaterialPlanMapper materialPlanMapper;
|
||||
|
||||
@Resource
|
||||
private SerialNumberService serialNumberService;
|
||||
|
||||
@Override
|
||||
public Long createMaterialPlan(MaterialPlanSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialPlanDO materialPlan = BeanUtils.toBean(createReqVO, MaterialPlanDO.class);
|
||||
|
||||
// 月度流水号
|
||||
SerialNumberDO serialNumberDO = new SerialNumberDO();
|
||||
serialNumberDO = serialNumberService.getSerialNumber(MATERIAL_PLAN.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||
serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1);
|
||||
|
||||
materialPlan.setProjectMaterialPlanNo(MATERIAL_PLAN.getCode(serialNumberDO.getSerialNumber().toString()));
|
||||
|
||||
materialPlanMapper.insert(materialPlan);
|
||||
|
||||
// 回写序列记录
|
||||
serialNumberService.updateSerialNumber(serialNumberDO);
|
||||
// 返回
|
||||
return materialPlan.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialPlan(MaterialPlanSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialPlanExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialPlanDO updateObj = BeanUtils.toBean(updateReqVO, MaterialPlanDO.class);
|
||||
|
||||
LocalDateTime currTime = LocalDateTime.now();
|
||||
if(updateReqVO.getStatus()==2){
|
||||
updateObj.setSubmitTime(currTime);
|
||||
}
|
||||
if(updateReqVO.getStatus()== 3 || updateReqVO.getStatus() == 4){
|
||||
updateObj.setAuditTime(currTime);
|
||||
}
|
||||
|
||||
materialPlanMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialPlan(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialPlanExists(id);
|
||||
// 删除
|
||||
materialPlanMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateMaterialPlanExists(Long id) {
|
||||
if (materialPlanMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_PLAN_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialPlanDO getMaterialPlan(Long id) {
|
||||
return materialPlanMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialPlanDO> getMaterialPlanPage(MaterialPlanPageReqVO pageReqVO) {
|
||||
return materialPlanMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.materialplandetail;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 物料需求计划物料详情 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface MaterialPlanDetailService {
|
||||
|
||||
/**
|
||||
* 创建物料需求计划物料详情
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMaterialPlanDetail(@Valid MaterialPlanDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新物料需求计划物料详情
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialPlanDetail(@Valid MaterialPlanDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除物料需求计划物料详情
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialPlanDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料需求计划物料详情
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 物料需求计划物料详情
|
||||
*/
|
||||
MaterialPlanDetailDO getMaterialPlanDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得物料需求计划物料详情分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 物料需求计划物料详情分页
|
||||
*/
|
||||
PageResult<MaterialPlanDetailDO> getMaterialPlanDetailPage(MaterialPlanDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue