From 213006655afad15165cf65504a5a013755536567 Mon Sep 17 00:00:00 2001 From: siontion Date: Sat, 17 Feb 2024 20:31:34 +0800 Subject: [PATCH 001/169] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=20?= =?UTF-8?q?UI/UX=20=E4=B8=9A=E5=8A=A1=E9=80=BB=E8=BE=91=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生产计划 UI/UX 业务逻辑接口实现 --- .../yunxi/mes/module/heli/enums/CodeEnum.java | 1 + .../module/heli/enums/ErrorCodeConstants.java | 3 + .../admin/equip/EquipController.java | 205 +++--- .../admin/mouldtype/MouldTypeController.java | 8 + .../controller/admin/plan/PlanController.java | 95 +++ .../admin/plan/vo/PlanPageReqVO.java | 96 +++ .../controller/admin/plan/vo/PlanRespVO.java | 135 ++++ .../admin/plan/vo/PlanSaveReqVO.java | 70 ++ .../admin/plansub/PlanSubController.java | 95 +++ .../admin/plansub/vo/PlanSubPageReqVO.java | 61 ++ .../admin/plansub/vo/PlanSubRespVO.java | 68 ++ .../admin/plansub/vo/PlanSubSaveReqVO.java | 52 ++ .../heli/dal/dataobject/plan/PlanDO.java | 137 ++++ .../dal/dataobject/plansub/PlanSubDO.java | 78 +++ .../heli/dal/mysql/equip/EquipMapper.java | 9 + .../dal/mysql/mouldtype/MouldTypeMapper.java | 5 +- .../heli/dal/mysql/plan/PlanMapper.java | 72 ++ .../heli/dal/mysql/plansub/PlanSubMapper.java | 38 ++ .../heli/service/equip/EquipService.java | 113 ++-- .../heli/service/equip/EquipServiceImpl.java | 157 +++-- .../service/mouldtype/MouldTypeService.java | 2 + .../mouldtype/MouldTypeServiceImpl.java | 7 + .../module/heli/service/plan/PlanService.java | 55 ++ .../heli/service/plan/PlanServiceImpl.java | 93 +++ .../heli/service/plansub/PlanSubService.java | 55 ++ .../service/plansub/PlanSubServiceImpl.java | 74 ++ .../main/resources/mapper/plan/PlanMapper.xml | 12 + .../mapper/plansub/PlanSubMapper.xml | 12 + .../.image/src/api/heli/plan/index.ts | 52 ++ .../.image/src/views/heli/plan/PlanForm.vue | 206 ++++++ .../.image/src/views/heli/plan/index.vue | 405 +++++++++++ .../src/api/heli/equip/index.ts | 9 + .../src/api/heli/mouldtype/index.ts | 5 +- .../src/api/heli/plan/index.ts | 51 ++ .../src/api/heli/plansub/index.ts | 46 ++ .../src/src/api/heli/plansub/index.ts | 46 ++ .../src/views/heli/plansub/PlanSubForm.vue | 155 +++++ .../src/src/views/heli/plansub/index.vue | 330 +++++++++ mes-ui/mes-ui-admin-vue3/src/utils/dict.ts | 2 + .../src/views/heli/plan/PlanForm.vue | 207 ++++++ .../src/views/heli/plan/add.vue | 337 ++++++++++ .../src/views/heli/plan/detail.vue | 631 +++++++++++++++++ .../src/views/heli/plan/edit.vue | 632 ++++++++++++++++++ .../src/views/heli/plan/index.vue | 249 +++++++ .../src/views/heli/plan/planprint.vue | 470 +++++++++++++ .../views/heli/plan/projectOrderDialog.vue | 216 ++++++ sql/v1.2.0/1.structure.sql | 76 +-- sql/v1.3.0/1.structure.sql | 73 +- 48 files changed, 5718 insertions(+), 288 deletions(-) create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/PlanController.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanPageReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubPageReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plan/PlanMapper.xml create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plansub/PlanSubMapper.xml create mode 100644 mes-ui/mes-ui-admin-vue3/.image/src/api/heli/plan/index.ts create mode 100644 mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/PlanForm.vue create mode 100644 mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/index.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/api/heli/plan/index.ts create mode 100644 mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts create mode 100644 mes-ui/mes-ui-admin-vue3/src/src/api/heli/plansub/index.ts create mode 100644 mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/PlanSubForm.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/index.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/plan/PlanForm.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/plan/index.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/plan/planprint.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/plan/projectOrderDialog.vue diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java index 54355069..0db895dd 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java @@ -43,6 +43,7 @@ public enum CodeEnum { STOCK_CHECK("盘点单据", "WC", 3, "yyyyMM"), PROJECT_ORDER("业务订单", 3, "yyyyMM"), PROJECT_DELIVERY_ORDER("发货单", "HL", 3, "yyyyMM"), + PROJECT_PLAN("生产计划", "PP",3, "yyyyMM"), ; diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java index fdd9b8a0..0fdc18f8 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java @@ -57,4 +57,7 @@ public interface ErrorCodeConstants { ErrorCode DELIVER_AMOUNT_OVERFLOW = new ErrorCode(1_005_003, "超额发货"); /************工艺设计***********/ ErrorCode PROCESS_DESIGN_NOT_EXISTS = new ErrorCode(1_006_001, "工艺设计不存在"); + /************生产计划管理***********/ + ErrorCode PLAN_NOT_EXISTS = new ErrorCode(1_007_001, "生产计划不存在"); + ErrorCode PLAN_SUB_NOT_EXISTS = new ErrorCode(1_007_002, "生产计划子项目不存在"); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equip/EquipController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equip/EquipController.java index 9cfdcd19..06fec576 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equip/EquipController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equip/EquipController.java @@ -1,95 +1,110 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.equip; - -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import javax.validation.constraints.*; -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; -import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; - -import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; - -import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; -import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; - -import com.chanko.yunxi.mes.module.heli.controller.admin.equip.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; -import com.chanko.yunxi.mes.module.heli.service.equip.EquipService; - -@Tag(name = "管理后台 - 设备信息") -@RestController -@RequestMapping("/heli/equip") -@Validated -public class EquipController { - - @Resource - private EquipService equipService; - - @PostMapping("/create") - @Operation(summary = "创建设备信息") - @PreAuthorize("@ss.hasPermission('heli:equip:create')") - public CommonResult createEquip(@Valid @RequestBody EquipSaveReqVO createReqVO) { - return success(equipService.createEquip(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新设备信息") - @PreAuthorize("@ss.hasPermission('heli:equip:update')") - public CommonResult updateEquip(@Valid @RequestBody EquipSaveReqVO updateReqVO) { - equipService.updateEquip(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除设备信息") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('heli:equip:delete')") - public CommonResult deleteEquip(@RequestParam("id") Long id) { - equipService.deleteEquip(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得设备信息") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('heli:equip:query')") - public CommonResult getEquip(@RequestParam("id") Long id) { - EquipDO equip = equipService.getEquip(id); - return success(BeanUtils.toBean(equip, EquipRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得设备信息分页") - @PreAuthorize("@ss.hasPermission('heli:equip:query')") - public CommonResult> getEquipPage(@Valid EquipPageReqVO pageReqVO) { - PageResult pageResult = equipService.getEquipPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, EquipRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出设备信息 Excel") - @PreAuthorize("@ss.hasPermission('heli:equip:export')") - @OperateLog(type = EXPORT) - public void exportEquipExcel(@Valid EquipPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = equipService.getEquipPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "设备信息.xls", "数据", EquipRespVO.class, - BeanUtils.toBean(list, EquipRespVO.class)); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.equip; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.equip.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; +import com.chanko.yunxi.mes.module.heli.service.equip.EquipService; + +@Tag(name = "管理后台 - 设备信息") +@RestController +@RequestMapping("/heli/equip") +@Validated +public class EquipController { + + @Resource + private EquipService equipService; + + @PostMapping("/create") + @Operation(summary = "创建设备信息") + @PreAuthorize("@ss.hasPermission('heli:equip:create')") + public CommonResult createEquip(@Valid @RequestBody EquipSaveReqVO createReqVO) { + return success(equipService.createEquip(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备信息") + @PreAuthorize("@ss.hasPermission('heli:equip:update')") + public CommonResult updateEquip(@Valid @RequestBody EquipSaveReqVO updateReqVO) { + equipService.updateEquip(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:equip:delete')") + public CommonResult deleteEquip(@RequestParam("id") Long id) { + equipService.deleteEquip(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:equip:query')") + public CommonResult getEquip(@RequestParam("id") Long id) { + EquipDO equip = equipService.getEquip(id); + return success(BeanUtils.toBean(equip, EquipRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备信息分页") + @PreAuthorize("@ss.hasPermission('heli:equip:query')") + public CommonResult> getEquipPage(@Valid EquipPageReqVO pageReqVO) { + PageResult pageResult = equipService.getEquipPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, EquipRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备信息 Excel") + @PreAuthorize("@ss.hasPermission('heli:equip:export')") + @OperateLog(type = EXPORT) + public void exportEquipExcel(@Valid EquipPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = equipService.getEquipPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备信息.xls", "数据", EquipRespVO.class, + BeanUtils.toBean(list, EquipRespVO.class)); + } + + @GetMapping({"/all-simples"}) + @Operation(summary = "TODO:获取设备信息信息列表", description = "只包含被开启的设备信息,主要用于前端的下拉选项") + public CommonResult> > getSimpleList() { + List> list = equipService.getEquipSimpleList(); + // 拼接数据 + return success(list); + } + + @GetMapping({"/all-no-status-simples"}) + @Operation(summary = "TODO:获取无状态设备信息信息列表", description = "设备信息,主要用于前端的下拉选项") + public CommonResult> > getNoStatusSimpleList() { + List> list = equipService.getEquipNoStatusSimpleList(); + // 拼接数据 + return success(list); + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/mouldtype/MouldTypeController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/mouldtype/MouldTypeController.java index f98d86a7..f511ff1b 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/mouldtype/MouldTypeController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/mouldtype/MouldTypeController.java @@ -99,4 +99,12 @@ public class MouldTypeController { // 拼接数据 return success(list); } + + @GetMapping({"/all-no-status-simples"}) + @Operation(summary = "TODO:获取无状态模块类型信息列表", description = "模块类型,主要用于前端的下拉选项") + public CommonResult> > getNoStatusSimpleList() { + List> list = mouldTypeService.getMouldTypeNoStatusSimpleList(); + // 拼接数据 + return success(list); + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/PlanController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/PlanController.java new file mode 100644 index 00000000..d54606ce --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/PlanController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plan; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; +import com.chanko.yunxi.mes.module.heli.service.plan.PlanService; + +@Tag(name = "管理后台 - 生产计划") +@RestController +@RequestMapping("/heli/plan") +@Validated +public class PlanController { + + @Resource + private PlanService planService; + + @PostMapping("/create") + @Operation(summary = "创建生产计划") + @PreAuthorize("@ss.hasPermission('heli:plan:create')") + public CommonResult createPlan(@Valid @RequestBody PlanSaveReqVO createReqVO) { + return success(planService.createPlan(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新生产计划") + @PreAuthorize("@ss.hasPermission('heli:plan:update')") + public CommonResult updatePlan(@Valid @RequestBody PlanSaveReqVO updateReqVO) { + planService.updatePlan(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除生产计划") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:plan:delete')") + public CommonResult deletePlan(@RequestParam("id") Long id) { + planService.deletePlan(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得生产计划") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:plan:query')") + public CommonResult getPlan(@RequestParam("id") Long id) { + PlanDO plan = planService.getPlan(id); + return success(BeanUtils.toBean(plan, PlanRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得生产计划分页") + @PreAuthorize("@ss.hasPermission('heli:plan:query')") + public CommonResult> getPlanPage(@Valid PlanPageReqVO pageReqVO) { + PageResult pageResult = planService.getPlanPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, PlanRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出生产计划 Excel") + @PreAuthorize("@ss.hasPermission('heli:plan:export')") + @OperateLog(type = EXPORT) + public void exportPlanExcel(@Valid PlanPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = planService.getPlanPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "生产计划.xls", "数据", PlanRespVO.class, + BeanUtils.toBean(list, PlanRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanPageReqVO.java new file mode 100644 index 00000000..6fcb9f9d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanPageReqVO.java @@ -0,0 +1,96 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 生产计划分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PlanPageReqVO extends PageParam { + + @Schema(description = "自增字段,唯一", example = "15769") + private Long id; + + @Schema(description = "计划单号") + private String planNo; + + @Schema(description = "项目id") + private Long projectId; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "客户名称") + private String businessManName; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "业务员") + private String customerName; + + @Schema(description = "业务线") + private String businessLine; + + @Schema(description = "性质") + private Integer property; + + @Schema(description = "项目负责人") + private String projectOwner; + + @Schema(description = "是否需要工艺:1表示需要,0表示不需要") + private Integer hasCraft; + + @Schema(description = "工艺负责人") + private String craftOwner; + + @Schema(description = "工艺开始日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] craftStartDate; + + @Schema(description = "工艺结束日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] craftEndDate; + + @Schema(description = "编辑人") + private String editor; + + @Schema(description = "编辑日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] editorDate; + + @Schema(description = "审核人") + private String auditor; + + @Schema(description = "审核日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] auditDate; + + @Schema(description = "批准人") + private String approver; + + @Schema(description = "批准日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] approveDate; + + @Schema(description = "备注", example = "随便") + private String description; + + @Schema(description = "状态,1未开始,2生产中,3已完成,4已终止 ,默认是1", example = "2") + private Integer status; + + @Schema(description = "项目变更次数") + private Integer changeNum; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java new file mode 100644 index 00000000..5b501712 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java @@ -0,0 +1,135 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plan.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.*; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 生产计划 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PlanRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "15769") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "计划单号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("计划单号") + private String planNo; + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28157") + @ExcelProperty("项目id") + private Long projectId; + + @Schema(description = "项目负责人") + @ExcelProperty("项目负责人") + private String projectOwner; + + @Schema(description = "项目编码") + @ExcelProperty("项目编码") + private String projectCode; + + @Schema(description = "客户名称") + @ExcelProperty("客户名称") + private String customerName; + + @Schema(description = "项目名称") + @ExcelProperty("项目名称") + private String projectName; + + @Schema(description = "业务员") + @ExcelProperty("业务员") + private String businessManName; + + @Schema(description = "项目开始日期") + @ExcelProperty("项目开始日期") + private LocalDateTime projectStartTime; + + @Schema(description = "项目结束日期") + @ExcelProperty("项目结束日期") + private LocalDateTime projectEndTime; + + @Schema(description = "业务线") + @ExcelProperty("业务线") + private String businessLine; + + @Schema(description = "性质") + @ExcelProperty("性质") + private Integer property; + + @Schema(description = "是否已变更") + @ExcelProperty("是否已变更") + private Integer hasAlter; + + @Schema(description = "是否紧急") + @ExcelProperty("是否紧急") + private Integer isUrgency; + + @Schema(description = "是否需要工艺:1表示需要,0表示不需要") + @ExcelProperty(value = "是否需要工艺:1表示需要,0表示不需要", converter = DictConvert.class) + @DictFormat("heli_common_is_or_not") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer hasCraft; + + @Schema(description = "工艺负责人") + @ExcelProperty("工艺负责人") + private String craftOwner; + + @Schema(description = "工艺开始日期") + @ExcelProperty("工艺开始日期") + private LocalDateTime craftStartDate; + + @Schema(description = "工艺结束日期") + @ExcelProperty("工艺结束日期") + private LocalDateTime craftEndDate; + + @Schema(description = "工艺流程数组信息[{'id':1,'sdate':'','edate':'','owner':'','description':''}]") + @ExcelProperty("工艺流程数组信息[{'id':1,'sdate':'','edate':'','owner':'','description':''}]") + private String craftContent; + + @Schema(description = "编辑人") + @ExcelProperty("编辑人") + private String editor; + + @Schema(description = "编辑日期") + @ExcelProperty("编辑日期") + private LocalDateTime editorDate; + + @Schema(description = "审核人") + @ExcelProperty("审核人") + private String auditor; + + @Schema(description = "审核日期") + @ExcelProperty("审核日期") + private LocalDateTime auditDate; + + @Schema(description = "批准人") + @ExcelProperty("批准人") + private String approver; + + @Schema(description = "批准日期") + @ExcelProperty("批准日期") + private LocalDateTime approveDate; + + @Schema(description = "备注", example = "随便") + @ExcelProperty("备注") + private String description; + + @Schema(description = "状态,1未开始,2生产中,3已完成,4已终止 ,默认是1", example = "2") + @ExcelProperty("状态,1未开始,2生产中,3已完成,4已终止 ,默认是1") + private Boolean status; + + @Schema(description = "项目变更次数") + @ExcelProperty("项目变更次数") + private Integer changeNum; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java new file mode 100644 index 00000000..84b0d81c --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java @@ -0,0 +1,70 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plan.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 PlanSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "15769") + private Long id; + + @Schema(description = "计划单号", requiredMode = Schema.RequiredMode.REQUIRED) + private String planNo; + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28157") + @NotNull(message = "项目id不能为空") + private Long projectId; + + @Schema(description = "项目负责人") + private String projectOwner; + + @Schema(description = "是否需要工艺:1表示需要,0表示不需要") + private Integer hasCraft; + + @Schema(description = "工艺负责人") + private String craftOwner; + + @Schema(description = "工艺开始日期") + private LocalDateTime craftStartDate; + + @Schema(description = "工艺结束日期") + private LocalDateTime craftEndDate; + + @Schema(description = "工艺流程数组信息[{'id':1,'sdate':'','edate':'','owner':'','description':''}]") + private String craftContent; + + @Schema(description = "编辑人") + private String editor; + + @Schema(description = "编辑日期") + private LocalDateTime editorDate; + + @Schema(description = "审核人") + private String auditor; + + @Schema(description = "审核日期") + private LocalDateTime auditDate; + + @Schema(description = "批准人") + private String approver; + + @Schema(description = "批准日期") + private LocalDateTime approveDate; + + @Schema(description = "备注", example = "随便") + private String description; + + @Schema(description = "状态,1未开始,2生产中,3已完成,4已终止 ,默认是1", example = "2") + private Boolean status; + + @Schema(description = "项目变更次数") + private Integer changeNum; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java new file mode 100644 index 00000000..3ae9ec87 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plansub; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.service.plansub.PlanSubService; + +@Tag(name = "管理后台 - 生产计划子项目") +@RestController +@RequestMapping("/heli/plan-sub") +@Validated +public class PlanSubController { + + @Resource + private PlanSubService planSubService; + + @PostMapping("/create") + @Operation(summary = "创建生产计划子项目") + @PreAuthorize("@ss.hasPermission('heli:plan-sub:create')") + public CommonResult createPlanSub(@Valid @RequestBody PlanSubSaveReqVO createReqVO) { + return success(planSubService.createPlanSub(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新生产计划子项目") + @PreAuthorize("@ss.hasPermission('heli:plan-sub:update')") + public CommonResult updatePlanSub(@Valid @RequestBody PlanSubSaveReqVO updateReqVO) { + planSubService.updatePlanSub(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除生产计划子项目") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:plan-sub:delete')") + public CommonResult deletePlanSub(@RequestParam("id") Long id) { + planSubService.deletePlanSub(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得生产计划子项目") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:plan-sub:query')") + public CommonResult getPlanSub(@RequestParam("id") Long id) { + PlanSubDO planSub = planSubService.getPlanSub(id); + return success(BeanUtils.toBean(planSub, PlanSubRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得生产计划子项目分页") + @PreAuthorize("@ss.hasPermission('heli:plan-sub:query')") + public CommonResult> getPlanSubPage(@Valid PlanSubPageReqVO pageReqVO) { + PageResult pageResult = planSubService.getPlanSubPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, PlanSubRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出生产计划子项目 Excel") + @PreAuthorize("@ss.hasPermission('heli:plan-sub:export')") + @OperateLog(type = EXPORT) + public void exportPlanSubExcel(@Valid PlanSubPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = planSubService.getPlanSubPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "生产计划子项目.xls", "数据", PlanSubRespVO.class, + BeanUtils.toBean(list, PlanSubRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubPageReqVO.java new file mode 100644 index 00000000..46ba7273 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubPageReqVO.java @@ -0,0 +1,61 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 生产计划子项目分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PlanSubPageReqVO extends PageParam { + + @Schema(description = "自增字段,唯一") + private Long id; + + @Schema(description = "计划id") + private Long projectPlanId; + + @Schema(description = "项目id") + private Long projectId; + + @Schema(description = "子项目id") + private Long projectSubId; + + @Schema(description = "模具类型id") + private Long mouldId; + + @Schema(description = "设备id") + private Long equipId; + + @Schema(description = "毛坯结束日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] blankDate; + + @Schema(description = "毛坯负责人") + private String blankOwner; + + @Schema(description = "2D结束日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] twoDimDate; + + @Schema(description = "2D负责人") + private String twoDimOwner; + + @Schema(description = "3D结束日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] threeDimDate; + + @Schema(description = "3D负责人") + private String threeDimOwner; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java new file mode 100644 index 00000000..d7afd49d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java @@ -0,0 +1,68 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 生产计划子项目 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PlanSubRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "计划id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("计划id") + private Long projectPlanId; + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("项目id") + private Long projectId; + + @Schema(description = "子项目id") + @ExcelProperty("子项目id") + private Long projectSubId; + + @Schema(description = "模具类型id") + @ExcelProperty("模具类型id") + private Long mouldId; + + @Schema(description = "设备id") + @ExcelProperty("设备id") + private Long equipId; + + @Schema(description = "毛坯结束日期") + @ExcelProperty("毛坯结束日期") + private LocalDateTime blankDate; + + @Schema(description = "毛坯负责人") + @ExcelProperty("毛坯负责人") + private String blankOwner; + + @Schema(description = "2D结束日期") + @ExcelProperty("2D结束日期") + private LocalDateTime twoDimDate; + + @Schema(description = "2D负责人") + @ExcelProperty("2D负责人") + private String twoDimOwner; + + @Schema(description = "3D结束日期") + @ExcelProperty("3D结束日期") + private LocalDateTime threeDimDate; + + @Schema(description = "3D负责人") + @ExcelProperty("3D负责人") + private String threeDimOwner; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java new file mode 100644 index 00000000..62196485 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java @@ -0,0 +1,52 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 生产计划子项目新增/修改 Request VO") +@Data +public class PlanSubSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "计划id", requiredMode = Schema.RequiredMode.REQUIRED) + private Long projectPlanId; + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "项目id不能为空") + private Long projectId; + + @Schema(description = "子项目id") + private Long projectSubId; + + @Schema(description = "模具类型id") + private Long mouldId; + + @Schema(description = "设备id") + private Long equipId; + + @Schema(description = "毛坯结束日期") + private LocalDateTime blankDate; + + @Schema(description = "毛坯负责人") + private String blankOwner; + + @Schema(description = "2D结束日期") + private LocalDateTime twoDimDate; + + @Schema(description = "2D负责人") + private String twoDimOwner; + + @Schema(description = "3D结束日期") + private LocalDateTime threeDimDate; + + @Schema(description = "3D负责人") + private String threeDimOwner; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java new file mode 100644 index 00000000..4b49a576 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java @@ -0,0 +1,137 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.plan; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 生产计划 DO + * + * @author 管理员 + */ +@TableName("project_plan") +@KeySequence("project_plan_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PlanDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 计划单号 + */ + private String planNo; + /** + * 项目id + */ + private Long projectId; + /** + * 项目负责人 + */ + private String projectOwner; + /** + * 是否需要工艺:1表示需要,0表示不需要 + * + * 枚举 {@link TODO heli_common_is_or_not 对应的类} + */ + private Integer hasCraft; + /** + * 工艺负责人 + */ + private String craftOwner; + /** + * 工艺开始日期 + */ + private LocalDateTime craftStartDate; + /** + * 工艺结束日期 + */ + private LocalDateTime craftEndDate; + /** + * 工艺流程数组信息[{'id':1,'sdate':'','edate':'','owner':'','description':''}] + */ + private String craftContent; + /** + * 编辑人 + */ + private String editor; + /** + * 编辑日期 + */ + private LocalDateTime editorDate; + /** + * 审核人 + */ + private String auditor; + /** + * 审核日期 + */ + private LocalDateTime auditDate; + /** + * 批准人 + */ + private String approver; + /** + * 批准日期 + */ + private LocalDateTime approveDate; + /** + * 备注 + */ + private String description; + /** + * 状态,1未开始,2生产中,3已完成,4已终止 ,默认是1 + */ + private Integer status; + /** + * 项目变更次数 + */ + private Integer changeNum; + + @TableField(exist = false) + private String projectCode; + + @TableField(exist = false) + private String customerName; + + @TableField(exist = false) + private String projectName; + + @TableField(exist = false) + private String businessManName; + + + @TableField(exist = false) + private LocalDateTime projectStartTime; + + @TableField(exist = false) + private LocalDateTime projectEndTime; + + @TableField(exist = false) + private String businessLine; + + @TableField(exist = false) + private Integer property; + + @TableField(exist = false) + private Integer hasAlter; + + @TableField(exist = false) + private Integer isUrgency; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java new file mode 100644 index 00000000..4163c148 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java @@ -0,0 +1,78 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 生产计划子项目 DO + * + * @author 管理员 + */ +@TableName("project_plan_sub") +@KeySequence("project_plan_sub_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PlanSubDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 计划id + */ + private Long projectPlanId; + /** + * 项目id + */ + private Long projectId; + /** + * 子项目id + */ + private Long projectSubId; + /** + * 模具类型id + */ + private Long mouldId; + /** + * 设备id + */ + private Long equipId; + /** + * 毛坯结束日期 + */ + private LocalDateTime blankDate; + /** + * 毛坯负责人 + */ + private String blankOwner; + /** + * 2D结束日期 + */ + private LocalDateTime twoDimDate; + /** + * 2D负责人 + */ + private String twoDimOwner; + /** + * 3D结束日期 + */ + private LocalDateTime threeDimDate; + /** + * 3D负责人 + */ + private String threeDimOwner; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/equip/EquipMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/equip/EquipMapper.java index 46e6c017..65c89596 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/equip/EquipMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/equip/EquipMapper.java @@ -2,10 +2,12 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.equip; import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.rg.RgDO; import org.apache.ibatis.annotations.Mapper; import com.chanko.yunxi.mes.module.heli.controller.admin.equip.vo.*; @@ -31,4 +33,11 @@ public interface EquipMapper extends BaseMapperX { .orderByDesc(EquipDO::getId)); } + default List> selectSimpleList() { + return selectMaps(new QueryWrapper().select("id", "name","mould_type_id").eq("status","1").lambda()); + } + + default List> selectNoStatusSimpleList() { + return selectMaps(new QueryWrapper().select("id", "name","mould_type_id").lambda()); + } } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/mouldtype/MouldTypeMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/mouldtype/MouldTypeMapper.java index 10155872..0ef06afb 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/mouldtype/MouldTypeMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/mouldtype/MouldTypeMapper.java @@ -27,8 +27,9 @@ public interface MouldTypeMapper extends BaseMapperX { .orderByDesc(MouldTypeDO::getId)); } default List> selectSimpleList() { - return selectMaps(new QueryWrapper().select("id", "name").eq("status","1").lambda()); - + } + default List> selectNoStatusSimpleList() { + return selectMaps(new QueryWrapper().select("id", "name").lambda()); } } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java new file mode 100644 index 00000000..83ba8864 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java @@ -0,0 +1,72 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.plan; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.*; +import org.springframework.util.StringUtils; + +/** + * 生产计划 Mapper + * + * @author 管理员 + */ +@Mapper +public interface PlanMapper extends BaseMapperX { + + default PageResult selectPage(PlanPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(PlanDO.class) + .select("u.nickname as businessManName", "e.name as customerName","p.code as projectCode","p.project_name as projectName","p.project_start_time as projectStartTime","p.project_end_time as projectEndTime","p.business_line as businessLine","p.property","p.is_urgency as isUrgency","p.has_alter as hasAlter") + .leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, PlanDO::getProjectId) + .leftJoin(AdminUserDO.class, "u", AdminUserDO::getId, ProjectOrderDO::getBusinessMan) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .disableSubLogicDel() + .orderByDesc(PlanDO::getPlanNo); + query.like(!StringUtils.isEmpty(reqVO.getPlanNo()), PlanDO::getPlanNo, reqVO.getPlanNo()) + .like(!StringUtils.isEmpty(reqVO.getProjectCode()), "p.code", reqVO.getProjectCode()) + .like(!StringUtils.isEmpty(reqVO.getCustomerName()), "e.name", reqVO.getCustomerName()) + .like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName()) + .like(!StringUtils.isEmpty(reqVO.getBusinessManName()), "u.nickname", reqVO.getBusinessManName()) + .like(!StringUtils.isEmpty(reqVO.getProjectOwner()), PlanDO::getProjectOwner, reqVO.getProjectOwner()) + .eq(reqVO.getBusinessLine() != null, ProjectOrderDO::getBusinessLine, reqVO.getBusinessLine()) + .eq(reqVO.getProperty() != null, ProjectOrderDO::getProperty, reqVO.getProperty()) + .eq(reqVO.getStatus() != null, PlanDO::getStatus, reqVO.getStatus()); + + return selectPage(reqVO, query); + } + +// default PageResult selectPage(PlanPageReqVO reqVO) { +// return selectPage(reqVO, new LambdaQueryWrapperX() +// .eqIfPresent(PlanDO::getId, reqVO.getId()) +// .likeIfPresent(PlanDO::getPlanNo, reqVO.getPlanNo()) +// .eqIfPresent(PlanDO::getProjectId, reqVO.getProjectId()) +// .likeIfPresent(PlanDO::getProjectOwner, reqVO.getProjectOwner()) +// .eqIfPresent(PlanDO::getHasCraft, reqVO.getHasCraft()) +// .likeIfPresent(PlanDO::getCraftOwner, reqVO.getCraftOwner()) +// .betweenIfPresent(PlanDO::getCraftStartDate, reqVO.getCraftStartDate()) +// .betweenIfPresent(PlanDO::getCraftEndDate, reqVO.getCraftEndDate()) +// .likeIfPresent(PlanDO::getEditor, reqVO.getEditor()) +// .betweenIfPresent(PlanDO::getEditorDate, reqVO.getEditorDate()) +// .likeIfPresent(PlanDO::getAuditor, reqVO.getAuditor()) +// .betweenIfPresent(PlanDO::getAuditDate, reqVO.getAuditDate()) +// .likeIfPresent(PlanDO::getApprover, reqVO.getApprover()) +// .betweenIfPresent(PlanDO::getApproveDate, reqVO.getApproveDate()) +// .eqIfPresent(PlanDO::getDescription, reqVO.getDescription()) +// .eqIfPresent(PlanDO::getStatus, reqVO.getStatus()) +// .eqIfPresent(PlanDO::getChangeNum, reqVO.getChangeNum()) +// .betweenIfPresent(PlanDO::getCreateTime, reqVO.getCreateTime()) +// .orderByDesc(PlanDO::getId)); +// } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java new file mode 100644 index 00000000..38f3788c --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java @@ -0,0 +1,38 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.plansub; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.*; + +/** + * 生产计划子项目 Mapper + * + * @author 管理员 + */ +@Mapper +public interface PlanSubMapper extends BaseMapperX { + + default PageResult selectPage(PlanSubPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(PlanSubDO::getId, reqVO.getId()) + .eqIfPresent(PlanSubDO::getProjectPlanId, reqVO.getProjectPlanId()) + .eqIfPresent(PlanSubDO::getProjectId, reqVO.getProjectId()) + .eqIfPresent(PlanSubDO::getProjectSubId, reqVO.getProjectSubId()) + .eqIfPresent(PlanSubDO::getMouldId, reqVO.getMouldId()) + .eqIfPresent(PlanSubDO::getEquipId, reqVO.getEquipId()) + .betweenIfPresent(PlanSubDO::getBlankDate, reqVO.getBlankDate()) + .eqIfPresent(PlanSubDO::getBlankOwner, reqVO.getBlankOwner()) + .betweenIfPresent(PlanSubDO::getTwoDimDate, reqVO.getTwoDimDate()) + .eqIfPresent(PlanSubDO::getTwoDimOwner, reqVO.getTwoDimOwner()) + .betweenIfPresent(PlanSubDO::getThreeDimDate, reqVO.getThreeDimDate()) + .eqIfPresent(PlanSubDO::getThreeDimOwner, reqVO.getThreeDimOwner()) + .betweenIfPresent(PlanSubDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(PlanSubDO::getId)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipService.java index 9247a3d0..309daf1f 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipService.java @@ -1,55 +1,58 @@ -package com.chanko.yunxi.mes.module.heli.service.equip; - -import java.util.*; -import javax.validation.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.equip.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; - -/** - * 设备信息 Service 接口 - * - * @author 管理员 - */ -public interface EquipService { - - /** - * 创建设备信息 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createEquip(@Valid EquipSaveReqVO createReqVO); - - /** - * 更新设备信息 - * - * @param updateReqVO 更新信息 - */ - void updateEquip(@Valid EquipSaveReqVO updateReqVO); - - /** - * 删除设备信息 - * - * @param id 编号 - */ - void deleteEquip(Long id); - - /** - * 获得设备信息 - * - * @param id 编号 - * @return 设备信息 - */ - EquipDO getEquip(Long id); - - /** - * 获得设备信息分页 - * - * @param pageReqVO 分页查询 - * @return 设备信息分页 - */ - PageResult getEquipPage(EquipPageReqVO pageReqVO); - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.equip; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.equip.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 设备信息 Service 接口 + * + * @author 管理员 + */ +public interface EquipService { + + /** + * 创建设备信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createEquip(@Valid EquipSaveReqVO createReqVO); + + /** + * 更新设备信息 + * + * @param updateReqVO 更新信息 + */ + void updateEquip(@Valid EquipSaveReqVO updateReqVO); + + /** + * 删除设备信息 + * + * @param id 编号 + */ + void deleteEquip(Long id); + + /** + * 获得设备信息 + * + * @param id 编号 + * @return 设备信息 + */ + EquipDO getEquip(Long id); + + /** + * 获得设备信息分页 + * + * @param pageReqVO 分页查询 + * @return 设备信息分页 + */ + PageResult getEquipPage(EquipPageReqVO pageReqVO); + + List> getEquipSimpleList(); + + List> getEquipNoStatusSimpleList(); +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipServiceImpl.java index 8eec3f8b..c6e773ed 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equip/EquipServiceImpl.java @@ -1,74 +1,83 @@ -package com.chanko.yunxi.mes.module.heli.service.equip; - -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.equip.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; - -import com.chanko.yunxi.mes.module.heli.dal.mysql.equip.EquipMapper; - -import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; - -/** - * 设备信息 Service 实现类 - * - * @author 管理员 - */ -@Service -@Validated -public class EquipServiceImpl implements EquipService { - - @Resource - private EquipMapper equipMapper; - - @Override - public Long createEquip(EquipSaveReqVO createReqVO) { - // 插入 - EquipDO equip = BeanUtils.toBean(createReqVO, EquipDO.class); - equipMapper.insert(equip); - // 返回 - return equip.getId(); - } - - @Override - public void updateEquip(EquipSaveReqVO updateReqVO) { - // 校验存在 - validateEquipExists(updateReqVO.getId()); - // 更新 - EquipDO updateObj = BeanUtils.toBean(updateReqVO, EquipDO.class); - equipMapper.updateById(updateObj); - } - - @Override - public void deleteEquip(Long id) { - // 校验存在 - validateEquipExists(id); - // 删除 - equipMapper.deleteById(id); - } - - private void validateEquipExists(Long id) { - if (equipMapper.selectById(id) == null) { - throw exception(EQUIP_NOT_EXISTS); - } - } - - @Override - public EquipDO getEquip(Long id) { - return equipMapper.selectById(id); - } - - @Override - public PageResult getEquipPage(EquipPageReqVO pageReqVO) { - return equipMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.equip; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.equip.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.equip.EquipMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 设备信息 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class EquipServiceImpl implements EquipService { + + @Resource + private EquipMapper equipMapper; + + @Override + public Long createEquip(EquipSaveReqVO createReqVO) { + // 插入 + EquipDO equip = BeanUtils.toBean(createReqVO, EquipDO.class); + equipMapper.insert(equip); + // 返回 + return equip.getId(); + } + + @Override + public void updateEquip(EquipSaveReqVO updateReqVO) { + // 校验存在 + validateEquipExists(updateReqVO.getId()); + // 更新 + EquipDO updateObj = BeanUtils.toBean(updateReqVO, EquipDO.class); + equipMapper.updateById(updateObj); + } + + @Override + public void deleteEquip(Long id) { + // 校验存在 + validateEquipExists(id); + // 删除 + equipMapper.deleteById(id); + } + + private void validateEquipExists(Long id) { + if (equipMapper.selectById(id) == null) { + throw exception(EQUIP_NOT_EXISTS); + } + } + + @Override + public EquipDO getEquip(Long id) { + return equipMapper.selectById(id); + } + + @Override + public PageResult getEquipPage(EquipPageReqVO pageReqVO) { + return equipMapper.selectPage(pageReqVO); + } + + @Override + public List> getEquipSimpleList(){ + return equipMapper.selectSimpleList(); + } + + @Override + public List> getEquipNoStatusSimpleList(){ + return equipMapper.selectNoStatusSimpleList(); + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeService.java index 892c3c55..2d30b5b6 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeService.java @@ -54,4 +54,6 @@ public interface MouldTypeService { List> getMouldTypeSimpleList(); + List> getMouldTypeNoStatusSimpleList(); + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeServiceImpl.java index d561d29a..f84cc4e4 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/mouldtype/MouldTypeServiceImpl.java @@ -75,4 +75,11 @@ public class MouldTypeServiceImpl implements MouldTypeService { public List> getMouldTypeSimpleList(){ return mouldTypeMapper.selectSimpleList(); } + + @Override + public List> getMouldTypeNoStatusSimpleList(){ + return mouldTypeMapper.selectNoStatusSimpleList(); + } } + + diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java new file mode 100644 index 00000000..c52d8813 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.plan; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 生产计划 Service 接口 + * + * @author 管理员 + */ +public interface PlanService { + + /** + * 创建生产计划 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createPlan(@Valid PlanSaveReqVO createReqVO); + + /** + * 更新生产计划 + * + * @param updateReqVO 更新信息 + */ + void updatePlan(@Valid PlanSaveReqVO updateReqVO); + + /** + * 删除生产计划 + * + * @param id 编号 + */ + void deletePlan(Long id); + + /** + * 获得生产计划 + * + * @param id 编号 + * @return 生产计划 + */ + PlanDO getPlan(Long id); + + /** + * 获得生产计划分页 + * + * @param pageReqVO 分页查询 + * @return 生产计划分页 + */ + PageResult getPlanPage(PlanPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java new file mode 100644 index 00000000..eabd52ce --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java @@ -0,0 +1,93 @@ +package com.chanko.yunxi.mes.module.heli.service.plan; + +import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; +import com.chanko.yunxi.mes.module.heli.enums.CodeEnum; +import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.text.SimpleDateFormat; +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.PROJECT_PLAN; +import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.STOCK_IN; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 生产计划 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class PlanServiceImpl implements PlanService { + + @Resource + private PlanMapper planMapper; + + @Resource + private SerialNumberService serialNumberService; + + @Override + public Long createPlan(PlanSaveReqVO createReqVO) { + // 插入 + PlanDO plan = BeanUtils.toBean(createReqVO, PlanDO.class); + + // 月度流水号 + SerialNumberDO serialNumberDO = new SerialNumberDO(); + serialNumberDO = serialNumberService.getSerialNumber(PROJECT_PLAN.name(), new SimpleDateFormat("yyyyMM").format(new Date())); + serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1); + + plan.setPlanNo(PROJECT_PLAN.getCode(serialNumberDO.getSerialNumber().toString())); + plan.setChangeNum(0); + planMapper.insert(plan); + // 回写序列记录 + serialNumberService.updateSerialNumber(serialNumberDO); + // 返回 + return plan.getId(); + } + + @Override + public void updatePlan(PlanSaveReqVO updateReqVO) { + // 校验存在 + validatePlanExists(updateReqVO.getId()); + // 更新 + PlanDO updateObj = BeanUtils.toBean(updateReqVO, PlanDO.class); + planMapper.updateById(updateObj); + } + + @Override + public void deletePlan(Long id) { + // 校验存在 + validatePlanExists(id); + // 删除 + planMapper.deleteById(id); + } + + private void validatePlanExists(Long id) { + if (planMapper.selectById(id) == null) { + throw exception(PLAN_NOT_EXISTS); + } + } + + @Override + public PlanDO getPlan(Long id) { + return planMapper.selectById(id); + } + + @Override + public PageResult getPlanPage(PlanPageReqVO pageReqVO) { + return planMapper.selectPage(pageReqVO); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java new file mode 100644 index 00000000..06b9ea71 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.plansub; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 生产计划子项目 Service 接口 + * + * @author 管理员 + */ +public interface PlanSubService { + + /** + * 创建生产计划子项目 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createPlanSub(@Valid PlanSubSaveReqVO createReqVO); + + /** + * 更新生产计划子项目 + * + * @param updateReqVO 更新信息 + */ + void updatePlanSub(@Valid PlanSubSaveReqVO updateReqVO); + + /** + * 删除生产计划子项目 + * + * @param id 编号 + */ + void deletePlanSub(Long id); + + /** + * 获得生产计划子项目 + * + * @param id 编号 + * @return 生产计划子项目 + */ + PlanSubDO getPlanSub(Long id); + + /** + * 获得生产计划子项目分页 + * + * @param pageReqVO 分页查询 + * @return 生产计划子项目分页 + */ + PageResult getPlanSubPage(PlanSubPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java new file mode 100644 index 00000000..b0259406 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.plansub; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.plansub.PlanSubMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 生产计划子项目 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class PlanSubServiceImpl implements PlanSubService { + + @Resource + private PlanSubMapper planSubMapper; + + @Override + public Long createPlanSub(PlanSubSaveReqVO createReqVO) { + // 插入 + PlanSubDO planSub = BeanUtils.toBean(createReqVO, PlanSubDO.class); + planSubMapper.insert(planSub); + // 返回 + return planSub.getId(); + } + + @Override + public void updatePlanSub(PlanSubSaveReqVO updateReqVO) { + // 校验存在 + validatePlanSubExists(updateReqVO.getId()); + // 更新 + PlanSubDO updateObj = BeanUtils.toBean(updateReqVO, PlanSubDO.class); + planSubMapper.updateById(updateObj); + } + + @Override + public void deletePlanSub(Long id) { + // 校验存在 + validatePlanSubExists(id); + // 删除 + planSubMapper.deleteById(id); + } + + private void validatePlanSubExists(Long id) { + if (planSubMapper.selectById(id) == null) { + throw exception(PLAN_SUB_NOT_EXISTS); + } + } + + @Override + public PlanSubDO getPlanSub(Long id) { + return planSubMapper.selectById(id); + } + + @Override + public PageResult getPlanSubPage(PlanSubPageReqVO pageReqVO) { + return planSubMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plan/PlanMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plan/PlanMapper.xml new file mode 100644 index 00000000..6992dd72 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plan/PlanMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plansub/PlanSubMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plansub/PlanSubMapper.xml new file mode 100644 index 00000000..527ab29d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plansub/PlanSubMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/.image/src/api/heli/plan/index.ts b/mes-ui/mes-ui-admin-vue3/.image/src/api/heli/plan/index.ts new file mode 100644 index 00000000..b13a018f --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/.image/src/api/heli/plan/index.ts @@ -0,0 +1,52 @@ +import request from '@/config/axios' + +export interface PlanVO { + id: number + planNo: string + projectId: number + projectOwner: string + hasCraft: number + craftOwner: string + craftStartDate: Date + craftEndDate: Date + craftContent: string + editor: string + editorDate: Date + auditor: string + auditDate: Date + approver: string + approveDate: Date + description: string + status: boolean + changeNum: number +} + +// 查询生产计划分页 +export const getPlanPage = async (params) => { + return await request.get({ url: `/heli/plan/page`, params }) +} + +// 查询生产计划详情 +export const getPlan = async (id: number) => { + return await request.get({ url: `/heli/plan/get?id=` + id }) +} + +// 新增生产计划 +export const createPlan = async (data: PlanVO) => { + return await request.post({ url: `/heli/plan/create`, data }) +} + +// 修改生产计划 +export const updatePlan = async (data: PlanVO) => { + return await request.put({ url: `/heli/plan/update`, data }) +} + +// 删除生产计划 +export const deletePlan = async (id: number) => { + return await request.delete({ url: `/heli/plan/delete?id=` + id }) +} + +// 导出生产计划 Excel +export const exportPlan = async (params) => { + return await request.download({ url: `/heli/plan/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/PlanForm.vue b/mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/PlanForm.vue new file mode 100644 index 00000000..265ee783 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/PlanForm.vue @@ -0,0 +1,206 @@ + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/index.vue b/mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/index.vue new file mode 100644 index 00000000..7c686d79 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/.image/src/views/heli/plan/index.vue @@ -0,0 +1,405 @@ + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/equip/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/equip/index.ts index d5768c97..a8061ced 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/equip/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/equip/index.ts @@ -6,6 +6,15 @@ export interface EquipVO { mouldTypeId: number status: number } +// 查询设备信息全页数据 +export const getNoStatusSimpList = async () => { + return await request.get({ url: `/heli/equip/all-no-status-simples` }) +} + +// 查询设备信息全页数据 +export const getSimpList = async () => { + return await request.get({ url: `/heli/equip/all-simples` }) +} // 查询设备信息分页 export const getEquipPage = async (params) => { diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/mouldtype/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/mouldtype/index.ts index dd43ee4c..2ffe886a 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/mouldtype/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/mouldtype/index.ts @@ -5,7 +5,10 @@ export interface MouldTypeVO { name: string status: number } - +// 查询模具类型全页数据 +export const getNoStatusSimpList = async () => { + return await request.get({ url: `/heli/mould-type/all-no-status-simples` }) +} // 查询模具类型全页数据 export const getSimpList = async () => { return await request.get({ url: `/heli/mould-type/all-simples` }) diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/plan/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/plan/index.ts new file mode 100644 index 00000000..3b30d14b --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/plan/index.ts @@ -0,0 +1,51 @@ +import request from '@/config/axios' + +export interface PlanVO { + id: number + planNo: string + projectId: number + projectOwner: string + hasCraft: boolean + craftOwner: string + craftStartDate: Date + craftEndDate: Date + craftContent: string + editor: string + editorDate: Date + auditor: string + auditDate: Date + approver: string + approveDate: Date + description: string + status: number +} + +// 查询生产计划分页 +export const getPlanPage = async (params) => { + return await request.get({ url: `/heli/plan/page`, params }) +} + +// 查询生产计划详情 +export const getPlan = async (id: number) => { + return await request.get({ url: `/heli/plan/get?id=` + id }) +} + +// 新增生产计划 +export const createPlan = async (data: PlanVO) => { + return await request.post({ url: `/heli/plan/create`, data }) +} + +// 修改生产计划 +export const updatePlan = async (data: PlanVO) => { + return await request.put({ url: `/heli/plan/update`, data }) +} + +// 删除生产计划 +export const deletePlan = async (id: number) => { + return await request.delete({ url: `/heli/plan/delete?id=` + id }) +} + +// 导出生产计划 Excel +export const exportPlan = async (params) => { + return await request.download({ url: `/heli/plan/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts new file mode 100644 index 00000000..e1243b06 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +export interface PlanSubVO { + id: number + projectPlanId: number + projectId: number + projectSubId: number + mouldId: number + equipId: number + blankDate: Date + blankOwner: string + twoDimDate: Date + twoDimOwner: string + threeDimDate: Date + threeDimOwner: string +} + +// 查询生产计划子项目分页 +export const getPlanSubPage = async (params) => { + return await request.get({ url: `/heli/plan-sub/page`, params }) +} + +// 查询生产计划子项目详情 +export const getPlanSub = async (id: number) => { + return await request.get({ url: `/heli/plan-sub/get?id=` + id }) +} + +// 新增生产计划子项目 +export const createPlanSub = async (data: PlanSubVO) => { + return await request.post({ url: `/heli/plan-sub/create`, data }) +} + +// 修改生产计划子项目 +export const updatePlanSub = async (data: PlanSubVO) => { + return await request.put({ url: `/heli/plan-sub/update`, data }) +} + +// 删除生产计划子项目 +export const deletePlanSub = async (id: number) => { + return await request.delete({ url: `/heli/plan-sub/delete?id=` + id }) +} + +// 导出生产计划子项目 Excel +export const exportPlanSub = async (params) => { + return await request.download({ url: `/heli/plan-sub/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/src/api/heli/plansub/index.ts b/mes-ui/mes-ui-admin-vue3/src/src/api/heli/plansub/index.ts new file mode 100644 index 00000000..e1243b06 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/src/api/heli/plansub/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +export interface PlanSubVO { + id: number + projectPlanId: number + projectId: number + projectSubId: number + mouldId: number + equipId: number + blankDate: Date + blankOwner: string + twoDimDate: Date + twoDimOwner: string + threeDimDate: Date + threeDimOwner: string +} + +// 查询生产计划子项目分页 +export const getPlanSubPage = async (params) => { + return await request.get({ url: `/heli/plan-sub/page`, params }) +} + +// 查询生产计划子项目详情 +export const getPlanSub = async (id: number) => { + return await request.get({ url: `/heli/plan-sub/get?id=` + id }) +} + +// 新增生产计划子项目 +export const createPlanSub = async (data: PlanSubVO) => { + return await request.post({ url: `/heli/plan-sub/create`, data }) +} + +// 修改生产计划子项目 +export const updatePlanSub = async (data: PlanSubVO) => { + return await request.put({ url: `/heli/plan-sub/update`, data }) +} + +// 删除生产计划子项目 +export const deletePlanSub = async (id: number) => { + return await request.delete({ url: `/heli/plan-sub/delete?id=` + id }) +} + +// 导出生产计划子项目 Excel +export const exportPlanSub = async (params) => { + return await request.download({ url: `/heli/plan-sub/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/PlanSubForm.vue b/mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/PlanSubForm.vue new file mode 100644 index 00000000..724ba15a --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/PlanSubForm.vue @@ -0,0 +1,155 @@ + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/index.vue b/mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/index.vue new file mode 100644 index 00000000..e24c5349 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/src/views/heli/plansub/index.vue @@ -0,0 +1,330 @@ + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts index f401920c..7872ca21 100644 --- a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts +++ b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts @@ -240,4 +240,6 @@ export enum DICT_TYPE { HELI_DELIVER_ORDER_STATUS = 'heli_deliver_order_status', // 发货单状态 HELI_DELIVER_MODE = 'heli_deliver_mode', // 发货方式 HELI_DELIVER_MATERIAL_TYPE = 'heli_deliver_material_type', // 发货物料类型 + HELI_PROJECT_PLAN_STATUS = 'heli_project_plan_status',//生产计划状态 + HELI_CRAFT = 'heli_craft',//工艺流程 } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/PlanForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/PlanForm.vue new file mode 100644 index 00000000..a054a45c --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/PlanForm.vue @@ -0,0 +1,207 @@ + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue new file mode 100644 index 00000000..59a2056f --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue @@ -0,0 +1,337 @@ + + + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue new file mode 100644 index 00000000..df90386c --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue @@ -0,0 +1,631 @@ + + + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue new file mode 100644 index 00000000..e3f728f3 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue @@ -0,0 +1,632 @@ + + + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/index.vue new file mode 100644 index 00000000..b318fe2b --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/index.vue @@ -0,0 +1,249 @@ + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/planprint.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/planprint.vue new file mode 100644 index 00000000..206adfdc --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/planprint.vue @@ -0,0 +1,470 @@ + + + + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/projectOrderDialog.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/projectOrderDialog.vue new file mode 100644 index 00000000..10932690 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/projectOrderDialog.vue @@ -0,0 +1,216 @@ + + + + diff --git a/sql/v1.2.0/1.structure.sql b/sql/v1.2.0/1.structure.sql index ffabae70..0329ca12 100644 --- a/sql/v1.2.0/1.structure.sql +++ b/sql/v1.2.0/1.structure.sql @@ -120,11 +120,11 @@ select 0 AS `deleted`,`lg`.`id` AS `id`,`lg`.`creator` AS `creator`,`lg`.`create (case when (isnull(`mat`.`brand`) = TRUE) then '' else `mat`.`brand` end) AS `mat_brand`, (select `system_dict_data`.`label` from `system_dict_data` where ((`system_dict_data`.`dict_type` = 'heli_material_unit') and (`system_dict_data`.`value` = `mat`.`unit`))) AS `mat_unit`, `st`.`stock_no` AS `stock_no`,`st`.`stock_type` AS `stock_type`, - (case when (`st`.`stock_type` = 1) then (select `system_dict_data`.`label` from `system_dict_data` where ((`system_dict_data`.`dict_type` = 'heli_storage_in_type') and (`system_dict_data`.`value` = `st`.`stock_in_type`))) else (select `system_dict_data`.`label` from `system_dict_data` where ((`system_dict_data`.`dict_type` = 'heli_storage_out_type') and (`system_dict_data`.`value` = `st`.`stock_in_type`))) end) AS `stock_type_name`,(case when (isnull(`st`.`header_no`) = TRUE) then '' else `st`.`header_no` end) AS `header_no`, - `wh`.`wh_name` AS `wh_name`,`rg`.`rg_name` AS `rg_name`,`pn`.`pn_name` AS `pn_name`, - (case when (isnull(`lg`.`lot_no`) = 1) then '' else `lg`.`lot_no` end) AS `lot_no`,(case when ((`st`.`stock_type` = 1) and (`lg`.`status` = 2)) then `lg`.`storage_ok_qty` when ((`st`.`stock_type` = 1) and (`lg`.`status` = 3)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 2)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 3)) then `lg`.`storage_ok_qty` else `lg`.`storage_ok_qty` end) AS `storage_ok_qty` -from (((((`wms_storage_log` `lg` - left join `wms_storage` `st` on((`lg`.`stock_id` = `st`.`id`))) + (case when (`st`.`stock_type` = 1) then (select `system_dict_data`.`label` from `system_dict_data` where ((`system_dict_data`.`dict_type` = 'heli_storage_in_type') and (`system_dict_data`.`value` = `st`.`stock_in_type`))) else (select `system_dict_data`.`label` from `system_dict_data` where ((`system_dict_data`.`dict_type` = 'heli_storage_out_type') and (`system_dict_data`.`value` = `st`.`stock_in_type`))) end) AS `stock_type_name`, + (case when (isnull(`st`.`header_no`) = TRUE) then '' else `st`.`header_no` end) AS `header_no`,`wh`.`wh_name` AS `wh_name`,`rg`.`rg_name` AS `rg_name`,`pn`.`pn_name` AS `pn_name`, + (case when (isnull(`lg`.`lot_no`) = 1) then '' else `lg`.`lot_no` end) AS `lot_no`, + (case when ((`st`.`stock_type` = 1) and (`lg`.`status` = 2)) then `lg`.`storage_ok_qty` when ((`st`.`stock_type` = 1) and (`lg`.`status` = 3)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 2)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 3)) then `lg`.`storage_ok_qty` else `lg`.`storage_ok_qty` end) AS `storage_ok_qty` +from (((((`wms_storage_log` `lg` left join `wms_storage` `st` on((`lg`.`stock_id` = `st`.`id`))) left join `base_material` `mat` on((`lg`.`mat_id` = `mat`.`id`))) left join `wms_wh` `wh` on((`lg`.`wh_id` = `wh`.`id`))) left join `wms_rg` `rg` on((`lg`.`rg_id` = `rg`.`id`))) @@ -133,41 +133,41 @@ where ((`st`.`deleted` = 0) and (`mat`.`deleted` = 0) and (`wh`.`deleted` = 0) a CREATE OR REPLACE VIEW v_storage_material_now AS select `t`.`deleted` AS `deleted`,`t`.`id` AS `id`,`t`.`creator` AS `creator`,`t`.`updater` AS `updater`,cast('2000-01-01 00:00' as date) AS `create_time`,cast('2000-01-01 00:00' as date) AS `update_time`, - `t`.`tenant_id` AS `tenant_id`,`t`.`mat_code` AS `mat_code`,`t`.`mat_name` AS `mat_name`, - `t`.`mat_type` AS `mat_type`,`t`.`mat_spec` AS `mat_spec`,`t`.`mat_unit` AS `mat_unit`,`t`.`mat_brand` AS `mat_brand`,`t`.`wh_id` AS `wh_id`,`t`.`wh_name` AS `wh_name`,`t`.`rg_id` AS `rg_id`, - `t`.`rg_name` AS `rg_name`,`t`.`pn_id` AS `pn_id`,`t`.`pn_name` AS `pn_name`,'' AS `lot_no`,`t`.`short_name` AS `short_name`,sum(`t`.`storage_ok_qty`) AS `storage_ok_qty` + `t`.`tenant_id` AS `tenant_id`,`t`.`mat_code` AS `mat_code`,`t`.`mat_name` AS `mat_name`,`t`.`mat_type` AS `mat_type`,`t`.`mat_spec` AS `mat_spec`,`t`.`mat_unit` AS `mat_unit`, + `t`.`mat_brand` AS `mat_brand`,`t`.`wh_id` AS `wh_id`,`t`.`wh_name` AS `wh_name`,`t`.`rg_id` AS `rg_id`,`t`.`rg_name` AS `rg_name`,`t`.`pn_id` AS `pn_id`,`t`.`pn_name` AS `pn_name`, + '' AS `lot_no`,`t`.`short_name` AS `short_name`,sum(`t`.`storage_ok_qty`) AS `storage_ok_qty` from ( - select 0 AS `deleted`,`mat`.`id` AS `id`,`mat`.`creator` AS `creator`,`mat`.`updater` AS `updater`,`mat`.`tenant_id` AS `tenant_id`,`mat`.`code` AS `mat_code`,`mat`.`name` AS `mat_name`, - (select `mes-heli`.`system_dict_data`.`label` from `mes-heli`.`system_dict_data` where ((`mes-heli`.`system_dict_data`.`dict_type` = 'heli_material_type') and (`mes-heli`.`system_dict_data`.`value` = `mat`.`material_type`))) AS `mat_type`, - (case when (isnull(`mat`.`short_name`) = TRUE) then '' else `mat`.`short_name` end) AS `short_name`, - (case when (isnull(`mat`.`spec`) = TRUE) then '' else `mat`.`spec` end) AS `mat_spec`, - (case when (isnull(`mat`.`brand`) = TRUE) then '' else `mat`.`brand` end) AS `mat_brand`, - (select `mes-heli`.`system_dict_data`.`label` from `mes-heli`.`system_dict_data` where ((`mes-heli`.`system_dict_data`.`dict_type` = 'heli_material_unit') and (`mes-heli`.`system_dict_data`.`value` = `mat`.`unit`))) AS `mat_unit`, - `wh`.`id` AS `wh_id`,`wh`.`wh_name` AS `wh_name`,`rg`.`id` AS `rg_id`,`rg`.`rg_name` AS `rg_name`,`pn`.`id` AS `pn_id`,`pn`.`pn_name` AS `pn_name`, - (case when (isnull(`lg`.`lot_no`) = 1) then '' else `lg`.`lot_no` end) AS `lot_no`, - (case when ((`st`.`stock_type` = 1) and (`lg`.`status` = 2)) then `lg`.`storage_ok_qty` when ((`st`.`stock_type` = 1) and (`lg`.`status` = 3)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 2)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 3)) then `lg`.`storage_ok_qty` else `lg`.`storage_ok_qty` end) AS `storage_ok_qty` - from (((((`mes-heli`.`wms_storage_log` `lg` - left join `mes-heli`.`wms_storage` `st` on((`lg`.`stock_id` = `st`.`id`))) - left join `mes-heli`.`base_material` `mat` on((`lg`.`mat_id` = `mat`.`id`))) - left join `mes-heli`.`wms_wh` `wh` on((`lg`.`wh_id` = `wh`.`id`))) - left join `mes-heli`.`wms_rg` `rg` on((`lg`.`rg_id` = `rg`.`id`))) - left join `mes-heli`.`wms_pn` `pn` on((`lg`.`pn_id` = `pn`.`id`))) - where ((`st`.`deleted` = 0) and (`mat`.`deleted` = 0) and (`wh`.`deleted` = 0) and (`rg`.`deleted` = 0) and (`pn`.`deleted` = 0))) `t` where `t`.`storage_ok_qty` > 0 -group by `t`.`deleted`,`t`.`id`,`t`.`creator`,`t`.`updater`,`t`.`tenant_id`,`t`.`mat_code`,`t`.`mat_name`,`t`.`mat_type`,`t`.`mat_spec`,`t`.`mat_unit`,`t`.`mat_brand`,`t`.`wh_id`,`t`.`wh_name`,`t`.`rg_id`,`t`.`rg_name`,`t`.`pn_id`,`t`.`pn_name`,`t`.`short_name` + select 0 AS `deleted`,`mat`.`id` AS `id`,`mat`.`creator` AS `creator`,`mat`.`updater` AS `updater`,`mat`.`tenant_id` AS `tenant_id`,`mat`.`code` AS `mat_code`,`mat`.`name` AS `mat_name`, + (select `mes-heli`.`system_dict_data`.`label` from `mes-heli`.`system_dict_data` where ((`mes-heli`.`system_dict_data`.`dict_type` = 'heli_material_type') and (`mes-heli`.`system_dict_data`.`value` = `mat`.`material_type`))) AS `mat_type`, + (case when (isnull(`mat`.`short_name`) = TRUE) then '' else `mat`.`short_name` end) AS `short_name`, + (case when (isnull(`mat`.`spec`) = TRUE) then '' else `mat`.`spec` end) AS `mat_spec`, + (case when (isnull(`mat`.`brand`) = TRUE) then '' else `mat`.`brand` end) AS `mat_brand`, + (select `mes-heli`.`system_dict_data`.`label` from `mes-heli`.`system_dict_data` where ((`mes-heli`.`system_dict_data`.`dict_type` = 'heli_material_unit') and (`mes-heli`.`system_dict_data`.`value` = `mat`.`unit`))) AS `mat_unit`, + `wh`.`id` AS `wh_id`,`wh`.`wh_name` AS `wh_name`,`rg`.`id` AS `rg_id`,`rg`.`rg_name` AS `rg_name`,`pn`.`id` AS `pn_id`,`pn`.`pn_name` AS `pn_name`, + (case when (isnull(`lg`.`lot_no`) = 1) then '' else `lg`.`lot_no` end) AS `lot_no`,(case when ((`st`.`stock_type` = 1) and (`lg`.`status` = 2)) then `lg`.`storage_ok_qty` when ((`st`.`stock_type` = 1) and (`lg`.`status` = 3)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 2)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 3)) then `lg`.`storage_ok_qty` else `lg`.`storage_ok_qty` end) AS `storage_ok_qty` + from (((((`mes-heli`.`wms_storage_log` `lg` + left join `mes-heli`.`wms_storage` `st` on((`lg`.`stock_id` = `st`.`id`))) + left join `mes-heli`.`base_material` `mat` on((`lg`.`mat_id` = `mat`.`id`))) + left join `mes-heli`.`wms_wh` `wh` on((`lg`.`wh_id` = `wh`.`id`))) + left join `mes-heli`.`wms_rg` `rg` on((`lg`.`rg_id` = `rg`.`id`))) + left join `mes-heli`.`wms_pn` `pn` on((`lg`.`pn_id` = `pn`.`id`))) + where ((`st`.`deleted` = 0) and (`mat`.`deleted` = 0) and (`mat`.`status` = 1) and (`wh`.`deleted` = 0) and (`wh`.`wh_status` = 1) and (`rg`.`deleted` = 0) and (`rg`.`rg_status` = 1) and (`pn`.`deleted` = 0) and (`pn`.`pn_status` = 1))) `t` +group by `t`.`deleted`,`t`.`id`,`t`.`creator`,`t`.`updater`,`t`.`tenant_id`,`t`.`mat_code`,`t`.`mat_name`,`t`.`mat_type`,`t`.`mat_spec`,`t`.`mat_unit`,`t`.`mat_brand`,`t`.`wh_id`,`t`.`wh_name`,`t`.`rg_id`,`t`.`rg_name`,`t`.`pn_id`,`t`.`pn_name`,`t`.`short_name`; CREATE OR REPLACE VIEW v_storage_material_amount AS -select `t`.`deleted` AS `deleted`,`t`.`id` AS `mat_id`,`t`.`creator` AS `creator`,`t`.`updater` AS `updater`,`t`.`tenant_id` AS `tenant_id`,`t`.`mat_code` AS `mat_code`,`t`.`mat_name` AS `mat_name`, - `t`.`material_type` AS `material_type`,`t`.`spec` AS `spec`,`t`.`unit` AS `unit`,`t`.`wh_id` AS `wh_id`,`t`.`rg_id` AS `rg_id`,`t`.`pn_id` AS `pn_id`,`t`.`short_name` AS `short_name`, - 0 AS `storage_ok_qty`,sum(`t`.`storage_ok_qty`) AS `mat_rest` +select `t`.`deleted` AS `deleted`,`t`.`id` AS `mat_id`,`t`.`creator` AS `creator`,`t`.`updater` AS `updater`,`t`.`tenant_id` AS `tenant_id`, + `t`.`mat_code` AS `mat_code`,`t`.`mat_name` AS `mat_name`,`t`.`material_type` AS `material_type`,`t`.`spec` AS `spec`,`t`.`unit` AS `unit`, + `t`.`wh_id` AS `wh_id`,`t`.`rg_id` AS `rg_id`,`t`.`pn_id` AS `pn_id`,`t`.`short_name` AS `short_name`,'' AS `storage_ok_qty`, + sum(`t`.`storage_ok_qty`) AS `mat_rest` from ( - select 0 AS `deleted`,`mat`.`id` AS `id`,`mat`.`creator` AS `creator`,`mat`.`updater` AS `updater`,`mat`.`tenant_id` AS `tenant_id`,`mat`.`code` AS `mat_code`,`mat`.`name` AS `mat_name`, - `mat`.`material_type` AS `material_type`,(case when (isnull(`mat`.`short_name`) = TRUE) then '' else `mat`.`short_name` end) AS `short_name`, - `mat`.`spec` AS `spec`,`mat`.`unit` AS `unit`,`lg`.`wh_id` AS `wh_id`,`lg`.`rg_id` AS `rg_id`,`lg`.`pn_id` AS `pn_id`, - (case when (isnull(`lg`.`lot_no`) = 1) then '' else `lg`.`lot_no` end) AS `lot_no`, - (case when ((`st`.`stock_type` = 1) and (`lg`.`status` = 2)) then `lg`.`storage_ok_qty` when ((`st`.`stock_type` = 1) and (`lg`.`status` = 3)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 2)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 3)) then `lg`.`storage_ok_qty` else `lg`.`storage_ok_qty` end) AS `storage_ok_qty` - from ((`mes-heli`.`wms_storage_log` `lg` - left join `mes-heli`.`wms_storage` `st` on((`lg`.`stock_id` = `st`.`id`))) - left join `mes-heli`.`base_material` `mat` on((`lg`.`mat_id` = `mat`.`id`))) - where ((`st`.`deleted` = 0) and (`mat`.`deleted` = 0) and (`lg`.`deleted` = 0)) - ) `t` + select 0 AS `deleted`,`mat`.`id` AS `id`,`mat`.`creator` AS `creator`,`mat`.`updater` AS `updater`,`mat`.`tenant_id` AS `tenant_id`, + `mat`.`code` AS `mat_code`,`mat`.`name` AS `mat_name`,`mat`.`material_type` AS `material_type`, + (case when (isnull(`mat`.`short_name`) = TRUE) then '' else `mat`.`short_name` end) AS `short_name`,`mat`.`spec` AS `spec`, + `mat`.`unit` AS `unit`,`lg`.`wh_id` AS `wh_id`,`lg`.`rg_id` AS `rg_id`,`lg`.`pn_id` AS `pn_id`, + (case when (isnull(`lg`.`lot_no`) = 1) then '' else `lg`.`lot_no` end) AS `lot_no`, + (case when ((`st`.`stock_type` = 1) and (`lg`.`status` = 2)) then `lg`.`storage_ok_qty` when ((`st`.`stock_type` = 1) and (`lg`.`status` = 3)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 2)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 3)) then `lg`.`storage_ok_qty` else `lg`.`storage_ok_qty` end) AS `storage_ok_qty` + from ((`mes-heli`.`wms_storage_log` `lg` + left join `mes-heli`.`wms_storage` `st` on((`lg`.`stock_id` = `st`.`id`))) + left join `mes-heli`.`base_material` `mat` on((`lg`.`mat_id` = `mat`.`id`))) + where ((`st`.`deleted` = 0) and (`mat`.`deleted` = 0) and (`lg`.`deleted` = 0))) `t` group by `t`.`deleted`,`t`.`id`,`t`.`creator`,`t`.`updater`,`t`.`tenant_id`,`t`.`mat_code`,`t`.`mat_name`,`t`.`material_type`,`t`.`spec`,`t`.`unit`,`t`.`wh_id`,`t`.`rg_id`,`t`.`pn_id`,`t`.`short_name`; diff --git a/sql/v1.3.0/1.structure.sql b/sql/v1.3.0/1.structure.sql index a3740d8d..0e8c4f5c 100644 --- a/sql/v1.3.0/1.structure.sql +++ b/sql/v1.3.0/1.structure.sql @@ -71,27 +71,54 @@ ALTER TABLE project_deliver_order MODIFY COLUMN `deliver_mode` CHAR ( 1 ) COMMEN ALTER TABLE wms_storage ADD COLUMN `v_mat_name` varchar(128) COMMENT '虚拟物料名称'; +DROP TABLE IF EXISTS `project_plan`; +CREATE TABLE `project_plan` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增字段,唯一', + `plan_no` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '计划单号', + `project_id` bigint(20) NOT NULL COMMENT '项目id', + `project_owner` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '项目负责人', + `has_craft` tinyint(1) DEFAULT NULL COMMENT '是否需要工艺:1表示需要,0表示不需要', + `craft_owner` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '工艺负责人', + `craft_start_date` datetime DEFAULT NULL COMMENT '工艺开始日期', + `craft_end_date` datetime DEFAULT NULL COMMENT '工艺结束日期', + `craft_content` varchar(1024) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '工艺流程数组信息[{''id'':1,''sdate'':'''',''edate'':'''',''owner'':'''',''description'':''''}]', + `editor` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '编辑人', + `editor_date` datetime DEFAULT NULL COMMENT '编辑日期', + `auditor` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '审核人', + `audit_date` datetime DEFAULT NULL COMMENT '审核日期', + `approver` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '批准人', + `approve_date` datetime DEFAULT NULL COMMENT '批准日期', + `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + `status` tinyint(1) DEFAULT '1' COMMENT '状态,1未开始,2生产中,3已完成,4已终止 ,默认是1', + `change_num` int(11) DEFAULT NULL COMMENT '项目变更次数', + `creator` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='生产计划表'; -CREATE OR REPLACE VIEW v_storage_material_now AS -select `t`.`deleted` AS `deleted`,`t`.`id` AS `id`,`t`.`creator` AS `creator`,`t`.`updater` AS `updater`,cast('2000-01-01 00:00' as date) AS `create_time`,cast('2000-01-01 00:00' as date) AS `update_time`, - `t`.`tenant_id` AS `tenant_id`,`t`.`mat_code` AS `mat_code`,`t`.`mat_name` AS `mat_name`, - `t`.`mat_type` AS `mat_type`,`t`.`mat_spec` AS `mat_spec`,`t`.`mat_unit` AS `mat_unit`,`t`.`mat_brand` AS `mat_brand`,`t`.`wh_id` AS `wh_id`,`t`.`wh_name` AS `wh_name`,`t`.`rg_id` AS `rg_id`, - `t`.`rg_name` AS `rg_name`,`t`.`pn_id` AS `pn_id`,`t`.`pn_name` AS `pn_name`,'' AS `lot_no`,`t`.`short_name` AS `short_name`,sum(`t`.`storage_ok_qty`) AS `storage_ok_qty` -from ( - select 0 AS `deleted`,`mat`.`id` AS `id`,`mat`.`creator` AS `creator`,`mat`.`updater` AS `updater`,`mat`.`tenant_id` AS `tenant_id`,`mat`.`code` AS `mat_code`,`mat`.`name` AS `mat_name`, - (select `mes-heli`.`system_dict_data`.`label` from `mes-heli`.`system_dict_data` where ((`mes-heli`.`system_dict_data`.`dict_type` = 'heli_material_type') and (`mes-heli`.`system_dict_data`.`value` = `mat`.`material_type`))) AS `mat_type`, - (case when (isnull(`mat`.`short_name`) = TRUE) then '' else `mat`.`short_name` end) AS `short_name`, - (case when (isnull(`mat`.`spec`) = TRUE) then '' else `mat`.`spec` end) AS `mat_spec`, - (case when (isnull(`mat`.`brand`) = TRUE) then '' else `mat`.`brand` end) AS `mat_brand`, - (select `mes-heli`.`system_dict_data`.`label` from `mes-heli`.`system_dict_data` where ((`mes-heli`.`system_dict_data`.`dict_type` = 'heli_material_unit') and (`mes-heli`.`system_dict_data`.`value` = `mat`.`unit`))) AS `mat_unit`, - `wh`.`id` AS `wh_id`,`wh`.`wh_name` AS `wh_name`,`rg`.`id` AS `rg_id`,`rg`.`rg_name` AS `rg_name`,`pn`.`id` AS `pn_id`,`pn`.`pn_name` AS `pn_name`, - (case when (isnull(`lg`.`lot_no`) = 1) then '' else `lg`.`lot_no` end) AS `lot_no`, - (case when ((`st`.`stock_type` = 1) and (`lg`.`status` = 2)) then `lg`.`storage_ok_qty` when ((`st`.`stock_type` = 1) and (`lg`.`status` = 3)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 2)) then (-(1) * `lg`.`storage_ok_qty`) when ((`st`.`stock_type` = 2) and (`lg`.`status` = 3)) then `lg`.`storage_ok_qty` else `lg`.`storage_ok_qty` end) AS `storage_ok_qty` - from (((((`mes-heli`.`wms_storage_log` `lg` - left join `mes-heli`.`wms_storage` `st` on((`lg`.`stock_id` = `st`.`id`))) - left join `mes-heli`.`base_material` `mat` on((`lg`.`mat_id` = `mat`.`id`))) - left join `mes-heli`.`wms_wh` `wh` on((`lg`.`wh_id` = `wh`.`id`))) - left join `mes-heli`.`wms_rg` `rg` on((`lg`.`rg_id` = `rg`.`id`))) - left join `mes-heli`.`wms_pn` `pn` on((`lg`.`pn_id` = `pn`.`id`))) - where ((`st`.`deleted` = 0) and (`mat`.`deleted` = 0) and (`wh`.`deleted` = 0) and (`rg`.`deleted` = 0) and (`pn`.`deleted` = 0))) `t` -group by `t`.`deleted`,`t`.`id`,`t`.`creator`,`t`.`updater`,`t`.`tenant_id`,`t`.`mat_code`,`t`.`mat_name`,`t`.`mat_type`,`t`.`mat_spec`,`t`.`mat_unit`,`t`.`mat_brand`,`t`.`wh_id`,`t`.`wh_name`,`t`.`rg_id`,`t`.`rg_name`,`t`.`pn_id`,`t`.`pn_name`,`t`.`short_name` +DROP TABLE IF EXISTS `project_plan_sub`; +CREATE TABLE `project_plan_sub` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增字段,唯一', + `project_plan_id` bigint(20) NOT NULL COMMENT '计划id', + `project_id` bigint(20) NOT NULL COMMENT '项目id', + `project_sub_id` bigint(20) DEFAULT NULL COMMENT '子项目id', + `mould_id` bigint(20) DEFAULT NULL COMMENT '模具类型id', + `equip_id` bigint(20) DEFAULT NULL COMMENT '设备id', + `blank_date` datetime DEFAULT NULL COMMENT '毛坯结束日期', + `blank_owner` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '毛坯负责人', + `two_dim_date` datetime DEFAULT NULL COMMENT '2D结束日期', + `two_dim_owner` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '2D负责人', + `three_dim_date` datetime DEFAULT NULL COMMENT '3D结束日期', + `three_dim_owner` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '3D负责人', + `creator` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='生产计划子项目表'; \ No newline at end of file From 1cbc705d7c226c7ad2ed1846d5137ff1a781ec41 Mon Sep 17 00:00:00 2001 From: siontion Date: Sat, 17 Feb 2024 20:43:10 +0800 Subject: [PATCH 002/169] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生产计划 状态修改 --- .../module/heli/controller/admin/plan/vo/PlanRespVO.java | 2 +- mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue | 9 ++++++--- mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue | 9 ++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java index 5b501712..0c4a5a38 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanRespVO.java @@ -122,7 +122,7 @@ public class PlanRespVO { @Schema(description = "状态,1未开始,2生产中,3已完成,4已终止 ,默认是1", example = "2") @ExcelProperty("状态,1未开始,2生产中,3已完成,4已终止 ,默认是1") - private Boolean status; + private Integer status; @Schema(description = "项目变更次数") @ExcelProperty("项目变更次数") diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue index df90386c..a70da8eb 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue @@ -230,8 +230,11 @@ - - + + + + @@ -458,7 +461,7 @@ const formData = ref({ approver: undefined, approveDate: undefined, description: undefined, - status: 1, + status: undefined, createTime: undefined, operateLogs: [], projectOrderSubs: [], diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue index e3f728f3..f55f4eb1 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue @@ -230,8 +230,11 @@ - - + + + + @@ -459,7 +462,7 @@ const formData = ref({ approver: undefined, approveDate: undefined, description: undefined, - status: 1, + status: undefined, createTime: undefined, operateLogs: [], projectOrderSubs: [], From 5db437404a42cc241bcee9ad251abe3a3179d221 Mon Sep 17 00:00:00 2001 From: qiuhongwu Date: Sun, 18 Feb 2024 09:34:38 +0800 Subject: [PATCH 003/169] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E7=8A=B6=E6=80=81=20?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mes-ui/mes-ui-admin-vue3/src/styles/cus.scss | 1 + .../mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss b/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss index f5dd0d61..6591c168 100644 --- a/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss +++ b/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss @@ -195,6 +195,7 @@ .iBack { background-color: #FFEDED; color: #E62412; + border:#FFEDED; } //已变更 diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue index eb4039f9..720a1aa4 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue @@ -45,7 +45,7 @@ - + From af425f41f95db76b8fc064e3ed52685a8aeb09b0 Mon Sep 17 00:00:00 2001 From: siontion Date: Sun, 18 Feb 2024 12:59:48 +0800 Subject: [PATCH 004/169] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=20?= =?UTF-8?q?=E5=AD=90=E9=A1=B9=E7=9B=AE=E6=95=B0=E6=8D=AE=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生产计划 子项目数据编辑 --- .../admin/plansub/vo/PlanSubRespVO.java | 9 ++ .../admin/plansub/vo/PlanSubSaveReqVO.java | 6 ++ .../dal/dataobject/plansub/PlanSubDO.java | 8 ++ .../src/api/heli/plansub/index.ts | 94 ++++++++++--------- .../src/views/heli/plan/add.vue | 5 +- .../src/views/heli/plan/detail.vue | 21 +++-- .../src/views/heli/plan/edit.vue | 43 ++++++--- sql/v1.3.0/1.structure.sql | 4 +- 8 files changed, 123 insertions(+), 67 deletions(-) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java index d7afd49d..623aefeb 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java @@ -29,6 +29,14 @@ public class PlanSubRespVO { @ExcelProperty("子项目id") private Long projectSubId; + @Schema(description = "子项目简称") + @ExcelProperty("子项目简称") + private String projectSubShortName; + + @Schema(description = "子项目编码") + @ExcelProperty("子项目编码") + private String projectSubCode; + @Schema(description = "模具类型id") @ExcelProperty("模具类型id") private Long mouldId; @@ -65,4 +73,5 @@ public class PlanSubRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; + } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java index 62196485..5ae1a8a2 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubSaveReqVO.java @@ -25,6 +25,12 @@ public class PlanSubSaveReqVO { @Schema(description = "子项目id") private Long projectSubId; + @Schema(description = "子项目简称") + private String projectSubShortName; + + @Schema(description = "子项目编号") + private String projectSubCode; + @Schema(description = "模具类型id") private Long mouldId; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java index 4163c148..deca1408 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java @@ -74,5 +74,13 @@ public class PlanSubDO extends BaseDO { * 3D负责人 */ private String threeDimOwner; + /** + * 子项目简称 + */ + private String projectSubShortName; + /** + * 子项目编码 + */ + private String projectSubCode; } \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts index e1243b06..0b882508 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts @@ -1,46 +1,48 @@ -import request from '@/config/axios' - -export interface PlanSubVO { - id: number - projectPlanId: number - projectId: number - projectSubId: number - mouldId: number - equipId: number - blankDate: Date - blankOwner: string - twoDimDate: Date - twoDimOwner: string - threeDimDate: Date - threeDimOwner: string -} - -// 查询生产计划子项目分页 -export const getPlanSubPage = async (params) => { - return await request.get({ url: `/heli/plan-sub/page`, params }) -} - -// 查询生产计划子项目详情 -export const getPlanSub = async (id: number) => { - return await request.get({ url: `/heli/plan-sub/get?id=` + id }) -} - -// 新增生产计划子项目 -export const createPlanSub = async (data: PlanSubVO) => { - return await request.post({ url: `/heli/plan-sub/create`, data }) -} - -// 修改生产计划子项目 -export const updatePlanSub = async (data: PlanSubVO) => { - return await request.put({ url: `/heli/plan-sub/update`, data }) -} - -// 删除生产计划子项目 -export const deletePlanSub = async (id: number) => { - return await request.delete({ url: `/heli/plan-sub/delete?id=` + id }) -} - -// 导出生产计划子项目 Excel -export const exportPlanSub = async (params) => { - return await request.download({ url: `/heli/plan-sub/export-excel`, params }) -} \ No newline at end of file +import request from '@/config/axios' + +export interface PlanSubVO { + id: number + projectPlanId: number + projectId: number + projectSubId: number + projectSubShortName: string + projectSubCode: string + mouldId: number + equipId: number + blankDate: Date + blankOwner: string + twoDimDate: Date + twoDimOwner: string + threeDimDate: Date + threeDimOwner: string +} + +// 查询生产计划子项目分页 +export const getPlanSubPage = async (params) => { + return await request.get({ url: `/heli/plan-sub/page`, params }) +} + +// 查询生产计划子项目详情 +export const getPlanSub = async (id: number) => { + return await request.get({ url: `/heli/plan-sub/get?id=` + id }) +} + +// 新增生产计划子项目 +export const createPlanSub = async (data: PlanSubVO) => { + return await request.post({ url: `/heli/plan-sub/create`, data }) +} + +// 修改生产计划子项目 +export const updatePlanSub = async (data: PlanSubVO) => { + return await request.put({ url: `/heli/plan-sub/update`, data }) +} + +// 删除生产计划子项目 +export const deletePlanSub = async (id: number) => { + return await request.delete({ url: `/heli/plan-sub/delete?id=` + id }) +} + +// 导出生产计划子项目 Excel +export const exportPlanSub = async (params) => { + return await request.download({ url: `/heli/plan-sub/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue index 59a2056f..5ff1a534 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/add.vue @@ -256,7 +256,7 @@ const formData = ref({ id: undefined, projectId: undefined, projectOwner:undefined, - hasCraft:undefined, + hasCraft:1, craftOwner:undefined, craftStartTime:undefined, craftEndTime:undefined, @@ -305,9 +305,8 @@ const submitForm = async () => { var planId = await PlanApi.createPlan(data) message.success(t('common.createSuccess')) - dialogVisible.value = false // 发送操作成功的事件 - emit('success') + //emit('success') router.push({ path: '/plan/edit',query: { id: planId }}) } finally { formLoading.value = false diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue index a70da8eb..8f37dc8b 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/detail.vue @@ -250,10 +250,17 @@ - - - - + + + + + + + - +