Compare commits
7 Commits
d76831c243
...
281bedbaa5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
281bedbaa5 | ||
|
|
2325f66936 | ||
|
|
ba6e91ebca | ||
|
|
08fa9c07b3 | ||
|
|
a12278d195 | ||
|
|
2cb4070fe0 | ||
|
|
c6398da8fc |
@ -9,6 +9,7 @@ import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLo
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.inspplanitem.InspPlanItemService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -98,4 +99,13 @@ public class InspPlanItemController {
|
||||
public CommonResult<List<InspPlanItemDO>> getInspPlanItemByPlanId(@RequestParam("planId") Integer planId) {
|
||||
return success(inspPlanItemService.getInspPlanItemByPlanId(planId));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/selectMaterialId")
|
||||
@Operation(summary = "获得检验项目")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<List<InspPlanItemDO>> selectMaterialId(@RequestParam("id") Integer id) {
|
||||
return success(inspPlanItemService.selectMaterialId(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -100,5 +100,13 @@ public class MachineController {
|
||||
List<MachineDO> dropdownList = machineService.getMachineDropdown(keyWord, procId);
|
||||
return success(BeanUtils.toBean(dropdownList, MachineRespVO.class));
|
||||
}
|
||||
//机台下拉框全部数据
|
||||
@GetMapping("/getMachineList")
|
||||
@Operation(summary = "获得机台下拉框")
|
||||
@PreAuthorize("@ss.hasPermission('biz:machine:query')")
|
||||
public CommonResult<List<MachineRespVO>> getMachineList() {
|
||||
List<MachineDO> dropdownList = machineService.getMachineList();
|
||||
return success(BeanUtils.toBean(dropdownList, MachineRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -23,6 +23,8 @@ public class MaterialPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||
private Integer enabledStatus;
|
||||
|
||||
@Schema(description = "物料类型(1 原材料 2 半成品 3 成品 4 联产品 )", example = "1")
|
||||
private String spec;
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
||||
@ -7,11 +7,7 @@ import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.order.vo.OrderItemRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.order.vo.OrderItemWithOrderRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.order.vo.OrderPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.order.vo.OrderRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.order.vo.OrderSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.order.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.order.OrderDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.orderitem.OrderItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.order.OrderService;
|
||||
|
||||
@ -0,0 +1,111 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanCompleteReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.plan.PlanDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.plan.PlanService;
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 生产计划")
|
||||
@RestController
|
||||
@RequestMapping("/tpl/plan")
|
||||
@Validated
|
||||
public class PlanController {
|
||||
|
||||
@Resource
|
||||
private PlanService planService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产计划")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan:create')")
|
||||
public CommonResult<Integer> createPlan(@Valid @RequestBody PlanSaveReqVO createReqVO) {
|
||||
return success(planService.createPlan(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产计划")
|
||||
@PreAuthorize("@ss.hasPermission('tpl: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('tpl:plan:delete')")
|
||||
public CommonResult<Boolean> deletePlan(@RequestParam("id") Integer id) {
|
||||
planService.deletePlan(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产计划")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan:query')")
|
||||
public CommonResult<PlanRespVO> getPlan(@RequestParam("id") Integer id) {
|
||||
PlanDO plan = planService.getPlan(id);
|
||||
return success(BeanUtils.toBean(plan, PlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan:query')")
|
||||
public CommonResult<PageResult<PlanRespVO>> getPlanPage(@Valid PlanPageReqVO pageReqVO) {
|
||||
PageResult<PlanDO> pageResult = planService.getPlanPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产计划 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tpl: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));
|
||||
}
|
||||
|
||||
@PutMapping("/complete")
|
||||
@Operation(summary = "计划完成")
|
||||
public CommonResult<Boolean> complete(@Valid @RequestBody List<PlanCompleteReqVO> reqVO) {
|
||||
planService.complete(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
@PutMapping("/close")
|
||||
@Operation(summary = "计划关闭")
|
||||
public CommonResult<Boolean> close(@Valid @RequestBody List<PlanCompleteReqVO> reqVO) {
|
||||
planService.close(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 计划完成请求 VO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Data
|
||||
public class PlanCompleteReqVO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 行号
|
||||
*/
|
||||
private Integer rowIndex;
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
import static com.ningxia.yunxi.chemmes.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 PlanPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "生产计划号(PL+年份+月份+3位流水号)")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate[] proDate;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "产品id", example = "7424")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "产品编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "产品名称", example = "芋艿")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "计划数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
@Schema(description = "计划开始日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] planBgDate;
|
||||
|
||||
@Schema(description = "计划完成日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] planEndDate;
|
||||
|
||||
@Schema(description = "工艺流程")
|
||||
private String processFlow;
|
||||
|
||||
@Schema(description = "计划状态(0 未下发 1已下发 2 执行中 3 已完成 4 暂停 5 关闭 )", example = "2")
|
||||
private String planStatus;
|
||||
|
||||
@Schema(description = "编制人id", example = "21487")
|
||||
private String planEmpId;
|
||||
|
||||
@Schema(description = "编制人名称", example = "芋艿")
|
||||
private String planEmpName;
|
||||
|
||||
@Schema(description = "完成数量")
|
||||
private BigDecimal completeQty;
|
||||
|
||||
@Schema(description = "是否所有产线( 0 是 1否)")
|
||||
private String isAllLine;
|
||||
|
||||
@Schema(description = "入库数量")
|
||||
private BigDecimal storeInQty;
|
||||
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
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 PlanRespVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "31598")
|
||||
@ExcelProperty("自增字段")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "生产计划号(PL+年份+月份+3位流水号)")
|
||||
@ExcelProperty("生产计划号(PL+年份+月份+3位流水号)")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划日期")
|
||||
@ExcelProperty("计划日期")
|
||||
private LocalDate proDate;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "产品id", example = "7424")
|
||||
@ExcelProperty("产品id")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "产品编码")
|
||||
@ExcelProperty("产品编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "产品名称", example = "芋艿")
|
||||
@ExcelProperty("产品名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
@ExcelProperty("规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "计划数量")
|
||||
@ExcelProperty("计划数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
@Schema(description = "计划开始日期")
|
||||
@ExcelProperty("计划开始日期")
|
||||
private LocalDate planBgDate;
|
||||
|
||||
@Schema(description = "计划完成日期")
|
||||
@ExcelProperty("计划完成日期")
|
||||
private LocalDate planEndDate;
|
||||
|
||||
@Schema(description = "工艺流程")
|
||||
@ExcelProperty("工艺流程")
|
||||
private String processFlow;
|
||||
|
||||
@Schema(description = "计划状态(0 未下发 1已下发 2 执行中 3 已完成 4 暂停 5 关闭 )", example = "2")
|
||||
@ExcelProperty("计划状态(0 未下发 1已下发 2 执行中 3 已完成 4 暂停 5 关闭 )")
|
||||
private String planStatus;
|
||||
|
||||
@Schema(description = "编制人id", example = "21487")
|
||||
@ExcelProperty("编制人id")
|
||||
private String planEmpId;
|
||||
|
||||
@Schema(description = "编制人名称", example = "芋艿")
|
||||
@ExcelProperty("编制人名称")
|
||||
private String planEmpName;
|
||||
|
||||
@Schema(description = "完成数量")
|
||||
@ExcelProperty("完成数量")
|
||||
private BigDecimal completeQty;
|
||||
|
||||
@Schema(description = "是否所有产线( 0 是 1否)")
|
||||
@ExcelProperty("是否所有产线( 0 是 1否)")
|
||||
private String isAllLine;
|
||||
|
||||
@Schema(description = "入库数量")
|
||||
@ExcelProperty("入库数量")
|
||||
private BigDecimal storeInQty;
|
||||
private String techProc;
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planline.PlanLineDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 生产计划新增/修改 Request VO")
|
||||
@Data
|
||||
public class PlanSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "31598")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "生产计划号(PL+年份+月份+3位流水号)")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划日期")
|
||||
private LocalDate proDate;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "产品id", example = "7424")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "产品编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "产品名称", example = "芋艿")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "计划数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
@Schema(description = "计划开始日期")
|
||||
private LocalDate planBgDate;
|
||||
|
||||
@Schema(description = "计划完成日期")
|
||||
private LocalDate planEndDate;
|
||||
|
||||
@Schema(description = "工艺流程")
|
||||
private String processFlow;
|
||||
|
||||
@Schema(description = "计划状态(0 未下发 1已下发 2 执行中 3 已完成 4 暂停 5 关闭 )", example = "2")
|
||||
private String planStatus;
|
||||
|
||||
@Schema(description = "编制人id", example = "21487")
|
||||
private String planEmpId;
|
||||
|
||||
@Schema(description = "编制人名称", example = "芋艿")
|
||||
private String planEmpName;
|
||||
|
||||
@Schema(description = "完成数量")
|
||||
private BigDecimal completeQty;
|
||||
|
||||
@Schema(description = "是否所有产线( 0 是 1否)")
|
||||
private String isAllLine;
|
||||
|
||||
@Schema(description = "入库数量")
|
||||
private BigDecimal storeInQty;
|
||||
|
||||
@Schema(description = "下发产线信息")
|
||||
private List<PlanLineDO> planLineList;
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLineRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planline.PlanLineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.planline.PlanLineService;
|
||||
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.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 产线计划")
|
||||
@RestController
|
||||
@RequestMapping("/tpl/plan-line")
|
||||
@Validated
|
||||
public class PlanLineController {
|
||||
|
||||
@Resource
|
||||
private PlanLineService planLineService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建产线计划")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:create')")
|
||||
public CommonResult<Integer> createPlanLine(@Valid @RequestBody PlanLineSaveReqVO createReqVO) {
|
||||
return success(planLineService.createPlanLine(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新产线计划")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:update')")
|
||||
public CommonResult<Boolean> updatePlanLine(@Valid @RequestBody PlanLineSaveReqVO updateReqVO) {
|
||||
planLineService.updatePlanLine(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除产线计划")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:delete')")
|
||||
public CommonResult<Boolean> deletePlanLine(@RequestParam("id") Integer id) {
|
||||
planLineService.deletePlanLine(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得产线计划")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:query')")
|
||||
public CommonResult<PlanLineRespVO> getPlanLine(@RequestParam("id") Integer id) {
|
||||
PlanLineDO planLine = planLineService.getPlanLine(id);
|
||||
return success(BeanUtils.toBean(planLine, PlanLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得产线计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:query')")
|
||||
public CommonResult<PageResult<PlanLineRespVO>> getPlanLinePage(@Valid PlanLinePageReqVO pageReqVO) {
|
||||
PageResult<PlanLineDO> pageResult = planLineService.getPlanLinePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出产线计划 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPlanLineExcel(@Valid PlanLinePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlanLineDO> list = planLineService.getPlanLinePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "产线计划.xls", "数据", PlanLineRespVO.class,
|
||||
BeanUtils.toBean(list, PlanLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getPlanLineList")
|
||||
@Operation(summary = "获得产线计划(含计划状态)")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:query')")
|
||||
public CommonResult<List<PlanLineRespVO>> getPlanLineList(@RequestParam("proId") Integer proId) {
|
||||
return success(planLineService.getPlanLineList(proId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.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 PlanLinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "生产计划号")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划id", example = "23972")
|
||||
private Integer proId;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开工时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] proBgDate;
|
||||
|
||||
@Schema(description = "完工时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] proEndDate;
|
||||
|
||||
@Schema(description = "产线编码")
|
||||
private String lineCd;
|
||||
|
||||
@Schema(description = "产线名称", example = "张三")
|
||||
private String lineName;
|
||||
|
||||
@Schema(description = "产线id", example = "25719")
|
||||
private Integer lineId;
|
||||
|
||||
@Schema(description = "完成数量")
|
||||
private BigDecimal completeQty;
|
||||
|
||||
@Schema(description = "计划数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
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 PlanLineRespVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "32583")
|
||||
@ExcelProperty("自增字段")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "生产计划号")
|
||||
@ExcelProperty("生产计划号")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划id", example = "23972")
|
||||
@ExcelProperty("计划id")
|
||||
private Integer proId;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开工时间")
|
||||
@ExcelProperty("开工时间")
|
||||
private LocalDate proBgDate;
|
||||
|
||||
@Schema(description = "完工时间")
|
||||
@ExcelProperty("完工时间")
|
||||
private LocalDate proEndDate;
|
||||
|
||||
@Schema(description = "产线编码")
|
||||
@ExcelProperty("产线编码")
|
||||
private String lineCd;
|
||||
|
||||
@Schema(description = "产线名称", example = "张三")
|
||||
@ExcelProperty("产线名称")
|
||||
private String lineName;
|
||||
|
||||
@Schema(description = "产线id", example = "25719")
|
||||
@ExcelProperty("产线id")
|
||||
private Integer lineId;
|
||||
|
||||
@Schema(description = "完成数量")
|
||||
@ExcelProperty("完成数量")
|
||||
private BigDecimal completeQty;
|
||||
|
||||
@Schema(description = "计划数量")
|
||||
@ExcelProperty("计划数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
@Schema(description = "计划状态(0未执行 1执行中 2暂停 3已完成)")
|
||||
private String planStatus;
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 产线计划新增/修改 Request VO")
|
||||
@Data
|
||||
public class PlanLineSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "32583")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "生产计划号")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划id", example = "23972")
|
||||
private Integer proId;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开工时间")
|
||||
private LocalDate proBgDate;
|
||||
|
||||
@Schema(description = "完工时间")
|
||||
private LocalDate proEndDate;
|
||||
|
||||
@Schema(description = "产线编码")
|
||||
private String lineCd;
|
||||
|
||||
@Schema(description = "产线名称", example = "张三")
|
||||
private String lineName;
|
||||
|
||||
@Schema(description = "产线id", example = "25719")
|
||||
private Integer lineId;
|
||||
|
||||
@Schema(description = "完成数量")
|
||||
private BigDecimal completeQty;
|
||||
|
||||
@Schema(description = "计划数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
@Schema(description = "计划状态(前端传入,用于接收但不存储)")
|
||||
private String planStatus;
|
||||
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachineRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planmachine.PlanMachineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.planmachine.PlanMachineService;
|
||||
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.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 机台执行计划")
|
||||
@RestController
|
||||
@RequestMapping("/tpl/plan-machine")
|
||||
@Validated
|
||||
public class PlanMachineController {
|
||||
|
||||
@Resource
|
||||
private PlanMachineService planMachineService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建机台执行计划")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-machine:create')")
|
||||
public CommonResult<Integer> createPlanMachine(@Valid @RequestBody PlanMachineSaveReqVO createReqVO) {
|
||||
return success(planMachineService.createPlanMachine(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新机台执行计划")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-machine:update')")
|
||||
public CommonResult<Boolean> updatePlanMachine(@Valid @RequestBody PlanMachineSaveReqVO updateReqVO) {
|
||||
planMachineService.updatePlanMachine(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除机台执行计划")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-machine:delete')")
|
||||
public CommonResult<Boolean> deletePlanMachine(@RequestParam("id") Integer id) {
|
||||
planMachineService.deletePlanMachine(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得机台执行计划")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-machine:query')")
|
||||
public CommonResult<PlanMachineRespVO> getPlanMachine(@RequestParam("id") Integer id) {
|
||||
PlanMachineDO planMachine = planMachineService.getPlanMachine(id);
|
||||
return success(BeanUtils.toBean(planMachine, PlanMachineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得机台执行计划分页")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-machine:query')")
|
||||
public CommonResult<PageResult<PlanMachineRespVO>> getPlanMachinePage(@Valid PlanMachinePageReqVO pageReqVO) {
|
||||
PageResult<PlanMachineDO> pageResult = planMachineService.getPlanMachinePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanMachineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出机台执行计划 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-machine:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPlanMachineExcel(@Valid PlanMachinePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlanMachineDO> list = planMachineService.getPlanMachinePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "机台执行计划.xls", "数据", PlanMachineRespVO.class,
|
||||
BeanUtils.toBean(list, PlanMachineRespVO.class));
|
||||
}
|
||||
@GetMapping("/getPlanMachineList")
|
||||
@Operation(summary = "获得机台执行计划列表")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tpl:plan-line:query')")
|
||||
public CommonResult<List<PlanMachineRespVO>> getPlanMachineList(@RequestParam("proOrderLineId") Integer proOrderLineId) {
|
||||
List<PlanMachineDO> list = planMachineService.getPlanLineList(proOrderLineId);
|
||||
return success(BeanUtils.toBean(list, PlanMachineRespVO.class));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.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 PlanMachinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "生产计划号")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划id", example = "25544")
|
||||
private Integer proId;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开工时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] proBgDate;
|
||||
|
||||
@Schema(description = "完工时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] proEndDate;
|
||||
|
||||
@Schema(description = "计划状态(2 执行中 3 已完成 4 暂停)", example = "1")
|
||||
private String proStatus;
|
||||
|
||||
@Schema(description = "机台编码")
|
||||
private String machineCd;
|
||||
|
||||
@Schema(description = "机台名称", example = "王五")
|
||||
private String machineName;
|
||||
|
||||
@Schema(description = "机台id", example = "11714")
|
||||
private Integer machineId;
|
||||
|
||||
@Schema(description = "产线编码")
|
||||
private String lineCd;
|
||||
|
||||
@Schema(description = "产线名称", example = "王五")
|
||||
private String lineName;
|
||||
|
||||
@Schema(description = "产线id", example = "12905")
|
||||
private Integer lineId;
|
||||
|
||||
@Schema(description = "产线计划表id", example = "9885")
|
||||
private Integer proOrderLineId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.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 PlanMachineRespVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "20311")
|
||||
@ExcelProperty("自增字段")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "生产计划号")
|
||||
@ExcelProperty("生产计划号")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划id", example = "25544")
|
||||
@ExcelProperty("计划id")
|
||||
private Integer proId;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开工时间")
|
||||
@ExcelProperty("开工时间")
|
||||
private LocalDateTime proBgDate;
|
||||
|
||||
@Schema(description = "完工时间")
|
||||
@ExcelProperty("完工时间")
|
||||
private LocalDateTime proEndDate;
|
||||
|
||||
@Schema(description = "计划状态(2 执行中 3 已完成 4 暂停)", example = "1")
|
||||
@ExcelProperty("计划状态(2 执行中 3 已完成 4 暂停)")
|
||||
private String proStatus;
|
||||
|
||||
@Schema(description = "机台编码")
|
||||
@ExcelProperty("机台编码")
|
||||
private String machineCd;
|
||||
|
||||
@Schema(description = "机台名称", example = "王五")
|
||||
@ExcelProperty("机台名称")
|
||||
private String machineName;
|
||||
|
||||
@Schema(description = "机台id", example = "11714")
|
||||
@ExcelProperty("机台id")
|
||||
private Integer machineId;
|
||||
|
||||
@Schema(description = "产线编码")
|
||||
@ExcelProperty("产线编码")
|
||||
private String lineCd;
|
||||
|
||||
@Schema(description = "产线名称", example = "王五")
|
||||
@ExcelProperty("产线名称")
|
||||
private String lineName;
|
||||
|
||||
@Schema(description = "产线id", example = "12905")
|
||||
@ExcelProperty("产线id")
|
||||
private Integer lineId;
|
||||
|
||||
@Schema(description = "产线计划表id", example = "9885")
|
||||
@ExcelProperty("产线计划表id")
|
||||
private Integer proOrderLineId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.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 PlanMachineSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "20311")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "生产计划号")
|
||||
private String proNo;
|
||||
|
||||
@Schema(description = "计划id", example = "25544")
|
||||
private Integer proId;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开工时间")
|
||||
private LocalDateTime proBgDate;
|
||||
|
||||
@Schema(description = "完工时间")
|
||||
private LocalDateTime proEndDate;
|
||||
|
||||
@Schema(description = "计划状态(2 执行中 3 已完成 4 暂停)", example = "1")
|
||||
private String proStatus;
|
||||
|
||||
@Schema(description = "机台编码")
|
||||
private String machineCd;
|
||||
|
||||
@Schema(description = "机台名称", example = "王五")
|
||||
private String machineName;
|
||||
|
||||
@Schema(description = "机台id", example = "11714")
|
||||
private Integer machineId;
|
||||
|
||||
@Schema(description = "产线编码")
|
||||
private String lineCd;
|
||||
|
||||
@Schema(description = "产线名称", example = "王五")
|
||||
private String lineName;
|
||||
|
||||
@Schema(description = "产线id", example = "12905")
|
||||
private Integer lineId;
|
||||
|
||||
@Schema(description = "产线计划表id", example = "9885")
|
||||
private Integer proOrderLineId;
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proc.vo.ProcRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLineRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLineSaveReqVO;
|
||||
@ -77,5 +78,12 @@ public class ProLineController {
|
||||
List<ProLineDO> proLineDOS = proLineService.getProLineDropdown(keyWord);
|
||||
return success(BeanUtils.toBean(proLineDOS, ProLineRespVO.class));
|
||||
}
|
||||
|
||||
// 下拉框
|
||||
@GetMapping("/getProLineList")
|
||||
@Operation(summary = "获得工序不分页")
|
||||
@PreAuthorize("@ss.hasPermission('biz:proc:query')")
|
||||
public CommonResult<List<ProLineRespVO>> getProLineList() {
|
||||
List<ProLineDO> proLineDOS = proLineService.getProLineList();
|
||||
return success(BeanUtils.toBean(proLineDOS, ProLineRespVO.class));
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,5 +17,7 @@ public class ProLinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||
private Integer enabledStatus;
|
||||
@Schema(description = "产线编号")
|
||||
private String keyword;
|
||||
|
||||
}
|
||||
@ -40,4 +40,8 @@ public class ProLineRespVO {
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "计划状态(0未执行 1执行中 2暂停 3已完成)")
|
||||
private String planStatus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.purorder.PurOrderService;
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 采购订单主")
|
||||
@RestController
|
||||
@RequestMapping("/tsc/pur-order")
|
||||
@Validated
|
||||
public class PurOrderController {
|
||||
|
||||
@Resource
|
||||
private PurOrderService purOrderService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购订单主")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order:create')")
|
||||
public CommonResult<Integer> createPurOrder(@Valid @RequestBody PurOrderSaveReqVO createReqVO) {
|
||||
return success(purOrderService.createPurOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采购订单主")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order:update')")
|
||||
public CommonResult<Boolean> updatePurOrder(@Valid @RequestBody PurOrderSaveReqVO updateReqVO) {
|
||||
purOrderService.updatePurOrder(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采购订单主")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order:delete')")
|
||||
public CommonResult<Boolean> deletePurOrder(@RequestParam("id") Integer id) {
|
||||
purOrderService.deletePurOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采购订单主")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order:query')")
|
||||
public CommonResult<PurOrderRespVO> getPurOrder(@RequestParam("id") Integer id) {
|
||||
PurOrderDO purOrder = purOrderService.getPurOrder(id);
|
||||
return success(BeanUtils.toBean(purOrder, PurOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采购订单主分页")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order:query')")
|
||||
public CommonResult<PageResult<PurOrderRespVO>> getPurOrderPage(@Valid PurOrderPageReqVO pageReqVO) {
|
||||
PageResult<PurOrderDO> pageResult = purOrderService.getPurOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PurOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采购订单主 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPurOrderExcel(@Valid PurOrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PurOrderDO> list = purOrderService.getPurOrderPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采购订单主.xls", "数据", PurOrderRespVO.class,
|
||||
BeanUtils.toBean(list, PurOrderRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.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 PurOrderPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "采购订单号(CGDD+年份+月份+3位流水号)")
|
||||
private String purOrdNo;
|
||||
|
||||
@Schema(description = "订单日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] purDate;
|
||||
|
||||
@Schema(description = "附件信息")
|
||||
private String attFile;
|
||||
|
||||
@Schema(description = "单据类型(1 标准采购申请 2设备采购申请)", example = "2")
|
||||
private String billType;
|
||||
|
||||
@Schema(description = "采购部门", example = "王五")
|
||||
private String purDeptName;
|
||||
|
||||
@Schema(description = "部门id", example = "4640")
|
||||
private String purDeptId;
|
||||
|
||||
@Schema(description = "申请类型(1 原材料 2 辅料 3设备)", example = "1")
|
||||
private String applyType;
|
||||
|
||||
@Schema(description = "采购人员", example = "赵六")
|
||||
private String purEmpName;
|
||||
|
||||
@Schema(description = "采购人id", example = "5929")
|
||||
private String purEmpId;
|
||||
|
||||
@Schema(description = "验收方式(1 数量验收 2金额验收)")
|
||||
private String acceptMeth;
|
||||
|
||||
@Schema(description = "单据状态(1 已创建 2 已确认 3 已审批 4已驳回 )", example = "2")
|
||||
private String purStatus;
|
||||
|
||||
@Schema(description = "供应商编码")
|
||||
private String supplierNo;
|
||||
|
||||
@Schema(description = "供应商名称", example = "张三")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "供应商id", example = "29224")
|
||||
private Integer supplierId;
|
||||
|
||||
@Schema(description = "收货状态(1 未收货 2部分收货 3 全部收货 )", example = "1")
|
||||
private String deliveryStatus;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "审核人id", example = "28411")
|
||||
private String auditId;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] auditTime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 采购订单主 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PurOrderRespVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "5253")
|
||||
@ExcelProperty("自增字段")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "采购订单号(CGDD+年份+月份+3位流水号)")
|
||||
@ExcelProperty("采购订单号(CGDD+年份+月份+3位流水号)")
|
||||
private String purOrdNo;
|
||||
|
||||
@Schema(description = "订单日期")
|
||||
@ExcelProperty("订单日期")
|
||||
private LocalDate purDate;
|
||||
|
||||
@Schema(description = "附件信息")
|
||||
@ExcelProperty("附件信息")
|
||||
private String attFile;
|
||||
|
||||
@Schema(description = "单据类型(1 标准采购申请 2设备采购申请)", example = "2")
|
||||
@ExcelProperty("单据类型(1 标准采购申请 2设备采购申请)")
|
||||
private String billType;
|
||||
|
||||
@Schema(description = "采购部门", example = "王五")
|
||||
@ExcelProperty("采购部门")
|
||||
private String purDeptName;
|
||||
|
||||
@Schema(description = "部门id", example = "4640")
|
||||
@ExcelProperty("部门id")
|
||||
private String purDeptId;
|
||||
|
||||
@Schema(description = "申请类型(1 原材料 2 辅料 3设备)", example = "1")
|
||||
@ExcelProperty("申请类型(1 原材料 2 辅料 3设备)")
|
||||
private String applyType;
|
||||
|
||||
@Schema(description = "采购人员", example = "赵六")
|
||||
@ExcelProperty("采购人员")
|
||||
private String purEmpName;
|
||||
|
||||
@Schema(description = "采购人id", example = "5929")
|
||||
@ExcelProperty("采购人id")
|
||||
private String purEmpId;
|
||||
|
||||
@Schema(description = "验收方式(1 数量验收 2金额验收)")
|
||||
@ExcelProperty("验收方式(1 数量验收 2金额验收)")
|
||||
private String acceptMeth;
|
||||
|
||||
@Schema(description = "单据状态(1 已创建 2 已确认 3 已审批 4已驳回 )", example = "2")
|
||||
@ExcelProperty("单据状态(1 已创建 2 已确认 3 已审批 4已驳回 )")
|
||||
private String purStatus;
|
||||
|
||||
@Schema(description = "供应商编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("供应商编码")
|
||||
private String supplierNo;
|
||||
|
||||
@Schema(description = "供应商名称", example = "张三")
|
||||
@ExcelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "供应商id", example = "29224")
|
||||
@ExcelProperty("供应商id")
|
||||
private Integer supplierId;
|
||||
|
||||
@Schema(description = "收货状态(1 未收货 2部分收货 3 全部收货 )", example = "1")
|
||||
@ExcelProperty("收货状态(1 未收货 2部分收货 3 全部收货 )")
|
||||
private String deliveryStatus;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "审核人id", example = "28411")
|
||||
@ExcelProperty("审核人id")
|
||||
private String auditId;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
@ExcelProperty("审核时间")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 采购订单主新增/修改 Request VO")
|
||||
@Data
|
||||
public class PurOrderSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "5253")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "采购订单号(CGDD+年份+月份+3位流水号)")
|
||||
private String purOrdNo;
|
||||
|
||||
@Schema(description = "订单日期")
|
||||
private LocalDate purDate;
|
||||
|
||||
@Schema(description = "附件信息")
|
||||
private String attFile;
|
||||
|
||||
@Schema(description = "单据类型(1 标准采购申请 2设备采购申请)", example = "2")
|
||||
private String billType;
|
||||
|
||||
@Schema(description = "采购部门", example = "王五")
|
||||
private String purDeptName;
|
||||
|
||||
@Schema(description = "部门id", example = "4640")
|
||||
private String purDeptId;
|
||||
|
||||
@Schema(description = "申请类型(1 原材料 2 辅料 3设备)", example = "1")
|
||||
private String applyType;
|
||||
|
||||
@Schema(description = "采购人员", example = "赵六")
|
||||
private String purEmpName;
|
||||
|
||||
@Schema(description = "采购人id", example = "5929")
|
||||
private String purEmpId;
|
||||
|
||||
@Schema(description = "验收方式(1 数量验收 2金额验收)")
|
||||
private String acceptMeth;
|
||||
|
||||
@Schema(description = "单据状态(1 已创建 2 已确认 3 已审批 4已驳回 )", example = "2")
|
||||
private String purStatus;
|
||||
|
||||
@Schema(description = "供应商编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "供应商编码不能为空")
|
||||
private String supplierNo;
|
||||
|
||||
@Schema(description = "供应商名称", example = "张三")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "供应商id", example = "29224")
|
||||
private Integer supplierId;
|
||||
|
||||
@Schema(description = "收货状态(1 未收货 2部分收货 3 全部收货 )", example = "1")
|
||||
private String deliveryStatus;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "审核人id", example = "28411")
|
||||
private String auditId;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem.PurOrderItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.purorderitem.PurOrderItemService;
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 采购订单子")
|
||||
@RestController
|
||||
@RequestMapping("/tsc/pur-order-item")
|
||||
@Validated
|
||||
public class PurOrderItemController {
|
||||
|
||||
@Resource
|
||||
private PurOrderItemService purOrderItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购订单子")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order-item:create')")
|
||||
public CommonResult<Integer> createPurOrderItem(@Valid @RequestBody PurOrderItemSaveReqVO createReqVO) {
|
||||
return success(purOrderItemService.createPurOrderItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采购订单子")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order-item:update')")
|
||||
public CommonResult<Boolean> updatePurOrderItem(@Valid @RequestBody PurOrderItemSaveReqVO updateReqVO) {
|
||||
purOrderItemService.updatePurOrderItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采购订单子")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order-item:delete')")
|
||||
public CommonResult<Boolean> deletePurOrderItem(@RequestParam("id") Integer id) {
|
||||
purOrderItemService.deletePurOrderItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采购订单子")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order-item:query')")
|
||||
public CommonResult<PurOrderItemRespVO> getPurOrderItem(@RequestParam("id") Integer id) {
|
||||
PurOrderItemDO purOrderItem = purOrderItemService.getPurOrderItem(id);
|
||||
return success(BeanUtils.toBean(purOrderItem, PurOrderItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采购订单子分页")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order-item:query')")
|
||||
public CommonResult<PageResult<PurOrderItemRespVO>> getPurOrderItemPage(@Valid PurOrderItemPageReqVO pageReqVO) {
|
||||
PageResult<PurOrderItemDO> pageResult = purOrderItemService.getPurOrderItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PurOrderItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采购订单子 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tsc:pur-order-item:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPurOrderItemExcel(@Valid PurOrderItemPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PurOrderItemDO> list = purOrderItemService.getPurOrderItemPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采购订单子.xls", "数据", PurOrderItemRespVO.class,
|
||||
BeanUtils.toBean(list, PurOrderItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.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 PurOrderItemPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "物料id", example = "29551")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "物料名称", example = "李四")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "收货数量")
|
||||
private BigDecimal deliveryQty;
|
||||
|
||||
@Schema(description = "要求到货日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] reqDeliveryDate;
|
||||
|
||||
@Schema(description = "采购申请单id", example = "11168")
|
||||
private Integer applyId;
|
||||
|
||||
@Schema(description = "采购申请单号")
|
||||
private String applyOrdNo;
|
||||
|
||||
@Schema(description = "采购申请单子表id", example = "13262")
|
||||
private Integer applyItemId;
|
||||
|
||||
@Schema(description = "采购数量")
|
||||
private BigDecimal purQty;
|
||||
|
||||
@Schema(description = "收货状态(1 未收货 2部分收货 3 全部收货 )", example = "1")
|
||||
private String deliveryStatus;
|
||||
|
||||
@Schema(description = "税率")
|
||||
private BigDecimal taxRatio;
|
||||
|
||||
@Schema(description = "含税单价")
|
||||
private BigDecimal priceTax;
|
||||
|
||||
@Schema(description = "含税总价", example = "19144")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "采购订单id", example = "21681")
|
||||
private Integer purId;
|
||||
|
||||
private List<String> deliveryStatusList;
|
||||
|
||||
private String purOrdNo;
|
||||
private String purStatus;
|
||||
private String supplierName;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
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 PurOrderItemRespVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "19396")
|
||||
@ExcelProperty("自增字段")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "物料id", example = "29551")
|
||||
@ExcelProperty("物料id")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
@ExcelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "物料名称", example = "李四")
|
||||
@ExcelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
@ExcelProperty("规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "收货数量")
|
||||
@ExcelProperty("收货数量")
|
||||
private BigDecimal deliveryQty;
|
||||
|
||||
@Schema(description = "要求到货日期")
|
||||
@ExcelProperty("要求到货日期")
|
||||
private LocalDate reqDeliveryDate;
|
||||
|
||||
@Schema(description = "采购申请单id", example = "11168")
|
||||
@ExcelProperty("采购申请单id")
|
||||
private Integer applyId;
|
||||
|
||||
@Schema(description = "采购申请单号")
|
||||
@ExcelProperty("采购申请单号")
|
||||
private String applyOrdNo;
|
||||
|
||||
@Schema(description = "采购申请单子表id", example = "13262")
|
||||
@ExcelProperty("采购申请单子表id")
|
||||
private Integer applyItemId;
|
||||
|
||||
@Schema(description = "采购数量")
|
||||
@ExcelProperty("采购数量")
|
||||
private BigDecimal purQty;
|
||||
|
||||
@Schema(description = "收货状态(1 未收货 2部分收货 3 全部收货 )", example = "1")
|
||||
@ExcelProperty("收货状态(1 未收货 2部分收货 3 全部收货 )")
|
||||
private String deliveryStatus;
|
||||
|
||||
@Schema(description = "税率")
|
||||
@ExcelProperty("税率")
|
||||
private BigDecimal taxRatio;
|
||||
|
||||
@Schema(description = "含税单价")
|
||||
@ExcelProperty("含税单价")
|
||||
private BigDecimal priceTax;
|
||||
|
||||
@Schema(description = "含税总价", example = "19144")
|
||||
@ExcelProperty("含税总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "采购订单id", example = "21681")
|
||||
@ExcelProperty("采购订单id")
|
||||
private Integer purId;
|
||||
|
||||
private String purOrdNo;
|
||||
|
||||
private String supplierName;
|
||||
|
||||
private String billType;
|
||||
|
||||
private LocalDate purDate;
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 采购订单子新增/修改 Request VO")
|
||||
@Data
|
||||
public class PurOrderItemSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "19396")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "物料id", example = "29551")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "物料名称", example = "李四")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "收货数量")
|
||||
private BigDecimal deliveryQty;
|
||||
|
||||
@Schema(description = "要求到货日期")
|
||||
private LocalDate reqDeliveryDate;
|
||||
|
||||
@Schema(description = "采购申请单id", example = "11168")
|
||||
private Integer applyId;
|
||||
|
||||
@Schema(description = "采购申请单号")
|
||||
private String applyOrdNo;
|
||||
|
||||
@Schema(description = "采购申请单子表id", example = "13262")
|
||||
private Integer applyItemId;
|
||||
|
||||
@Schema(description = "采购数量")
|
||||
private BigDecimal purQty;
|
||||
|
||||
@Schema(description = "收货状态(1 未收货 2部分收货 3 全部收货 )", example = "1")
|
||||
private String deliveryStatus;
|
||||
|
||||
@Schema(description = "税率")
|
||||
private BigDecimal taxRatio;
|
||||
|
||||
@Schema(description = "含税单价")
|
||||
private BigDecimal priceTax;
|
||||
|
||||
@Schema(description = "含税总价", example = "19144")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "采购订单id", example = "21681")
|
||||
private Integer purId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsp.RawMaterialInspDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinsp.RawMaterialInspService;
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 原材料检验主")
|
||||
@RestController
|
||||
@RequestMapping("/tqm/raw-material-insp")
|
||||
@Validated
|
||||
public class RawMaterialInspController {
|
||||
|
||||
@Resource
|
||||
private RawMaterialInspService rawMaterialInspService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建原材料检验主")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp:create')")
|
||||
public CommonResult<String> createRawMaterialInsp(@Valid @RequestBody RawMaterialInspSaveReqVO createReqVO) {
|
||||
return success(rawMaterialInspService.createRawMaterialInsp(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新原材料检验主")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp:update')")
|
||||
public CommonResult<Boolean> updateRawMaterialInsp(@Valid @RequestBody RawMaterialInspSaveReqVO updateReqVO) {
|
||||
rawMaterialInspService.updateRawMaterialInsp(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除原材料检验主")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp:delete')")
|
||||
public CommonResult<Boolean> deleteRawMaterialInsp(@RequestParam("id") String id) {
|
||||
rawMaterialInspService.deleteRawMaterialInsp(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得原材料检验主")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp:query')")
|
||||
public CommonResult<RawMaterialInspRespVO> getRawMaterialInsp(@RequestParam("id") String id) {
|
||||
RawMaterialInspDO rawMaterialInsp = rawMaterialInspService.getRawMaterialInsp(id);
|
||||
return success(BeanUtils.toBean(rawMaterialInsp, RawMaterialInspRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得原材料检验主分页")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp:query')")
|
||||
public CommonResult<PageResult<RawMaterialInspRespVO>> getRawMaterialInspPage(@Valid RawMaterialInspPageReqVO pageReqVO) {
|
||||
PageResult<RawMaterialInspDO> pageResult = rawMaterialInspService.getRawMaterialInspPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RawMaterialInspRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出原材料检验主 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportRawMaterialInspExcel(@Valid RawMaterialInspPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RawMaterialInspDO> list = rawMaterialInspService.getRawMaterialInspPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "原材料检验主.xls", "数据", RawMaterialInspRespVO.class,
|
||||
BeanUtils.toBean(list, RawMaterialInspRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
import static com.ningxia.yunxi.chemmes.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 RawMaterialInspPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "检验单号,YL+年月日+两位流水号")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "供应商id", example = "15219")
|
||||
private Integer supplierId;
|
||||
|
||||
@Schema(description = "供应商简称", example = "赵六")
|
||||
private String supplierSimName;
|
||||
|
||||
@Schema(description = "物料id", example = "9776")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String matCode;
|
||||
|
||||
@Schema(description = "物料名称", example = "芋艿")
|
||||
private String matName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "批次号")
|
||||
private String lotNo;
|
||||
|
||||
@Schema(description = "到货日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] recieveDate;
|
||||
|
||||
@Schema(description = "到货数量(kg)")
|
||||
private BigDecimal recieveKg;
|
||||
|
||||
@Schema(description = "抽检数量(kg)")
|
||||
private BigDecimal sampleQty;
|
||||
|
||||
@Schema(description = "检验日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate[] checkDate;
|
||||
|
||||
@Schema(description = "检验结果(0 合格 1 不合格 2让步接收)")
|
||||
private String checkResult;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "表单编号")
|
||||
private String formCode;
|
||||
|
||||
@Schema(description = "质检方案id", example = "25168")
|
||||
private String qaSchemeBaseId;
|
||||
|
||||
@Schema(description = "检验值数量")
|
||||
private Integer testNum;
|
||||
|
||||
@Schema(description = "检验人员id", example = "28188")
|
||||
private Integer checkUserId;
|
||||
|
||||
@Schema(description = "审核人员id", example = "10414")
|
||||
private Integer checkExUserId;
|
||||
|
||||
@Schema(description = "审核日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] checkExDate;
|
||||
|
||||
@Schema(description = "单据状态( 0-已创建 1-已确认 )", example = "1")
|
||||
private String checkStatus;
|
||||
|
||||
@Schema(description = "审核原因", example = "你说的对")
|
||||
private String checkRemark;
|
||||
|
||||
@Schema(description = "严格度(1、正常 2、加严 3、放宽)")
|
||||
private String strness;
|
||||
|
||||
@Schema(description = "来料类型(1、进货 2、样品)", example = "1")
|
||||
private String inmatType;
|
||||
|
||||
@Schema(description = "检验人员名称", example = "李四")
|
||||
private String checkUserName;
|
||||
|
||||
@Schema(description = "审核人员名称", example = "李四")
|
||||
private String checkExUserName;
|
||||
|
||||
@Schema(description = "采购订单id", example = "12822")
|
||||
private Integer purOrdId;
|
||||
|
||||
@Schema(description = "采购订单号")
|
||||
private String purOrdNo;
|
||||
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
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 RawMaterialInspRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11125")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "检验单号,YL+年月日+两位流水号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("检验单号,YL+年月日+两位流水号")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "供应商id", example = "15219")
|
||||
@ExcelProperty("供应商id")
|
||||
private Integer supplierId;
|
||||
|
||||
@Schema(description = "供应商简称", example = "赵六")
|
||||
@ExcelProperty("供应商简称")
|
||||
private String supplierSimName;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9776")
|
||||
@ExcelProperty("物料id")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
@ExcelProperty("物料编码")
|
||||
private String matCode;
|
||||
|
||||
@Schema(description = "物料名称", example = "芋艿")
|
||||
@ExcelProperty("物料名称")
|
||||
private String matName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
@ExcelProperty("规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "批次号")
|
||||
@ExcelProperty("批次号")
|
||||
private String lotNo;
|
||||
|
||||
@Schema(description = "到货日期")
|
||||
@ExcelProperty("到货日期")
|
||||
private LocalDate recieveDate;
|
||||
|
||||
@Schema(description = "到货数量(kg)")
|
||||
@ExcelProperty("到货数量(kg)")
|
||||
private BigDecimal recieveKg;
|
||||
|
||||
@Schema(description = "抽检数量(kg)")
|
||||
@ExcelProperty("抽检数量(kg)")
|
||||
private BigDecimal sampleQty;
|
||||
|
||||
@Schema(description = "检验日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("检验日期")
|
||||
private LocalDate checkDate;
|
||||
|
||||
@Schema(description = "检验结果(0 合格 1 不合格 2让步接收)")
|
||||
@ExcelProperty("检验结果(0 合格 1 不合格 2让步接收)")
|
||||
private String checkResult;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "表单编号")
|
||||
@ExcelProperty("表单编号")
|
||||
private String formCode;
|
||||
|
||||
@Schema(description = "质检方案id", example = "25168")
|
||||
@ExcelProperty("质检方案id")
|
||||
private String qaSchemeBaseId;
|
||||
|
||||
@Schema(description = "检验值数量")
|
||||
@ExcelProperty("检验值数量")
|
||||
private Integer testNum;
|
||||
|
||||
@Schema(description = "检验人员id", example = "28188")
|
||||
@ExcelProperty("检验人员id")
|
||||
private Integer checkUserId;
|
||||
|
||||
@Schema(description = "审核人员id", example = "10414")
|
||||
@ExcelProperty("审核人员id")
|
||||
private Integer checkExUserId;
|
||||
|
||||
@Schema(description = "审核日期")
|
||||
@ExcelProperty("审核日期")
|
||||
private LocalDate checkExDate;
|
||||
|
||||
@Schema(description = "单据状态( 0-已创建 1-已确认 )", example = "1")
|
||||
@ExcelProperty("单据状态( 0-已创建 1-已确认 )")
|
||||
private String checkStatus;
|
||||
|
||||
@Schema(description = "审核原因", example = "你说的对")
|
||||
@ExcelProperty("审核原因")
|
||||
private String checkRemark;
|
||||
|
||||
@Schema(description = "严格度(1、正常 2、加严 3、放宽)")
|
||||
@ExcelProperty("严格度(1、正常 2、加严 3、放宽)")
|
||||
private String strness;
|
||||
|
||||
@Schema(description = "来料类型(1、进货 2、样品)", example = "1")
|
||||
@ExcelProperty("来料类型(1、进货 2、样品)")
|
||||
private String inmatType;
|
||||
|
||||
@Schema(description = "检验人员名称", example = "李四")
|
||||
@ExcelProperty("检验人员名称")
|
||||
private String checkUserName;
|
||||
|
||||
@Schema(description = "审核人员名称", example = "李四")
|
||||
@ExcelProperty("审核人员名称")
|
||||
private String checkExUserName;
|
||||
|
||||
@Schema(description = "采购订单id", example = "12822")
|
||||
@ExcelProperty("采购订单id")
|
||||
private Integer purOrdId;
|
||||
|
||||
@Schema(description = "采购订单号")
|
||||
@ExcelProperty("采购订单号")
|
||||
private String purOrdNo;
|
||||
private List<RawMaterialInspTotalDO> rawMaterialInspTotalList;
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 原材料检验主新增/修改 Request VO")
|
||||
@Data
|
||||
public class RawMaterialInspSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11125")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "检验单号,YL+年月日+两位流水号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "检验单号,YL+年月日+两位流水号不能为空")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "供应商id", example = "15219")
|
||||
private Integer supplierId;
|
||||
|
||||
@Schema(description = "供应商简称", example = "赵六")
|
||||
private String supplierSimName;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9776")
|
||||
@NotNull(message = "物料id不能为空")
|
||||
private Integer materialId;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String matCode;
|
||||
|
||||
@Schema(description = "物料名称", example = "芋艿")
|
||||
private String matName;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "批次号")
|
||||
private String lotNo;
|
||||
|
||||
@Schema(description = "到货日期")
|
||||
private LocalDate recieveDate;
|
||||
|
||||
@Schema(description = "到货数量(kg)")
|
||||
private BigDecimal recieveKg;
|
||||
|
||||
@Schema(description = "抽检数量(kg)")
|
||||
private BigDecimal sampleQty;
|
||||
|
||||
@Schema(description = "检验日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "检验日期不能为空")
|
||||
private LocalDate checkDate;
|
||||
|
||||
@Schema(description = "检验结果(0 合格 1 不合格 2让步接收)")
|
||||
private String checkResult;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "表单编号")
|
||||
private String formCode;
|
||||
|
||||
@Schema(description = "质检方案id", example = "25168")
|
||||
private String qaSchemeBaseId;
|
||||
|
||||
@Schema(description = "检验值数量")
|
||||
private Integer testNum;
|
||||
|
||||
@Schema(description = "检验人员id", example = "28188")
|
||||
private Integer checkUserId;
|
||||
|
||||
@Schema(description = "审核人员id", example = "10414")
|
||||
private Integer checkExUserId;
|
||||
|
||||
@Schema(description = "审核日期")
|
||||
private LocalDate checkExDate;
|
||||
|
||||
@Schema(description = "单据状态( 0-已创建 1-已确认 )", example = "1")
|
||||
private String checkStatus;
|
||||
|
||||
@Schema(description = "审核原因", example = "你说的对")
|
||||
private String checkRemark;
|
||||
|
||||
@Schema(description = "严格度(1、正常 2、加严 3、放宽)")
|
||||
private String strness;
|
||||
|
||||
@Schema(description = "来料类型(1、进货 2、样品)", example = "1")
|
||||
private String inmatType;
|
||||
|
||||
@Schema(description = "检验人员名称", example = "李四")
|
||||
private String checkUserName;
|
||||
|
||||
@Schema(description = "审核人员名称", example = "李四")
|
||||
private String checkExUserName;
|
||||
|
||||
@Schema(description = "采购订单id", example = "12822")
|
||||
private Integer purOrdId;
|
||||
|
||||
@Schema(description = "采购订单号")
|
||||
private String purOrdNo;
|
||||
@Schema(description = "采购订单号")
|
||||
private List<RawMaterialInspTotalDO> rawMaterialInspTotalList;
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail.RawMaterialInspDetailDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinspdetail.RawMaterialInspDetailService;
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 原材料检验值明细")
|
||||
@RestController
|
||||
@RequestMapping("/tqm/raw-material-insp-detail")
|
||||
@Validated
|
||||
public class RawMaterialInspDetailController {
|
||||
|
||||
@Resource
|
||||
private RawMaterialInspDetailService rawMaterialInspDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建原材料检验值明细")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-detail:create')")
|
||||
public CommonResult<Integer> createRawMaterialInspDetail(@Valid @RequestBody RawMaterialInspDetailSaveReqVO createReqVO) {
|
||||
return success(rawMaterialInspDetailService.createRawMaterialInspDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新原材料检验值明细")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-detail:update')")
|
||||
public CommonResult<Boolean> updateRawMaterialInspDetail(@Valid @RequestBody RawMaterialInspDetailSaveReqVO updateReqVO) {
|
||||
rawMaterialInspDetailService.updateRawMaterialInspDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除原材料检验值明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-detail:delete')")
|
||||
public CommonResult<Boolean> deleteRawMaterialInspDetail(@RequestParam("id") Integer id) {
|
||||
rawMaterialInspDetailService.deleteRawMaterialInspDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得原材料检验值明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-detail:query')")
|
||||
public CommonResult<RawMaterialInspDetailRespVO> getRawMaterialInspDetail(@RequestParam("id") Integer id) {
|
||||
RawMaterialInspDetailDO rawMaterialInspDetail = rawMaterialInspDetailService.getRawMaterialInspDetail(id);
|
||||
return success(BeanUtils.toBean(rawMaterialInspDetail, RawMaterialInspDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得原材料检验值明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-detail:query')")
|
||||
public CommonResult<PageResult<RawMaterialInspDetailRespVO>> getRawMaterialInspDetailPage(@Valid RawMaterialInspDetailPageReqVO pageReqVO) {
|
||||
PageResult<RawMaterialInspDetailDO> pageResult = rawMaterialInspDetailService.getRawMaterialInspDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RawMaterialInspDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出原材料检验值明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-detail:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportRawMaterialInspDetailExcel(@Valid RawMaterialInspDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RawMaterialInspDetailDO> list = rawMaterialInspDetailService.getRawMaterialInspDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "原材料检验值明细.xls", "数据", RawMaterialInspDetailRespVO.class,
|
||||
BeanUtils.toBean(list, RawMaterialInspDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.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 RawMaterialInspDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "检测值")
|
||||
private String actValue;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "质检方案id", example = "19916")
|
||||
private Integer inspPlanId;
|
||||
|
||||
@Schema(description = "质检方案明细id", example = "30013")
|
||||
private Integer inspPlanItemId;
|
||||
|
||||
@Schema(description = "原料检id", example = "157")
|
||||
private Integer rawMatInspId;
|
||||
|
||||
@Schema(description = "界面展示顺序")
|
||||
private Integer seqNo;
|
||||
|
||||
@Schema(description = "检验编码")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "原材料检验值汇总表id", example = "20757")
|
||||
private Integer matInspTotalId;
|
||||
|
||||
@Schema(description = "流程id", example = "21420")
|
||||
private String fFlowId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.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 RawMaterialInspDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "973")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "检测值")
|
||||
@ExcelProperty("检测值")
|
||||
private String actValue;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "质检方案id", example = "19916")
|
||||
@ExcelProperty("质检方案id")
|
||||
private Integer inspPlanId;
|
||||
|
||||
@Schema(description = "质检方案明细id", example = "30013")
|
||||
@ExcelProperty("质检方案明细id")
|
||||
private Integer inspPlanItemId;
|
||||
|
||||
@Schema(description = "原料检id", example = "157")
|
||||
@ExcelProperty("原料检id")
|
||||
private Integer rawMatInspId;
|
||||
|
||||
@Schema(description = "界面展示顺序")
|
||||
@ExcelProperty("界面展示顺序")
|
||||
private Integer seqNo;
|
||||
|
||||
@Schema(description = "检验编码")
|
||||
@ExcelProperty("检验编码")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "原材料检验值汇总表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20757")
|
||||
@ExcelProperty("原材料检验值汇总表id")
|
||||
private Integer matInspTotalId;
|
||||
|
||||
@Schema(description = "流程id", example = "21420")
|
||||
@ExcelProperty("流程id")
|
||||
private String fFlowId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 原材料检验值明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class RawMaterialInspDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "973")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "检测值")
|
||||
private String actValue;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "质检方案id", example = "19916")
|
||||
private Integer inspPlanId;
|
||||
|
||||
@Schema(description = "质检方案明细id", example = "30013")
|
||||
private Integer inspPlanItemId;
|
||||
|
||||
@Schema(description = "原料检id", example = "157")
|
||||
private Integer rawMatInspId;
|
||||
|
||||
@Schema(description = "界面展示顺序")
|
||||
private Integer seqNo;
|
||||
|
||||
@Schema(description = "检验编码")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "原材料检验值汇总表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20757")
|
||||
@NotNull(message = "原材料检验值汇总表id不能为空")
|
||||
private Integer matInspTotalId;
|
||||
|
||||
@Schema(description = "流程id", example = "21420")
|
||||
private String fFlowId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinsptotal.RawMaterialInspTotalService;
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 原材料检验值汇总")
|
||||
@RestController
|
||||
@RequestMapping("/tqm/raw-material-insp-total")
|
||||
@Validated
|
||||
public class RawMaterialInspTotalController {
|
||||
|
||||
@Resource
|
||||
private RawMaterialInspTotalService rawMaterialInspTotalService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建原材料检验值汇总")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-total:create')")
|
||||
public CommonResult<Integer> createRawMaterialInspTotal(@Valid @RequestBody RawMaterialInspTotalSaveReqVO createReqVO) {
|
||||
return success(rawMaterialInspTotalService.createRawMaterialInspTotal(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新原材料检验值汇总")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-total:update')")
|
||||
public CommonResult<Boolean> updateRawMaterialInspTotal(@Valid @RequestBody RawMaterialInspTotalSaveReqVO updateReqVO) {
|
||||
rawMaterialInspTotalService.updateRawMaterialInspTotal(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除原材料检验值汇总")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-total:delete')")
|
||||
public CommonResult<Boolean> deleteRawMaterialInspTotal(@RequestParam("id") Integer id) {
|
||||
rawMaterialInspTotalService.deleteRawMaterialInspTotal(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得原材料检验值汇总")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-total:query')")
|
||||
public CommonResult<RawMaterialInspTotalRespVO> getRawMaterialInspTotal(@RequestParam("id") Integer id) {
|
||||
RawMaterialInspTotalDO rawMaterialInspTotal = rawMaterialInspTotalService.getRawMaterialInspTotal(id);
|
||||
return success(BeanUtils.toBean(rawMaterialInspTotal, RawMaterialInspTotalRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得原材料检验值汇总分页")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-total:query')")
|
||||
public CommonResult<PageResult<RawMaterialInspTotalRespVO>> getRawMaterialInspTotalPage(@Valid RawMaterialInspTotalPageReqVO pageReqVO) {
|
||||
PageResult<RawMaterialInspTotalDO> pageResult = rawMaterialInspTotalService.getRawMaterialInspTotalPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RawMaterialInspTotalRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出原材料检验值汇总 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tqm:raw-material-insp-total:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportRawMaterialInspTotalExcel(@Valid RawMaterialInspTotalPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RawMaterialInspTotalDO> list = rawMaterialInspTotalService.getRawMaterialInspTotalPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "原材料检验值汇总.xls", "数据", RawMaterialInspTotalRespVO.class,
|
||||
BeanUtils.toBean(list, RawMaterialInspTotalRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.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 RawMaterialInspTotalPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "平均值")
|
||||
private String actValue;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "质检方案id", example = "15740")
|
||||
private Integer inspPlanId;
|
||||
|
||||
@Schema(description = "质检方案明细id", example = "24329")
|
||||
private Integer inspPlanItemId;
|
||||
|
||||
@Schema(description = "主表id", example = "26587")
|
||||
private String rawMatInspId;
|
||||
|
||||
@Schema(description = "界面展示顺序")
|
||||
private Integer seqNo;
|
||||
|
||||
@Schema(description = "检验编码")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "判定结果,0表示合格,1表示不合格")
|
||||
private String checkResult;
|
||||
|
||||
@Schema(description = "检验项目id", example = "29366")
|
||||
private Integer itemId;
|
||||
|
||||
@Schema(description = "检验项名称", example = "王五")
|
||||
private String itemName;
|
||||
|
||||
@Schema(description = "流程id", example = "32327")
|
||||
private String fFlowId;
|
||||
|
||||
@Schema(description = "标准值")
|
||||
private String standardValue;
|
||||
|
||||
@Schema(description = "上限值")
|
||||
private String upperLimit;
|
||||
|
||||
@Schema(description = "下限值")
|
||||
private String lowerLimit;
|
||||
|
||||
@Schema(description = "检验方法")
|
||||
private String checkMethod;
|
||||
|
||||
@Schema(description = "标准值类型(1、不变 2、区间 3大于等于 4、小于等于)")
|
||||
private String printItem;
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.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 RawMaterialInspTotalRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5876")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "平均值")
|
||||
@ExcelProperty("平均值")
|
||||
private String actValue;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "质检方案id", example = "15740")
|
||||
@ExcelProperty("质检方案id")
|
||||
private Integer inspPlanId;
|
||||
|
||||
@Schema(description = "质检方案明细id", example = "24329")
|
||||
@ExcelProperty("质检方案明细id")
|
||||
private Integer inspPlanItemId;
|
||||
|
||||
@Schema(description = "主表id", example = "26587")
|
||||
@ExcelProperty("主表id")
|
||||
private String rawMatInspId;
|
||||
|
||||
@Schema(description = "界面展示顺序")
|
||||
@ExcelProperty("界面展示顺序")
|
||||
private Integer seqNo;
|
||||
|
||||
@Schema(description = "检验编码")
|
||||
@ExcelProperty("检验编码")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "判定结果,0表示合格,1表示不合格")
|
||||
@ExcelProperty("判定结果,0表示合格,1表示不合格")
|
||||
private String checkResult;
|
||||
|
||||
@Schema(description = "检验项目id", example = "29366")
|
||||
@ExcelProperty("检验项目id")
|
||||
private Integer itemId;
|
||||
|
||||
@Schema(description = "检验项名称", example = "王五")
|
||||
@ExcelProperty("检验项名称")
|
||||
private String itemName;
|
||||
|
||||
@Schema(description = "流程id", example = "32327")
|
||||
@ExcelProperty("流程id")
|
||||
private String fFlowId;
|
||||
|
||||
@Schema(description = "标准值")
|
||||
@ExcelProperty("标准值")
|
||||
private String standardValue;
|
||||
|
||||
@Schema(description = "上限值")
|
||||
@ExcelProperty("上限值")
|
||||
private String upperLimit;
|
||||
|
||||
@Schema(description = "下限值")
|
||||
@ExcelProperty("下限值")
|
||||
private String lowerLimit;
|
||||
|
||||
@Schema(description = "检验方法")
|
||||
@ExcelProperty("检验方法")
|
||||
private String checkMethod;
|
||||
|
||||
@Schema(description = "标准值类型(1、不变 2、区间 3大于等于 4、小于等于)")
|
||||
@ExcelProperty("标准值类型(1、不变 2、区间 3大于等于 4、小于等于)")
|
||||
private String printItem;
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 原材料检验值汇总新增/修改 Request VO")
|
||||
@Data
|
||||
public class RawMaterialInspTotalSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5876")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "平均值")
|
||||
private String actValue;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "质检方案id", example = "15740")
|
||||
private Integer inspPlanId;
|
||||
|
||||
@Schema(description = "质检方案明细id", example = "24329")
|
||||
private Integer inspPlanItemId;
|
||||
|
||||
@Schema(description = "主表id", example = "26587")
|
||||
private String rawMatInspId;
|
||||
|
||||
@Schema(description = "界面展示顺序")
|
||||
private Integer seqNo;
|
||||
|
||||
@Schema(description = "检验编码")
|
||||
private String checkCode;
|
||||
|
||||
@Schema(description = "判定结果,0表示合格,1表示不合格")
|
||||
private String checkResult;
|
||||
|
||||
@Schema(description = "检验项目id", example = "29366")
|
||||
private Integer itemId;
|
||||
|
||||
@Schema(description = "检验项名称", example = "王五")
|
||||
private String itemName;
|
||||
|
||||
@Schema(description = "流程id", example = "32327")
|
||||
private String fFlowId;
|
||||
|
||||
@Schema(description = "标准值")
|
||||
private String standardValue;
|
||||
|
||||
@Schema(description = "上限值")
|
||||
private String upperLimit;
|
||||
|
||||
@Schema(description = "下限值")
|
||||
private String lowerLimit;
|
||||
|
||||
@Schema(description = "检验方法")
|
||||
private String checkMethod;
|
||||
|
||||
@Schema(description = "标准值类型(1、不变 2、区间 3大于等于 4、小于等于)")
|
||||
private String printItem;
|
||||
|
||||
}
|
||||
@ -1,95 +1,105 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.supplier;
|
||||
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.supplier.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.supplier.SupplierDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.supplier.SupplierService;
|
||||
|
||||
@Tag(name = "管理后台 - 供应商主数据")
|
||||
@RestController
|
||||
@RequestMapping("/biz/supplier")
|
||||
@Validated
|
||||
public class SupplierController {
|
||||
|
||||
@Resource
|
||||
private SupplierService supplierService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建供应商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:create')")
|
||||
public CommonResult<Integer> createSupplier(@Valid @RequestBody SupplierSaveReqVO createReqVO) {
|
||||
return success(supplierService.createSupplier(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新供应商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:update')")
|
||||
public CommonResult<Boolean> updateSupplier(@Valid @RequestBody SupplierSaveReqVO updateReqVO) {
|
||||
supplierService.updateSupplier(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除供应商主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:delete')")
|
||||
public CommonResult<Boolean> deleteSupplier(@RequestParam("id") Integer id) {
|
||||
supplierService.deleteSupplier(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得供应商主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:query')")
|
||||
public CommonResult<SupplierRespVO> getSupplier(@RequestParam("id") Integer id) {
|
||||
SupplierDO supplier = supplierService.getSupplier(id);
|
||||
return success(BeanUtils.toBean(supplier, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得供应商主数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:query')")
|
||||
public CommonResult<PageResult<SupplierRespVO>> getSupplierPage(@Valid SupplierPageReqVO pageReqVO) {
|
||||
PageResult<SupplierDO> pageResult = supplierService.getSupplierPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出供应商主数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSupplierExcel(@Valid SupplierPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SupplierDO> list = supplierService.getSupplierPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "供应商主数据.xls", "数据", SupplierRespVO.class,
|
||||
BeanUtils.toBean(list, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.supplier;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc.vo.TechProcRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.supplier.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.supplier.SupplierDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.supplier.SupplierService;
|
||||
|
||||
@Tag(name = "管理后台 - 供应商主数据")
|
||||
@RestController
|
||||
@RequestMapping("/biz/supplier")
|
||||
@Validated
|
||||
public class SupplierController {
|
||||
|
||||
@Resource
|
||||
private SupplierService supplierService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建供应商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:create')")
|
||||
public CommonResult<Integer> createSupplier(@Valid @RequestBody SupplierSaveReqVO createReqVO) {
|
||||
return success(supplierService.createSupplier(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新供应商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:update')")
|
||||
public CommonResult<Boolean> updateSupplier(@Valid @RequestBody SupplierSaveReqVO updateReqVO) {
|
||||
supplierService.updateSupplier(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除供应商主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:delete')")
|
||||
public CommonResult<Boolean> deleteSupplier(@RequestParam("id") Integer id) {
|
||||
supplierService.deleteSupplier(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得供应商主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:query')")
|
||||
public CommonResult<SupplierRespVO> getSupplier(@RequestParam("id") Integer id) {
|
||||
SupplierDO supplier = supplierService.getSupplier(id);
|
||||
return success(BeanUtils.toBean(supplier, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得供应商主数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:query')")
|
||||
public CommonResult<PageResult<SupplierRespVO>> getSupplierPage(@Valid SupplierPageReqVO pageReqVO) {
|
||||
PageResult<SupplierDO> pageResult = supplierService.getSupplierPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出供应商主数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('biz:supplier:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSupplierExcel(@Valid SupplierPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SupplierDO> list = supplierService.getSupplierPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "供应商主数据.xls", "数据", SupplierRespVO.class,
|
||||
BeanUtils.toBean(list, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
//获得供应商下拉框
|
||||
@GetMapping("/dropdown")
|
||||
@Operation(summary = "获得供应商下拉框")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:query')")
|
||||
public CommonResult<List<SupplierRespVO>> dropdown(@RequestParam(required = false) List<String> supplierTypeList) {
|
||||
List<SupplierDO> list = supplierService.dropdown(supplierTypeList);
|
||||
return success(BeanUtils.toBean(list, SupplierRespVO.class));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,95 +1,103 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc;
|
||||
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.techproc.TechProcService;
|
||||
|
||||
@Tag(name = "管理后台 - 工艺流程主数据")
|
||||
@RestController
|
||||
@RequestMapping("/biz/tech-proc")
|
||||
@Validated
|
||||
public class TechProcController {
|
||||
|
||||
@Resource
|
||||
private TechProcService techProcService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建工艺流程主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:create')")
|
||||
public CommonResult<Integer> createTechProc(@Valid @RequestBody TechProcSaveReqVO createReqVO) {
|
||||
return success(techProcService.createTechProc(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新工艺流程主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:update')")
|
||||
public CommonResult<Boolean> updateTechProc(@Valid @RequestBody TechProcSaveReqVO updateReqVO) {
|
||||
techProcService.updateTechProc(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除工艺流程主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:delete')")
|
||||
public CommonResult<Boolean> deleteTechProc(@RequestParam("id") Integer id) {
|
||||
techProcService.deleteTechProc(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得工艺流程主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:query')")
|
||||
public CommonResult<TechProcRespVO> getTechProc(@RequestParam("id") Integer id) {
|
||||
TechProcDO techProc = techProcService.getTechProc(id);
|
||||
return success(BeanUtils.toBean(techProc, TechProcRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得工艺流程主数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:query')")
|
||||
public CommonResult<PageResult<TechProcRespVO>> getTechProcPage(@Valid TechProcPageReqVO pageReqVO) {
|
||||
PageResult<TechProcDO> pageResult = techProcService.getTechProcPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TechProcRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出工艺流程主数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportTechProcExcel(@Valid TechProcPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TechProcDO> list = techProcService.getTechProcPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "工艺流程主数据.xls", "数据", TechProcRespVO.class,
|
||||
BeanUtils.toBean(list, TechProcRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc;
|
||||
|
||||
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.techproc.TechProcService;
|
||||
|
||||
@Tag(name = "管理后台 - 工艺流程主数据")
|
||||
@RestController
|
||||
@RequestMapping("/biz/tech-proc")
|
||||
@Validated
|
||||
public class TechProcController {
|
||||
|
||||
@Resource
|
||||
private TechProcService techProcService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建工艺流程主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:create')")
|
||||
public CommonResult<Integer> createTechProc(@Valid @RequestBody TechProcSaveReqVO createReqVO) {
|
||||
return success(techProcService.createTechProc(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新工艺流程主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:update')")
|
||||
public CommonResult<Boolean> updateTechProc(@Valid @RequestBody TechProcSaveReqVO updateReqVO) {
|
||||
techProcService.updateTechProc(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除工艺流程主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:delete')")
|
||||
public CommonResult<Boolean> deleteTechProc(@RequestParam("id") Integer id) {
|
||||
techProcService.deleteTechProc(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得工艺流程主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:query')")
|
||||
public CommonResult<TechProcRespVO> getTechProc(@RequestParam("id") Integer id) {
|
||||
TechProcDO techProc = techProcService.getTechProc(id);
|
||||
return success(BeanUtils.toBean(techProc, TechProcRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得工艺流程主数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:query')")
|
||||
public CommonResult<PageResult<TechProcRespVO>> getTechProcPage(@Valid TechProcPageReqVO pageReqVO) {
|
||||
PageResult<TechProcDO> pageResult = techProcService.getTechProcPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TechProcRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出工艺流程主数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportTechProcExcel(@Valid TechProcPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TechProcDO> list = techProcService.getTechProcPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "工艺流程主数据.xls", "数据", TechProcRespVO.class,
|
||||
BeanUtils.toBean(list, TechProcRespVO.class));
|
||||
}
|
||||
//获得工艺流程下拉框
|
||||
@GetMapping("/dropdown")
|
||||
@Operation(summary = "获得工艺流程下拉框")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('biz:tech-proc:query')")
|
||||
public CommonResult<List<TechProcRespVO>> dropdown() {
|
||||
List<TechProcDO> list = techProcService.dropdown();
|
||||
return success(BeanUtils.toBean(list, TechProcRespVO.class));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
@ -20,7 +21,7 @@ import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InspPlanItemDO extends BaseDO {
|
||||
public class InspPlanItemDO extends BaseDOWithoutLogic {
|
||||
|
||||
/**
|
||||
* id
|
||||
@ -74,5 +75,16 @@ public class InspPlanItemDO extends BaseDO {
|
||||
* 模板检测值数量
|
||||
*/
|
||||
private Integer printNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer testNum;
|
||||
@TableField(exist = false)
|
||||
private String itemValueType;
|
||||
@TableField(exist = false)
|
||||
private String itemContent;
|
||||
@TableField(exist = false)
|
||||
private Integer floatNum;
|
||||
@TableField(exist = false)
|
||||
private Integer tolNum;
|
||||
@TableField(exist = false)
|
||||
private String checkMethod;
|
||||
}
|
||||
|
||||
@ -0,0 +1,111 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.plan;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 生产计划 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tpl_plan")
|
||||
@KeySequence("tpl_plan_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PlanDO extends BaseDOWithoutLogic {
|
||||
|
||||
/**
|
||||
* 自增字段
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 生产计划号(PL+年份+月份+3位流水号)
|
||||
*/
|
||||
private String proNo;
|
||||
/**
|
||||
* 计划日期
|
||||
*/
|
||||
private LocalDate proDate;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
private Integer materialId;
|
||||
/**
|
||||
* 产品编码
|
||||
*/
|
||||
private String materialCode;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String materialName;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal planQty;
|
||||
/**
|
||||
* 计划开始日期
|
||||
*/
|
||||
private LocalDate planBgDate;
|
||||
/**
|
||||
* 计划完成日期
|
||||
*/
|
||||
private LocalDate planEndDate;
|
||||
/**
|
||||
* 工艺流程
|
||||
*/
|
||||
private String processFlow;
|
||||
/**
|
||||
* 计划状态(0 未下发 1已下发 2 执行中 3 已完成 4 暂停 5 关闭 )
|
||||
*/
|
||||
private String planStatus;
|
||||
/**
|
||||
* 编制人id
|
||||
*/
|
||||
private String planEmpId;
|
||||
/**
|
||||
* 编制人名称
|
||||
*/
|
||||
private String planEmpName;
|
||||
/**
|
||||
* 完成数量
|
||||
*/
|
||||
private BigDecimal completeQty;
|
||||
/**
|
||||
* 是否所有产线( 0 是 1否)
|
||||
*/
|
||||
private String isAllLine;
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
private BigDecimal storeInQty;
|
||||
@TableField(exist = false)
|
||||
private String techProc;
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planline;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 产线计划 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tpl_plan_line")
|
||||
@KeySequence("tpl_plan_line_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PlanLineDO extends BaseDOWithoutLogic {
|
||||
|
||||
/**
|
||||
* 自增字段
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 生产计划号
|
||||
*/
|
||||
private String proNo;
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
private Integer proId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 开工时间
|
||||
*/
|
||||
private LocalDate proBgDate;
|
||||
/**
|
||||
* 完工时间
|
||||
*/
|
||||
private LocalDate proEndDate;
|
||||
/**
|
||||
* 产线编码
|
||||
*/
|
||||
private String lineCd;
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
/**
|
||||
* 产线id
|
||||
*/
|
||||
private Integer lineId;
|
||||
/**
|
||||
* 完成数量
|
||||
*/
|
||||
private BigDecimal completeQty;
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal planQty;
|
||||
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planmachine;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 机台执行计划 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tpl_plan_machine")
|
||||
@KeySequence("tpl_plan_machine_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PlanMachineDO extends BaseDOWithoutLogic {
|
||||
|
||||
/**
|
||||
* 自增字段
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 生产计划号
|
||||
*/
|
||||
private String proNo;
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
private Integer proId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 开工时间
|
||||
*/
|
||||
private LocalDateTime proBgDate;
|
||||
/**
|
||||
* 完工时间
|
||||
*/
|
||||
private LocalDateTime proEndDate;
|
||||
/**
|
||||
* 计划状态(2 执行中 3 已完成 4 暂停)
|
||||
*/
|
||||
private String proStatus;
|
||||
/**
|
||||
* 机台编码
|
||||
*/
|
||||
private String machineCd;
|
||||
/**
|
||||
* 机台名称
|
||||
*/
|
||||
private String machineName;
|
||||
/**
|
||||
* 机台id
|
||||
*/
|
||||
private Integer machineId;
|
||||
/**
|
||||
* 产线编码
|
||||
*/
|
||||
private String lineCd;
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
/**
|
||||
* 产线id
|
||||
*/
|
||||
private Integer lineId;
|
||||
/**
|
||||
* 产线计划表id
|
||||
*/
|
||||
private Integer proOrderLineId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 采购订单主 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tsc_pur_order")
|
||||
@KeySequence("tsc_pur_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PurOrderDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 自增字段
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 采购订单号(CGDD+年份+月份+3位流水号)
|
||||
*/
|
||||
private String purOrdNo;
|
||||
/**
|
||||
* 订单日期
|
||||
*/
|
||||
private LocalDate purDate;
|
||||
/**
|
||||
* 附件信息
|
||||
*/
|
||||
private String attFile;
|
||||
/**
|
||||
* 单据类型(1 标准采购申请 2设备采购申请)
|
||||
*/
|
||||
private String billType;
|
||||
/**
|
||||
* 采购部门
|
||||
*/
|
||||
private String purDeptName;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private String purDeptId;
|
||||
/**
|
||||
* 申请类型(1 原材料 2 辅料 3设备)
|
||||
*/
|
||||
private String applyType;
|
||||
/**
|
||||
* 采购人员
|
||||
*/
|
||||
private String purEmpName;
|
||||
/**
|
||||
* 采购人id
|
||||
*/
|
||||
private String purEmpId;
|
||||
/**
|
||||
* 验收方式(1 数量验收 2金额验收)
|
||||
*/
|
||||
private String acceptMeth;
|
||||
/**
|
||||
* 单据状态(1 已创建 2 已确认 3 已审批 4已驳回 )
|
||||
*/
|
||||
private String purStatus;
|
||||
/**
|
||||
* 供应商编码
|
||||
*/
|
||||
private String supplierNo;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
private Integer supplierId;
|
||||
/**
|
||||
* 收货状态(1 未收货 2部分收货 3 全部收货 )
|
||||
*/
|
||||
private String deliveryStatus;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 审核人id
|
||||
*/
|
||||
private String auditId;
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 采购订单子 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tsc_pur_order_item")
|
||||
@KeySequence("tsc_pur_order_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PurOrderItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 自增字段
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private Integer materialId;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialCode;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String materialName;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 收货数量
|
||||
*/
|
||||
private BigDecimal deliveryQty;
|
||||
/**
|
||||
* 要求到货日期
|
||||
*/
|
||||
private LocalDate reqDeliveryDate;
|
||||
/**
|
||||
* 采购申请单id
|
||||
*/
|
||||
private Integer applyId;
|
||||
/**
|
||||
* 采购申请单号
|
||||
*/
|
||||
private String applyOrdNo;
|
||||
/**
|
||||
* 采购申请单子表id
|
||||
*/
|
||||
private Integer applyItemId;
|
||||
/**
|
||||
* 采购数量
|
||||
*/
|
||||
private BigDecimal purQty;
|
||||
/**
|
||||
* 收货状态(1 未收货 2部分收货 3 全部收货 )
|
||||
*/
|
||||
private String deliveryStatus;
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
private BigDecimal taxRatio;
|
||||
/**
|
||||
* 含税单价
|
||||
*/
|
||||
private BigDecimal priceTax;
|
||||
/**
|
||||
* 含税总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
/**
|
||||
* 采购订单id
|
||||
*/
|
||||
private Integer purId;
|
||||
/**
|
||||
* 采购订单号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String purOrdNo;
|
||||
@TableField(exist = false)
|
||||
private String supplierName;
|
||||
@TableField(exist = false)
|
||||
private String billType;
|
||||
@TableField(exist = false)
|
||||
private LocalDate purDate;
|
||||
|
||||
}
|
||||
@ -0,0 +1,150 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsp;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 原材料检验主 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tqm_raw_material_insp")
|
||||
@KeySequence("tqm_raw_material_insp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RawMaterialInspDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String id;
|
||||
/**
|
||||
* 检验单号,YL+年月日+两位流水号
|
||||
*/
|
||||
private String checkCode;
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
private Integer supplierId;
|
||||
/**
|
||||
* 供应商简称
|
||||
*/
|
||||
private String supplierSimName;
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private Integer materialId;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String matCode;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String matName;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String spec;
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNo;
|
||||
/**
|
||||
* 到货日期
|
||||
*/
|
||||
private LocalDate recieveDate;
|
||||
/**
|
||||
* 到货数量(kg)
|
||||
*/
|
||||
private BigDecimal recieveKg;
|
||||
/**
|
||||
* 抽检数量(kg)
|
||||
*/
|
||||
private BigDecimal sampleQty;
|
||||
/**
|
||||
* 检验日期
|
||||
*/
|
||||
private LocalDate checkDate;
|
||||
/**
|
||||
* 检验结果(0 合格 1 不合格 2让步接收)
|
||||
*/
|
||||
private String checkResult;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private String formCode;
|
||||
/**
|
||||
* 质检方案id
|
||||
*/
|
||||
private String qaSchemeBaseId;
|
||||
/**
|
||||
* 检验值数量
|
||||
*/
|
||||
private Integer testNum;
|
||||
/**
|
||||
* 检验人员id
|
||||
*/
|
||||
private Integer checkUserId;
|
||||
/**
|
||||
* 审核人员id
|
||||
*/
|
||||
private Integer checkExUserId;
|
||||
/**
|
||||
* 审核日期
|
||||
*/
|
||||
private LocalDate checkExDate;
|
||||
/**
|
||||
* 单据状态( 0-已创建 1-已确认 )
|
||||
*/
|
||||
private String checkStatus;
|
||||
/**
|
||||
* 审核原因
|
||||
*/
|
||||
private String checkRemark;
|
||||
/**
|
||||
* 严格度(1、正常 2、加严 3、放宽)
|
||||
*/
|
||||
private String strness;
|
||||
/**
|
||||
* 来料类型(1、进货 2、样品)
|
||||
*/
|
||||
private String inmatType;
|
||||
/**
|
||||
* 检验人员名称
|
||||
*/
|
||||
private String checkUserName;
|
||||
/**
|
||||
* 审核人员名称
|
||||
*/
|
||||
private String checkExUserName;
|
||||
/**
|
||||
* 采购订单id
|
||||
*/
|
||||
private Integer purOrdId;
|
||||
/**
|
||||
* 采购订单号
|
||||
*/
|
||||
private String purOrdNo;
|
||||
@TableField(exist = false)
|
||||
private List<RawMaterialInspTotalDO> rawMaterialInspTotalList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 原材料检验值明细 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tqm_raw_material_insp_detail")
|
||||
@KeySequence("tqm_raw_material_insp_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RawMaterialInspDetailDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 检测值
|
||||
*/
|
||||
private String actValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 质检方案id
|
||||
*/
|
||||
private Integer inspPlanId;
|
||||
/**
|
||||
* 质检方案明细id
|
||||
*/
|
||||
private Integer inspPlanItemId;
|
||||
/**
|
||||
* 原料检id
|
||||
*/
|
||||
private Integer rawMatInspId;
|
||||
/**
|
||||
* 界面展示顺序
|
||||
*/
|
||||
private Integer seqNo;
|
||||
/**
|
||||
* 检验编码
|
||||
*/
|
||||
private String checkCode;
|
||||
/**
|
||||
* 原材料检验值汇总表id
|
||||
*/
|
||||
private Integer matInspTotalId;
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String fFlowId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail.RawMaterialInspDetailDO;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 原材料检验值汇总 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("tqm_raw_material_insp_total")
|
||||
@KeySequence("tqm_raw_material_insp_total_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RawMaterialInspTotalDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 平均值
|
||||
*/
|
||||
private String actValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 质检方案id
|
||||
*/
|
||||
private Integer inspPlanId;
|
||||
/**
|
||||
* 质检方案明细id
|
||||
*/
|
||||
private Integer inspPlanItemId;
|
||||
/**
|
||||
* 主表id
|
||||
*/
|
||||
private String rawMatInspId;
|
||||
/**
|
||||
* 界面展示顺序
|
||||
*/
|
||||
private Integer seqNo;
|
||||
/**
|
||||
* 检验编码
|
||||
*/
|
||||
private String checkCode;
|
||||
/**
|
||||
* 判定结果,0表示合格,1表示不合格
|
||||
*/
|
||||
private String checkResult;
|
||||
/**
|
||||
* 检验项目id
|
||||
*/
|
||||
private Integer itemId;
|
||||
/**
|
||||
* 检验项名称
|
||||
*/
|
||||
private String itemName;
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String fFlowId;
|
||||
/**
|
||||
* 标准值
|
||||
*/
|
||||
private String standardValue;
|
||||
/**
|
||||
* 上限值
|
||||
*/
|
||||
private String upperLimit;
|
||||
/**
|
||||
* 下限值
|
||||
*/
|
||||
private String lowerLimit;
|
||||
/**
|
||||
* 检验方法
|
||||
*/
|
||||
private String checkMethod;
|
||||
/**
|
||||
* 标准值类型(1、不变 2、区间 3大于等于 4、小于等于)
|
||||
*/
|
||||
private String printItem;
|
||||
@TableField(exist = false)
|
||||
private List<RawMaterialInspDetailDO> rawMaterialInspDetailList;
|
||||
@TableField(exist = false)
|
||||
private String itemValueType;
|
||||
@TableField(exist = false)
|
||||
private String itemContent;
|
||||
@TableField(exist = false)
|
||||
private Integer testNum;
|
||||
@TableField(exist = false)
|
||||
private Integer floatNum;
|
||||
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfig;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
@ -22,7 +23,7 @@ import static org.aspectj.lang.reflect.DeclareAnnotation.Kind.Field;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WipConfigDO extends BaseDO {
|
||||
public class WipConfigDO extends BaseDOWithoutLogic {
|
||||
|
||||
/**
|
||||
* 自增字段
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
@ -20,7 +21,7 @@ import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WipConfigDetailDO extends BaseDO {
|
||||
public class WipConfigDetailDO extends BaseDOWithoutLogic {
|
||||
|
||||
/**
|
||||
* 自增字段
|
||||
|
||||
@ -6,8 +6,11 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplan.InspPlanDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.material.MaterialDO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.checkitem.vo.*;
|
||||
@ -69,4 +72,6 @@ public interface CheckItemMapper extends BaseMapperX<CheckItemDO> {
|
||||
.like(CheckItemDO::getItemNo, reqVO.getKeyWord())));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,8 +3,12 @@ package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.inspplanitem;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplan.InspPlanDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.material.MaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -56,4 +60,18 @@ public interface InspPlanItemMapper extends BaseMapperX<InspPlanItemDO> {
|
||||
return delete(new LambdaQueryWrapperX<InspPlanItemDO>()
|
||||
.eq(InspPlanItemDO::getSchemeId, schemeId));
|
||||
}
|
||||
|
||||
default List<InspPlanItemDO> selectMaterialId(Integer id){
|
||||
MPJLambdaWrapperX<InspPlanItemDO> query = new MPJLambdaWrapperX<>();
|
||||
query.selectAll(InspPlanItemDO.class)
|
||||
.select("p.test_Num as tolNum")
|
||||
.select("c.item_value_type as itemValueType","c.item_content as itemContent")
|
||||
.select("c.test_num as testNum","c.float_num as floatNum","c.check_method as checkMethod")
|
||||
.leftJoin(CheckItemDO.class,"c",CheckItemDO::getId,InspPlanItemDO::getItemId)
|
||||
.leftJoin(InspPlanDO.class,"p",InspPlanDO::getId,InspPlanItemDO::getSchemeId)
|
||||
.leftJoin(MaterialDO.class,"m",MaterialDO::getSchemeId,InspPlanDO::getId)
|
||||
.disableSubLogicDel().orderByAsc(InspPlanItemDO::getSeqNo);
|
||||
query.eq(MaterialDO::getId,id).eq(InspPlanDO::getSchemeType,"1");
|
||||
return selectList(query);
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,4 +41,10 @@ public interface MachineMapper extends BaseMapperX<MachineDO> {
|
||||
.or()
|
||||
.like(MachineDO::getMachineCd, keyWord)));
|
||||
}
|
||||
|
||||
default List<MachineDO> getMachineList(){
|
||||
return selectList(new LambdaQueryWrapperX<MachineDO>()
|
||||
.eq(MachineDO::getEnabledStatus,0)
|
||||
.orderByDesc(MachineDO::getCreateTime));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.material;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@ -24,6 +25,13 @@ public interface MaterialMapper extends BaseMapperX<MaterialDO> {
|
||||
.likeIfPresent(MaterialDO::getSpec, reqVO.getSpec())
|
||||
.eqIfPresent(MaterialDO::getMatType, reqVO.getMatType())
|
||||
.eqIfPresent(MaterialDO::getEnabledStatus, reqVO.getEnabledStatus())
|
||||
.and(
|
||||
ObjectUtil.isNotEmpty(reqVO.getKeyWord()),
|
||||
wrapper -> wrapper
|
||||
.like(MaterialDO::getMatCode, reqVO.getKeyWord())
|
||||
.or()
|
||||
.like(MaterialDO::getMatName, reqVO.getKeyWord())
|
||||
)
|
||||
.orderByDesc(MaterialDO::getId));
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.plan;
|
||||
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.plan.PlanDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产计划 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("e.tech_proc as techProc")
|
||||
.leftJoin(TechProcDO.class, "e",TechProcDO::getId,PlanDO::getProcessFlow)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(PlanDO::getCreateTime);
|
||||
query.between(ObjectUtil.isNotEmpty(reqVO.getProDate()), PlanDO::getProDate, reqVO.getProDate()[0], reqVO.getProDate()[1])
|
||||
.like(ObjectUtil.isNotEmpty(reqVO.getProNo()),PlanDO::getProNo, reqVO.getProNo())
|
||||
.like(ObjectUtil.isNotEmpty(reqVO.getSpec()),PlanDO::getSpec, reqVO.getSpec())
|
||||
.eq(ObjectUtil.isNotEmpty(reqVO.getPlanStatus()),PlanDO::getPlanStatus, reqVO.getPlanStatus())
|
||||
.like(ObjectUtil.isNotEmpty(reqVO.getMaterialName()),PlanDO::getMaterialName, reqVO.getMaterialName());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量完成计划,状态改为3
|
||||
*/
|
||||
default int complete(Integer[] ids) {
|
||||
return update(PlanDO.builder().planStatus("3").build(),
|
||||
new LambdaQueryWrapperX<PlanDO>().in(PlanDO::getId, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量关闭计划,状态改为5
|
||||
*/
|
||||
default int close(Integer[] ids) {
|
||||
return update(PlanDO.builder().planStatus("5").build(),
|
||||
new LambdaQueryWrapperX<PlanDO>().in(PlanDO::getId, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询最新的生产计划号
|
||||
*/
|
||||
default String selectMaxProNo() {
|
||||
PlanDO plan = selectOne(new LambdaQueryWrapperX<PlanDO>()
|
||||
.orderByDesc(PlanDO::getProNo)
|
||||
.last("LIMIT 1"));
|
||||
return plan != null ? plan.getProNo() : null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planline;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.plan.PlanDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planline.PlanLineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 产线计划 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PlanLineMapper extends BaseMapperX<PlanLineDO> {
|
||||
|
||||
default PageResult<PlanLineDO> selectPage(PlanLinePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PlanLineDO>()
|
||||
.betweenIfPresent(PlanLineDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(PlanLineDO::getProNo, reqVO.getProNo())
|
||||
.eqIfPresent(PlanLineDO::getProId, reqVO.getProId())
|
||||
.eqIfPresent(PlanLineDO::getRemark, reqVO.getRemark())
|
||||
|
||||
.eqIfPresent(PlanLineDO::getLineCd, reqVO.getLineCd())
|
||||
.likeIfPresent(PlanLineDO::getLineName, reqVO.getLineName())
|
||||
.eqIfPresent(PlanLineDO::getLineId, reqVO.getLineId())
|
||||
.eqIfPresent(PlanLineDO::getCompleteQty, reqVO.getCompleteQty())
|
||||
.eqIfPresent(PlanLineDO::getPlanQty, reqVO.getPlanQty())
|
||||
.orderByDesc(PlanLineDO::getId));
|
||||
}
|
||||
|
||||
default List<PlanLineDO> getPlanLineList(Integer proId){
|
||||
MPJLambdaWrapper<PlanLineDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(PlanLineDO.class)
|
||||
.select("p.plan_status as planStatus")
|
||||
.leftJoin(PlanDO.class, "p",PlanDO::getId,PlanLineDO::getProId)
|
||||
.disableSubLogicDel();
|
||||
query.eq(ObjectUtil.isNotEmpty( proId),PlanLineDO::getProId, proId);
|
||||
return selectList( query);
|
||||
}
|
||||
|
||||
default void deleteByProId(Integer id){
|
||||
delete(new LambdaQueryWrapperX<PlanLineDO>()
|
||||
.eqIfPresent(PlanLineDO::getProId, id));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planmachine;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planmachine.PlanMachineDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 机台执行计划 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PlanMachineMapper extends BaseMapperX<PlanMachineDO> {
|
||||
|
||||
default PageResult<PlanMachineDO> selectPage(PlanMachinePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PlanMachineDO>()
|
||||
.betweenIfPresent(PlanMachineDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(PlanMachineDO::getProNo, reqVO.getProNo())
|
||||
.eqIfPresent(PlanMachineDO::getProId, reqVO.getProId())
|
||||
.eqIfPresent(PlanMachineDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(PlanMachineDO::getProBgDate, reqVO.getProBgDate())
|
||||
.betweenIfPresent(PlanMachineDO::getProEndDate, reqVO.getProEndDate())
|
||||
.eqIfPresent(PlanMachineDO::getProStatus, reqVO.getProStatus())
|
||||
.eqIfPresent(PlanMachineDO::getMachineCd, reqVO.getMachineCd())
|
||||
.likeIfPresent(PlanMachineDO::getMachineName, reqVO.getMachineName())
|
||||
.eqIfPresent(PlanMachineDO::getMachineId, reqVO.getMachineId())
|
||||
.eqIfPresent(PlanMachineDO::getLineCd, reqVO.getLineCd())
|
||||
.likeIfPresent(PlanMachineDO::getLineName, reqVO.getLineName())
|
||||
.eqIfPresent(PlanMachineDO::getLineId, reqVO.getLineId())
|
||||
.eqIfPresent(PlanMachineDO::getProOrderLineId, reqVO.getProOrderLineId())
|
||||
.orderByDesc(PlanMachineDO::getId));
|
||||
}
|
||||
|
||||
default List<PlanMachineDO> getPlanLineList(Integer proOrderLineId){
|
||||
return selectList(new LambdaQueryWrapperX<PlanMachineDO>()
|
||||
.eqIfPresent(PlanMachineDO::getProOrderLineId, proOrderLineId).orderByAsc(PlanMachineDO::getProBgDate));
|
||||
}
|
||||
|
||||
default void deleteByProId(Integer id){
|
||||
delete(new LambdaQueryWrapperX<PlanMachineDO>()
|
||||
.eqIfPresent(PlanMachineDO::getProId, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据产线ID查询所有机台计划的proStatus列表
|
||||
*/
|
||||
default List<String> selectProStatusListByLineId(Integer lineId) {
|
||||
List<PlanMachineDO> list = selectList(new LambdaQueryWrapperX<PlanMachineDO>()
|
||||
.eq(PlanMachineDO::getLineId, lineId)
|
||||
.isNotNull(PlanMachineDO::getProStatus));
|
||||
return list.stream().map(PlanMachineDO::getProStatus).collect(java.util.stream.Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据产线ID和计划ID查询机台计划的proStatus列表
|
||||
*/
|
||||
default List<String> selectProStatusListByLineIdAndProId(Integer lineId, Integer proId) {
|
||||
List<PlanMachineDO> list = selectList(new LambdaQueryWrapperX<PlanMachineDO>()
|
||||
.eq(PlanMachineDO::getLineId, lineId)
|
||||
.eq(PlanMachineDO::getProId, proId)
|
||||
.isNotNull(PlanMachineDO::getProStatus));
|
||||
return list.stream().map(PlanMachineDO::getProStatus).collect(java.util.stream.Collectors.toList());
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,14 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proline;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proc.vo.ProcRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proline.ProLineDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -20,6 +23,9 @@ public interface ProLineMapper extends BaseMapperX<ProLineDO> {
|
||||
default PageResult<ProLineDO> selectPage(ProLinePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProLineDO>()
|
||||
.eqIfPresent(ProLineDO::getEnabledStatus, reqVO.getEnabledStatus())
|
||||
.and(ObjectUtil.isNotEmpty(reqVO.getKeyword()), wrapper -> wrapper.like(ProLineDO::getProLineCd, reqVO.getKeyword())
|
||||
.or()
|
||||
.like(ProLineDO::getProLineName, reqVO.getKeyword()))
|
||||
.orderByDesc(ProLineDO::getId));
|
||||
}
|
||||
|
||||
@ -35,4 +41,10 @@ public interface ProLineMapper extends BaseMapperX<ProLineDO> {
|
||||
default ProLineDO selectByProcLineCd(String procLineCd) {
|
||||
return selectOne(ProLineDO::getProLineCd, procLineCd);
|
||||
}
|
||||
|
||||
default List<ProLineDO> getProLineList(){
|
||||
return selectList(new LambdaQueryWrapperX<ProLineDO>()
|
||||
.eqIfPresent(ProLineDO::getEnabledStatus, 0)
|
||||
.orderByDesc(ProLineDO::getCreateTime));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.purorder;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem.PurOrderItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 采购订单主 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurOrderMapper extends BaseMapperX<PurOrderDO> {
|
||||
|
||||
default PageResult<PurOrderDO> selectPage(PurOrderPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PurOrderDO>()
|
||||
.betweenIfPresent(PurOrderDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(PurOrderDO::getPurOrdNo, reqVO.getPurOrdNo())
|
||||
.betweenIfPresent(PurOrderDO::getPurDate, reqVO.getPurDate())
|
||||
.eqIfPresent(PurOrderDO::getAttFile, reqVO.getAttFile())
|
||||
.eqIfPresent(PurOrderDO::getBillType, reqVO.getBillType())
|
||||
.likeIfPresent(PurOrderDO::getPurDeptName, reqVO.getPurDeptName())
|
||||
.eqIfPresent(PurOrderDO::getPurDeptId, reqVO.getPurDeptId())
|
||||
.eqIfPresent(PurOrderDO::getApplyType, reqVO.getApplyType())
|
||||
.likeIfPresent(PurOrderDO::getPurEmpName, reqVO.getPurEmpName())
|
||||
.eqIfPresent(PurOrderDO::getPurEmpId, reqVO.getPurEmpId())
|
||||
.eqIfPresent(PurOrderDO::getAcceptMeth, reqVO.getAcceptMeth())
|
||||
.eqIfPresent(PurOrderDO::getPurStatus, reqVO.getPurStatus())
|
||||
.eqIfPresent(PurOrderDO::getSupplierNo, reqVO.getSupplierNo())
|
||||
.likeIfPresent(PurOrderDO::getSupplierName, reqVO.getSupplierName())
|
||||
.eqIfPresent(PurOrderDO::getSupplierId, reqVO.getSupplierId())
|
||||
.orderByDesc(PurOrderDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.purorderitem;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem.PurOrderItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 采购订单子 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurOrderItemMapper extends BaseMapperX<PurOrderItemDO> {
|
||||
|
||||
default PageResult<PurOrderItemDO> selectPage(PurOrderItemPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<PurOrderItemDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(PurOrderItemDO.class)
|
||||
.select("p.pur_ord_no as purOrdNo","p.supplier_name as supplierName","p.bill_type as billType")
|
||||
.select("p.pur_date as purDate")
|
||||
.leftJoin(PurOrderDO.class, "p",PurOrderDO::getId,PurOrderItemDO::getPurId);
|
||||
query.in(ObjectUtil.isNotEmpty(reqVO.getDeliveryStatusList()),PurOrderDO::getDeliveryStatus,reqVO.getDeliveryStatusList())
|
||||
.eq(ObjectUtil.isNotEmpty(reqVO.getPurStatus()),PurOrderDO::getPurStatus,reqVO.getPurStatus())
|
||||
.like(ObjectUtil.isNotEmpty(reqVO.getPurOrdNo()),PurOrderDO::getPurOrdNo,reqVO.getPurOrdNo())
|
||||
.like(ObjectUtil.isNotEmpty(reqVO.getSupplierName()),PurOrderDO::getSupplierName,reqVO.getSupplierName());
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinsp;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsp.RawMaterialInspDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 原材料检验主 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface RawMaterialInspMapper extends BaseMapperX<RawMaterialInspDO> {
|
||||
|
||||
/**
|
||||
* 查询最大检验单号
|
||||
*/
|
||||
default String selectMaxCheckCode() {
|
||||
RawMaterialInspDO result = selectOne(new LambdaQueryWrapperX<RawMaterialInspDO>()
|
||||
.orderByDesc(RawMaterialInspDO::getCheckCode)
|
||||
.last("LIMIT 1"));
|
||||
return result == null ? null : result.getCheckCode();
|
||||
}
|
||||
|
||||
default PageResult<RawMaterialInspDO> selectPage(RawMaterialInspPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RawMaterialInspDO>()
|
||||
.eqIfPresent(RawMaterialInspDO::getCheckCode, reqVO.getCheckCode())
|
||||
.eqIfPresent(RawMaterialInspDO::getSupplierId, reqVO.getSupplierId())
|
||||
.likeIfPresent(RawMaterialInspDO::getSupplierSimName, reqVO.getSupplierSimName())
|
||||
.eqIfPresent(RawMaterialInspDO::getMaterialId, reqVO.getMaterialId())
|
||||
.eqIfPresent(RawMaterialInspDO::getMatCode, reqVO.getMatCode())
|
||||
.likeIfPresent(RawMaterialInspDO::getMatName, reqVO.getMatName())
|
||||
.eqIfPresent(RawMaterialInspDO::getSpec, reqVO.getSpec())
|
||||
.eqIfPresent(RawMaterialInspDO::getLotNo, reqVO.getLotNo())
|
||||
.betweenIfPresent(RawMaterialInspDO::getRecieveDate, reqVO.getRecieveDate())
|
||||
.eqIfPresent(RawMaterialInspDO::getRecieveKg, reqVO.getRecieveKg())
|
||||
.eqIfPresent(RawMaterialInspDO::getSampleQty, reqVO.getSampleQty())
|
||||
.betweenIfPresent(RawMaterialInspDO::getCheckDate, reqVO.getCheckDate())
|
||||
.eqIfPresent(RawMaterialInspDO::getCheckResult, reqVO.getCheckResult())
|
||||
.eqIfPresent(RawMaterialInspDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(RawMaterialInspDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(RawMaterialInspDO::getFormCode, reqVO.getFormCode())
|
||||
.eqIfPresent(RawMaterialInspDO::getQaSchemeBaseId, reqVO.getQaSchemeBaseId())
|
||||
.eqIfPresent(RawMaterialInspDO::getTestNum, reqVO.getTestNum())
|
||||
.eqIfPresent(RawMaterialInspDO::getCheckUserId, reqVO.getCheckUserId())
|
||||
.eqIfPresent(RawMaterialInspDO::getCheckExUserId, reqVO.getCheckExUserId())
|
||||
.betweenIfPresent(RawMaterialInspDO::getCheckExDate, reqVO.getCheckExDate())
|
||||
.eqIfPresent(RawMaterialInspDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.eqIfPresent(RawMaterialInspDO::getCheckRemark, reqVO.getCheckRemark())
|
||||
.eqIfPresent(RawMaterialInspDO::getStrness, reqVO.getStrness())
|
||||
.eqIfPresent(RawMaterialInspDO::getInmatType, reqVO.getInmatType())
|
||||
.likeIfPresent(RawMaterialInspDO::getCheckUserName, reqVO.getCheckUserName())
|
||||
.likeIfPresent(RawMaterialInspDO::getCheckExUserName, reqVO.getCheckExUserName())
|
||||
.eqIfPresent(RawMaterialInspDO::getPurOrdId, reqVO.getPurOrdId())
|
||||
.eqIfPresent(RawMaterialInspDO::getPurOrdNo, reqVO.getPurOrdNo())
|
||||
.orderByDesc(RawMaterialInspDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinspdetail;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail.RawMaterialInspDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 原材料检验值明细 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface RawMaterialInspDetailMapper extends BaseMapperX<RawMaterialInspDetailDO> {
|
||||
|
||||
/**
|
||||
* 根据主表id删除
|
||||
*/
|
||||
default void deleteByRawMatInspId(String rawMatInspId) {
|
||||
delete(new LambdaQueryWrapperX<RawMaterialInspDetailDO>()
|
||||
.eq(RawMaterialInspDetailDO::getRawMatInspId, rawMatInspId));
|
||||
}
|
||||
|
||||
default PageResult<RawMaterialInspDetailDO> selectPage(RawMaterialInspDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RawMaterialInspDetailDO>()
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getActValue, reqVO.getActValue())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(RawMaterialInspDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getInspPlanId, reqVO.getInspPlanId())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getInspPlanItemId, reqVO.getInspPlanItemId())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getRawMatInspId, reqVO.getRawMatInspId())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getSeqNo, reqVO.getSeqNo())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getCheckCode, reqVO.getCheckCode())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getMatInspTotalId, reqVO.getMatInspTotalId())
|
||||
.eqIfPresent(RawMaterialInspDetailDO::getFFlowId, reqVO.getFFlowId())
|
||||
.orderByDesc(RawMaterialInspDetailDO::getId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据汇总表id查询明细列表
|
||||
*/
|
||||
default List<RawMaterialInspDetailDO> selectByMatInspTotalId(Integer matInspTotalId) {
|
||||
return selectList(new LambdaQueryWrapperX<RawMaterialInspDetailDO>()
|
||||
.eq(RawMaterialInspDetailDO::getMatInspTotalId, matInspTotalId)
|
||||
.orderByAsc(RawMaterialInspDetailDO::getSeqNo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinsptotal;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 原材料检验值汇总 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface RawMaterialInspTotalMapper extends BaseMapperX<RawMaterialInspTotalDO> {
|
||||
|
||||
/**
|
||||
* 根据主表id删除
|
||||
*/
|
||||
default void deleteByRawMatInspId(String rawMatInspId) {
|
||||
delete(new LambdaQueryWrapperX<RawMaterialInspTotalDO>()
|
||||
.eq(RawMaterialInspTotalDO::getRawMatInspId, rawMatInspId));
|
||||
}
|
||||
|
||||
default PageResult<RawMaterialInspTotalDO> selectPage(RawMaterialInspTotalPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RawMaterialInspTotalDO>()
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getActValue, reqVO.getActValue())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(RawMaterialInspTotalDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getInspPlanId, reqVO.getInspPlanId())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getInspPlanItemId, reqVO.getInspPlanItemId())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getRawMatInspId, reqVO.getRawMatInspId())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getSeqNo, reqVO.getSeqNo())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getCheckCode, reqVO.getCheckCode())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getCheckResult, reqVO.getCheckResult())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getItemId, reqVO.getItemId())
|
||||
.likeIfPresent(RawMaterialInspTotalDO::getItemName, reqVO.getItemName())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getFFlowId, reqVO.getFFlowId())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getStandardValue, reqVO.getStandardValue())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getUpperLimit, reqVO.getUpperLimit())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getLowerLimit, reqVO.getLowerLimit())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getCheckMethod, reqVO.getCheckMethod())
|
||||
.eqIfPresent(RawMaterialInspTotalDO::getPrintItem, reqVO.getPrintItem())
|
||||
.orderByDesc(RawMaterialInspTotalDO::getId));
|
||||
}
|
||||
|
||||
default List<RawMaterialInspTotalDO> selectByRawMatInspId(String id){
|
||||
MPJLambdaWrapperX<RawMaterialInspTotalDO> query = new MPJLambdaWrapperX<>();
|
||||
query.selectAll(RawMaterialInspTotalDO.class)
|
||||
.select("c.item_value_type as itemValueType","c.item_content as itemContent")
|
||||
.select("c.test_num as testNum","c.float_num as floatNum")
|
||||
.leftJoin(CheckItemDO.class,"c",CheckItemDO::getId,RawMaterialInspTotalDO::getItemId)
|
||||
.disableSubLogicDel()
|
||||
.orderByAsc(RawMaterialInspTotalDO::getSeqNo);
|
||||
query.eq(RawMaterialInspTotalDO::getRawMatInspId, id);
|
||||
return selectList(query);
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,8 @@ package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.supplier;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
@ -29,4 +31,10 @@ public interface SupplierMapper extends BaseMapperX<SupplierDO> {
|
||||
.orderByDesc(SupplierDO::getId));
|
||||
}
|
||||
|
||||
default List<SupplierDO> dropdown(List<String> supplierTypeList){
|
||||
return selectList(new MPJLambdaWrapper<SupplierDO>()
|
||||
.eq(SupplierDO::getEnabledStatus, 0)
|
||||
.in(ObjectUtil.isNotEmpty(supplierTypeList), SupplierDO::getSupplierType, supplierTypeList)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,8 @@ import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工艺流程主数据 Mapper
|
||||
*
|
||||
@ -38,4 +40,10 @@ public interface TechProcMapper extends BaseMapperX<TechProcDO> {
|
||||
}
|
||||
|
||||
|
||||
default List<TechProcDO> dropdown(){
|
||||
return selectList(new MPJLambdaWrapper<TechProcDO>()
|
||||
.eq(TechProcDO::getEnabledStatus, 0)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.checkitem.vo.CheckI
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验项目 Service 接口
|
||||
@ -52,4 +53,5 @@ public interface CheckItemService {
|
||||
*/
|
||||
PageResult<CheckItemDO> getCheckItemPage(CheckItemPageReqVO pageReqVO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -14,6 +14,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
@ -119,4 +121,6 @@ public class CheckItemServiceImpl implements CheckItemService {
|
||||
return checkItemMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ningxia.yunxi.chemmes.module.biz.service.inspplanitem;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@ -54,4 +55,5 @@ public interface InspPlanItemService {
|
||||
PageResult<InspPlanItemDO> getInspPlanItemPage(InspPlanItemPageReqVO pageReqVO);
|
||||
|
||||
List<InspPlanItemDO> getInspPlanItemByPlanId(Integer planId);
|
||||
List<InspPlanItemDO> selectMaterialId(Integer id);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.inspplanitem.InspPlanItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -72,5 +73,8 @@ public class InspPlanItemServiceImpl implements InspPlanItemService {
|
||||
public List<InspPlanItemDO> getInspPlanItemByPlanId(Integer planId) {
|
||||
return inspPlanItemMapper.getInspPlanItemByPlanId(planId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InspPlanItemDO> selectMaterialId(Integer id) {
|
||||
return inspPlanItemMapper.selectMaterialId(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,4 +54,6 @@ public interface MachineService {
|
||||
PageResult<MachineDO> getMachinePage(MachinePageReqVO pageReqVO);
|
||||
|
||||
List<MachineDO> getMachineDropdown(String keyWord, Integer procId);
|
||||
|
||||
List<MachineDO> getMachineList();
|
||||
}
|
||||
|
||||
@ -82,4 +82,9 @@ public class MachineServiceImpl implements MachineService {
|
||||
public List<MachineDO> getMachineDropdown(String keyWord, Integer procId) {
|
||||
return machineMapper.seleLectListByKeyWord(keyWord,procId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachineDO> getMachineList() {
|
||||
return machineMapper.getMachineList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.plan;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanCompleteReqVO;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.plan.PlanDO;
|
||||
|
||||
/**
|
||||
* 生产计划 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PlanService {
|
||||
|
||||
/**
|
||||
* 创建生产计划
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPlan(@Valid PlanSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生产计划
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePlan(@Valid PlanSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生产计划
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePlan(Integer id);
|
||||
|
||||
/**
|
||||
* 获得生产计划
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 生产计划
|
||||
*/
|
||||
PlanDO getPlan(Integer id);
|
||||
|
||||
/**
|
||||
* 获得生产计划分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生产计划分页
|
||||
*/
|
||||
PageResult<PlanDO> getPlanPage(PlanPageReqVO pageReqVO);
|
||||
|
||||
void complete(List<PlanCompleteReqVO> reqVO);
|
||||
|
||||
void close(List<PlanCompleteReqVO> reqVO);
|
||||
}
|
||||
@ -0,0 +1,250 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.plan;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanCompleteReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.plan.vo.PlanSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.plan.PlanDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planline.PlanLineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planmachine.PlanMachineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.plan.PlanMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planline.PlanLineMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planmachine.PlanMachineMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.ningxia.yunxi.chemmes.module.system.dal.mysql.user.AdminUserMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.system.service.user.AdminUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.stream.Collectors;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import java.time.LocalDate;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.ningxia.yunxi.chemmes.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static com.ningxia.yunxi.chemmes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 生产计划 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PlanServiceImpl implements PlanService {
|
||||
|
||||
@Resource
|
||||
private PlanMapper planMapper;
|
||||
@Resource
|
||||
private PlanLineMapper planLineMapper;
|
||||
@Resource
|
||||
private PlanMachineMapper planMachineMapper;
|
||||
@Resource
|
||||
private AdminUserMapper adminUserMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer createPlan(PlanSaveReqVO createReqVO) {
|
||||
// 生成生产订单编号
|
||||
String proNo = generateProNo();
|
||||
createReqVO.setProNo(proNo);
|
||||
|
||||
// 设置编制人信息为当前登录用户
|
||||
Long userId = getLoginUserId();
|
||||
AdminUserDO adminUserDO = adminUserMapper.selectById(userId);
|
||||
createReqVO.setPlanEmpId(String.valueOf(userId));
|
||||
createReqVO.setPlanEmpName(adminUserDO.getNickname());
|
||||
|
||||
// 插入主表
|
||||
PlanDO plan = BeanUtils.toBean(createReqVO, PlanDO.class);
|
||||
planMapper.insert(plan);
|
||||
|
||||
// 插入子表
|
||||
if (createReqVO.getPlanLineList() != null && !createReqVO.getPlanLineList().isEmpty()) {
|
||||
for (PlanLineDO lineDO : createReqVO.getPlanLineList()) {
|
||||
lineDO.setProId(plan.getId());
|
||||
lineDO.setProNo(plan.getProNo());
|
||||
planLineMapper.insert(lineDO);
|
||||
}
|
||||
}
|
||||
|
||||
// 返回
|
||||
return plan.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成生产订单编号
|
||||
* 格式: PL + 年月(YYYYMM) + 3位流水号
|
||||
*/
|
||||
private String generateProNo() {
|
||||
LocalDate now = LocalDate.now();
|
||||
String ym = now.getYear() + String.format("%02d", now.getMonthValue());
|
||||
|
||||
String maxProNo = planMapper.selectMaxProNo();
|
||||
|
||||
if (maxProNo == null || !maxProNo.substring(2, 8).equals(ym)) {
|
||||
// 查不到数据 或 月份不同,从001开始
|
||||
return "PL" + ym + "001";
|
||||
} else {
|
||||
// 月份相同,流水号+1
|
||||
String prefix = maxProNo.substring(0, 8);
|
||||
int seq = Integer.parseInt(maxProNo.substring(8)) + 1;
|
||||
return prefix + String.format("%03d", seq);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updatePlan(PlanSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePlanExists(updateReqVO.getId());
|
||||
|
||||
|
||||
// 更新主表
|
||||
PlanDO updateObj = BeanUtils.toBean(updateReqVO, PlanDO.class);
|
||||
planMapper.updateById(updateObj);
|
||||
|
||||
// 查询数据库中的子表数据
|
||||
List<PlanLineDO> dbList = planLineMapper.getPlanLineList(updateReqVO.getId());
|
||||
// 转为lineId -> PlanLineDO的map,方便查找
|
||||
Map<Integer, PlanLineDO> dbMap = dbList.stream()
|
||||
.collect(Collectors.toMap(PlanLineDO::getLineId, p -> p, (a, b) -> a));
|
||||
|
||||
// 用于记录前端传过来的lineId集合
|
||||
Set<Integer> frontLineIds = new HashSet<>();
|
||||
|
||||
// 遍历前端数据,处理新增和更新
|
||||
if (updateReqVO.getPlanLineList() != null) {
|
||||
for (PlanLineDO frontLine : updateReqVO.getPlanLineList()) {
|
||||
frontLine.setProId(updateReqVO.getId());
|
||||
frontLine.setProNo(updateReqVO.getProNo());
|
||||
frontLineIds.add(frontLine.getLineId());
|
||||
|
||||
if (frontLine.getId() != null) {
|
||||
// 有id → 更新
|
||||
planLineMapper.updateById(frontLine);
|
||||
} else if (dbMap.containsKey(frontLine.getLineId())) {
|
||||
// 无id但lineId在数据库中存在 → 赋值id后更新
|
||||
frontLine.setId(dbMap.get(frontLine.getLineId()).getId());
|
||||
planLineMapper.updateById(frontLine);
|
||||
} else {
|
||||
// 无id且lineId不在数据库中 → 新增
|
||||
planLineMapper.insert(frontLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除数据库中有但前端没有的数据
|
||||
for (PlanLineDO dbLine : dbList) {
|
||||
if (!frontLineIds.contains(dbLine.getLineId())) {
|
||||
planLineMapper.deleteById(dbLine.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePlan(Integer id) {
|
||||
// 校验存在
|
||||
PlanDO plan = planMapper.selectById(id);
|
||||
if (plan == null) {
|
||||
throw exception("该计划产品信息不存在,请刷新数据!");
|
||||
}
|
||||
// 校验计划状态,如果已下发则不允许删除
|
||||
if (!"0".equals(plan.getPlanStatus())) {
|
||||
throw exception("该订单产品已下发,不允许删除!");
|
||||
}
|
||||
planLineMapper.deleteByProId(id);
|
||||
// planMachineMapper.deleteByProId(id);
|
||||
// 删除
|
||||
planMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePlanExists(Integer id) {
|
||||
if (planMapper.selectById(id) == null) {
|
||||
throw exception("该计划产品信息不存在,请刷新数据!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanDO getPlan(Integer id) {
|
||||
return planMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PlanDO> getPlanPage(PlanPageReqVO pageReqVO) {
|
||||
return planMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(List<PlanCompleteReqVO> reqVO) {
|
||||
for (PlanCompleteReqVO item : reqVO) {
|
||||
Integer rowIndex = item.getRowIndex()+1;
|
||||
Integer id = item.getId();
|
||||
|
||||
// 1. 校验计划是否存在
|
||||
PlanDO plan = planMapper.selectById(id);
|
||||
if (plan == null) {
|
||||
throw exception("第" + rowIndex + "行生产计划信息不存在,请确认!");
|
||||
}
|
||||
|
||||
// 2. 校验计划状态必须是已下发(1)或暂停(4)
|
||||
String planStatus = plan.getPlanStatus();
|
||||
if (!"1".equals(planStatus) && !"4".equals(planStatus)) {
|
||||
throw exception("第" + rowIndex + "行只有已下发或暂停状态计划才允许完成,请确认!");
|
||||
}
|
||||
|
||||
// 3. 校验机台状态不能包含执行中(2)
|
||||
List<PlanMachineDO> machineList = planMachineMapper.getPlanLineList(id);
|
||||
for (PlanMachineDO machine : machineList) {
|
||||
if ("2".equals(machine.getProStatus())) {
|
||||
throw exception("第" + rowIndex + "行当前计划存在机台正在执行,请确认!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 全部校验通过,执行完成操作
|
||||
Integer[] ids = reqVO.stream().map(PlanCompleteReqVO::getId).toArray(Integer[]::new);
|
||||
planMapper.complete(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(List<PlanCompleteReqVO> reqVO) {
|
||||
for (PlanCompleteReqVO item : reqVO) {
|
||||
Integer rowIndex = item.getRowIndex()+1;
|
||||
Integer id = item.getId();
|
||||
|
||||
// 1. 校验计划是否存在
|
||||
PlanDO plan = planMapper.selectById(id);
|
||||
if (plan == null) {
|
||||
throw exception("第" + rowIndex + "行生产计划信息不存在,请确认!");
|
||||
}
|
||||
|
||||
// 2. 校验计划状态必须是已下发(1)或暂停(4)
|
||||
String planStatus = plan.getPlanStatus();
|
||||
if (!"1".equals(planStatus) && !"4".equals(planStatus)) {
|
||||
throw exception("第" + rowIndex + "行只有已下发或暂停状态计划才允许关闭,请确认!");
|
||||
}
|
||||
|
||||
// 3. 校验机台状态不能包含执行中(2)
|
||||
List<PlanMachineDO> machineList = planMachineMapper.getPlanLineList(id);
|
||||
for (PlanMachineDO machine : machineList) {
|
||||
if ("2".equals(machine.getProStatus())) {
|
||||
throw exception("第" + rowIndex + "行当前计划存在机台正在执行,请确认!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 全部校验通过,执行关闭操作
|
||||
Integer[] ids = reqVO.stream().map(PlanCompleteReqVO::getId).toArray(Integer[]::new);
|
||||
planMapper.close(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.planline;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLineRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planline.PlanLineDO;
|
||||
|
||||
/**
|
||||
* 产线计划 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PlanLineService {
|
||||
|
||||
/**
|
||||
* 创建产线计划
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPlanLine(@Valid PlanLineSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新产线计划
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePlanLine(@Valid PlanLineSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除产线计划
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePlanLine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得产线计划
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 产线计划
|
||||
*/
|
||||
PlanLineDO getPlanLine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得产线计划分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 产线计划分页
|
||||
*/
|
||||
PageResult<PlanLineDO> getPlanLinePage(PlanLinePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得产线计划列表(含计划状态)
|
||||
*
|
||||
* @param proId 计划ID
|
||||
* @return 产线计划列表
|
||||
*/
|
||||
List<PlanLineRespVO> getPlanLineList(Integer proId);
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.planline;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLineRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planline.vo.PlanLineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planline.PlanLineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planline.PlanLineMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planmachine.PlanMachineMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 产线计划 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PlanLineServiceImpl implements PlanLineService {
|
||||
|
||||
@Resource
|
||||
private PlanLineMapper planLineMapper;
|
||||
@Resource
|
||||
private PlanMachineMapper planMachineMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPlanLine(PlanLineSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PlanLineDO planLine = BeanUtils.toBean(createReqVO, PlanLineDO.class);
|
||||
planLineMapper.insert(planLine);
|
||||
// 返回
|
||||
return planLine.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePlanLine(PlanLineSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePlanLineExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PlanLineDO updateObj = BeanUtils.toBean(updateReqVO, PlanLineDO.class);
|
||||
planLineMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePlanLine(Integer id) {
|
||||
// 校验存在
|
||||
validatePlanLineExists(id);
|
||||
// 删除
|
||||
planLineMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePlanLineExists(Integer id) {
|
||||
if (planLineMapper.selectById(id) == null) {
|
||||
throw exception("数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanLineDO getPlanLine(Integer id) {
|
||||
return planLineMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PlanLineDO> getPlanLinePage(PlanLinePageReqVO pageReqVO) {
|
||||
return planLineMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlanLineRespVO> getPlanLineList(Integer proId) {
|
||||
List<PlanLineDO> list = planLineMapper.getPlanLineList(proId);
|
||||
return list.stream().map(doObj -> {
|
||||
PlanLineRespVO respVO = BeanUtils.toBean(doObj, PlanLineRespVO.class);
|
||||
// 查询该产线计划关联的机台计划状态
|
||||
List<String> proStatusList = planMachineMapper.selectProStatusListByLineIdAndProId(doObj.getLineId(), doObj.getProId());
|
||||
respVO.setPlanStatus(calculatePlanStatus(proStatusList));
|
||||
return respVO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算计划状态
|
||||
* proStatusList = null 或空 → 0 未执行
|
||||
* 包含 '2' → 1 执行中
|
||||
* 包含 '4' → 2 暂停
|
||||
* 其他 → 3 已完成
|
||||
*/
|
||||
private String calculatePlanStatus(List<String> proStatusList) {
|
||||
if (proStatusList == null || proStatusList.isEmpty()) {
|
||||
return "未执行"; // 未执行
|
||||
}
|
||||
boolean hasExecuting = proStatusList.stream().anyMatch(status -> "2".equals(status));
|
||||
boolean hasPaused = proStatusList.stream().anyMatch(status -> "4".equals(status));
|
||||
|
||||
if (hasExecuting) {
|
||||
return "执行中"; // 执行中
|
||||
}
|
||||
if (hasPaused) {
|
||||
return "暂停"; // 暂停
|
||||
}
|
||||
return "已完成"; // 已完成
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.planmachine;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planmachine.PlanMachineDO;
|
||||
|
||||
/**
|
||||
* 机台执行计划 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PlanMachineService {
|
||||
|
||||
/**
|
||||
* 创建机台执行计划
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPlanMachine(@Valid PlanMachineSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新机台执行计划
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePlanMachine(@Valid PlanMachineSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除机台执行计划
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePlanMachine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得机台执行计划
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 机台执行计划
|
||||
*/
|
||||
PlanMachineDO getPlanMachine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得机台执行计划分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 机台执行计划分页
|
||||
*/
|
||||
PageResult<PlanMachineDO> getPlanMachinePage(PlanMachinePageReqVO pageReqVO);
|
||||
|
||||
List<PlanMachineDO> getPlanLineList(Integer proOrderLineId);
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.planmachine;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.planmachine.vo.PlanMachineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.planmachine.PlanMachineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planmachine.PlanMachineMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 机台执行计划 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PlanMachineServiceImpl implements PlanMachineService {
|
||||
|
||||
@Resource
|
||||
private PlanMachineMapper planMachineMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPlanMachine(PlanMachineSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PlanMachineDO planMachine = BeanUtils.toBean(createReqVO, PlanMachineDO.class);
|
||||
planMachineMapper.insert(planMachine);
|
||||
// 返回
|
||||
return planMachine.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePlanMachine(PlanMachineSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePlanMachineExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PlanMachineDO updateObj = BeanUtils.toBean(updateReqVO, PlanMachineDO.class);
|
||||
planMachineMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePlanMachine(Integer id) {
|
||||
// 校验存在
|
||||
validatePlanMachineExists(id);
|
||||
// 删除
|
||||
planMachineMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePlanMachineExists(Integer id) {
|
||||
if (planMachineMapper.selectById(id) == null) {
|
||||
throw exception("数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanMachineDO getPlanMachine(Integer id) {
|
||||
return planMachineMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PlanMachineDO> getPlanMachinePage(PlanMachinePageReqVO pageReqVO) {
|
||||
return planMachineMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlanMachineDO> getPlanLineList(Integer proOrderLineId) {
|
||||
return planMachineMapper.getPlanLineList(proOrderLineId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.proline;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proc.vo.ProcRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLineRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proline.ProLineDO;
|
||||
|
||||
@ -54,4 +56,6 @@ public interface ProLineService {
|
||||
PageResult<ProLineDO> getProLinePage(ProLinePageReqVO pageReqVO);
|
||||
|
||||
List<ProLineDO> getProLineDropdown(String keyWord);
|
||||
|
||||
List<ProLineDO> getProLineList();
|
||||
}
|
||||
|
||||
@ -2,15 +2,19 @@ package com.ningxia.yunxi.chemmes.module.biz.service.proline;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proc.vo.ProcRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLineRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proline.vo.ProLineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proline.ProLineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.planmachine.PlanMachineMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proline.ProLineMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.ningxia.yunxi.chemmes.module.biz.enums.ErrorCodeConstants.PROC_LINE_CODE_DUPLICATE;
|
||||
@ -26,6 +30,8 @@ public class ProLineServiceImpl implements ProLineService {
|
||||
|
||||
@Resource
|
||||
private ProLineMapper proLineMapper;
|
||||
@Resource
|
||||
private PlanMachineMapper planMachineMapper;
|
||||
|
||||
@Override
|
||||
public Integer createProLine(ProLineSaveReqVO createReqVO) {
|
||||
@ -89,4 +95,10 @@ public class ProLineServiceImpl implements ProLineService {
|
||||
public List<ProLineDO> getProLineDropdown(String keyWord) {
|
||||
return proLineMapper.selectList(keyWord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProLineDO> getProLineList() {
|
||||
|
||||
return proLineMapper.getProLineList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.purorder;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
||||
|
||||
/**
|
||||
* 采购订单主 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PurOrderService {
|
||||
|
||||
/**
|
||||
* 创建采购订单主
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPurOrder(@Valid PurOrderSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新采购订单主
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePurOrder(@Valid PurOrderSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除采购订单主
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePurOrder(Integer id);
|
||||
|
||||
/**
|
||||
* 获得采购订单主
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 采购订单主
|
||||
*/
|
||||
PurOrderDO getPurOrder(Integer id);
|
||||
|
||||
/**
|
||||
* 获得采购订单主分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 采购订单主分页
|
||||
*/
|
||||
PageResult<PurOrderDO> getPurOrderPage(PurOrderPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.purorder;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrderSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.purorder.PurOrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
|
||||
|
||||
import java.util.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 采购订单主 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PurOrderServiceImpl implements PurOrderService {
|
||||
|
||||
@Resource
|
||||
private PurOrderMapper purOrderMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPurOrder(PurOrderSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PurOrderDO purOrder = BeanUtils.toBean(createReqVO, PurOrderDO.class);
|
||||
purOrderMapper.insert(purOrder);
|
||||
// 返回
|
||||
return purOrder.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePurOrder(PurOrderSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePurOrderExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PurOrderDO updateObj = BeanUtils.toBean(updateReqVO, PurOrderDO.class);
|
||||
purOrderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePurOrder(Integer id) {
|
||||
// 校验存在
|
||||
validatePurOrderExists(id);
|
||||
// 删除
|
||||
purOrderMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePurOrderExists(Integer id) {
|
||||
if (purOrderMapper.selectById(id) == null) {
|
||||
throw exception("数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurOrderDO getPurOrder(Integer id) {
|
||||
return purOrderMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PurOrderDO> getPurOrderPage(PurOrderPageReqVO pageReqVO) {
|
||||
return purOrderMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.purorderitem;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem.PurOrderItemDO;
|
||||
|
||||
/**
|
||||
* 采购订单子 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PurOrderItemService {
|
||||
|
||||
/**
|
||||
* 创建采购订单子
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPurOrderItem(@Valid PurOrderItemSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新采购订单子
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePurOrderItem(@Valid PurOrderItemSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除采购订单子
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePurOrderItem(Integer id);
|
||||
|
||||
/**
|
||||
* 获得采购订单子
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 采购订单子
|
||||
*/
|
||||
PurOrderItemDO getPurOrderItem(Integer id);
|
||||
|
||||
/**
|
||||
* 获得采购订单子分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 采购订单子分页
|
||||
*/
|
||||
PageResult<PurOrderItemDO> getPurOrderItemPage(PurOrderItemPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.purorderitem;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem.PurOrderItemDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.purorderitem.PurOrderItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
|
||||
|
||||
import java.util.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 采购订单子 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PurOrderItemServiceImpl implements PurOrderItemService {
|
||||
|
||||
@Resource
|
||||
private PurOrderItemMapper purOrderItemMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPurOrderItem(PurOrderItemSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PurOrderItemDO purOrderItem = BeanUtils.toBean(createReqVO, PurOrderItemDO.class);
|
||||
purOrderItemMapper.insert(purOrderItem);
|
||||
// 返回
|
||||
return purOrderItem.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePurOrderItem(PurOrderItemSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePurOrderItemExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PurOrderItemDO updateObj = BeanUtils.toBean(updateReqVO, PurOrderItemDO.class);
|
||||
purOrderItemMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePurOrderItem(Integer id) {
|
||||
// 校验存在
|
||||
validatePurOrderItemExists(id);
|
||||
// 删除
|
||||
purOrderItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePurOrderItemExists(Integer id) {
|
||||
if (purOrderItemMapper.selectById(id) == null) {
|
||||
throw exception("数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurOrderItemDO getPurOrderItem(Integer id) {
|
||||
return purOrderItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PurOrderItemDO> getPurOrderItemPage(PurOrderItemPageReqVO pageReqVO) {
|
||||
return purOrderItemMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinsp;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsp.RawMaterialInspDO;
|
||||
|
||||
/**
|
||||
* 原材料检验主 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface RawMaterialInspService {
|
||||
|
||||
/**
|
||||
* 创建原材料检验主
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createRawMaterialInsp(@Valid RawMaterialInspSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新原材料检验主
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRawMaterialInsp(@Valid RawMaterialInspSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除原材料检验主
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRawMaterialInsp(String id);
|
||||
|
||||
/**
|
||||
* 获得原材料检验主
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 原材料检验主
|
||||
*/
|
||||
RawMaterialInspDO getRawMaterialInsp(String id);
|
||||
|
||||
/**
|
||||
* 获得原材料检验主分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 原材料检验主分页
|
||||
*/
|
||||
PageResult<RawMaterialInspDO> getRawMaterialInspPage(RawMaterialInspPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,227 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinsp;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsp.vo.RawMaterialInspSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsp.RawMaterialInspDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail.RawMaterialInspDetailDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinsp.RawMaterialInspMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinspdetail.RawMaterialInspDetailMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinsptotal.RawMaterialInspTotalMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 原材料检验主 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RawMaterialInspServiceImpl implements RawMaterialInspService {
|
||||
|
||||
@Resource
|
||||
private RawMaterialInspMapper rawMaterialInspMapper;
|
||||
@Resource
|
||||
private RawMaterialInspTotalMapper rawMaterialInspTotalMapper;
|
||||
@Resource
|
||||
private RawMaterialInspDetailMapper rawMaterialInspDetailMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createRawMaterialInsp(RawMaterialInspSaveReqVO createReqVO) {
|
||||
// 生成检验单号
|
||||
String checkCode = generateCheckCode();
|
||||
|
||||
// 1. 插入主表 tqm_raw_material_insp
|
||||
RawMaterialInspDO rawMaterialInsp = BeanUtils.toBean(createReqVO, RawMaterialInspDO.class);
|
||||
rawMaterialInsp.setCheckCode(checkCode);
|
||||
rawMaterialInspMapper.insert(rawMaterialInsp);
|
||||
String rawMatInspId = rawMaterialInsp.getId();
|
||||
|
||||
// 2. 循环插入汇总表 tqm_raw_material_insp_total(顺序号由后台生成)
|
||||
List<RawMaterialInspTotalDO> totalList = createReqVO.getRawMaterialInspTotalList();
|
||||
if (totalList != null && !totalList.isEmpty()) {
|
||||
int totalSeq = 0;
|
||||
for (RawMaterialInspTotalDO totalDO : totalList) {
|
||||
totalSeq++;
|
||||
// 插入汇总表
|
||||
RawMaterialInspTotalDO total = RawMaterialInspTotalDO.builder()
|
||||
.rawMatInspId(rawMatInspId)
|
||||
.checkCode(checkCode)
|
||||
.itemId(totalDO.getItemId())
|
||||
.itemName(totalDO.getItemName())
|
||||
.standardValue(totalDO.getStandardValue())
|
||||
.upperLimit(totalDO.getUpperLimit())
|
||||
.lowerLimit(totalDO.getLowerLimit())
|
||||
.checkMethod(totalDO.getCheckMethod())
|
||||
.actValue(totalDO.getActValue())
|
||||
.checkResult(totalDO.getCheckResult())
|
||||
.seqNo(totalSeq)
|
||||
.inspPlanId(totalDO.getInspPlanId())
|
||||
.inspPlanItemId(totalDO.getInspPlanItemId())
|
||||
.build();
|
||||
rawMaterialInspTotalMapper.insert(total);
|
||||
Integer totalId = total.getId();
|
||||
|
||||
// 3. 如果实测值有数据,批量插入明细表 tqm_raw_material_insp_detail
|
||||
List<RawMaterialInspDetailDO> detailList = totalDO.getRawMaterialInspDetailList();
|
||||
if (detailList != null && !detailList.isEmpty()) {
|
||||
int detailSeq = 0;
|
||||
for (RawMaterialInspDetailDO detailDO : detailList) {
|
||||
detailSeq++;
|
||||
RawMaterialInspDetailDO detail = RawMaterialInspDetailDO.builder()
|
||||
.rawMatInspId(Integer.parseInt(rawMatInspId))
|
||||
.matInspTotalId(totalId)
|
||||
.checkCode(checkCode)
|
||||
.actValue(detailDO.getActValue())
|
||||
.seqNo(detailSeq)
|
||||
.inspPlanId(detailDO.getInspPlanId())
|
||||
.inspPlanItemId(detailDO.getInspPlanItemId())
|
||||
.build();
|
||||
rawMaterialInspDetailMapper.insert(detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 返回检验单号
|
||||
return checkCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成检验单号
|
||||
* 格式: YL + 年月日(YYYYMMDD) + 两位流水号
|
||||
*/
|
||||
private String generateCheckCode() {
|
||||
LocalDate now = LocalDate.now();
|
||||
String ymd = now.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
|
||||
String maxCheckCode = rawMaterialInspMapper.selectMaxCheckCode();
|
||||
|
||||
if (maxCheckCode == null || !maxCheckCode.substring(2, 10).equals(ymd)) {
|
||||
// 查不到数据 或 日期不同,从01开始
|
||||
return "YL" + ymd + "01";
|
||||
} else {
|
||||
// 日期相同,流水号+1
|
||||
String prefix = maxCheckCode.substring(0, 10);
|
||||
int seq = Integer.parseInt(maxCheckCode.substring(10)) + 1;
|
||||
return prefix + String.format("%02d", seq);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateRawMaterialInsp(RawMaterialInspSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRawMaterialInspExists(updateReqVO.getId());
|
||||
String rawMatInspId = updateReqVO.getId();
|
||||
String checkCode = updateReqVO.getCheckCode();
|
||||
|
||||
// 1. 更新主表 tqm_raw_material_insp
|
||||
RawMaterialInspDO updateObj = BeanUtils.toBean(updateReqVO, RawMaterialInspDO.class);
|
||||
rawMaterialInspMapper.updateById(updateObj);
|
||||
|
||||
// 2. 先删除旧的子表数据
|
||||
rawMaterialInspDetailMapper.deleteByRawMatInspId(rawMatInspId);
|
||||
rawMaterialInspTotalMapper.deleteByRawMatInspId(rawMatInspId);
|
||||
|
||||
// 3. 重新插入汇总表 tqm_raw_material_insp_total(顺序号由后台生成)
|
||||
List<RawMaterialInspTotalDO> totalList = updateReqVO.getRawMaterialInspTotalList();
|
||||
if (totalList != null && !totalList.isEmpty()) {
|
||||
int totalSeq = 0;
|
||||
for (RawMaterialInspTotalDO totalDO : totalList) {
|
||||
totalSeq++;
|
||||
RawMaterialInspTotalDO total = RawMaterialInspTotalDO.builder()
|
||||
.rawMatInspId(rawMatInspId)
|
||||
.checkCode(checkCode)
|
||||
.itemId(totalDO.getItemId())
|
||||
.itemName(totalDO.getItemName())
|
||||
.standardValue(totalDO.getStandardValue())
|
||||
.upperLimit(totalDO.getUpperLimit())
|
||||
.lowerLimit(totalDO.getLowerLimit())
|
||||
.checkMethod(totalDO.getCheckMethod())
|
||||
.actValue(totalDO.getActValue())
|
||||
.checkResult(totalDO.getCheckResult())
|
||||
.seqNo(totalSeq)
|
||||
.inspPlanId(totalDO.getInspPlanId())
|
||||
.inspPlanItemId(totalDO.getInspPlanItemId())
|
||||
.build();
|
||||
rawMaterialInspTotalMapper.insert(total);
|
||||
Integer totalId = total.getId();
|
||||
|
||||
// 4. 如果实测值有数据,重新插入明细表 tqm_raw_material_insp_detail
|
||||
List<RawMaterialInspDetailDO> detailList = totalDO.getRawMaterialInspDetailList();
|
||||
if (detailList != null && !detailList.isEmpty()) {
|
||||
int detailSeq = 0;
|
||||
for (RawMaterialInspDetailDO detailDO : detailList) {
|
||||
detailSeq++;
|
||||
RawMaterialInspDetailDO detail = RawMaterialInspDetailDO.builder()
|
||||
.rawMatInspId(Integer.parseInt(rawMatInspId))
|
||||
.matInspTotalId(totalId)
|
||||
.checkCode(checkCode)
|
||||
.actValue(detailDO.getActValue())
|
||||
.seqNo(detailSeq)
|
||||
.inspPlanId(detailDO.getInspPlanId())
|
||||
.inspPlanItemId(detailDO.getInspPlanItemId())
|
||||
.build();
|
||||
rawMaterialInspDetailMapper.insert(detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRawMaterialInsp(String id) {
|
||||
// 校验存在
|
||||
validateRawMaterialInspExists(id);
|
||||
// 删除
|
||||
rawMaterialInspMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRawMaterialInspExists(String id) {
|
||||
if (rawMaterialInspMapper.selectById(id) == null) {
|
||||
throw exception("数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RawMaterialInspDO getRawMaterialInsp(String id) {
|
||||
RawMaterialInspDO rawMaterialInspDO = rawMaterialInspMapper.selectById(id);
|
||||
if (rawMaterialInspDO == null) {
|
||||
return null;
|
||||
}
|
||||
// 查询汇总表数据
|
||||
List<RawMaterialInspTotalDO> totalList = rawMaterialInspTotalMapper.selectByRawMatInspId(rawMaterialInspDO.getId());
|
||||
// 填充明细数据到汇总表的 rawMaterialInspDetailList
|
||||
if (totalList != null && !totalList.isEmpty()) {
|
||||
for (RawMaterialInspTotalDO total : totalList) {
|
||||
List<RawMaterialInspDetailDO> detailList = rawMaterialInspDetailMapper.selectByMatInspTotalId(total.getId());
|
||||
total.setRawMaterialInspDetailList(detailList);
|
||||
}
|
||||
}
|
||||
rawMaterialInspDO.setRawMaterialInspTotalList(totalList);
|
||||
return rawMaterialInspDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RawMaterialInspDO> getRawMaterialInspPage(RawMaterialInspPageReqVO pageReqVO) {
|
||||
return rawMaterialInspMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinspdetail;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail.RawMaterialInspDetailDO;
|
||||
|
||||
/**
|
||||
* 原材料检验值明细 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface RawMaterialInspDetailService {
|
||||
|
||||
/**
|
||||
* 创建原材料检验值明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createRawMaterialInspDetail(@Valid RawMaterialInspDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新原材料检验值明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRawMaterialInspDetail(@Valid RawMaterialInspDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除原材料检验值明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRawMaterialInspDetail(Integer id);
|
||||
|
||||
/**
|
||||
* 获得原材料检验值明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 原材料检验值明细
|
||||
*/
|
||||
RawMaterialInspDetailDO getRawMaterialInspDetail(Integer id);
|
||||
|
||||
/**
|
||||
* 获得原材料检验值明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 原材料检验值明细分页
|
||||
*/
|
||||
PageResult<RawMaterialInspDetailDO> getRawMaterialInspDetailPage(RawMaterialInspDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinspdetail;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinspdetail.vo.RawMaterialInspDetailSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail.RawMaterialInspDetailDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinspdetail.RawMaterialInspDetailMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
|
||||
|
||||
import java.util.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 原材料检验值明细 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RawMaterialInspDetailServiceImpl implements RawMaterialInspDetailService {
|
||||
|
||||
@Resource
|
||||
private RawMaterialInspDetailMapper rawMaterialInspDetailMapper;
|
||||
|
||||
@Override
|
||||
public Integer createRawMaterialInspDetail(RawMaterialInspDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RawMaterialInspDetailDO rawMaterialInspDetail = BeanUtils.toBean(createReqVO, RawMaterialInspDetailDO.class);
|
||||
rawMaterialInspDetailMapper.insert(rawMaterialInspDetail);
|
||||
// 返回
|
||||
return rawMaterialInspDetail.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRawMaterialInspDetail(RawMaterialInspDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRawMaterialInspDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RawMaterialInspDetailDO updateObj = BeanUtils.toBean(updateReqVO, RawMaterialInspDetailDO.class);
|
||||
rawMaterialInspDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRawMaterialInspDetail(Integer id) {
|
||||
// 校验存在
|
||||
validateRawMaterialInspDetailExists(id);
|
||||
// 删除
|
||||
rawMaterialInspDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRawMaterialInspDetailExists(Integer id) {
|
||||
if (rawMaterialInspDetailMapper.selectById(id) == null) {
|
||||
throw exception("数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RawMaterialInspDetailDO getRawMaterialInspDetail(Integer id) {
|
||||
return rawMaterialInspDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RawMaterialInspDetailDO> getRawMaterialInspDetailPage(RawMaterialInspDetailPageReqVO pageReqVO) {
|
||||
return rawMaterialInspDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinsptotal;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
|
||||
/**
|
||||
* 原材料检验值汇总 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface RawMaterialInspTotalService {
|
||||
|
||||
/**
|
||||
* 创建原材料检验值汇总
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createRawMaterialInspTotal(@Valid RawMaterialInspTotalSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新原材料检验值汇总
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRawMaterialInspTotal(@Valid RawMaterialInspTotalSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除原材料检验值汇总
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRawMaterialInspTotal(Integer id);
|
||||
|
||||
/**
|
||||
* 获得原材料检验值汇总
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 原材料检验值汇总
|
||||
*/
|
||||
RawMaterialInspTotalDO getRawMaterialInspTotal(Integer id);
|
||||
|
||||
/**
|
||||
* 获得原材料检验值汇总分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 原材料检验值汇总分页
|
||||
*/
|
||||
PageResult<RawMaterialInspTotalDO> getRawMaterialInspTotalPage(RawMaterialInspTotalPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.rawmaterialinsptotal;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.rawmaterialinsptotal.vo.RawMaterialInspTotalSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinsptotal.RawMaterialInspTotalMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
|
||||
|
||||
import java.util.*;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 原材料检验值汇总 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RawMaterialInspTotalServiceImpl implements RawMaterialInspTotalService {
|
||||
|
||||
@Resource
|
||||
private RawMaterialInspTotalMapper rawMaterialInspTotalMapper;
|
||||
|
||||
@Override
|
||||
public Integer createRawMaterialInspTotal(RawMaterialInspTotalSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RawMaterialInspTotalDO rawMaterialInspTotal = BeanUtils.toBean(createReqVO, RawMaterialInspTotalDO.class);
|
||||
rawMaterialInspTotalMapper.insert(rawMaterialInspTotal);
|
||||
// 返回
|
||||
return rawMaterialInspTotal.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRawMaterialInspTotal(RawMaterialInspTotalSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRawMaterialInspTotalExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RawMaterialInspTotalDO updateObj = BeanUtils.toBean(updateReqVO, RawMaterialInspTotalDO.class);
|
||||
rawMaterialInspTotalMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRawMaterialInspTotal(Integer id) {
|
||||
// 校验存在
|
||||
validateRawMaterialInspTotalExists(id);
|
||||
// 删除
|
||||
rawMaterialInspTotalMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRawMaterialInspTotalExists(Integer id) {
|
||||
if (rawMaterialInspTotalMapper.selectById(id) == null) {
|
||||
throw exception("数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RawMaterialInspTotalDO getRawMaterialInspTotal(Integer id) {
|
||||
return rawMaterialInspTotalMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RawMaterialInspTotalDO> getRawMaterialInspTotalPage(RawMaterialInspTotalPageReqVO pageReqVO) {
|
||||
return rawMaterialInspTotalMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,55 +1,56 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.supplier;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.supplier.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.supplier.SupplierDO;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 供应商主数据 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface SupplierService {
|
||||
|
||||
/**
|
||||
* 创建供应商主数据
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createSupplier(@Valid SupplierSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新供应商主数据
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSupplier(@Valid SupplierSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除供应商主数据
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSupplier(Integer id);
|
||||
|
||||
/**
|
||||
* 获得供应商主数据
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 供应商主数据
|
||||
*/
|
||||
SupplierDO getSupplier(Integer id);
|
||||
|
||||
/**
|
||||
* 获得供应商主数据分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 供应商主数据分页
|
||||
*/
|
||||
PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.supplier;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.supplier.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.supplier.SupplierDO;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 供应商主数据 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface SupplierService {
|
||||
|
||||
/**
|
||||
* 创建供应商主数据
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createSupplier(@Valid SupplierSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新供应商主数据
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSupplier(@Valid SupplierSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除供应商主数据
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSupplier(Integer id);
|
||||
|
||||
/**
|
||||
* 获得供应商主数据
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 供应商主数据
|
||||
*/
|
||||
SupplierDO getSupplier(Integer id);
|
||||
|
||||
/**
|
||||
* 获得供应商主数据分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 供应商主数据分页
|
||||
*/
|
||||
PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO);
|
||||
|
||||
List<SupplierDO> dropdown(List<String> supplierTypeList);
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
@ -67,4 +69,9 @@ public class SupplierServiceImpl implements SupplierService {
|
||||
return supplierMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupplierDO> dropdown(List<String> supplierTypeList) {
|
||||
return supplierMapper.dropdown(supplierTypeList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,55 +1,56 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.techproc;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 工艺流程主数据 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface TechProcService {
|
||||
|
||||
/**
|
||||
* 创建工艺流程主数据
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createTechProc(@Valid TechProcSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新工艺流程主数据
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateTechProc(@Valid TechProcSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除工艺流程主数据
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteTechProc(Integer id);
|
||||
|
||||
/**
|
||||
* 获得工艺流程主数据
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工艺流程主数据
|
||||
*/
|
||||
TechProcDO getTechProc(Integer id);
|
||||
|
||||
/**
|
||||
* 获得工艺流程主数据分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工艺流程主数据分页
|
||||
*/
|
||||
PageResult<TechProcDO> getTechProcPage(TechProcPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.techproc;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.techproc.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 工艺流程主数据 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface TechProcService {
|
||||
|
||||
/**
|
||||
* 创建工艺流程主数据
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createTechProc(@Valid TechProcSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新工艺流程主数据
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateTechProc(@Valid TechProcSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除工艺流程主数据
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteTechProc(Integer id);
|
||||
|
||||
/**
|
||||
* 获得工艺流程主数据
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 工艺流程主数据
|
||||
*/
|
||||
TechProcDO getTechProc(Integer id);
|
||||
|
||||
/**
|
||||
* 获得工艺流程主数据分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 工艺流程主数据分页
|
||||
*/
|
||||
PageResult<TechProcDO> getTechProcPage(TechProcPageReqVO pageReqVO);
|
||||
List<TechProcDO> dropdown();
|
||||
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
@ -75,4 +77,9 @@ public class TechProcServiceImpl implements TechProcService {
|
||||
return techProcMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TechProcDO> dropdown() {
|
||||
return techProcMapper.dropdown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,9 @@ import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.wipconfigdetail.WipConfigD
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
@ -34,6 +37,8 @@ public class WipConfigServiceImpl implements WipConfigService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer createWipConfig(WipConfigSaveReqVO createReqVO) {
|
||||
// 校验子表:同一保管类型下保管单位不能重复
|
||||
validateWipConfigDetailDuplicate(createReqVO.getWipConfigDetailList());
|
||||
// 插入主表
|
||||
WipConfigDO wipConfig = BeanUtils.toBean(createReqVO, WipConfigDO.class);
|
||||
wipConfigMapper.insert(wipConfig);
|
||||
@ -53,6 +58,8 @@ public class WipConfigServiceImpl implements WipConfigService {
|
||||
public void updateWipConfig(WipConfigSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateWipConfigExists(updateReqVO.getId());
|
||||
// 校验子表:同一保管类型下保管单位不能重复
|
||||
validateWipConfigDetailDuplicate(updateReqVO.getWipConfigDetailList());
|
||||
// 更新主表
|
||||
WipConfigDO updateObj = BeanUtils.toBean(updateReqVO, WipConfigDO.class);
|
||||
wipConfigMapper.updateById(updateObj);
|
||||
@ -83,6 +90,25 @@ public class WipConfigServiceImpl implements WipConfigService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验子表:同一保管类型下保管单位不能重复
|
||||
*/
|
||||
private void validateWipConfigDetailDuplicate(List<WipConfigDetailDO> detailList) {
|
||||
if (detailList == null || detailList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Set<String> seen = new HashSet<>();
|
||||
for (WipConfigDetailDO detail : detailList) {
|
||||
if (detail.getKeepType() == null || detail.getKeepCode() == null) {
|
||||
continue;
|
||||
}
|
||||
String key = detail.getKeepType() + "-" + detail.getKeepCode();
|
||||
if (!seen.add(key)) {
|
||||
throw exception("同一保管类型下保管单位不能重复");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WipConfigDO getWipConfig(Integer id) {
|
||||
return wipConfigMapper.selectById(id);
|
||||
|
||||
@ -1,48 +1,49 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CheckItemVO {
|
||||
id: number
|
||||
itemNo: string
|
||||
itemName: string
|
||||
nature: string
|
||||
unitName: string
|
||||
checkMethod: string
|
||||
remark: string
|
||||
itemType: string
|
||||
itemClass: string
|
||||
itemValueType: string
|
||||
itemContent: string
|
||||
testNum: number
|
||||
floatNum: number
|
||||
printAvgValues: string
|
||||
}
|
||||
|
||||
// 查询检验项目分页
|
||||
export const getCheckItemPage = async (params) => {
|
||||
return await request.get({ url: `/biz/check-item/page`, params })
|
||||
}
|
||||
|
||||
// 查询检验项目详情
|
||||
export const getCheckItem = async (id: number) => {
|
||||
return await request.get({ url: `/biz/check-item/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增检验项目
|
||||
export const createCheckItem = async (data: CheckItemVO) => {
|
||||
return await request.post({ url: `/biz/check-item/create`, data })
|
||||
}
|
||||
|
||||
// 修改检验项目
|
||||
export const updateCheckItem = async (data: CheckItemVO) => {
|
||||
return await request.put({ url: `/biz/check-item/update`, data })
|
||||
}
|
||||
|
||||
// 删除检验项目
|
||||
export const deleteCheckItem = async (id: number) => {
|
||||
return await request.delete({ url: `/biz/check-item/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出检验项目 Excel
|
||||
export const exportCheckItem = async (params) => {
|
||||
return await request.download({ url: `/biz/check-item/export-excel`, params })
|
||||
}
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CheckItemVO {
|
||||
id: number
|
||||
itemNo: string
|
||||
itemName: string
|
||||
nature: string
|
||||
unitName: string
|
||||
checkMethod: string
|
||||
remark: string
|
||||
itemType: string
|
||||
itemClass: string
|
||||
itemValueType: string
|
||||
itemContent: string
|
||||
testNum: number
|
||||
floatNum: number
|
||||
printAvgValues: string
|
||||
}
|
||||
|
||||
// 查询检验项目分页
|
||||
export const getCheckItemPage = async (params) => {
|
||||
return await request.get({ url: `/biz/check-item/page`, params })
|
||||
}
|
||||
|
||||
// 查询检验项目详情
|
||||
export const getCheckItem = async (id: number) => {
|
||||
return await request.get({ url: `/biz/check-item/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增检验项目
|
||||
export const createCheckItem = async (data: CheckItemVO) => {
|
||||
return await request.post({ url: `/biz/check-item/create`, data })
|
||||
}
|
||||
|
||||
// 修改检验项目
|
||||
export const updateCheckItem = async (data: CheckItemVO) => {
|
||||
return await request.put({ url: `/biz/check-item/update`, data })
|
||||
}
|
||||
|
||||
// 删除检验项目
|
||||
export const deleteCheckItem = async (id: number) => {
|
||||
return await request.delete({ url: `/biz/check-item/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出检验项目 Excel
|
||||
export const exportCheckItem = async (params) => {
|
||||
return await request.download({ url: `/biz/check-item/export-excel`, params })
|
||||
}
|
||||
|
||||
|
||||
@ -50,3 +50,7 @@ export const exportInspPlanItem = async (params) => {
|
||||
export const getInspPlanItemByPlanId = async (id: number) => {
|
||||
return await request.get({ url: `/tba/insp-plan-item/getInspPlanItemByPlanId?planId=` + id })
|
||||
}
|
||||
|
||||
export const selectMaterialId = async (id: number) => {
|
||||
return await request.get({ url: `/tba/insp-plan-item/selectMaterialId?id=` + id })
|
||||
}
|
||||
|
||||
@ -1,46 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MachineVO {
|
||||
id: number
|
||||
machineCd: string
|
||||
machineName: string
|
||||
enabledStatus: number
|
||||
remark: string
|
||||
belgLineId: number
|
||||
belgProcId: number
|
||||
}
|
||||
|
||||
// 查询机台主数据分页
|
||||
export const getMachinePage = async (params) => {
|
||||
return await request.get({ url: `/biz/machine/page`, params })
|
||||
}
|
||||
|
||||
// 查询机台主数据详情
|
||||
export const getMachine = async (id: number) => {
|
||||
return await request.get({ url: `/biz/machine/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增机台主数据
|
||||
export const createMachine = async (data: MachineVO) => {
|
||||
return await request.post({ url: `/biz/machine/create`, data })
|
||||
}
|
||||
|
||||
// 修改机台主数据
|
||||
export const updateMachine = async (data: MachineVO) => {
|
||||
return await request.put({ url: `/biz/machine/update`, data })
|
||||
}
|
||||
|
||||
// 删除机台主数据
|
||||
export const deleteMachine = async (id: number) => {
|
||||
return await request.delete({ url: `/biz/machine/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出机台主数据 Excel
|
||||
export const exportMachine = async (params) => {
|
||||
return await request.download({ url: `/biz/machine/export-excel`, params })
|
||||
}
|
||||
|
||||
// 查询机台下拉列表
|
||||
export const getMachineDropdown = async (params) => {
|
||||
return await request.get({ url: `/biz/machine/dropdown`, params })
|
||||
}
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MachineVO {
|
||||
id: number
|
||||
machineCd: string
|
||||
machineName: string
|
||||
enabledStatus: number
|
||||
remark: string
|
||||
belgLineId: number
|
||||
belgProcId: number
|
||||
}
|
||||
|
||||
// 查询机台主数据分页
|
||||
export const getMachinePage = async (params) => {
|
||||
return await request.get({ url: `/biz/machine/page`, params })
|
||||
}
|
||||
|
||||
// 查询机台主数据详情
|
||||
export const getMachine = async (id: number) => {
|
||||
return await request.get({ url: `/biz/machine/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增机台主数据
|
||||
export const createMachine = async (data: MachineVO) => {
|
||||
return await request.post({ url: `/biz/machine/create`, data })
|
||||
}
|
||||
|
||||
// 修改机台主数据
|
||||
export const updateMachine = async (data: MachineVO) => {
|
||||
return await request.put({ url: `/biz/machine/update`, data })
|
||||
}
|
||||
|
||||
// 删除机台主数据
|
||||
export const deleteMachine = async (id: number) => {
|
||||
return await request.delete({ url: `/biz/machine/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出机台主数据 Excel
|
||||
export const exportMachine = async (params) => {
|
||||
return await request.download({ url: `/biz/machine/export-excel`, params })
|
||||
}
|
||||
|
||||
// 查询机台下拉列表
|
||||
export const getMachineDropdown = async (params) => {
|
||||
return await request.get({ url: `/biz/machine/dropdown`, params })
|
||||
}
|
||||
// 获取工序下拉列表
|
||||
export const getMachineList = async () => {
|
||||
return await request.get({ url: `/biz/machine/getMachineList` })
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user