近期更新
This commit is contained in:
parent
ae9305a150
commit
ea8dcc3300
@ -66,6 +66,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode STORAGE_CHECK_MAT_NOT_EXISTS = new ErrorCode(1_003_008, "盘点物料不存在");
|
||||
ErrorCode BEFORE_STORAGE_NOT_EXISTS = new ErrorCode(1_003_009, "物料原仓库查询错误");
|
||||
ErrorCode STORAGE_IN_NOT_EXISTS = new ErrorCode(1_003_010, "入库单不存在");
|
||||
ErrorCode PLAN_SUB_DETAIL_NOT_EXISTS = new ErrorCode(1_003_100, "生产计划子项目设计时间明细不存在");
|
||||
ErrorCode STORAGE_IN_DETAIL_NOT_EXISTS = new ErrorCode(1_003_011, "入库单明细不存在");
|
||||
ErrorCode STORAGE_INVENTORY_NOT_EXISTS = new ErrorCode(1_003_012, "库存不存在");
|
||||
/************订单管理***********/
|
||||
|
||||
@ -39,11 +39,9 @@ public class DeliverOrderSaveReqVO {
|
||||
private Integer deliverStatus;
|
||||
|
||||
@Schema(description = "发货人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "发货人不能为空")
|
||||
private Long deliverPerson;
|
||||
|
||||
@Schema(description = "发货人电话", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "发货人电话不能为空")
|
||||
private String deliverPersonMobile;
|
||||
|
||||
@Schema(description = "发货方式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
||||
@ -1,95 +1,110 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail;
|
||||
|
||||
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.plansubdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.plansubdetail.PlanSubDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产计划子项目设计时间明细")
|
||||
@RestController
|
||||
@RequestMapping("/heli/plan-sub-detail")
|
||||
@Validated
|
||||
public class PlanSubDetailController {
|
||||
|
||||
@Resource
|
||||
private PlanSubDetailService planSubDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产计划子项目设计时间明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:create')")
|
||||
public CommonResult<Long> createPlanSubDetail(@Valid @RequestBody PlanSubDetailSaveReqVO createReqVO) {
|
||||
return success(planSubDetailService.createPlanSubDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产计划子项目设计时间明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:update')")
|
||||
public CommonResult<Boolean> updatePlanSubDetail(@Valid @RequestBody PlanSubDetailSaveReqVO updateReqVO) {
|
||||
planSubDetailService.updatePlanSubDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产计划子项目设计时间明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:delete')")
|
||||
public CommonResult<Boolean> deletePlanSubDetail(@RequestParam("id") Long id) {
|
||||
planSubDetailService.deletePlanSubDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产计划子项目设计时间明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:query')")
|
||||
public CommonResult<PlanSubDetailRespVO> getPlanSubDetail(@RequestParam("id") Long id) {
|
||||
PlanSubDetailDO planSubDetail = planSubDetailService.getPlanSubDetail(id);
|
||||
return success(BeanUtils.toBean(planSubDetail, PlanSubDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产计划子项目设计时间明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:query')")
|
||||
public CommonResult<PageResult<PlanSubDetailRespVO>> getPlanSubDetailPage(@Valid PlanSubDetailPageReqVO pageReqVO) {
|
||||
PageResult<PlanSubDetailDO> pageResult = planSubDetailService.getPlanSubDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanSubDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产计划子项目设计时间明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPlanSubDetailExcel(@Valid PlanSubDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlanSubDetailDO> list = planSubDetailService.getPlanSubDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产计划子项目设计时间明细.xls", "数据", PlanSubDetailRespVO.class,
|
||||
BeanUtils.toBean(list, PlanSubDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail;
|
||||
|
||||
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.plansubdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.plansubdetail.PlanSubDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 生产计划子项目设计时间明细")
|
||||
@RestController
|
||||
@RequestMapping("/heli/plan-sub-detail")
|
||||
@Validated
|
||||
public class PlanSubDetailController {
|
||||
|
||||
@Resource
|
||||
private PlanSubDetailService planSubDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生产计划子项目设计时间明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:create')")
|
||||
public CommonResult<Long> createPlanSubDetail(@Valid @RequestBody PlanSubDetailSaveReqVO createReqVO) {
|
||||
return success(planSubDetailService.createPlanSubDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生产计划子项目设计时间明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:update')")
|
||||
public CommonResult<Boolean> updatePlanSubDetail(@Valid @RequestBody PlanSubDetailSaveReqVO updateReqVO) {
|
||||
planSubDetailService.updatePlanSubDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生产计划子项目设计时间明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:delete')")
|
||||
public CommonResult<Boolean> deletePlanSubDetail(@RequestParam("id") Long id) {
|
||||
return planSubDetailService.deletePlanSubDetail(id);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产计划子项目设计时间明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:query')")
|
||||
public CommonResult<PlanSubDetailRespVO> getPlanSubDetail(@RequestParam("id") Long id) {
|
||||
PlanSubDetailDO planSubDetail = planSubDetailService.getPlanSubDetail(id);
|
||||
return success(BeanUtils.toBean(planSubDetail, PlanSubDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产计划子项目设计时间明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:query')")
|
||||
public CommonResult<PageResult<PlanSubDetailRespVO>> getPlanSubDetailPage(@Valid PlanSubDetailPageReqVO pageReqVO) {
|
||||
PageResult<PlanSubDetailDO> pageResult = planSubDetailService.getPlanSubDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanSubDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产计划子项目设计时间明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub-detail:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPlanSubDetailExcel(@Valid PlanSubDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlanSubDetailDO> list = planSubDetailService.getPlanSubDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生产计划子项目设计时间明细.xls", "数据", PlanSubDetailRespVO.class,
|
||||
BeanUtils.toBean(list, PlanSubDetailRespVO.class));
|
||||
}
|
||||
@GetMapping("/getSearchRlTs")
|
||||
@Operation(summary = "查询日期是否是节假日")
|
||||
public CommonResult<Integer> getSearchRlTs(@RequestParam("startDateTime") String startDateTime) {
|
||||
Integer planSubDOList = planSubDetailService.getSearchRlTs(startDateTime);
|
||||
return success(planSubDOList);
|
||||
|
||||
}
|
||||
@PostMapping("/modification")
|
||||
@Operation(summary = "修改生产计划子项目设计时间明细")
|
||||
public CommonResult modification(@Valid @RequestBody PlanSubDetailSaveReqVO updateReqVO) {
|
||||
return planSubDetailService.modification(updateReqVO);
|
||||
}
|
||||
@PostMapping("/insertWork")
|
||||
@Operation(summary = "插活")
|
||||
public CommonResult insertWork(@Valid @RequestBody PlanSubDetailSaveReqVO updateReqVO) {
|
||||
return planSubDetailService.insertWork(updateReqVO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ 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 javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@ -59,5 +61,8 @@ public class PlanSubDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "子项目名称,唯一", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime startTime;
|
||||
@Schema(description = "是否是最大时间段")
|
||||
private Integer flag;
|
||||
}
|
||||
@ -1,59 +1,63 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail.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 PlanSubDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "6922")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13863")
|
||||
@NotNull(message = "计划id不能为空")
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11384")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "子项目id", example = "26785")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "子项目编码")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "设计结束日期")
|
||||
private LocalDateTime twoDimDate;
|
||||
|
||||
@Schema(description = "设计负责人")
|
||||
private Long twoDimOwner;
|
||||
|
||||
@Schema(description = "设计开始日期")
|
||||
private LocalDateTime startTwoDimDate;
|
||||
|
||||
@Schema(description = "设计类型(BLUEPRINT_WORKBLANK-毛坯 BLUEPRINT_2D-2D BLUEPRINT_3D-3D)", example = "1")
|
||||
private String subType;
|
||||
|
||||
@Schema(description = "结束( 默认0 1结束)")
|
||||
private Boolean isOverProcess;
|
||||
|
||||
@Schema(description = "时间段顺序")
|
||||
private Long seqNo;
|
||||
|
||||
@Schema(description = "设计天数")
|
||||
private Long designNum;
|
||||
|
||||
@Schema(description = "项目编号,唯一")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "子项目名称,唯一", example = "张三")
|
||||
private String name;
|
||||
|
||||
}
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail.vo;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
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 PlanSubDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "6922")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13863")
|
||||
@NotNull(message = "计划id不能为空")
|
||||
private Long projectPlanId;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11384")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "子项目id", example = "26785")
|
||||
private Long projectSubId;
|
||||
|
||||
@Schema(description = "子项目编码")
|
||||
private String projectSubCode;
|
||||
|
||||
@Schema(description = "设计结束日期")
|
||||
private LocalDateTime twoDimDate;
|
||||
|
||||
@Schema(description = "设计负责人")
|
||||
private Long twoDimOwner;
|
||||
|
||||
@Schema(description = "设计开始日期")
|
||||
private LocalDateTime startTwoDimDate;
|
||||
|
||||
@Schema(description = "设计类型(BLUEPRINT_WORKBLANK-毛坯 BLUEPRINT_2D-2D BLUEPRINT_3D-3D)", example = "1")
|
||||
private String subType;
|
||||
|
||||
@Schema(description = "结束( 默认0 1结束)")
|
||||
private Boolean isOverProcess;
|
||||
|
||||
@Schema(description = "时间段顺序")
|
||||
private Long seqNo;
|
||||
|
||||
@Schema(description = "设计天数")
|
||||
private Long designNum;
|
||||
|
||||
@Schema(description = "项目编号,唯一")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "子项目名称,唯一", example = "张三")
|
||||
private String name;
|
||||
@Schema(description = "是否新增")
|
||||
private String isAdd;
|
||||
@Schema(description = "是否新增")
|
||||
private List<PlanSubDetailDO> list;
|
||||
}
|
||||
|
||||
@ -170,4 +170,12 @@ public class ProcessDesignController {
|
||||
processDesignService.reWork(createReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@PostMapping("/updateFlag")
|
||||
@Operation(summary = "修改工艺明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:process-design:query')")
|
||||
public CommonResult<Boolean> updateFlag(@RequestBody ProcessDesignProgressDO processDesignProgressDO ) {
|
||||
return success(processDesignService.updateFlag(processDesignProgressDO));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -275,8 +275,8 @@ public class ProjectOrderController {
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:project-order:delete')")
|
||||
public CommonResult<Boolean> deleteProjectOrderSub(@RequestParam("id") Long id) {
|
||||
projectOrderService.deleteProjectOrderSub(id);
|
||||
return success(true);
|
||||
|
||||
return projectOrderService.deleteProjectOrderSub(id);
|
||||
}
|
||||
|
||||
@GetMapping("/project-order-sub/page")
|
||||
|
||||
@ -42,7 +42,7 @@ public class PurchaseOrderMakeSaveReqVO {
|
||||
private BigDecimal actualPrice;
|
||||
|
||||
@Schema(description = "单据状态,0 待送审,1已送审,2已审核,3已打回 ,默认是1", example = "2")
|
||||
private Boolean status;
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "送审人", example = "17514")
|
||||
private Long submitUserId;
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomImportRespVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageNowAllReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storageinventory.StorageInventoryMapper;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -23,6 +25,8 @@ 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.error;
|
||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||
@ -33,6 +37,7 @@ import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEn
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageinventory.StorageInventoryDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.storageinventory.StorageInventoryService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Tag(name = "管理后台 - 库存")
|
||||
@RestController
|
||||
@ -146,4 +151,26 @@ public class StorageInventoryController {
|
||||
StorageInventoryDO storageInventoryDO = storageInventoryMapper.selectOne(wrapper);
|
||||
return success(storageInventoryDO);
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
@Operation(summary = "导入库存")
|
||||
@Parameters({@Parameter(name = "file", description = "Excel 文件", required = true)})
|
||||
@OperateLog(type = IMPORT)
|
||||
public CommonResult<List<StorageInventoryImportExcelVO>> importExcel(HttpServletRequest request, @RequestParam("file") MultipartFile file) {
|
||||
try {
|
||||
|
||||
return storageInventoryService.importExcel(file);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return error(500, "文件导入失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
@PostMapping("/saveMaterial")
|
||||
@Operation(summary = "插入物料")
|
||||
@Parameters({@Parameter(name = "file", description = "Excel 文件", required = true)})
|
||||
@OperateLog(type = IMPORT)
|
||||
public void saveMaterial(@RequestBody List<StorageInventoryImportExcelVO> list) {
|
||||
storageInventoryService.saveMaterial(list);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* BOM Excel 导入 VO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免BOM导入有问题
|
||||
public class StorageInventoryImportExcelVO {
|
||||
|
||||
@ExcelProperty("物料号")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("物料名称")
|
||||
private String materialName;
|
||||
@ExcelProperty("物料简称")
|
||||
private String shortName;
|
||||
@ExcelProperty("类型")
|
||||
private String type;
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
@ExcelProperty("零件编码")
|
||||
private String materialCode;
|
||||
@ExcelProperty("规格/型号")
|
||||
private String spec;
|
||||
@ExcelProperty("品牌")
|
||||
private String brand;
|
||||
@ExcelProperty("来源")
|
||||
private String mainFrom;
|
||||
|
||||
@ExcelProperty("仓库")
|
||||
private String whName;
|
||||
|
||||
@ExcelProperty("库区")
|
||||
private String rgName;
|
||||
@ExcelProperty("库位")
|
||||
private String pnName;
|
||||
@ExcelProperty("库存")
|
||||
private String yardAmount;
|
||||
@ExcelProperty("平均单价(元)")
|
||||
private String price;
|
||||
}
|
||||
@ -64,7 +64,7 @@ public class PlanSubDetailDO extends BaseDO {
|
||||
/**
|
||||
* 结束( 默认0 1结束)
|
||||
*/
|
||||
private Boolean isOverProcess;
|
||||
private Integer isOverProcess;
|
||||
/**
|
||||
* 时间段顺序
|
||||
*/
|
||||
@ -81,5 +81,11 @@ public class PlanSubDetailDO extends BaseDO {
|
||||
* 子项目名称,唯一
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 子项目名称,唯一
|
||||
*/
|
||||
private String isCha;
|
||||
@TableField(exist = false)
|
||||
private Integer flag;
|
||||
|
||||
}
|
||||
@ -2,12 +2,20 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.plansubdetail;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.ProcessDesignTypeEnum;
|
||||
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.plansubdetail.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 生产计划子项目设计时间明细 Mapper
|
||||
@ -18,22 +26,20 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail.vo.*;
|
||||
public interface PlanSubDetailMapper extends BaseMapperX<PlanSubDetailDO> {
|
||||
|
||||
default PageResult<PlanSubDetailDO> selectPage(PlanSubDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PlanSubDetailDO>()
|
||||
.eqIfPresent(PlanSubDetailDO::getProjectPlanId, reqVO.getProjectPlanId())
|
||||
.eqIfPresent(PlanSubDetailDO::getProjectId, reqVO.getProjectId())
|
||||
.eqIfPresent(PlanSubDetailDO::getProjectSubId, reqVO.getProjectSubId())
|
||||
.eqIfPresent(PlanSubDetailDO::getProjectSubCode, reqVO.getProjectSubCode())
|
||||
.betweenIfPresent(PlanSubDetailDO::getTwoDimDate, reqVO.getTwoDimDate())
|
||||
.eqIfPresent(PlanSubDetailDO::getTwoDimOwner, reqVO.getTwoDimOwner())
|
||||
.betweenIfPresent(PlanSubDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(PlanSubDetailDO::getStartTwoDimDate, reqVO.getStartTwoDimDate())
|
||||
.eqIfPresent(PlanSubDetailDO::getSubType, reqVO.getSubType())
|
||||
.eqIfPresent(PlanSubDetailDO::getIsOverProcess, reqVO.getIsOverProcess())
|
||||
.eqIfPresent(PlanSubDetailDO::getSeqNo, reqVO.getSeqNo())
|
||||
.eqIfPresent(PlanSubDetailDO::getDesignNum, reqVO.getDesignNum())
|
||||
.eqIfPresent(PlanSubDetailDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(PlanSubDetailDO::getName, reqVO.getName())
|
||||
.orderByDesc(PlanSubDetailDO::getId));
|
||||
MPJLambdaWrapper<PlanSubDetailDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(PlanSubDetailDO.class)
|
||||
.orderByAsc(PlanSubDetailDO::getStartTwoDimDate);
|
||||
query.eq(ObjectUtil.isNotEmpty(reqVO.getTwoDimOwner()), PlanSubDetailDO::getTwoDimOwner, reqVO.getTwoDimOwner())
|
||||
.like(ObjectUtil.isNotEmpty(reqVO.getCode()), PlanSubDetailDO::getCode, reqVO.getCode())
|
||||
.like(ObjectUtil.isNotEmpty(reqVO.getName()), PlanSubDetailDO::getName, reqVO.getName())
|
||||
.eq(ObjectUtil.isNotEmpty(reqVO.getSubType()), PlanSubDetailDO::getSubType, reqVO.getSubType())
|
||||
.and(QueryWrapper -> QueryWrapper.gt(PlanSubDetailDO::getStartTwoDimDate, reqVO.getStartTime())
|
||||
.or()
|
||||
.lt( PlanSubDetailDO::getTwoDimDate, reqVO.getStartTime()))
|
||||
.in(PlanSubDetailDO::getIsOverProcess,0,2);
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.plantask;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
@ -49,8 +50,17 @@ public interface PlanTaskMapper extends BaseMapperX<PlanTaskDO> {
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectName()), "p.project_name", reqVO.getProjectName())
|
||||
.like(!StringUtils.isEmpty(reqVO.getPlanNo()), "pl.plan_no", reqVO.getPlanNo())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectSubCode()), "ps.project_sub_code", reqVO.getProjectSubCode())
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), "po.name", reqVO.getProjectSubName())
|
||||
.eq(reqVO.getStatus() != null, PlanTaskDO::getStatus, reqVO.getStatus());
|
||||
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), "po.name", reqVO.getProjectSubName());
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getStatus())){
|
||||
if (reqVO.getStatus() == 4){
|
||||
query.eq(ProjectOrderDO::getDeliveryStatus, 3);
|
||||
}else {
|
||||
query.eq(PlanTaskDO::getStatus, reqVO.getStatus());
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(reqVO.getStatus())){
|
||||
query.ne(ProjectOrderDO::getDeliveryStatus, 3);
|
||||
}
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
|
||||
|
||||
@ -68,8 +68,8 @@ public interface ProjectOrderSubMapper extends BaseMapperX<ProjectOrderSubDO> {
|
||||
.leftJoin(CompositionDO.class, "b", CompositionDO::getId, ProjectOrderSubDO::getCompositionId)
|
||||
.disableSubLogicDel()
|
||||
.orderByAsc(ProjectOrderSubDO::getId)
|
||||
.eq(ProjectOrderSubDO::getProjectOrderId, projectOrderId)
|
||||
.gt(ProjectOrderSubDO::getRemAmount, 0);
|
||||
.eq(ProjectOrderSubDO::getProjectOrderId, projectOrderId);
|
||||
|
||||
return selectList(query);
|
||||
}
|
||||
default int deleteByProjectOrderId(Long projectOrderId) {
|
||||
|
||||
@ -145,4 +145,51 @@ public interface ShopCalendarMapper extends BaseMapperX<ShopCalendarDO> {
|
||||
|
||||
}
|
||||
|
||||
default List<ShopCalendarDO> getSearchRlT(String startDateTime){
|
||||
MPJLambdaWrapper<ShopCalendarDO> query = new MPJLambdaWrapper<>();
|
||||
try {
|
||||
query.selectAll(ShopCalendarDO.class);
|
||||
query.ne(ShopCalendarDO::getIfjiejiari,"true");
|
||||
query.eq(ShopCalendarDO::getDates,startDateTime)
|
||||
|
||||
;
|
||||
return selectList(query);
|
||||
} catch (Exception e) {
|
||||
// 处理异常,例如记录日志或抛出自定义异常
|
||||
System.out.println("发生了一个异常: " + e.getMessage());
|
||||
}
|
||||
return selectList(query);
|
||||
}
|
||||
|
||||
default List<ShopCalendarDO> getSearchRlTL(LocalDateTime startDateTime){
|
||||
MPJLambdaWrapper<ShopCalendarDO> query = new MPJLambdaWrapper<>();
|
||||
try {
|
||||
query.selectAll(ShopCalendarDO.class);
|
||||
query.ne(ShopCalendarDO::getIfjiejiari,"true");
|
||||
query.eq(ShopCalendarDO::getDates,startDateTime)
|
||||
|
||||
;
|
||||
return selectList(query);
|
||||
} catch (Exception e) {
|
||||
// 处理异常,例如记录日志或抛出自定义异常
|
||||
System.out.println("发生了一个异常: " + e.getMessage());
|
||||
}
|
||||
return selectList(query);
|
||||
}
|
||||
|
||||
default List<ShopCalendarDO> getSearchRlTLs(LocalDateTime startDateTime, LocalDateTime endDateTime){
|
||||
MPJLambdaWrapper<ShopCalendarDO> query = new MPJLambdaWrapper<>();
|
||||
try {
|
||||
query.selectAll(ShopCalendarDO.class);
|
||||
query.ne(ShopCalendarDO::getIfjiejiari,"true");
|
||||
query.between(ShopCalendarDO::getDates,startDateTime,endDateTime)
|
||||
|
||||
;
|
||||
return selectList(query);
|
||||
} catch (Exception e) {
|
||||
// 处理异常,例如记录日志或抛出自定义异常
|
||||
System.out.println("发生了一个异常: " + e.getMessage());
|
||||
}
|
||||
return selectList(query);
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
||||
|
||||
if(OperateTypeEnum.valueOf(createReqVO.getActive()) == OperateTypeEnum.DELIVER){
|
||||
// 超额校验
|
||||
overageDeliverValidate(createReqVO.getSaleOrderIds(), createReqVO.getDeliverOrderSubs());
|
||||
// overageDeliverValidate(createReqVO.getSaleOrderIds(), createReqVO.getDeliverOrderSubs());
|
||||
}
|
||||
|
||||
// 插入
|
||||
@ -151,7 +151,7 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
||||
updateObj.setDeliverStatus(2);
|
||||
}else {
|
||||
// 超额校验
|
||||
overageDeliverValidate(updateReqVO.getSaleOrderIds(), updateReqVO.getDeliverOrderSubs());
|
||||
// overageDeliverValidate(updateReqVO.getSaleOrderIds(), updateReqVO.getDeliverOrderSubs());
|
||||
}
|
||||
deliverOrderMapper.updateById(updateObj);
|
||||
updateReqVO.setDeliverStatus(updateObj.getDeliverStatus());
|
||||
@ -211,10 +211,6 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
||||
int historyDeliveredAmount = historySubList == null || historySubList.isEmpty() ? 0 : historySubList.stream().mapToInt(DeliverOrderSubDO::getAmount).sum();
|
||||
int thisTimeAmount = thisTimeSubsGroupBySaleSubId.get(projectOrderSubDO.getId()).get(0).getAmount();
|
||||
if (relaAmount-historyDeliveredAmount-thisTimeAmount <0){
|
||||
System.out.println("子项目"+projectOrderSubDO.getName());
|
||||
System.out.println("已发货"+historyDeliveredAmount);
|
||||
System.out.println(",本次发货"+thisTimeAmount);
|
||||
System.out.println(",总数量"+relaAmount);
|
||||
throw new RuntimeException("子项目"+projectOrderSubDO.getName()+"已发货"+historyDeliveredAmount+",本次发货"+thisTimeAmount+",大于总数量"+relaAmount);
|
||||
}
|
||||
}
|
||||
@ -247,7 +243,7 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
||||
projectOrderSubMapper.updateById(projectOrderSubDO);
|
||||
|
||||
} });
|
||||
deliverOrderMapper.deleteById(id);
|
||||
deliverOrderMapper.delete(DeliverOrderDO::getId, id);
|
||||
|
||||
// 删除子表
|
||||
deleteDeliverOrderSubByDeliveryOrderId(id);
|
||||
@ -256,7 +252,7 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
deliverOrderMapper.deleteById(id);
|
||||
deliverOrderMapper.delete(DeliverOrderDO::getId, id);
|
||||
|
||||
// 删除子表
|
||||
deleteDeliverOrderSubByDeliveryOrderId(id);
|
||||
@ -434,7 +430,7 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
||||
|
||||
private void updateDeliverOrderSubList(Long deliveryOrderId, List<DeliverOrderSubDO> list, @Valid List<DeliverOrderSubDO> deliverOrderOtherSubs,String type) {
|
||||
deleteDeliverOrderSubByDeliveryOrderId(deliveryOrderId);
|
||||
list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
|
||||
list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null).setCreator(null).setCreateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
|
||||
if ("DELIVER".equals(type)){
|
||||
//计算分摊运费
|
||||
for (DeliverOrderSubDO deliverOrderOtherSub : list) {
|
||||
|
||||
@ -1,10 +1,17 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.plansub;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.shopCalendar.vo.ShopCalendarPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.shopCalendar.ShopCalendarDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.plansubdetail.PlanSubDetailMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.shopCalendar.ShopCalendarMapper;
|
||||
import jodd.util.StringUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -41,6 +48,10 @@ public class PlanSubServiceImpl implements PlanSubService {
|
||||
private ShopCalendarMapper shopCalendarMapper;
|
||||
@Resource
|
||||
private ProcessBomMapper bomMapper;
|
||||
@Resource
|
||||
private PlanSubDetailMapper planSubDetailMapper;
|
||||
@Resource
|
||||
private ProjectOrderMapper projectOrderMapper;
|
||||
@Override
|
||||
public Long createPlanSub(PlanSubSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@ -72,7 +83,66 @@ public class PlanSubServiceImpl implements PlanSubService {
|
||||
processBomDO.setCode(code);
|
||||
bomMapper.updateById(processBomDO);
|
||||
}
|
||||
|
||||
// LambdaQueryWrapper<PlanSubDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.eq(PlanSubDetailDO::getProjectSubId, updateObj.getProjectSubId());
|
||||
// planSubDetailMapper.delete( wrapper);
|
||||
// List<PlanSubDetailDO> planSubDetailDOS = new ArrayList<>();
|
||||
// ProjectOrderDO projectOrderDO = projectOrderMapper.selectById(updateObj.getProjectId());
|
||||
// if (ObjectUtil.isNotEmpty(updateObj.getStartBlankDate())&&ObjectUtil.isNotEmpty(updateObj.getBlankDate())&&ObjectUtil.isNotEmpty(updateObj.getBlankOwner())){
|
||||
// PlanSubDetailDO planSubDetailDO = new PlanSubDetailDO();
|
||||
// planSubDetailDO.setProjectPlanId(updateObj.getProjectPlanId());
|
||||
// planSubDetailDO.setProjectId(updateObj.getProjectId());
|
||||
// planSubDetailDO.setProjectSubId(updateObj.getProjectSubId());
|
||||
// planSubDetailDO.setProjectSubCode(updateObj.getProjectSubCode());
|
||||
// planSubDetailDO.setSubType("BLUEPRINT_WORKBLANK");
|
||||
// planSubDetailDO.setStartTwoDimDate(updateObj.getStartBlankDate());
|
||||
// planSubDetailDO.setTwoDimDate(updateObj.getBlankDate());
|
||||
// planSubDetailDO.setTwoDimOwner(updateObj.getBlankOwner());
|
||||
// planSubDetailDO.setDesignNum(updateObj.getBlankNum());
|
||||
// planSubDetailDO.setName(updateObj.getName());
|
||||
// planSubDetailDO.setSeqNo(1L);
|
||||
// if (ObjectUtil.isNotEmpty(projectOrderDO)){
|
||||
// planSubDetailDO.setCode(projectOrderDO.getCode());
|
||||
// }
|
||||
// planSubDetailDOS.add(planSubDetailDO);
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(updateObj.getStartTwoDimDate())&&ObjectUtil.isNotEmpty(updateObj.getTwoDimDate())&&ObjectUtil.isNotEmpty(updateObj.getTwoDimOwner())){
|
||||
// PlanSubDetailDO planSubDetailDO = new PlanSubDetailDO();
|
||||
// planSubDetailDO.setProjectPlanId(updateObj.getProjectPlanId());
|
||||
// planSubDetailDO.setProjectId(updateObj.getProjectId());
|
||||
// planSubDetailDO.setProjectSubId(updateObj.getProjectSubId());
|
||||
// planSubDetailDO.setProjectSubCode(updateObj.getProjectSubCode());
|
||||
// planSubDetailDO.setSubType("BLUEPRINT_2D");
|
||||
// planSubDetailDO.setStartTwoDimDate(updateObj.getStartTwoDimDate());
|
||||
// planSubDetailDO.setTwoDimDate(updateObj.getTwoDimDate());
|
||||
// planSubDetailDO.setTwoDimOwner(updateObj.getTwoDimOwner());
|
||||
// planSubDetailDO.setDesignNum(updateObj.getTwoDimNum());
|
||||
// planSubDetailDO.setName(updateObj.getName());
|
||||
// planSubDetailDO.setSeqNo(1L);
|
||||
// if (ObjectUtil.isNotEmpty(projectOrderDO)){
|
||||
// planSubDetailDO.setCode(projectOrderDO.getCode());
|
||||
// }
|
||||
// planSubDetailDOS.add(planSubDetailDO);
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(updateObj.getStartThreeDimDate())&&ObjectUtil.isNotEmpty(updateObj.getThreeDimDate())&&ObjectUtil.isNotEmpty(updateObj.getThreeDimOwner())){
|
||||
// PlanSubDetailDO planSubDetailDO = new PlanSubDetailDO();
|
||||
// planSubDetailDO.setProjectPlanId(updateObj.getProjectPlanId());
|
||||
// planSubDetailDO.setProjectId(updateObj.getProjectId());
|
||||
// planSubDetailDO.setProjectSubId(updateObj.getProjectSubId());
|
||||
// planSubDetailDO.setProjectSubCode(updateObj.getProjectSubCode());
|
||||
// planSubDetailDO.setSubType("BLUEPRINT_3D");
|
||||
// planSubDetailDO.setStartTwoDimDate(updateObj.getStartThreeDimDate());
|
||||
// planSubDetailDO.setTwoDimDate(updateObj.getThreeDimDate());
|
||||
// planSubDetailDO.setTwoDimOwner(updateObj.getThreeDimOwner());
|
||||
// planSubDetailDO.setDesignNum(updateObj.getThreeDimNum());
|
||||
// planSubDetailDO.setName(updateObj.getName());
|
||||
// planSubDetailDO.setSeqNo(1L);
|
||||
// if (ObjectUtil.isNotEmpty(projectOrderDO)){
|
||||
// planSubDetailDO.setCode(projectOrderDO.getCode());
|
||||
// }
|
||||
// planSubDetailDOS.add(planSubDetailDO);
|
||||
// }
|
||||
// planSubDetailMapper.insertBatch(planSubDetailDOS);
|
||||
planSubMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
@ -1,55 +1,62 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.plansubdetail;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产计划子项目设计时间明细 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PlanSubDetailService {
|
||||
|
||||
/**
|
||||
* 创建生产计划子项目设计时间明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPlanSubDetail(@Valid PlanSubDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生产计划子项目设计时间明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePlanSubDetail(@Valid PlanSubDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生产计划子项目设计时间明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePlanSubDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产计划子项目设计时间明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 生产计划子项目设计时间明细
|
||||
*/
|
||||
PlanSubDetailDO getPlanSubDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产计划子项目设计时间明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生产计划子项目设计时间明细分页
|
||||
*/
|
||||
PageResult<PlanSubDetailDO> getPlanSubDetailPage(PlanSubDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
package com.chanko.yunxi.mes.module.heli.service.plansubdetail;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生产计划子项目设计时间明细 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PlanSubDetailService {
|
||||
|
||||
/**
|
||||
* 创建生产计划子项目设计时间明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPlanSubDetail(@Valid PlanSubDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生产计划子项目设计时间明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePlanSubDetail(@Valid PlanSubDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生产计划子项目设计时间明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
CommonResult<Boolean> deletePlanSubDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产计划子项目设计时间明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 生产计划子项目设计时间明细
|
||||
*/
|
||||
PlanSubDetailDO getPlanSubDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产计划子项目设计时间明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生产计划子项目设计时间明细分页
|
||||
*/
|
||||
PageResult<PlanSubDetailDO> getPlanSubDetailPage(PlanSubDetailPageReqVO pageReqVO);
|
||||
|
||||
Integer getSearchRlTs(String startDateTime);
|
||||
|
||||
CommonResult modification(PlanSubDetailSaveReqVO updateReqVO);
|
||||
|
||||
CommonResult insertWork(PlanSubDetailSaveReqVO updateReqVO);
|
||||
}
|
||||
|
||||
@ -1,11 +1,24 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.plansubdetail;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.shopCalendar.ShopCalendarDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.plansub.PlanSubMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.shopCalendar.ShopCalendarMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plansubdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansubdetail.PlanSubDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
@ -28,6 +41,10 @@ public class PlanSubDetailServiceImpl implements PlanSubDetailService {
|
||||
|
||||
@Resource
|
||||
private PlanSubDetailMapper planSubDetailMapper;
|
||||
@Resource
|
||||
private ShopCalendarMapper shopCalendarMapper;
|
||||
@Resource
|
||||
private PlanSubMapper planSubMapper;
|
||||
|
||||
@Override
|
||||
public Long createPlanSubDetail(PlanSubDetailSaveReqVO createReqVO) {
|
||||
@ -48,16 +65,81 @@ public class PlanSubDetailServiceImpl implements PlanSubDetailService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePlanSubDetail(Long id) {
|
||||
public CommonResult<Boolean> deletePlanSubDetail(Long id) {
|
||||
// 校验存在
|
||||
validatePlanSubDetailExists(id);
|
||||
// 删除
|
||||
planSubDetailMapper.deleteById(id);
|
||||
PlanSubDetailDO planSubDetailDO = planSubDetailMapper.selectById(id);
|
||||
// 获取当前日期时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
// 判断 当前时间是否在startTwoDimDate之后
|
||||
boolean isGreaterThanCurrent = now.isAfter(planSubDetailDO.getStartTwoDimDate());
|
||||
if (isGreaterThanCurrent) return CommonResult.error(400,"当前日期>开始日期,不允许删除");
|
||||
if (ObjectUtil.isNotEmpty(planSubDetailDO.getIsOverProcess())&& planSubDetailDO.getIsOverProcess()==1&&planSubDetailDO.getSeqNo()==1){
|
||||
return CommonResult.error(400,"该设计已报工,不允许删除");
|
||||
}
|
||||
LambdaQueryWrapper<PlanSubDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PlanSubDetailDO::getProjectSubId,planSubDetailDO.getProjectSubId());
|
||||
wrapper.eq(PlanSubDetailDO::getSubType,planSubDetailDO.getSubType());
|
||||
wrapper.gt(PlanSubDetailDO::getSeqNo,planSubDetailDO.getSeqNo());
|
||||
if (planSubDetailMapper.selectCount(wrapper)>0) return CommonResult.error(400,"请先删除序列号最大的派工时间数据 ");
|
||||
LambdaUpdateWrapper<PlanSubDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(PlanSubDO::getProjectSubId,planSubDetailDO.getProjectSubId());
|
||||
if (planSubDetailDO.getSeqNo()==1){
|
||||
if ("BLUEPRINT_WORKBLANK".equals(planSubDetailDO.getSubType())){
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getStartBlankDate,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getBlankDate,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getBlankOwner,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getBlankNum,0);
|
||||
}else if ("BLUEPRINT_2D".equals(planSubDetailDO.getSubType())){
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getStartTwoDimDate,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getTwoDimDate,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getTwoDimOwner,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getTwoDimNum,0);
|
||||
}else {
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getStartThreeDimDate,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getThreeDimDate,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getThreeDimOwner,null);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getThreeDimNum,0);
|
||||
}
|
||||
}else {
|
||||
LambdaQueryWrapper<PlanSubDetailDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlanSubDetailDO::getProjectSubId,planSubDetailDO.getProjectSubId());
|
||||
lambdaQueryWrapper.eq(PlanSubDetailDO::getSubType,planSubDetailDO.getSubType());
|
||||
lambdaQueryWrapper.ne(PlanSubDetailDO::getId,planSubDetailDO.getId());
|
||||
lambdaQueryWrapper.orderByAsc(PlanSubDetailDO::getSeqNo);
|
||||
List<PlanSubDetailDO> planSubDetailDOS = planSubDetailMapper.selectList(lambdaQueryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(planSubDetailDOS)){
|
||||
Long num = planSubDetailDOS.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(PlanSubDetailDO::getDesignNum)
|
||||
.filter(Objects::nonNull)
|
||||
.reduce(0L,Long::sum);
|
||||
LocalDateTime startTwoDimDate = planSubDetailDOS.get(0).getStartTwoDimDate();
|
||||
LocalDateTime twoDimDate = planSubDetailDOS.get(planSubDetailDOS.size()-1).getTwoDimDate();
|
||||
if ("BLUEPRINT_WORKBLANK".equals(planSubDetailDO.getSubType())){
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getStartBlankDate,startTwoDimDate);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getBlankDate,twoDimDate);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getBlankNum,num);
|
||||
}else if ("BLUEPRINT_2D".equals(planSubDetailDO.getSubType())){
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getStartTwoDimDate,startTwoDimDate);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getTwoDimDate,twoDimDate);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getTwoDimNum,num);
|
||||
}else {
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getStartThreeDimDate,startTwoDimDate);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getThreeDimDate,twoDimDate);
|
||||
lambdaUpdateWrapper.set(PlanSubDO::getThreeDimNum,num);
|
||||
}
|
||||
}
|
||||
}
|
||||
planSubMapper.update(lambdaUpdateWrapper);
|
||||
planSubDetailMapper.delete(new LambdaUpdateWrapper<PlanSubDetailDO>().eq(PlanSubDetailDO::getId,id));
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
private void validatePlanSubDetailExists(Long id) {
|
||||
if (planSubDetailMapper.selectById(id) == null) {
|
||||
// throw exception(PLAN_SUB_DETAIL_NOT_EXISTS);
|
||||
throw exception(PLAN_SUB_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,10 +147,246 @@ public class PlanSubDetailServiceImpl implements PlanSubDetailService {
|
||||
public PlanSubDetailDO getPlanSubDetail(Long id) {
|
||||
return planSubDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PlanSubDetailDO> getPlanSubDetailPage(PlanSubDetailPageReqVO pageReqVO) {
|
||||
return planSubDetailMapper.selectPage(pageReqVO);
|
||||
PageResult<PlanSubDetailDO> planSubDetailDOPageResult = planSubDetailMapper.selectPage(pageReqVO);
|
||||
List<PlanSubDetailDO> list = planSubDetailDOPageResult.getList();
|
||||
for (PlanSubDetailDO planSubDetailDO : list) {
|
||||
LambdaQueryWrapper<PlanSubDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PlanSubDetailDO::getProjectSubId,planSubDetailDO.getProjectSubId());
|
||||
wrapper.eq(PlanSubDetailDO::getSubType,planSubDetailDO.getSubType());
|
||||
wrapper.gt(PlanSubDetailDO::getSeqNo,planSubDetailDO.getSeqNo());
|
||||
if (planSubDetailMapper.selectCount(wrapper)>0) {
|
||||
planSubDetailDO.setFlag(0);
|
||||
}else {
|
||||
planSubDetailDO.setFlag(1);
|
||||
}
|
||||
}
|
||||
planSubDetailDOPageResult.setList(list);
|
||||
return planSubDetailDOPageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getSearchRlTs(String startDateTime) {
|
||||
List<ShopCalendarDO> shopCalendarDOS =shopCalendarMapper.getSearchRlT(startDateTime);
|
||||
int a = shopCalendarDOS.size();
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult modification(PlanSubDetailSaveReqVO updateReqVO) {
|
||||
LambdaQueryWrapper<PlanSubDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PlanSubDetailDO::getProjectSubId,updateReqVO.getProjectSubId());
|
||||
wrapper.eq(PlanSubDetailDO::getSubType,updateReqVO.getSubType());
|
||||
wrapper.gt(PlanSubDetailDO::getSeqNo,updateReqVO.getSeqNo());
|
||||
if (planSubDetailMapper.selectCount(wrapper)>0) return CommonResult.error(400,"该子项目存在多时间段派工,不允许从中间修改!");
|
||||
LambdaQueryWrapper<PlanSubDetailDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PlanSubDetailDO::getProjectSubId,updateReqVO.getProjectSubId());
|
||||
queryWrapper.eq(PlanSubDetailDO::getSubType,updateReqVO.getSubType());
|
||||
if (ObjectUtil.isNotEmpty(updateReqVO.getId())){
|
||||
queryWrapper.ne(PlanSubDetailDO::getId,updateReqVO.getId());
|
||||
}
|
||||
List<PlanSubDetailDO> planSubDetailDOS = planSubDetailMapper.selectList(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(planSubDetailDOS)) {
|
||||
for (PlanSubDetailDO planSubDetailDO : planSubDetailDOS) {
|
||||
LocalDateTime reqStart = updateReqVO.getStartTwoDimDate();
|
||||
LocalDateTime reqEnd = updateReqVO.getTwoDimDate();
|
||||
LocalDateTime existStart = planSubDetailDO.getStartTwoDimDate();
|
||||
LocalDateTime existEnd = planSubDetailDO.getTwoDimDate();
|
||||
// 判断请求时间段是否与已有时间段有重叠
|
||||
boolean hasOverlap = !reqEnd.isBefore(existStart) && !reqStart.isAfter(existEnd);
|
||||
if (hasOverlap) {
|
||||
return CommonResult.error(400, "该子项目设计时间存在交叉,请确认!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(updateReqVO.getIsAdd())&&"1".equals(updateReqVO.getIsAdd())){
|
||||
LambdaQueryWrapper<PlanSubDetailDO> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(PlanSubDetailDO::getProjectSubId,updateReqVO.getProjectSubId());
|
||||
wrapper1.eq(PlanSubDetailDO::getSubType,updateReqVO.getSubType());
|
||||
String type="BLUEPRINT_WORKBLANK".equals(updateReqVO.getSubType())?"毛坯":"BLUEPRINT_2D".equals(updateReqVO.getSubType())?"2D":"3D";
|
||||
if (planSubDetailMapper.selectCount(wrapper1)>0) return CommonResult.error(400,"该子项目"+updateReqVO.getName()+" 设计类型"+type+" 存在派工数据,请确认!");
|
||||
}
|
||||
LambdaQueryWrapper<PlanSubDetailDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(PlanSubDetailDO::getIsOverProcess,0,2);
|
||||
lambdaQueryWrapper.eq(PlanSubDetailDO::getTwoDimOwner,updateReqVO.getTwoDimOwner());
|
||||
lambdaQueryWrapper.ge(PlanSubDetailDO::getStartTwoDimDate,updateReqVO.getStartTwoDimDate());
|
||||
lambdaQueryWrapper.orderByAsc(PlanSubDetailDO::getStartTwoDimDate);
|
||||
if (ObjectUtil.isNotEmpty(updateReqVO.getId())){
|
||||
lambdaQueryWrapper.ne(PlanSubDetailDO::getId,updateReqVO.getId());
|
||||
}
|
||||
List<PlanSubDetailDO> list = planSubDetailMapper.selectList(lambdaQueryWrapper);
|
||||
if (ObjectUtil.isEmpty( list) ||updateReqVO.getTwoDimDate().isBefore(list.get(0).getStartTwoDimDate())){
|
||||
if (ObjectUtil.isNotEmpty(updateReqVO.getId())){
|
||||
planSubDetailMapper.delete(PlanSubDetailDO::getId,updateReqVO.getId());
|
||||
}
|
||||
PlanSubDetailDO planSubDetailDO = new PlanSubDetailDO();
|
||||
planSubDetailDO.setProjectPlanId(updateReqVO.getProjectPlanId());
|
||||
planSubDetailDO.setProjectId(updateReqVO.getProjectId());
|
||||
planSubDetailDO.setProjectSubId(updateReqVO.getProjectSubId());
|
||||
planSubDetailDO.setProjectSubCode(updateReqVO.getProjectSubCode());
|
||||
planSubDetailDO.setTwoDimDate(updateReqVO.getTwoDimDate());
|
||||
planSubDetailDO.setTwoDimOwner(updateReqVO.getTwoDimOwner());
|
||||
planSubDetailDO.setStartTwoDimDate(updateReqVO.getStartTwoDimDate());
|
||||
planSubDetailDO.setSubType(updateReqVO.getSubType());
|
||||
planSubDetailDO.setIsOverProcess(0);
|
||||
planSubDetailDO.setSeqNo(1L);
|
||||
planSubDetailDO.setDesignNum(updateReqVO.getDesignNum());
|
||||
planSubDetailDO.setCode(updateReqVO.getCode());
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
updateReqVO.setList( list);
|
||||
return CommonResult.success(updateReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult insertWork(PlanSubDetailSaveReqVO updateReqVO) {
|
||||
List<PlanSubDetailDO> list = updateReqVO.getList();
|
||||
if (isAfterOrEqual(updateReqVO.getStartTwoDimDate(), list.get(0).getTwoDimDate())&&isAfterOrEqual(list.get(0).getStartTwoDimDate(),updateReqVO.getTwoDimDate())){
|
||||
PlanSubDetailDO planSubDetailDO = list.get(0);
|
||||
LocalDateTime localDateTime = addDays(updateReqVO.getTwoDimDate(), 1L);
|
||||
Integer searchRlTs = getSearchRlTs(localDateTime);
|
||||
int maxAttempts = 365; // 最多检查一年
|
||||
int attempts = 0;
|
||||
while (searchRlTs>0 && attempts < maxAttempts){
|
||||
localDateTime = addDays(localDateTime, 1L);
|
||||
searchRlTs = getSearchRlTs(localDateTime);
|
||||
attempts++;
|
||||
}
|
||||
if (attempts >= maxAttempts) {
|
||||
// 处理找不到合适日期的情况
|
||||
return CommonResult.error(400,"在一年内未找到合适的日期");
|
||||
}
|
||||
int max = 365; // 最多检查一年
|
||||
int count = 0;
|
||||
planSubDetailDO.setStartTwoDimDate(localDateTime);
|
||||
Long designNum = planSubDetailDO.getDesignNum();
|
||||
LocalDateTime twoDimDate = planSubDetailDO.getTwoDimDate();
|
||||
LocalDateTime dateTime = addDays(twoDimDate, designNum);
|
||||
Integer rlTs = getSearchRlTs(localDateTime, dateTime);
|
||||
while (rlTs<designNum&&count<max){
|
||||
long l = designNum - rlTs;
|
||||
dateTime = addDays(dateTime, l);
|
||||
rlTs = getSearchRlTs(localDateTime, dateTime);
|
||||
count++;
|
||||
}
|
||||
if (count >= max) {
|
||||
// 处理找不到合适日期的情况
|
||||
return CommonResult.error(400,"在一年内未找到合适的日期");
|
||||
}
|
||||
planSubDetailDO.setTwoDimDate(dateTime);
|
||||
list.add(0,planSubDetailDO);
|
||||
PlanSubDetailDO subDetailDO = new PlanSubDetailDO();
|
||||
subDetailDO.setProjectPlanId(updateReqVO.getProjectPlanId());
|
||||
subDetailDO.setProjectId(updateReqVO.getProjectId());
|
||||
subDetailDO.setProjectSubId(updateReqVO.getProjectSubId());
|
||||
subDetailDO.setProjectSubCode(updateReqVO.getProjectSubCode());
|
||||
subDetailDO.setTwoDimDate(planSubDetailDO.getTwoDimDate());
|
||||
subDetailDO.setTwoDimOwner(updateReqVO.getTwoDimOwner());
|
||||
subDetailDO.setStartTwoDimDate(updateReqVO.getStartTwoDimDate());
|
||||
subDetailDO.setSubType(updateReqVO.getSubType());
|
||||
subDetailDO.setIsOverProcess(0);
|
||||
subDetailDO.setSeqNo(1L);
|
||||
subDetailDO.setDesignNum(updateReqVO.getDesignNum());
|
||||
list.add(subDetailDO);
|
||||
|
||||
}else if (isGreaterOrEqual(list.get(0).getStartTwoDimDate(),updateReqVO.getStartTwoDimDate())&&isAfterOrEqual(updateReqVO.getStartTwoDimDate(),list.get(0).getTwoDimDate())){
|
||||
PlanSubDetailDO planSubDetailDO = list.get(0);
|
||||
// 拷贝两份
|
||||
PlanSubDetailDO copy1 = BeanUtils.toBean(planSubDetailDO, PlanSubDetailDO.class);
|
||||
PlanSubDetailDO copy2 = BeanUtils.toBean(updateReqVO, PlanSubDetailDO.class);
|
||||
copy2.setIsCha("Y");
|
||||
planSubDetailDO.setTwoDimDate(subtractDays(planSubDetailDO.getTwoDimDate(), 1L));
|
||||
planSubDetailDO.setDesignNum(getSearchRlTs(planSubDetailDO.getStartTwoDimDate(), planSubDetailDO.getTwoDimDate()).longValue());
|
||||
copy1.setStartTwoDimDate(addDays(copy2.getTwoDimDate(),1L));
|
||||
long l = copy1.getDesignNum() - planSubDetailDO.getDesignNum();
|
||||
LocalDateTime dateTime = addDays(copy1.getStartTwoDimDate(), l);
|
||||
Integer rlTs = getSearchRlTs(copy1.getStartTwoDimDate(), dateTime);
|
||||
int max = 365; // 最多检查一年
|
||||
int count = 0;
|
||||
while (rlTs<l&&count<max){
|
||||
long a = l - rlTs;
|
||||
dateTime = addDays(dateTime, a);
|
||||
rlTs = getSearchRlTs(copy1.getStartTwoDimDate(), dateTime);
|
||||
count++;
|
||||
}
|
||||
if (count >= max) {
|
||||
// 处理找不到合适日期的情况
|
||||
return CommonResult.error(400,"在一年内未找到合适的日期");
|
||||
}
|
||||
copy1.setTwoDimDate(dateTime);
|
||||
copy1.setDesignNum(l);
|
||||
list.add(0,copy1);
|
||||
list.add(0,copy2);
|
||||
list.add(0,planSubDetailDO);
|
||||
for (int i = 3; i < list.size(); i++) {
|
||||
if (isAfterOrEqual(list.get(i).getStartTwoDimDate(), list.get(i-1).getTwoDimDate())){
|
||||
PlanSubDetailDO subDetailDO = list.get(i);
|
||||
LocalDateTime previous = list.get(i - 1).getTwoDimDate();
|
||||
LocalDateTime localDateTime = addDays(previous, 1L);
|
||||
Integer searchRlTs = getSearchRlTs(localDateTime);
|
||||
int maxAttempts = 365; // 最多检查一年
|
||||
int attempts = 0;
|
||||
while (searchRlTs>0 && attempts < maxAttempts){
|
||||
localDateTime = addDays(localDateTime, 1L);
|
||||
searchRlTs = getSearchRlTs(localDateTime);
|
||||
attempts++;
|
||||
}
|
||||
if (attempts >= maxAttempts) {
|
||||
// 处理找不到合适日期的情况
|
||||
return CommonResult.error(400,"在一年内未找到合适的日期");
|
||||
}
|
||||
int maxNumber = 365; // 最多检查一年
|
||||
int number = 0;
|
||||
subDetailDO.setStartTwoDimDate(localDateTime);
|
||||
Long designNum = subDetailDO.getDesignNum();
|
||||
LocalDateTime twoDimDate = subDetailDO.getTwoDimDate();
|
||||
LocalDateTime date = addDays(twoDimDate, designNum);
|
||||
Integer rlT = getSearchRlTs(localDateTime, date);
|
||||
while (rlT<designNum&&number<maxNumber){
|
||||
long t = designNum - rlT;
|
||||
date = addDays(date, t);
|
||||
rlT = getSearchRlTs(localDateTime, date);
|
||||
number++;
|
||||
}
|
||||
if (number >= maxNumber) {
|
||||
// 处理找不到合适日期的情况
|
||||
return CommonResult.error(400,"在一年内未找到合适的日期");
|
||||
}
|
||||
subDetailDO.setTwoDimDate(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<PlanSubDetailDO> sortedList = list.stream()
|
||||
.sorted(Comparator.comparing(
|
||||
PlanSubDetailDO::getStartTwoDimDate,
|
||||
Comparator.nullsLast(Comparator.naturalOrder())
|
||||
))
|
||||
.collect(Collectors.toList());
|
||||
updateReqVO.setList(sortedList);
|
||||
return CommonResult.success(updateReqVO);
|
||||
}
|
||||
public Integer getSearchRlTs(LocalDateTime startDateTime) {
|
||||
List<ShopCalendarDO> shopCalendarDOS =shopCalendarMapper.getSearchRlTL(startDateTime);
|
||||
int a = shopCalendarDOS.size();
|
||||
return a;
|
||||
}
|
||||
public Integer getSearchRlTs(LocalDateTime startDateTime,LocalDateTime endDateTime) {
|
||||
List<ShopCalendarDO> shopCalendarDOS =shopCalendarMapper.getSearchRlTLs(startDateTime,endDateTime);
|
||||
int a = shopCalendarDOS.size();
|
||||
return a;
|
||||
}
|
||||
public boolean isGreaterOrEqual(LocalDateTime time1, LocalDateTime time2) {
|
||||
return time1.isBefore(time2);
|
||||
}
|
||||
public boolean isAfterOrEqual(LocalDateTime time1, LocalDateTime time2) {
|
||||
return !time1.isAfter(time2);
|
||||
}
|
||||
public LocalDateTime addDays(LocalDateTime dateTime, Long days) {
|
||||
return dateTime.plusDays(days);
|
||||
}
|
||||
public LocalDateTime subtractDays(LocalDateTime dateTime, Long days) {
|
||||
return dateTime.minusDays(days);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -89,4 +89,5 @@ public interface ProcessDesignService {
|
||||
PageResult<ProcessDesignDO> getProcessDesignPages(ProcessDesignPageReqVO pageReqVO);
|
||||
PageResult<ProcessDesignDO> getExportExcel(ProcessDesignPageReqVO pageReqVO);
|
||||
|
||||
Boolean updateFlag(ProcessDesignProgressDO processDesignProgressDO);
|
||||
}
|
||||
|
||||
@ -273,7 +273,7 @@ public class ProcessDesignServiceImpl implements ProcessDesignService {
|
||||
wrapper.eq(PlanSubDetailDO::getProjectId, processDesignDO.getProjectId());
|
||||
wrapper.eq(PlanSubDetailDO::getProjectSubId, processDesignDO.getProjectSubId());
|
||||
wrapper.eq(PlanSubDetailDO::getSubType, processDesignDO.getProcessDesignType());
|
||||
wrapper.set(PlanSubDetailDO::getIsOverProcess, 2);
|
||||
wrapper.set(PlanSubDetailDO::getIsOverProcess, 1);
|
||||
planSubDetailMapper.update(wrapper);
|
||||
return processDesignMapper.over(id);
|
||||
}
|
||||
@ -734,6 +734,18 @@ public class ProcessDesignServiceImpl implements ProcessDesignService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateFlag(ProcessDesignProgressDO processDesignProgressDO) {
|
||||
LambdaUpdateWrapper<ProcessDesignProgressDO> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(ProcessDesignProgressDO::getId, processDesignProgressDO.getId());
|
||||
wrapper.set(ProcessDesignProgressDO::getBeginTime, processDesignProgressDO.getBeginTime());
|
||||
wrapper.set(ProcessDesignProgressDO::getEndTime, processDesignProgressDO.getEndTime());
|
||||
wrapper.set(ProcessDesignProgressDO::getWorkTime, processDesignProgressDO.getWorkTime());
|
||||
wrapper.set(ProcessDesignProgressDO::getRemark, processDesignProgressDO.getRemark());
|
||||
processDesignProgressMapper.update(wrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void createProcessDesignProgressList(Long processDesignId, List<ProcessDesignProgressDO> list) {
|
||||
list.forEach(o -> o.setProcessDesignId(processDesignId));
|
||||
// 按创建时间排序
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.projectorder;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderCostPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO;
|
||||
@ -81,7 +82,7 @@ public interface ProjectOrderService {
|
||||
*/
|
||||
void createProjectOrderSnapshot(ProjectOrderSaveReqVO operateReqVO);
|
||||
void updateProjectOrderPrice(ProjectOrderSaveReqVO updateReqVO);
|
||||
void deleteProjectOrderSub(Long id);
|
||||
CommonResult<Boolean> deleteProjectOrderSub(Long id);
|
||||
|
||||
PageResult<ProjectOrderSubDO> getProjectOrderSubPage(ProjectOrderSubPageReqVO pageReqVO);
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
||||
@ -18,12 +19,18 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthing
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.deliverorder.DeliverOrderSubMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.plansub.PlanSubMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||
@ -101,9 +108,15 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
||||
@Autowired
|
||||
private ProcessBomService processBomService;
|
||||
@Autowired
|
||||
private ProcessBomMapper processBomMapper;
|
||||
@Autowired
|
||||
private AttentiontodoService attentiontodoService;
|
||||
@Autowired
|
||||
private bdgzsomthingMapper bdgzsomthingMapper;
|
||||
@Resource
|
||||
private ProcessBomDetailMapper processBomDetailDOMapper;
|
||||
@Resource
|
||||
private PlanSubMapper planSubMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -174,8 +187,26 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProjectOrderSub(Long id) {
|
||||
public CommonResult<Boolean> deleteProjectOrderSub(Long id) {
|
||||
LambdaQueryWrapper<ProcessBomDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ProcessBomDO::getProjectSubId,id);
|
||||
List<ProcessBomDO> processBomDOS = processBomMapper.selectList(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(processBomDOS)){
|
||||
List<Long> collect = processBomDOS.stream().map(processBomDO -> processBomDO.getId()).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<ProcessBomDetailDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(ProcessBomDetailDO::getBomId,collect);
|
||||
if (processBomDetailDOMapper.selectCount(lambdaQueryWrapper)>0){
|
||||
return CommonResult.error(400,"子项目已生成BOM明细,不允许删除");
|
||||
}
|
||||
}
|
||||
LambdaUpdateWrapper<ProcessBomDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(ProcessBomDO::getProjectSubId,id);
|
||||
processBomMapper.delete(lambdaUpdateWrapper);
|
||||
LambdaUpdateWrapper<PlanSubDO> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(PlanSubDO::getProjectSubId,id);
|
||||
planSubMapper.delete( wrapper);
|
||||
projectOrderSubMapper.deleteById(id);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -638,9 +669,11 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
||||
List<ProjectOrderSubDO> insertList = list.stream().filter(o -> o.getId() == null).collect(Collectors.toList());
|
||||
insertList.forEach(o -> o.setRemAmount(o.getAmount()));
|
||||
for (ProjectOrderSubDO projectOrderSubDO : updateList) {
|
||||
ProjectOrderSubDO subDO = projectOrderSubMapper.selectById(projectOrderSubDO.getId());
|
||||
LambdaQueryWrapper<ProjectOrderSubDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProjectOrderSubDO::getId,projectOrderSubDO.getId());
|
||||
ProjectOrderSubDO subDO = projectOrderSubMapper.selectOne(wrapper);
|
||||
if (ObjectUtil.isNotEmpty(subDO)){
|
||||
projectOrderSubDO.setRemAmount(subDO.getRemAmount()+(projectOrderSubDO.getAmount()-subDO.getAmount()));
|
||||
projectOrderSubDO.setRemAmount(subDO.getRemAmount()+(projectOrderSubDO.getAmount()-subDO.getAmount()));
|
||||
}
|
||||
}
|
||||
if(!updateList.isEmpty()) projectOrderSubMapper.updateBatch(updateList);
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.storageinventory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageinventory.StorageInventoryDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 库存 Service 接口
|
||||
@ -59,4 +63,8 @@ public interface StorageInventoryService {
|
||||
StorageInventoryDO selectNowByMatPnId(Long matId, Long pnId);
|
||||
|
||||
PageResult<StorageInventoryDO> realTimeInventory(StorageInventoryPageReqVO pageReqVO);
|
||||
|
||||
CommonResult<List<StorageInventoryImportExcelVO>> importExcel(MultipartFile file) throws IOException;
|
||||
|
||||
void saveMaterial(List<StorageInventoryImportExcelVO> list);
|
||||
}
|
||||
|
||||
@ -1,14 +1,46 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.storageinventory;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chanko.yunxi.mes.framework.common.enums.BomEditStatusEnum;
|
||||
import com.chanko.yunxi.mes.framework.common.enums.StatusEnum;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomImportExcelVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageNowAllReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pn.PnDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.rg.RgDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelog.StorageLogDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.warehouse.WarehouseDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.pn.PnMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.rg.RgMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.warehouse.WarehouseMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.service.composition.CompositionService;
|
||||
import com.chanko.yunxi.mes.module.system.controller.admin.dict.vo.data.DictDataPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.dict.DictDataDO;
|
||||
import com.chanko.yunxi.mes.module.system.dal.mysql.dict.DictDataMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.rmi.RemoteException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storageinventory.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageinventory.StorageInventoryDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
@ -16,6 +48,7 @@ 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.storageinventory.StorageInventoryMapper;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
@ -31,7 +64,18 @@ public class StorageInventoryServiceImpl implements StorageInventoryService {
|
||||
|
||||
@Resource
|
||||
private StorageInventoryMapper storageInventoryMapper;
|
||||
|
||||
@Resource
|
||||
private DictDataMapper dictDataMapper;
|
||||
@Resource
|
||||
private WarehouseMapper warehouseMapper;
|
||||
@Resource
|
||||
private RgMapper rgMapper;
|
||||
@Resource
|
||||
private PnMapper pnMapper;
|
||||
@Resource
|
||||
private MaterialMapper materialMapper;
|
||||
@Resource
|
||||
private StorageLogMapper storageLogMapper;
|
||||
@Override
|
||||
public Long createStorageInventory(StorageInventorySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@ -107,4 +151,321 @@ public class StorageInventoryServiceImpl implements StorageInventoryService {
|
||||
return storageInventoryMapper.realTimeInventory(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public CommonResult<List<StorageInventoryImportExcelVO>> importExcel(MultipartFile file) throws IOException {
|
||||
// 校验文件格式
|
||||
if (!file.getOriginalFilename().endsWith(".xlsx") && !file.getOriginalFilename().endsWith(".xls")) {
|
||||
throw exception(EXCEL_FILE_FORMAT_ERROR);
|
||||
}
|
||||
// 读取Excel文件并转换为VO对象列表
|
||||
List<StorageInventoryImportExcelVO> list = ExcelUtils.read(file, StorageInventoryImportExcelVO.class);
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
List<String> errorMessages1 = new ArrayList<>();
|
||||
List<String> errorMessages2 = new ArrayList<>();
|
||||
List<String> errorMessages3 = new ArrayList<>();
|
||||
List<String> errorMessages4 = new ArrayList<>();
|
||||
List<String> errorMessages5= new ArrayList<>();
|
||||
List<String> errorMessages6 = new ArrayList<>();
|
||||
List<String> errorMessages7 = new ArrayList<>();
|
||||
List<String> errorMessages8 = new ArrayList<>();
|
||||
List<String> errorMessages9 = new ArrayList<>();
|
||||
List<String> errorMessages10 = new ArrayList<>();
|
||||
HashMap<String, String> unitDictData = getUnitDictData();
|
||||
HashMap<String, String> TypeDictData = getTypeDictData();
|
||||
HashMap<String, String> OriginalDictData = getOriginalDictData();
|
||||
List<StorageInventoryDO> storageInventoryDOS = new ArrayList<>();
|
||||
List<StorageInventoryImportExcelVO> dataList = new ArrayList<>();
|
||||
// 新增:重复组合追踪器
|
||||
Map<String,String> duplicateTracker = new HashMap<>();
|
||||
List<StorageLogDO> logs = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
StorageInventoryDO storageInventoryDO = new StorageInventoryDO();
|
||||
StorageLogDO logDO = new StorageLogDO();
|
||||
logDO.setStockType(1);
|
||||
logDO.setGoodsType(1);
|
||||
StorageInventoryImportExcelVO vo = list.get(i);
|
||||
String code = null;
|
||||
Long whId = null;
|
||||
Long rgId = null;
|
||||
Long pnId = null;
|
||||
if (ObjectUtil.isNotEmpty(vo.getYardAmount())) {
|
||||
if (!vo.getYardAmount().matches("[0-9]+")) {
|
||||
errorMessages.add("第" + (i + 1) + "行库存数量必须是数字");
|
||||
} else {
|
||||
storageInventoryDO.setYardAmount(new BigDecimal(vo.getYardAmount()));
|
||||
logDO.setStorageOkQty(new BigDecimal(vo.getYardAmount()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(vo.getPrice())) {
|
||||
if (!vo.getPrice().matches("[0-9]+")) {
|
||||
errorMessages1.add("第" + (i + 1) + "行平均单价必须是数字");
|
||||
} else {
|
||||
storageInventoryDO.setPrice(new BigDecimal(vo.getPrice()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getCode())) {
|
||||
errorMessages2.add("第" + (i + 1) + "行物料号不能为空");
|
||||
} else {
|
||||
code = vo.getCode();
|
||||
LambdaQueryWrapper<MaterialDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MaterialDO::getCode, vo.getCode());
|
||||
MaterialDO materialDO = materialMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(materialDO)) {
|
||||
boolean hasDuplicate = dataList.stream()
|
||||
.anyMatch(item -> Objects.equals(item.getCode(), vo.getCode()));
|
||||
|
||||
if (!hasDuplicate) {
|
||||
dataList.add(vo);
|
||||
}
|
||||
} else {
|
||||
storageInventoryDO.setMaterialId(materialDO.getId());
|
||||
logDO.setMatId(materialDO.getId());
|
||||
storageInventoryDO.setBoomCode(vo.getCode());
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getMaterialName())) {
|
||||
errorMessages3.add("第" + (i + 1) + "行物料名称不能为空");
|
||||
} else {
|
||||
storageInventoryDO.setBoomName(vo.getMaterialName());
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getType())) {
|
||||
errorMessages4.add("第" + (i + 1) + "行类型不能为空");
|
||||
} else {
|
||||
if (TypeDictData.get(vo.getType()) == null) {
|
||||
errorMessages4.add("第" + (i + 1) + "行类型" + vo.getType() + "在键值中不存在,请联系系统管理人员");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getUnit())) {
|
||||
errorMessages5.add("第" + (i + 1) + "行单位不能为空");
|
||||
} else {
|
||||
if (unitDictData.get(vo.getUnit()) == null) {
|
||||
errorMessages5.add("第" + (i + 1) + "行单位" + vo.getUnit() + "在键值中不存在,请联系系统管理人员");
|
||||
} else {
|
||||
storageInventoryDO.setBoomUnit(unitDictData.get(vo.getUnit()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getMainFrom())) {
|
||||
errorMessages6.add("第" + (i + 1) + "行来源不能为空");
|
||||
} else {
|
||||
if (OriginalDictData.get(vo.getMainFrom()) == null) {
|
||||
errorMessages6.add("第" + (i + 1) + "行来源" + vo.getMainFrom() + "在键值中不存在,请联系系统管理人员");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getWhName())) {
|
||||
errorMessages7.add("第" + (i + 1) + "行仓库不能为空");
|
||||
} else {
|
||||
LambdaQueryWrapper<WarehouseDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(WarehouseDO::getWhName, vo.getWhName());
|
||||
lambdaQueryWrapper.eq(WarehouseDO::getWhStatus, 1);
|
||||
WarehouseDO warehouseDO = warehouseMapper.selectOne(lambdaQueryWrapper);
|
||||
if (ObjectUtil.isEmpty(warehouseDO)) {
|
||||
errorMessages7.add("第" + (i + 1) + "行仓库" + vo.getWhName() + "不存在或未启用,请确认");
|
||||
} else {
|
||||
logDO.setWhId(warehouseDO.getId());
|
||||
whId = warehouseDO.getId();
|
||||
storageInventoryDO.setWhId(warehouseDO.getId());
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getRgName())) {
|
||||
errorMessages8.add("第" + (i + 1) + "行库区不能为空");
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(whId)) {
|
||||
LambdaQueryWrapper<RgDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(RgDO::getRgName, vo.getRgName());
|
||||
lambdaQueryWrapper.eq(RgDO::getRgStatus, 1);
|
||||
lambdaQueryWrapper.eq(RgDO::getWhId, whId);
|
||||
RgDO rgDO = rgMapper.selectOne(lambdaQueryWrapper);
|
||||
if (ObjectUtil.isEmpty(rgDO)) {
|
||||
errorMessages8.add("第" + (i + 1) + "行库区" + vo.getRgName() + "不存在或未启用,请确认");
|
||||
} else {
|
||||
logDO.setRgId(rgDO.getId());
|
||||
rgId = rgDO.getId();
|
||||
storageInventoryDO.setRgId(rgDO.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vo.getPnName())) {
|
||||
errorMessages9.add("第" + (i + 1) + "行库位不能为空");
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(whId) && ObjectUtil.isNotEmpty(rgId)) {
|
||||
LambdaQueryWrapper<PnDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PnDO::getPnName, vo.getPnName());
|
||||
lambdaQueryWrapper.eq(PnDO::getPnStatus, 1);
|
||||
lambdaQueryWrapper.eq(PnDO::getRgId, rgId);
|
||||
lambdaQueryWrapper.eq(PnDO::getWhId, whId);
|
||||
PnDO pnDO = pnMapper.selectOne(lambdaQueryWrapper);
|
||||
if (ObjectUtil.isEmpty(pnDO)) {
|
||||
errorMessages9.add("第" + (i + 1) + "行库位" + vo.getPnName() + "不存在或未启用,请确认");
|
||||
} else {
|
||||
logDO.setPnId(pnDO.getId());
|
||||
pnId = pnDO.getId();
|
||||
storageInventoryDO.setPnId(pnDO.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(vo.getShortName())) {
|
||||
storageInventoryDO.setShortName(vo.getShortName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(vo.getSpec())) {
|
||||
storageInventoryDO.setBoomSpec(vo.getSpec());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(code) && ObjectUtil.isNotEmpty(whId) && ObjectUtil.isNotEmpty(rgId) && ObjectUtil.isNotEmpty(pnId)) {
|
||||
LambdaQueryWrapper<StorageInventoryDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(StorageInventoryDO::getBoomCode, code);
|
||||
wrapper.eq(StorageInventoryDO::getWhId, whId);
|
||||
wrapper.eq(StorageInventoryDO::getRgId, rgId);
|
||||
wrapper.eq(StorageInventoryDO::getPnId, pnId);
|
||||
StorageInventoryDO selectOne = storageInventoryMapper.selectOne(wrapper);
|
||||
if (ObjectUtil.isNotEmpty(selectOne)) {
|
||||
errorMessages10.add("第" + (i + 1) + "行物料" + vo.getMaterialName() + "在库存表中已存在,请确认");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(code) && ObjectUtil.isNotEmpty(whId)
|
||||
&& ObjectUtil.isNotEmpty(rgId) && ObjectUtil.isNotEmpty(pnId)) {
|
||||
String compositeKey = String.format("%d_%d_%d_%s", whId, rgId, pnId, code);
|
||||
String existingRows = duplicateTracker.get(compositeKey);
|
||||
if (existingRows != null) { // ✅ 防止 NPE
|
||||
errorMessages2.add("第" + (i + 1) + "行物料" + vo.getMaterialName() + "重复,请确认");
|
||||
} else {
|
||||
duplicateTracker.put(compositeKey, vo.getCode());
|
||||
}
|
||||
storageInventoryDOS.add(storageInventoryDO);
|
||||
logs.add(logDO);
|
||||
}
|
||||
}
|
||||
if (!errorMessages.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages1.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages1);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages2.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages2);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages3.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages3);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages4.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages4);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages5.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages5);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages6.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages6);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages7.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages7);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages8.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages8);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages9.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages9);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
if (!errorMessages10.isEmpty()) {
|
||||
|
||||
String joinedErrors = String.join(System.lineSeparator(), errorMessages10);
|
||||
throw new RuntimeException(joinedErrors); // 若仍需抛异常可改用此方式
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(dataList)) {
|
||||
return CommonResult.success(dataList);
|
||||
}
|
||||
storageInventoryMapper.insertBatch(storageInventoryDOS);
|
||||
storageLogMapper.insertBatch(logs);
|
||||
return CommonResult.success(null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveMaterial(List<StorageInventoryImportExcelVO> list) {
|
||||
ArrayList<MaterialDO> materialDOS = new ArrayList<>();
|
||||
HashMap<String, String> unitDictData = getUnitDictData();
|
||||
HashMap<String, String> TypeDictData = getTypeDictData();
|
||||
HashMap<String, String> OriginalDictData = getOriginalDictData();
|
||||
for (StorageInventoryImportExcelVO vo : list) {
|
||||
MaterialDO materialDO = new MaterialDO();
|
||||
materialDO.setCode(vo.getCode());
|
||||
materialDO.setName(vo.getMaterialName());
|
||||
materialDO.setBrand(vo.getBrand());
|
||||
materialDO.setSpec(vo.getSpec());
|
||||
if (ObjectUtil.isNotEmpty(vo.getShortName())){
|
||||
materialDO.setShortName(vo.getShortName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(unitDictData.get(vo.getUnit()))){
|
||||
materialDO.setUnit(unitDictData.get(vo.getUnit()));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(TypeDictData.get(vo.getType()))){
|
||||
materialDO.setMaterialType(TypeDictData.get(vo.getType()));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(OriginalDictData.get(vo.getMainFrom()))){
|
||||
materialDO.setMainFrom(Integer.valueOf(OriginalDictData.get(vo.getMainFrom())));
|
||||
}
|
||||
materialDOS.add(materialDO);
|
||||
}
|
||||
materialMapper.insertBatch(materialDOS);
|
||||
}
|
||||
|
||||
public HashMap<String,String> getUnitDictData() {
|
||||
//获取单位字典
|
||||
DictDataPageReqVO dictDataPageReqVO = new DictDataPageReqVO();
|
||||
dictDataPageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
dictDataPageReqVO.setDictType("heli_material_unit");
|
||||
PageResult<DictDataDO> dictDataDOPageResult = dictDataMapper.selectPage(dictDataPageReqVO);
|
||||
List<DictDataDO> dictList = dictDataDOPageResult.getList();
|
||||
HashMap<String, String> unitMap = new HashMap<>();
|
||||
for (DictDataDO dictDataDO : dictList) {
|
||||
unitMap.put(dictDataDO.getLabel(), dictDataDO.getValue());
|
||||
}
|
||||
return unitMap;
|
||||
}
|
||||
|
||||
public HashMap<String,String> getTypeDictData() {
|
||||
//获取类型字典
|
||||
DictDataPageReqVO dictDataPageReqVO = new DictDataPageReqVO();
|
||||
dictDataPageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
dictDataPageReqVO.setDictType("heli_material_type");
|
||||
PageResult<DictDataDO> dictDataDOPageResult = dictDataMapper.selectPage(dictDataPageReqVO);
|
||||
List<DictDataDO> dictList = dictDataDOPageResult.getList();
|
||||
HashMap<String, String> unitMap = new HashMap<>();
|
||||
for (DictDataDO dictDataDO : dictList) {
|
||||
unitMap.put(dictDataDO.getLabel(), dictDataDO.getValue());
|
||||
}
|
||||
return unitMap;
|
||||
}
|
||||
public HashMap<String,String> getOriginalDictData() {
|
||||
//获取来源字典
|
||||
DictDataPageReqVO dictDataPageReqVO = new DictDataPageReqVO();
|
||||
dictDataPageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
dictDataPageReqVO.setDictType("heli_material_original");
|
||||
PageResult<DictDataDO> dictDataDOPageResult = dictDataMapper.selectPage(dictDataPageReqVO);
|
||||
List<DictDataDO> dictList = dictDataDOPageResult.getList();
|
||||
HashMap<String, String> unitMap = new HashMap<>();
|
||||
for (DictDataDO dictDataDO : dictList) {
|
||||
unitMap.put(dictDataDO.getLabel(), dictDataDO.getValue());
|
||||
}
|
||||
return unitMap;
|
||||
}
|
||||
}
|
||||
|
||||
51
mes-ui/mes-ui-admin-vue3/src/api/heli/plansubdetail/index.ts
Normal file
51
mes-ui/mes-ui-admin-vue3/src/api/heli/plansubdetail/index.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface PlanSubDetailVO {
|
||||
id: number
|
||||
projectPlanId: number
|
||||
projectId: number
|
||||
projectSubId: number
|
||||
projectSubCode: string
|
||||
twoDimDate: Date
|
||||
twoDimOwner: number
|
||||
startTwoDimDate: Date
|
||||
subType: string
|
||||
isOverProcess: boolean
|
||||
seqNo: number
|
||||
designNum: number
|
||||
code: string
|
||||
name: string
|
||||
}
|
||||
|
||||
// 查询生产计划子项目设计时间明细分页
|
||||
export const getPlanSubDetailPage = async (params) => {
|
||||
return await request.get({ url: `/heli/plan-sub-detail/page`, params })
|
||||
}
|
||||
|
||||
// 查询生产计划子项目设计时间明细详情
|
||||
export const getPlanSubDetail = async (id: number) => {
|
||||
return await request.get({ url: `/heli/plan-sub-detail/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增生产计划子项目设计时间明细
|
||||
export const createPlanSubDetail = async (data: PlanSubDetailVO) => {
|
||||
return await request.post({ url: `/heli/plan-sub-detail/create`, data })
|
||||
}
|
||||
|
||||
// 修改生产计划子项目设计时间明细
|
||||
export const updatePlanSubDetail = async (data: PlanSubDetailVO) => {
|
||||
return await request.put({ url: `/heli/plan-sub-detail/update`, data })
|
||||
}
|
||||
|
||||
// 删除生产计划子项目设计时间明细
|
||||
export const deletePlanSubDetail = async (id: number) => {
|
||||
return await request.delete({ url: `/heli/plan-sub-detail/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出生产计划子项目设计时间明细 Excel
|
||||
export const exportPlanSubDetail = async (params) => {
|
||||
return await request.download({ url: `/heli/plan-sub-detail/export-excel`, params })
|
||||
}
|
||||
export const getSearchRlTsS = async (startDateTime: string ) => {
|
||||
return await request.get({ url: `/heli/plan-sub-detail/getSearchRlTs?startDateTime=` + startDateTime})
|
||||
}
|
||||
@ -71,3 +71,6 @@ export const getProcessDesignPages = async (params) => {
|
||||
export const exportProcessDesigns = async (params) => {
|
||||
return await request.download({ url: `/heli/process-design/exportExcel`, params })
|
||||
}
|
||||
export const updateFlag = async (data) => {
|
||||
return await request.post({ url: `/heli/process-design/updateFlag`, data })
|
||||
}
|
||||
|
||||
@ -66,3 +66,7 @@ export const realTimeInventory = async (params) => {
|
||||
export const getById = async (params) => {
|
||||
return await request.get({ url: `/heli/storage-inventory/getById`, params })
|
||||
}
|
||||
// 新增库存
|
||||
export const saveMaterial = async (data) => {
|
||||
return await request.post({ url: `/heli/storage-inventory/saveMaterial`, data })
|
||||
}
|
||||
|
||||
@ -301,5 +301,8 @@ export enum DICT_TYPE {
|
||||
HELI_PROCESS_TYPE="heli_process_type",
|
||||
HELI_RECEIVING_STATUS="heli_receiving_status",
|
||||
HELI_YS_TYPE = 'heli_ys_type', // 质检类型
|
||||
HELI_CH_PROCESS_TYPE="heli_ch_process_type",
|
||||
HELI_PLAN_TASK_STATUS = 'heli_plan_task_status', //bom状态
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -689,7 +689,9 @@ const handlePay =async (row: any) => {
|
||||
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //直接修改取消显示
|
||||
}
|
||||
if (row.type == 'BOM变更审核通过后') {
|
||||
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
|
||||
await bdgzsomthingApi.deleteByIdNew(row.id);
|
||||
|
||||
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
|
||||
router.push({ path: '/plan/PlanTasks', state: { idid: row.idid } });
|
||||
}
|
||||
if (row.type == '质检通知单') {
|
||||
@ -727,13 +729,14 @@ if (row.type == '设计任务到期'){
|
||||
||row.type == '生产任务到期'
|
||||
||row.type == '质检任务到期前'
|
||||
||row.type == '《物料需求计划》提交后'
|
||||
|| row.type=='BOM变更审核通过后'
|
||||
// ||(row.type == '《物料需求计划》的采购'&&userDept.value.deptName != '采购部')
|
||||
|
||||
) {
|
||||
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', query: { idid: row.idid } });
|
||||
await bdgzsomthingApi.updatebdgzsomthingbyidone(row.id)
|
||||
ElMessage({
|
||||
message: '已阅',
|
||||
message: '查阅',
|
||||
type: 'success',
|
||||
});
|
||||
getList()
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="发货日期" prop="deliverDate">
|
||||
<el-date-picker :disabled="detailDisabled || active!='create'" v-model="formData.deliverDate" type="date" value-format="x" placeholder="选择发货日期" class="!w-250px" />
|
||||
<el-date-picker :disabled="detailDisabled || flag" v-model="formData.deliverDate" type="date" value-format="x" placeholder="选择发货日期" class="!w-250px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@ -203,7 +203,7 @@
|
||||
<template #header> <span class="hl-table_header">*</span>本次发货数量 </template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.amount`" :rules="subFormRules.amount" class="mb-0px!">
|
||||
<el-input-number :disabled="detailDisabled || flag" v-model="row.amount" placeholder="请输入本次发货数量" style="width: 100%" :min="1" /><!-- :precision="0" -->
|
||||
<el-input-number :disabled="detailDisabled || flag" v-model="row.amount" placeholder="请输入本次发货数量" style="width: 100%" :min="0" /><!-- :precision="0" -->
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -290,7 +290,7 @@
|
||||
<template #header> <span class="hl-table_header">*</span>本次发货数量 </template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.amount`" :rules="subFormRules.amount" class="mb-0px!">
|
||||
<el-input-number :disabled="detailDisabled || formData.deliverStatus == 2" v-model="row.amount" placeholder="请输入本次发货数量" style="width: 100%" :min="1" :precision="0"/><!-- :precision="0" -->
|
||||
<el-input-number :disabled="detailDisabled || formData.deliverStatus == 2" v-model="row.amount" placeholder="请输入本次发货数量" style="width: 100%" :min="0" :precision="0"/><!-- :precision="0" -->
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -538,11 +538,16 @@ const otherSubFormRef = ref()
|
||||
//计算运费
|
||||
const yunFei = (event) => {
|
||||
|
||||
const totalWeight = formData.value.deliverOrderSubs.reduce((sum, item) => {
|
||||
const weight = item.weight !== null && item.weight !== undefined ? Number(item.weight) : 0;
|
||||
return sum + weight;
|
||||
}, 0);
|
||||
formData.value.transportWeight=totalWeight
|
||||
// const totalWeight = formData.value.deliverOrderSubs.reduce((sum, item) => {
|
||||
// const weight = item.weight != null ? Number(item.weight) : 0;
|
||||
//
|
||||
// return sum + weight;
|
||||
// }, 0);
|
||||
let totalWeight = 0;
|
||||
for (let i = 0; i < formData.value.deliverOrderSubs.length; i++) {
|
||||
totalWeight += Number(formData.value.deliverOrderSubs[i].weight) || 0;
|
||||
}
|
||||
formData.value.transportWeight=parseFloat(totalWeight.toPrecision(12))
|
||||
|
||||
if (formData.value.transportFreightCost && formData.value.transportFreightCost > 0) {
|
||||
//先将有重量和无重量的进行拆分
|
||||
|
||||
@ -46,23 +46,34 @@ const gitlist = async () => {
|
||||
userList.value = []
|
||||
userSelectList.value = []
|
||||
userList.value = [...userList.value, ...data.list]
|
||||
console.log(propsmodelValue.value)
|
||||
// 设置初始值
|
||||
if (propsmodelValue.value) {
|
||||
valueName.value = propsmodelValue.value
|
||||
const initialUser = await UserApi.getUser(valueName.value)
|
||||
if (initialUser.status == 1) {
|
||||
status1.value = true
|
||||
} else {
|
||||
console.log(valueName.value)
|
||||
console.log(initialUser)
|
||||
if (initialUser){
|
||||
if (initialUser.status == 1) {
|
||||
status1.value = true
|
||||
} else {
|
||||
status1.value = false
|
||||
}
|
||||
}else {
|
||||
status1.value = false
|
||||
|
||||
}
|
||||
|
||||
// 查找初始用户是否已经在 userList 中
|
||||
let foundInitialUserInList = false
|
||||
for (const user of userList.value) {
|
||||
if (user.id === initialUser.id) {
|
||||
// propsmodelValue.value=initialUser.username+' '+initialUser.nickname
|
||||
if (initialUser){
|
||||
if (user.id === initialUser.id) {
|
||||
// propsmodelValue.value=initialUser.username+' '+initialUser.nickname
|
||||
|
||||
foundInitialUserInList = true
|
||||
break
|
||||
foundInitialUserInList = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果初始用户不在列表中,则将其添加到列表开头
|
||||
|
||||
288
mes-ui/mes-ui-admin-vue3/src/views/heli/interrupt/index.vue
Normal file
288
mes-ui/mes-ui-admin-vue3/src/views/heli/interrupt/index.vue
Normal file
@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<el-card class="hl-card">
|
||||
<template #header>
|
||||
<span>手动插活方案</span>
|
||||
</template>
|
||||
<ContentWrap class="borderxx">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="110px"
|
||||
>
|
||||
<el-form-item label="负责人" prop="twoDimOwner">
|
||||
<el-select class="!w-265px" v-model="queryParams.twoDimOwner" clearable filterable>
|
||||
<el-option
|
||||
v-for="dict in userInit" :key="dict.id"
|
||||
:label="dict.nickname" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始日期" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.startTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
class="!w-280px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编号" prop="code">
|
||||
<el-input
|
||||
v-model="queryParams.code"
|
||||
placeholder="请输入项目编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子项目名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入子项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设计类型" prop="subType">
|
||||
<el-select v-model="queryParams.subType" placeholder="类型" clearable class="!w-240px">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_CH_PROCESS_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery" type="primary"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" class="hl-table" border>
|
||||
<el-table-column fixed label="序号" type="index" width="70" align="center" />
|
||||
<el-table-column fixed label="项目编码" align="center" prop="code" min-width="120" />
|
||||
<el-table-column fixed label="子项目名称" align="center" prop="name" min-width="250" />
|
||||
<el-table-column min-width="200px" align="center" >
|
||||
<template #header>设计类型</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.subType`" class="mb-0px!" >
|
||||
<el-select class="!w-265px" v-model="row.subType" clearable filterable :disabled="row.flag==0">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_CH_PROCESS_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="200px" align="center" >
|
||||
<template #header>负责人</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.twoDimOwner`" class="mb-0px!" >
|
||||
<el-select class="!w-265px" v-model="row.twoDimOwner" clearable filterable :disabled="row.flag==0">
|
||||
<el-option
|
||||
v-for="dict in userInit" :key="dict.id"
|
||||
:label="dict.username+' '+dict.nickname" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="200px" align="center" >
|
||||
<template #header>开始日期</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.startTwoDimDate`" class="mb-0px!" >
|
||||
<el-date-picker class="!w-265px" v-model="row.startTwoDimDate" type="date" @change="change1(row,0)" value-format="x" placeholder="开始日期" :disabled="row.flag==0" :disabled-date="disabledFutureDates"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="200px" align="center" >
|
||||
<template #header>结束日期</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.twoDimDate`" class="mb-0px!" >
|
||||
<el-date-picker class="!w-265px" v-model="row.twoDimDate" type="date" @change="change1(row,1)" value-format="x" placeholder="结束日期" :disabled="row.flag==0" :disabled-date="disabledFutureDates"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设计天数" align="center" prop="designNum" min-width="120"/>
|
||||
<el-table-column label="时间段顺序" align="center" prop="seqNo" min-width="120"/>
|
||||
<el-table-column label="是否新增" align="center" prop="seqNo" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ scope.row.isAdd==1?"是":"否" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" min-width="120">
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-button link type="primary" @click="modification(scope.row)" >-->
|
||||
<!-- 修改-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- link-->
|
||||
<!-- type="danger"-->
|
||||
<!-- >-->
|
||||
<!-- 删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button link type="primary" >-->
|
||||
<!-- 新增-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
defineOptions({ name: 'interrupt' })
|
||||
import * as PlansubdetailApi from '@/api/heli/plansubdetail'
|
||||
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
|
||||
import {ref, reactive, onMounted} from "vue"; // 确保导入 onMounted
|
||||
import * as UserApi from "@/api/system/user";
|
||||
import {formatDate} from "@/utils/formatTime";
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const userInit = ref()
|
||||
const loading = ref(false)
|
||||
const list = ref([])
|
||||
const total = ref(0)
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
twoDimOwner: undefined,
|
||||
subType: undefined,
|
||||
startTime: undefined,
|
||||
code: undefined,
|
||||
name: undefined
|
||||
})
|
||||
const queryFormRef = ref()
|
||||
|
||||
// 添加一个标志位防止无限循环
|
||||
let isProcessingChange = false
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await PlansubdetailApi.getPlanSubDetailPage(queryParams)
|
||||
list.value = data.list
|
||||
list.value.forEach(item => {
|
||||
item.isAdd = 0
|
||||
})
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const modification = (row) => {
|
||||
console.log(row)
|
||||
}
|
||||
|
||||
// 禁用过去日期
|
||||
const disabledFutureDates = (time) => {
|
||||
const today = new Date()
|
||||
today.setHours(0, 0, 0, 0)
|
||||
return time.getTime() < today.getTime()
|
||||
}
|
||||
|
||||
const change1 = async (row: any, type: number) => {
|
||||
if (isProcessingChange) return // 防止重复处理
|
||||
isProcessingChange = true
|
||||
|
||||
try {
|
||||
if (row.startTwoDimDate && row.twoDimDate) {
|
||||
const startTime = new Date(row.startTwoDimDate).getTime()
|
||||
const endTime = new Date(row.twoDimDate).getTime()
|
||||
|
||||
if (startTime > endTime) {
|
||||
// 使用 setTimeout 避免在渲染过程中直接调用 message.error
|
||||
setTimeout(() => {
|
||||
message.error("开始日期不能大于结束日期,请确认!")
|
||||
}, 100)
|
||||
|
||||
if (type === 0) {
|
||||
row.startTwoDimDate = undefined
|
||||
} else {
|
||||
row.twoDimDate = undefined
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const time = type === 0 ? new Date(row.startTwoDimDate) : new Date(row.twoDimDate)
|
||||
if (!time || isNaN(time.getTime())) return
|
||||
|
||||
const data = await PlansubdetailApi.getSearchRlTsS(formatDate(time, 'YYYY-MM-DD'))
|
||||
|
||||
if (data <= 0) {
|
||||
setTimeout(() => {
|
||||
message.error("选择的日期是节假日,请确认!")
|
||||
}, 100)
|
||||
|
||||
if (type === 0) {
|
||||
row.startTwoDimDate = undefined
|
||||
} else {
|
||||
row.twoDimDate = undefined
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
isProcessingChange = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
if (queryParams.twoDimOwner == null) {
|
||||
// 使用 setTimeout 避免渲染过程中直接调用 message.error
|
||||
setTimeout(() => {
|
||||
message.error("负责人为空,请确认")
|
||||
}, 100)
|
||||
return // 添加 return 防止继续执行
|
||||
}
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
// 不要在这里直接调用 handleQuery,避免循环
|
||||
queryParams.pageNo = 1
|
||||
Object.assign(queryParams, {
|
||||
twoDimOwner: undefined,
|
||||
subType: undefined,
|
||||
startTime: undefined,
|
||||
code: undefined,
|
||||
name: undefined
|
||||
})
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 取消注释并正确初始化
|
||||
userInit.value = await UserApi.getDeptName("设计部")
|
||||
await getList()
|
||||
} catch (error) {
|
||||
console.error('初始化失败:', error)
|
||||
setTimeout(() => {
|
||||
message.error("初始化数据失败")
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@ -61,6 +61,7 @@ const submitForm = async () => {
|
||||
try {
|
||||
|
||||
dialogVisible.value = false
|
||||
formData.value.status=3
|
||||
await PartPurchaseOrderApi.updatePurchaseOrderMakeNo(formData.value)
|
||||
// 发送操作成功的事件
|
||||
message.success("驳回成功");
|
||||
|
||||
@ -105,7 +105,12 @@
|
||||
<td>负责人</td>
|
||||
<td colspan="2">{{ userInit.find((user) => user.id == planData.craftOwner)?.nickname }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="font-size: 16px">备注</td>
|
||||
<td colspan="8">
|
||||
{{ formData.remark }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody>
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态 " prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="单据状态" clearable class="!w-240px">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_BOM_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PLAN_TASK_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left: 20px">
|
||||
@ -73,7 +73,7 @@
|
||||
<el-table-column label="备注" align="center" prop="description" width="220px" /> -->
|
||||
<el-table-column fixed="right" label="单据状态" align="center" prop="status" width="150">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_BOM_STATUS" :value="scope.row.status" />
|
||||
<dict-tag :type="DICT_TYPE.HELI_PLAN_TASK_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
@ -745,7 +745,17 @@ const submitForm = async (operate) => {
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const onAddItem = () => {
|
||||
const onAddItem = async () => {
|
||||
if (formData.value.processBomDetails!=null){
|
||||
var status
|
||||
await ProcessBomApi.selectPlanTaskStatus(formData.value.id).then(data=>{
|
||||
status=data
|
||||
});
|
||||
if (status){
|
||||
await message.confirm("是否取消提交生产任务单")
|
||||
await ProcessBomApi.updateById(formData.value.id)
|
||||
}
|
||||
}
|
||||
const row = {
|
||||
id: undefined,
|
||||
bomId: undefined,
|
||||
|
||||
@ -35,7 +35,7 @@ import DOMPurify from 'dompurify';
|
||||
defineOptions({ name: 'BomImportForm' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
import * as ProcessBomApi from '@/api/heli/processbom'
|
||||
|
||||
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
|
||||
@ -301,7 +301,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.beginTime`" class="mb-0px!">
|
||||
<!-- <el-input-number min="0" max="100" class="!w-240px" :disabled="detailDisabled || row.id" v-model="row.progress" placeholder="请输入进度百分比" @change="verify1($index)"/>-->
|
||||
<el-date-picker class="!w-230px" :disabled-date="(date) => disabledDate1(date, row)" @change="(e) => beginTimeChange(e,row)" :disabled=" row.isOver == 1 || formData.isOverProcess == 1" :formatter="dateFormatter" v-model="row.beginTime" type="datetime" placeholder="选择开始日期"/>
|
||||
<el-date-picker class="!w-230px" :disabled-date="(date) => disabledDate1(date, row)" @change="(e) => beginTimeChange(e,row)" :disabled=" (row.isOver == 1 || formData.isOverProcess == 1) && row.flag!=0" :formatter="dateFormatter" v-model="row.beginTime" type="datetime" placeholder="选择开始日期"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -310,7 +310,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.endTime`" class="mb-0px!">
|
||||
<!-- <el-input-number min="0" max="100" class="!w-240px" :disabled="detailDisabled || row.id" v-model="row.progress" placeholder="请输入进度百分比" @change="verify1($index)"/>-->
|
||||
<el-date-picker class="!w-230px" :disabled-date="(date) => disabledDate(date, row)" @change="(e) => endTimeChange(e,row)" :disabled=" row.isOver == 1 || formData.isOverProcess == 1" :formatter="dateFormatter" v-model="row.endTime" type="datetime" placeholder="选择结束日期"/>
|
||||
<el-date-picker class="!w-230px" :disabled-date="(date) => disabledDate(date, row)" @change="(e) => endTimeChange(e,row)" :disabled=" (row.isOver == 1 || formData.isOverProcess == 1) && row.flag!=0" :formatter="dateFormatter" v-model="row.endTime" type="datetime" placeholder="选择结束日期"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -318,7 +318,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<template #header>已做时间(小时)</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.workTime`" class="mb-0px!">
|
||||
<el-input-number :max="row.maxTime" :precision="2" class="!w-240px" :disabled=" row.isOver == 1 || formData.isOverProcess == 1" v-model="row.workTime" placeholder="请输入已做时间"/>
|
||||
<el-input-number :max="row.maxTime" :precision="2" class="!w-240px" :disabled=" (row.isOver == 1 || formData.isOverProcess == 1) && row.flag!=0" v-model="row.workTime" placeholder="请输入已做时间"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -345,7 +345,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<el-table-column label="备注" prop="remark" min-width="280">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.remark`" class="mb-0px!">
|
||||
<el-input :disabled="row.hasNext || row.isOver == 1 || formData.isOverProcess == 1" v-model="row.remark" placeholder="请输入备注" />
|
||||
<el-input :disabled="(row.hasNext || row.isOver == 1 || formData.isOverProcess == 1) && row.flag!=0" v-model="row.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -360,6 +360,15 @@ v-if="scope.row.isOver == 0 && active != 'detail'"
|
||||
>
|
||||
结束
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.flag == 0"
|
||||
link
|
||||
type="primary"
|
||||
|
||||
@click="updateFlag(scope.row)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -386,6 +395,7 @@ import {useCommonStore} from "@/store/modules/common";
|
||||
import {ElMessageBox} from "element-plus";
|
||||
import * as PlanSubApi from "@/api/heli/plansub";
|
||||
import {getPgMasterLineListByZlPgId} from "@/api/heli/pgmaster";
|
||||
import * as UserApi from "@/api/system/user";
|
||||
|
||||
defineOptions({ name: 'ProcessDesignDetail' })
|
||||
|
||||
@ -403,7 +413,7 @@ const processDesignType = toRef(commonStore.getStore('processDesignType'))
|
||||
const formLoading = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
const detailDisabled = ref(false)
|
||||
const flag = ref(false)
|
||||
const ststus = ref(false)
|
||||
const delayDialog = ref(false)
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
@ -415,6 +425,7 @@ const formData = ref({
|
||||
projectSubId: undefined,
|
||||
processDesignProgressList: [],
|
||||
})
|
||||
const flag = ref(false) // 列表的加载中
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
const processDesignProgressFormRef = ref()
|
||||
@ -723,6 +734,31 @@ const overRow = async( row :any) =>{
|
||||
await submitForm('SAVE');
|
||||
//更新一下这条数据的状态
|
||||
}
|
||||
const updateFlag = async(row:any) =>{
|
||||
console.log(row)
|
||||
if(row.endTime == null ){
|
||||
message.error("开始时间不能为空!请确认!")
|
||||
return
|
||||
}
|
||||
if(row.endTime == null ){
|
||||
message.error("结束时间不能为空!请确认!")
|
||||
return
|
||||
}
|
||||
if(row.workTime == null){
|
||||
message.error("已做时间不能为空!请确认")
|
||||
return
|
||||
}
|
||||
if(new Date(row.beginTime) > new Date(row.endTime)){
|
||||
message.error("开始时间不能大于结束时间!请确认!")
|
||||
return
|
||||
}
|
||||
await ProcessDesignApi.updateFlag(row)
|
||||
//更新一下这条数据的状态
|
||||
message.success(t('common.operationSuccess'))
|
||||
commonStore.setStore('active', 'update');
|
||||
commonStore.setStore('id', processDesignId);
|
||||
reload()
|
||||
}
|
||||
const overProcess = () =>{
|
||||
if(formData.value.processDesignProgressList != null && formData.value.processDesignProgressList.length > 0){
|
||||
for (let index = 0; index < formData.value.processDesignProgressList.length; index++) {
|
||||
@ -819,19 +855,46 @@ const queryData = async (id?: number) => {
|
||||
getWorkTime(1)
|
||||
getWorkTime(2)
|
||||
formData.value.processDesignProgressList = await ProcessDesignApi.getProcessDesignProgressListByProcessDesignId(id)
|
||||
const newVar = await UserApi.isAdministrator();
|
||||
if (newVar==true){
|
||||
ststus.value=true
|
||||
}
|
||||
if( formData.value.processDesignProgressList != null && formData.value.processDesignProgressList.length > 0){
|
||||
var maxTime = null;
|
||||
if(formData.value.processDesignProgressList.length == 1){
|
||||
formData.value.processDesignProgressList[0].hasNext = false;
|
||||
console.log(ststus.value)
|
||||
if(formData.value.processDesignProgressList[0].endTime != null && formData.value.processDesignProgressList[0].endTime != ''){
|
||||
if (ststus.value){
|
||||
formData.value.processDesignProgressList[0].flag=0
|
||||
}else {
|
||||
if (formData.value.processDesignProgressList[0].isOver == 1 || formData.value.isOverProcess == 1) {
|
||||
formData.value.processDesignProgressList[0].flag = 1
|
||||
}
|
||||
}
|
||||
|
||||
formData.value.processDesignProgressList[0].maxTime = (formData.value.processDesignProgressList[0].endTime - formData.value.processDesignProgressList[0].beginTime)/ (1000 * 60 * 60);
|
||||
}else {
|
||||
formData.value.processDesignProgressList[0].flag=1
|
||||
|
||||
}
|
||||
} else{
|
||||
console.log(ststus.value)
|
||||
|
||||
var maxIndex = 0;
|
||||
for (let index = 0; index < formData.value.processDesignProgressList.length; index++) {
|
||||
var item = formData.value.processDesignProgressList[index];
|
||||
if(item.endTime != null && item.endTime != ''){
|
||||
item.maxTime = (item.endTime - item.beginTime)/ (1000 * 60 * 60);
|
||||
if (ststus.value){
|
||||
item.flag=0
|
||||
}else {
|
||||
if (item.isOver==1||formData.value.isOverProcess == 1)
|
||||
item.flag=1
|
||||
}
|
||||
}else {
|
||||
formData.value.processDesignProgressList[0].flag=1
|
||||
|
||||
}
|
||||
if(maxTime == null){
|
||||
maxIndex = index;
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" class="hl-table" border>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" class="hl-table" border :cell-class-name="cellClassName">
|
||||
<el-table-column fixed label="序号" type="index" width="70" align="center" />
|
||||
<el-table-column fixed label="客户名称" align="center" prop="customerName" min-width="120" />
|
||||
<el-table-column fixed label="项目名称" align="center" prop="projectName" min-width="180" />
|
||||
@ -261,7 +261,42 @@ const typeList = ref([
|
||||
// await getList()
|
||||
// } catch {}
|
||||
// }
|
||||
// const tableRowClassName = ({ row }) => {
|
||||
// if (row.endDate){
|
||||
// var endTime = new Date(row.endDate);
|
||||
//
|
||||
// // 获取当前时间的 Date 对象
|
||||
// var currentTime = new Date();
|
||||
// // 将 endTime 和 currentTime 的时间部分设置为零
|
||||
// endTime.setHours(0, 0, 0, 0);
|
||||
// currentTime.setHours(0, 0, 0, 0);
|
||||
// if (endTime < currentTime&&row.isOverProcess!=1){
|
||||
// return 'warning-row1';
|
||||
// }else {
|
||||
// return ''
|
||||
// }
|
||||
// }
|
||||
// return ''
|
||||
// }
|
||||
const cellClassName = ({ row,column }) => {
|
||||
if (row.endDate){
|
||||
var endTime = new Date(row.endDate);
|
||||
|
||||
// 获取当前时间的 Date 对象
|
||||
var currentTime = new Date();
|
||||
// 将 endTime 和 currentTime 的时间部分设置为零
|
||||
endTime.setHours(0, 0, 0, 0);
|
||||
currentTime.setHours(0, 0, 0, 0);
|
||||
if (endTime < currentTime&&row.isOverProcess!=1){
|
||||
if (column.label=='计划终止')
|
||||
return 'warning-row1';
|
||||
}else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
return ''
|
||||
|
||||
};
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
@ -292,3 +327,8 @@ onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
.warning-row1 {
|
||||
background-color:#F08080 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -673,7 +673,7 @@ v-model="row.compositionId"
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="'update,create'.indexOf(query.active) > -1 && !formData.hasAlter"
|
||||
v-if="'update,create,alter'.indexOf(query.active) > -1"
|
||||
link type="danger" size="small"
|
||||
@click.prevent="onDeleteItem(scope.$index)">
|
||||
删除
|
||||
@ -1738,10 +1738,11 @@ type="textarea" v-model="formData.activeOpinion" placeholder="请输入打回原
|
||||
|
||||
/** 删除子项操作 */
|
||||
const onDeleteItem = async (index) => {
|
||||
let deletedItems = formData.value.projectOrderSubs.splice(index, 1)
|
||||
let id = deletedItems[0].id;
|
||||
let id = formData.value.projectOrderSubs[index].id;
|
||||
if (id) await ProjectOrderApi.deleteProjectOrderSub(id)
|
||||
}
|
||||
formData.value.projectOrderSubs.splice(index, 1)
|
||||
|
||||
}
|
||||
// ====================附件信息 开始=======================================
|
||||
const uploading = ref(false)
|
||||
const uploadUrl = ref(
|
||||
|
||||
@ -107,7 +107,7 @@ v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.ente
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="requireTime" min-width="150" label="需要完成日期" align="center" :formatter="dateFormatter1"/>
|
||||
<el-table-column prop="arriveTime" min-width="150" label="预计收货日期" align="center" :formatter="dateFormatter1" />
|
||||
<el-table-column prop="arriveTime" min-width="150" label="收货日期" align="center" :formatter="dateFormatter1" />
|
||||
<el-table-column prop="description" min-width="150" label="技术要求" align="center"/>
|
||||
<el-table-column prop="theWeight" min-width="100" label="理论重量" align="center"/>
|
||||
<el-table-column label="操作" align="center" fixed="right" min-width="200">
|
||||
@ -277,7 +277,7 @@ const route = useRoute()
|
||||
const routeValue = ref('')
|
||||
onMounted(async () => {
|
||||
const newVar = await UserApi.isAdministrator();
|
||||
if (!newVar.data){
|
||||
if (newVar==false){
|
||||
isReadOnly.value=true
|
||||
}
|
||||
console.log(newVar)
|
||||
|
||||
@ -67,24 +67,29 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="rem">
|
||||
<el-input class="!w-1825px" v-model="formData.rem" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-card>
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">标准件成本</span>
|
||||
</template>
|
||||
<ContentWrap>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="标准件成本" name="biao">{{ }}</el-tab-pane>
|
||||
<el-tab-pane label="材料成本" name="cai">{{ }}</el-tab-pane>
|
||||
<el-tab-pane label="装配成本" name="zhuang">{{ }}</el-tab-pane>
|
||||
<el-tab-pane label="运费成本" name="yun">{{ }}</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-card class="hl-card-info" v-if="activeIndex == 'biao'">
|
||||
<!-- <template #header>-->
|
||||
<!-- <div class="hl-card-info-icona"></div><span class="hl-card-info-text">标准件成本</span>-->
|
||||
<!-- </template>-->
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" border class="hl-table" height="500px">
|
||||
<el-table-column type="index" min-width="70" fixed label="序号" align="center" />
|
||||
|
||||
|
||||
@ -112,11 +117,11 @@
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">材料成本</span>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="listcl" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||||
<el-card class="hl-card-info" v-if="activeIndex == 'cai'">
|
||||
<!-- <template #header>-->
|
||||
<!-- <div class="hl-card-info-icona"></div><span class="hl-card-info-text">材料成本</span>-->
|
||||
<!-- </template>-->
|
||||
<el-table v-loading="loading" :data="listcl" :stripe="true" :show-overflow-tooltip="true" border class="hl-table" height="500px">
|
||||
<el-table-column type="index" width="70" fixed label="序号" align="center" />
|
||||
|
||||
|
||||
@ -285,20 +290,16 @@
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="单件成本" align="center" prop="assemblyLaborCost" width="120px"/>
|
||||
|
||||
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">装配成本</span>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="listJg" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||||
<el-card class="hl-card-info" v-if="activeIndex == 'zhuang'">
|
||||
<!-- <template #header>-->
|
||||
<!-- <div class="hl-card-info-icona"></div><span class="hl-card-info-text">装配成本</span>-->
|
||||
<!-- </template>-->
|
||||
<el-table v-loading="loading" :data="listJg" :stripe="true" :show-overflow-tooltip="true" border class="hl-table" height="500px">
|
||||
<el-table-column type="index" min-width="60" fixed label="序号" align="center" />
|
||||
<el-table-column label="子项目编码" align="center" prop="projectSubCode" width="240px"/>
|
||||
<el-table-column label="子项目名称" align="center" prop="projectSubName" width="240px"/>
|
||||
@ -347,23 +348,20 @@
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">运费成本</span>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="listYf" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||||
<el-card class="hl-card-info" v-if="activeIndex == 'yun'">
|
||||
<!-- <template #header>-->
|
||||
<!-- <div class="hl-card-info-icona"></div><span class="hl-card-info-text">运费成本</span>-->
|
||||
<!-- </template>-->
|
||||
<el-table v-loading="loading" :data="listYf" :stripe="true" :show-overflow-tooltip="true" border class="hl-table" height="500px">
|
||||
<el-table-column type="index" min-width="60" fixed label="序号" align="center" />
|
||||
<el-table-column label="发货日期" align="center" prop="deliverDate" width="240px" :formatter="dateFormatter2"/>
|
||||
<el-table-column label="发货数量" align="center" prop="amount" />
|
||||
<el-table-column label="重量" align="center" prop="weight" />
|
||||
<el-table-column label="发货人" align="center" prop="deliverPersonName" />
|
||||
|
||||
<el-table-column label="运费" align="center" prop="yunFei" />
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
<div class="text-center hl-footer">
|
||||
<el-button @click="() => router.back()" size="large">取 消</el-button>
|
||||
@ -379,6 +377,7 @@
|
||||
import * as SaleeOrderCost from '@/api/heli/saleordercost'
|
||||
import {dateFormatter2} from "@/utils/formatTime";
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
import type {TabsPaneContext} from "element-plus";
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
@ -390,6 +389,8 @@
|
||||
const listcl = ref([]) // 材料
|
||||
// const listFzc = ref([]) // 副资材
|
||||
// const loading = ref(true) // 列表的加载中
|
||||
const activeName = ref('biao')
|
||||
const activeIndex = ref('biao')
|
||||
|
||||
// const listWx = ref([]) // 外协
|
||||
const listJg = ref([]) // 加工
|
||||
@ -414,7 +415,10 @@
|
||||
neiBuCost:undefined,
|
||||
})
|
||||
|
||||
|
||||
const handleClick = async(tab: TabsPaneContext, event: Event) => {
|
||||
var tabIndex = tab.props.name;
|
||||
activeIndex.value = tabIndex;
|
||||
}
|
||||
|
||||
//初始化方法
|
||||
onMounted(async () => {
|
||||
|
||||
145
mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/Import.vue
Normal file
145
mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/Import.vue
Normal file
@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" title="库存导入" width="400">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
v-model:file-list="fileList"
|
||||
:action="importUrl"
|
||||
:auto-upload="false"
|
||||
:disabled="formLoading"
|
||||
:headers="uploadHeaders"
|
||||
:limit="1"
|
||||
:on-error="submitFormError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="submitFormSuccess"
|
||||
accept=".xlsx, .xls"
|
||||
drag
|
||||
>
|
||||
<Icon icon="ep:upload" />
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<span>仅允许导入 xls、xlsx 格式文件。</span>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { getAccessToken, getTenantId } from '@/utils/auth'
|
||||
defineOptions({ name: 'import' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const uploadRef = ref()
|
||||
const importUrl =
|
||||
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/heli/storage-inventory/import'
|
||||
const uploadHeaders = ref() // 上传 Header 头
|
||||
const fileList = ref([]) // 文件列表
|
||||
const bomCode = ref('')
|
||||
import * as StorageInventoryApi from '@/api/heli/storageinventory'
|
||||
/** 打开弹窗 */
|
||||
const open = () => {
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
||||
if (fileList.value.length == 0) {
|
||||
message.error('请上传文件')
|
||||
return
|
||||
}
|
||||
// 提交请求
|
||||
uploadHeaders.value = {
|
||||
Authorization: 'Bearer ' + getAccessToken(),
|
||||
'tenant-id': getTenantId()}
|
||||
formLoading.value = true
|
||||
uploadRef.value!.submit()
|
||||
}
|
||||
|
||||
/** 文件上传成功 */
|
||||
const emits = defineEmits(['success'])
|
||||
const submitFormSuccess = async (response: any) => {
|
||||
if (response.code == 500) {
|
||||
uploadRef.value!.clearFiles()
|
||||
let formattedMsg = response.msg
|
||||
formattedMsg = formattedMsg.replace(/文件导入失败:/g, "文件导入失败:<br>");
|
||||
const finalMsg = formattedMsg
|
||||
.replace(/\r?\n/g, '<br>') // 将 \r\n 和 \n 都转为 <br>
|
||||
.replace(/\r/g, ''); // 清理残留的孤零零的 \r
|
||||
ElMessage({
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: finalMsg,
|
||||
type: 'error',
|
||||
duration: 3000,
|
||||
showClose: false,
|
||||
center: true
|
||||
});
|
||||
formLoading.value = false
|
||||
return
|
||||
}else if (response.data!=null){
|
||||
uploadRef.value!.clearFiles()
|
||||
formLoading.value = false
|
||||
await message.confirm("物料在物料表中不存在,是否先导入物料信息")
|
||||
await StorageInventoryApi.saveMaterial(response.data)
|
||||
return
|
||||
}
|
||||
message.alert("导入成功!")
|
||||
// 发送操作成功的事件
|
||||
uploadRef.value!.clearFiles()
|
||||
dialogVisible.value=false
|
||||
emits('success')
|
||||
}
|
||||
const submitFormSuccessTwo = (response: any) => {
|
||||
if (response.code !== 0) {
|
||||
message.error(response.msg)
|
||||
formLoading.value = false
|
||||
return
|
||||
}
|
||||
// 拼接提示语
|
||||
const data = response.data
|
||||
let text = '上传成功数量:' + data.createMaterials.length + ';'
|
||||
for (let material of data.createMaterials) {
|
||||
text += '< ' + material + ' >'
|
||||
}
|
||||
text += '更新成功数量:' + data.updateMaterials.length + ';'
|
||||
for (const material of data.updateMaterials) {
|
||||
text += '< ' + material + ' >'
|
||||
}
|
||||
text += '更新失败数量:' + Object.keys(data.failureMaterials).length + ';'
|
||||
for (const material in data.failureMaterials) {
|
||||
text += '< ' + material + ': ' + data.failureMaterials[material] + ' >'
|
||||
}
|
||||
message.alert(text)
|
||||
// 发送操作成功的事件
|
||||
emits('success')
|
||||
}
|
||||
|
||||
/** 上传错误提示 */
|
||||
const submitFormError = (): void => {
|
||||
message.error('上传失败,请您重新上传!')
|
||||
uploadRef.value!.clearFiles()
|
||||
formLoading.value = false
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
// 重置上传状态和文件
|
||||
formLoading.value = false
|
||||
// uploadRef.value!.clearFiles()
|
||||
uploadRef.value?.clearFiles()
|
||||
}
|
||||
|
||||
/** 文件数超出提示 */
|
||||
const handleExceed = (): void => {
|
||||
message.error('最多只能上传一个文件!')
|
||||
}
|
||||
</script>
|
||||
@ -58,6 +58,13 @@ v-for="dict in pnCurrentList" :key="dict.id" :label="dict.pn_name"
|
||||
<el-button type="warning" size="mini" @click="printfClick">
|
||||
<Icon icon="ep:printer" class="mr-5px"/>
|
||||
打印</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
size="large"
|
||||
@click="handleImport"
|
||||
>
|
||||
<Icon icon="ep:upload" />库存导入
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
@ -100,6 +107,7 @@ v-for="dict in pnCurrentList" :key="dict.id" :label="dict.pn_name"
|
||||
</ContentWrap>
|
||||
</el-card>
|
||||
<MaterialForm ref="formRef" />
|
||||
<Import ref="importFormRef" @success="getList" />
|
||||
|
||||
<printDialog ref="printref" :minAmount="minAmount" :formData="formData" />
|
||||
</template>
|
||||
@ -115,6 +123,8 @@ import * as RgApi from '@/api/heli/rg'
|
||||
import * as PnApi from '@/api/heli/pn'
|
||||
import printDialog from './printDialog.vue'
|
||||
import MaterialForm from "./MaterialForm.vue";
|
||||
import Import from "./Import.vue";
|
||||
import {ref} from "vue";
|
||||
defineOptions({ name: 'StorageLog' })
|
||||
const printref = ref()
|
||||
const whList = ref([])
|
||||
@ -145,6 +155,7 @@ const queryParams = reactive({
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const importFormRef = ref()
|
||||
const openForm = ( id?: number) => {
|
||||
formRef.value.open( id)
|
||||
}
|
||||
@ -164,6 +175,9 @@ const clickItem = ref([])
|
||||
const handleSelectionChange = (val) => {
|
||||
clickItem.value = val;
|
||||
};
|
||||
const handleImport = async () => {
|
||||
importFormRef.value.open()
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user