近期修改
This commit is contained in:
parent
5bab5bb12f
commit
371f55f1b9
@ -61,8 +61,8 @@ public class BgMasterLineController {
|
|||||||
@Operation(summary = "更新过程检报工")
|
@Operation(summary = "更新过程检报工")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:update')")
|
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:update')")
|
||||||
public CommonResult<Boolean> updateBgMasterLine(@Valid @RequestBody BgMasterLineSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateBgMasterLine(@Valid @RequestBody BgMasterLineSaveReqVO updateReqVO) {
|
||||||
bgMasterLineService.updateBgMasterLine(updateReqVO);
|
return bgMasterLineService.updateBgMasterLine(updateReqVO);
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@ -70,8 +70,8 @@ public class BgMasterLineController {
|
|||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:delete')")
|
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:delete')")
|
||||||
public CommonResult<Boolean> deleteBgMasterLine(@RequestParam("id") Integer id) {
|
public CommonResult<Boolean> deleteBgMasterLine(@RequestParam("id") Integer id) {
|
||||||
bgMasterLineService.deleteBgMasterLine(id);
|
|
||||||
return success(true);
|
return bgMasterLineService.deleteBgMasterLine(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -63,4 +63,5 @@ public class BgMasterLineRespVO {
|
|||||||
private Integer auditor;
|
private Integer auditor;
|
||||||
private LocalDateTime audit_time;
|
private LocalDateTime audit_time;
|
||||||
private List<String> fileUrlList;
|
private List<String> fileUrlList;
|
||||||
|
private String modRemark;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,4 +44,7 @@ public class BgMasterLineSaveReqVO {
|
|||||||
private String auditOpinion;
|
private String auditOpinion;
|
||||||
private Integer auditor;
|
private Integer auditor;
|
||||||
private LocalDateTime audit_time;
|
private LocalDateTime audit_time;
|
||||||
|
@Schema(description = "原因说明")
|
||||||
|
private String modRemark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,5 +47,7 @@ public class CompositionRespVO {
|
|||||||
@Schema(description = "密度")
|
@Schema(description = "密度")
|
||||||
@ExcelProperty("密度")
|
@ExcelProperty("密度")
|
||||||
private BigDecimal density;
|
private BigDecimal density;
|
||||||
|
@Schema(description = "单价")
|
||||||
|
@ExcelProperty("单价")
|
||||||
|
private BigDecimal price;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,5 +34,6 @@ public class CompositionSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "密度")
|
@Schema(description = "密度")
|
||||||
private BigDecimal density;
|
private BigDecimal density;
|
||||||
|
@Schema(description = "密度")
|
||||||
|
private BigDecimal price;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -187,5 +187,12 @@ public class DeliverOrderController {
|
|||||||
List<DeliverOrderDO> deliverOrderDO = deliverOrderService.getListYf(id,projectSubId);
|
List<DeliverOrderDO> deliverOrderDO = deliverOrderService.getListYf(id,projectSubId);
|
||||||
return success( deliverOrderDO);
|
return success( deliverOrderDO);
|
||||||
}
|
}
|
||||||
|
@GetMapping("/getListYfDetails")
|
||||||
|
@Operation(summary = "获得运费成本明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:deliver-order:query')")
|
||||||
|
public CommonResult<List<DeliverOrderDO>> getListYfDetails(@RequestParam("id") Long id, @RequestParam("projectSubId") Long projectSubId ) {
|
||||||
|
List<DeliverOrderDO> deliverOrderDO = deliverOrderService.getListYfDetails(id,projectSubId);
|
||||||
|
return success( deliverOrderDO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,5 +77,6 @@ public class MaterialPlanPageReqVO extends PageParam {
|
|||||||
private String duEmpName;
|
private String duEmpName;
|
||||||
@Schema(description = "责任人")
|
@Schema(description = "责任人")
|
||||||
private String blueprintNo;
|
private String blueprintNo;
|
||||||
|
@Schema(description = "工序")
|
||||||
|
private String procedureName;
|
||||||
}
|
}
|
||||||
@ -99,7 +99,13 @@ public class ProcessDesignController {
|
|||||||
PageResult<ProcessDesignDO> pageResult = processDesignService.getProcessDesignPage(pageReqVO);
|
PageResult<ProcessDesignDO> pageResult = processDesignService.getProcessDesignPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, ProcessDesignRespVO.class));
|
return success(BeanUtils.toBean(pageResult, ProcessDesignRespVO.class));
|
||||||
}
|
}
|
||||||
|
@GetMapping("/pages")
|
||||||
|
@Operation(summary = "获得工艺设计进度一览")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:process-design:query')")
|
||||||
|
public CommonResult<PageResult<ProcessDesignDO>> getProcessDesignPages(@Valid ProcessDesignPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProcessDesignDO> pageResult = processDesignService.getProcessDesignPages(pageReqVO);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出工艺设计 Excel")
|
@Operation(summary = "导出工艺设计 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:process-design:export')")
|
@PreAuthorize("@ss.hasPermission('heli:process-design:export')")
|
||||||
@ -112,6 +118,18 @@ public class ProcessDesignController {
|
|||||||
ExcelUtils.write(response, "工艺设计.xls", "数据", ProcessDesignRespVO.class,
|
ExcelUtils.write(response, "工艺设计.xls", "数据", ProcessDesignRespVO.class,
|
||||||
BeanUtils.toBean(list, ProcessDesignRespVO.class));
|
BeanUtils.toBean(list, ProcessDesignRespVO.class));
|
||||||
}
|
}
|
||||||
|
@GetMapping("/exportExcel")
|
||||||
|
@Operation(summary = "导出设计进度一览 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:process-design:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportProcessDesignExcels(@Valid ProcessDesignPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ProcessDesignDO> list = processDesignService.getExportExcel(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "设计进度一览.xlsx", "数据", ExportExcelPageReqVO.class,
|
||||||
|
BeanUtils.toBean(list, ExportExcelPageReqVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== 子表(工艺设计进度) ====================
|
// ==================== 子表(工艺设计进度) ====================
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,47 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat;
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工艺设计 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ExportExcelPageReqVO {
|
||||||
|
|
||||||
|
@ExcelProperty("客户名称")
|
||||||
|
private String customerName;
|
||||||
|
@ExcelProperty( "项目名称")
|
||||||
|
private String projectName;
|
||||||
|
@ExcelProperty( "子项目名称")
|
||||||
|
private String projectSubName;
|
||||||
|
@ExcelProperty( "负责人")
|
||||||
|
private String userName;
|
||||||
|
@ExcelProperty( "负责类型")
|
||||||
|
private String processDesignType;
|
||||||
|
@ExcelProperty( "计划起始")
|
||||||
|
private String startDates;
|
||||||
|
@ExcelProperty( "计划终止")
|
||||||
|
private String endDates;
|
||||||
|
@ExcelProperty( "起始报工时间")
|
||||||
|
private String startReportingTimes;
|
||||||
|
@ExcelProperty( "终止报工时间")
|
||||||
|
private String endReportingTimes;
|
||||||
|
@ExcelProperty( "已报工时")
|
||||||
|
private String workTimes;
|
||||||
|
@ExcelProperty( "状态")
|
||||||
|
private String completed;
|
||||||
|
@ExcelProperty( "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -91,4 +91,6 @@ public class ProcessDesignPageReqVO extends PageParam {
|
|||||||
@Schema(description = "是否完成")
|
@Schema(description = "是否完成")
|
||||||
private Integer pgType;
|
private Integer pgType;
|
||||||
|
|
||||||
|
@Schema(description = "负责人名称")
|
||||||
|
private String ownerName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.controller.admin.projectorder;
|
package com.chanko.yunxi.mes.module.heli.controller.admin.projectorder;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
@ -19,6 +20,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager;
|
import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.deliverorder.DeliverOrderService;
|
import com.chanko.yunxi.mes.module.heli.service.deliverorder.DeliverOrderService;
|
||||||
@ -44,6 +46,7 @@ import java.io.IOException;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
@ -71,6 +74,8 @@ public class ProjectOrderController {
|
|||||||
private ProcessBomService processBomService;
|
private ProcessBomService processBomService;
|
||||||
@Resource
|
@Resource
|
||||||
private DeliverOrderService deliverOrderService;
|
private DeliverOrderService deliverOrderService;
|
||||||
|
@Resource
|
||||||
|
private ProjectOrderSubMapper projectOrderSubMapper;
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建项目订单")
|
@Operation(summary = "创建项目订单")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:project-order:create')")
|
@PreAuthorize("@ss.hasPermission('heli:project-order:create')")
|
||||||
@ -99,6 +104,22 @@ public class ProjectOrderController {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public CommonResult<Long> operateProjectOrder(@Valid @RequestBody ProjectOrderSaveReqVO operateReqVO) {
|
public CommonResult<Long> operateProjectOrder(@Valid @RequestBody ProjectOrderSaveReqVO operateReqVO) {
|
||||||
LocalDateTime startTime = LocalDateTime.now();
|
LocalDateTime startTime = LocalDateTime.now();
|
||||||
|
if ("ALTER".equals(operateReqVO.getActive())) {
|
||||||
|
List<ProjectOrderSubDO> list = operateReqVO.getProjectOrderSubs();
|
||||||
|
List<ProjectOrderSubDO> updateList = list.stream().filter(o -> o.getId() != null).collect(Collectors.toList());
|
||||||
|
for (ProjectOrderSubDO projectOrderSubDO : updateList) {
|
||||||
|
ProjectOrderSubDO subDO = projectOrderSubMapper.selectById(projectOrderSubDO.getId());
|
||||||
|
if (ObjectUtil.isNotEmpty(subDO)){
|
||||||
|
if (ObjectUtil.isEmpty(subDO.getRemAmount())){
|
||||||
|
subDO.setRemAmount(0);
|
||||||
|
}
|
||||||
|
int i = projectOrderSubDO.getAmount() - subDO.getAmount();
|
||||||
|
if (subDO.getRemAmount()+i<0){
|
||||||
|
return CommonResult.error(400,"剩余数量"+subDO.getRemAmount()+"+ 订单变更"+i+"小于0,不允许修改,请确认!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
projectOrderService.operateProjectOrder(operateReqVO);
|
projectOrderService.operateProjectOrder(operateReqVO);
|
||||||
|
|
||||||
// 手动记录日志
|
// 手动记录日志
|
||||||
@ -171,7 +192,10 @@ public class ProjectOrderController {
|
|||||||
BigDecimal internalLaborCost;
|
BigDecimal internalLaborCost;
|
||||||
internalLaborCost=processBomService.internalLaborCost(projectOrderDO.getId(),projectOrderDO.getProjectSubId());
|
internalLaborCost=processBomService.internalLaborCost(projectOrderDO.getId(),projectOrderDO.getProjectSubId());
|
||||||
projectOrderDO.setNeibuCost(internalLaborCost);
|
projectOrderDO.setNeibuCost(internalLaborCost);
|
||||||
|
//装配工时费
|
||||||
|
BigDecimal assemblyLaborCost;
|
||||||
|
assemblyLaborCost=processBomService.assemblyLaborCost(projectOrderDO.getId(),projectOrderDO.getProjectSubId());
|
||||||
|
projectOrderDO.setZpCost(assemblyLaborCost);
|
||||||
|
|
||||||
//运费成本
|
//运费成本
|
||||||
List<DeliverOrderDO> deliverOrderDO = deliverOrderService.getListYf(projectOrderDO.getId(),projectOrderDO.getProjectSubId());
|
List<DeliverOrderDO> deliverOrderDO = deliverOrderService.getListYf(projectOrderDO.getId(),projectOrderDO.getProjectSubId());
|
||||||
@ -202,7 +226,7 @@ public class ProjectOrderController {
|
|||||||
// }else {
|
// }else {
|
||||||
// projectOrderDO.setQitaCost(BigDecimal.ZERO);
|
// projectOrderDO.setQitaCost(BigDecimal.ZERO);
|
||||||
// }
|
// }
|
||||||
BigDecimal sum = projectOrderDO.getYunFeiCost().add(projectOrderDO.getCailiaoCost()).add(projectOrderDO.getBiaoZhunJianCost()).add(projectOrderDO.getNeibuCost()).add(projectOrderDO.getWaixeiCost());
|
BigDecimal sum = projectOrderDO.getYunFeiCost().add(projectOrderDO.getCailiaoCost()).add(projectOrderDO.getBiaoZhunJianCost()).add(projectOrderDO.getNeibuCost()).add(projectOrderDO.getWaixeiCost().add(projectOrderDO.getZpCost()));
|
||||||
projectOrderDO.setSumCost(sum);
|
projectOrderDO.setSumCost(sum);
|
||||||
}
|
}
|
||||||
return success(BeanUtils.toBean(pageResult, ProjectOrderCostRespVO.class));
|
return success(BeanUtils.toBean(pageResult, ProjectOrderCostRespVO.class));
|
||||||
@ -254,7 +278,13 @@ public class ProjectOrderController {
|
|||||||
public CommonResult<List<ProjectOrderSubDO>> getProjectOrderSubListByProjectOrderId(@RequestParam("projectOrderId") Long projectOrderId) {
|
public CommonResult<List<ProjectOrderSubDO>> getProjectOrderSubListByProjectOrderId(@RequestParam("projectOrderId") Long projectOrderId) {
|
||||||
return success(projectOrderService.getProjectOrderSubListByProjectOrderId(projectOrderId));
|
return success(projectOrderService.getProjectOrderSubListByProjectOrderId(projectOrderId));
|
||||||
}
|
}
|
||||||
|
@GetMapping("/project-order-sub/list-by-project-order-id-gt")
|
||||||
|
@Operation(summary = "发货获得项目订单子项目列表")
|
||||||
|
@Parameter(name = "projectOrderId", description = "项目订单id")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:project-order:query')")
|
||||||
|
public CommonResult<List<ProjectOrderSubDO>> getProjectOrderSubListByProjectOrderIdGt(@RequestParam("projectOrderId") Long projectOrderId) {
|
||||||
|
return success(projectOrderService.getProjectOrderSubListByProjectOrderIdGt(projectOrderId));
|
||||||
|
}
|
||||||
@DeleteMapping("/project-order-sub/delete")
|
@DeleteMapping("/project-order-sub/delete")
|
||||||
@Operation(summary = "删除项目订单子项目")
|
@Operation(summary = "删除项目订单子项目")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
|||||||
@ -62,6 +62,9 @@ public class ProjectOrderCostRespVO {
|
|||||||
@Schema(description = "内部加工成本")
|
@Schema(description = "内部加工成本")
|
||||||
@ExcelProperty("内部加工成本")
|
@ExcelProperty("内部加工成本")
|
||||||
private BigDecimal neibuCost;
|
private BigDecimal neibuCost;
|
||||||
|
@Schema(description = "装配工时费")
|
||||||
|
@ExcelProperty("装配工时费")
|
||||||
|
private BigDecimal zpCost;
|
||||||
@Schema(description = "运费成本")
|
@Schema(description = "运费成本")
|
||||||
@ExcelProperty("运费成本")
|
@ExcelProperty("运费成本")
|
||||||
private BigDecimal yunFeiCost;
|
private BigDecimal yunFeiCost;
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail;
|
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail;
|
||||||
|
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoPageReqVO;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoRespVO;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -130,7 +126,27 @@ public class PurchaseOrderNoDetailController {
|
|||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<PurchaseOrderNoDetailDO> list = purchaseOrderNoDetailService.received(pageReqVO).getList();
|
List<PurchaseOrderNoDetailDO> list = purchaseOrderNoDetailService.received(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "标准件收货.xlsx", "数据", ReceivedExcelVo.class,
|
ExcelUtils.write(response, "标准件收货.xlsx", "数据", OutsourcingExcelVo.class,
|
||||||
BeanUtils.toBean(list, ReceivedExcelVo.class));
|
BeanUtils.toBean(list, OutsourcingExcelVo.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getOutsourcingExpenses")
|
||||||
|
@Operation(summary = "获得外协费用分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('project:purchase-order-no-detail:query')")
|
||||||
|
public CommonResult<PageResult<PurchaseOrderNoDetailDO>> getOutsourcingExpenses(@Valid PurchaseOrderNoDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<PurchaseOrderNoDetailDO> pageResult = purchaseOrderNoDetailService.getOutsourcingExpenses(pageReqVO);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
@GetMapping("/exportOutsourcing")
|
||||||
|
@Operation(summary = "导出外协费用 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('project:purchase-order-no:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportOutsourcing(@Valid PurchaseOrderNoDetailPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<PurchaseOrderNoDetailDO> list = purchaseOrderNoDetailService.exportOutsourcing(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "外协费用查询.xlsx", "数据", OutsourcingExcelVo.class,
|
||||||
|
BeanUtils.toBean(list, OutsourcingExcelVo.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.format.NumberFormat;
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat;
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Excel 导入 VO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = false) // 设置 chain = false,避免BOM导入有问题
|
||||||
|
public class OutsourcingExcelVo {
|
||||||
|
@ExcelProperty("订单日期")
|
||||||
|
private String ordDates;
|
||||||
|
@ExcelProperty("供应商简称")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@ExcelProperty("BOM编号")
|
||||||
|
private String boomCode;
|
||||||
|
@ExcelProperty("件号")
|
||||||
|
private String blueprintNo;
|
||||||
|
@ExcelProperty("零件名称")
|
||||||
|
private String boomName;
|
||||||
|
@ExcelProperty("材料")
|
||||||
|
private String composition;
|
||||||
|
@ExcelProperty("规格")
|
||||||
|
private String boomSpec;
|
||||||
|
|
||||||
|
@ExcelProperty("数量")
|
||||||
|
private String purchaseAmount;
|
||||||
|
@ExcelProperty("单价")
|
||||||
|
private String unitPrice;
|
||||||
|
@ExcelProperty("小计")
|
||||||
|
@NumberFormat("#0.00") // 强制保留 2 位小数
|
||||||
|
private BigDecimal estimatedPrice;
|
||||||
|
@ExcelProperty("工序")
|
||||||
|
private String procedureName;
|
||||||
|
@ExcelProperty("到货日期")
|
||||||
|
private String acarrDates;
|
||||||
|
@ExcelProperty("采购员")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -120,4 +120,10 @@ public class PurchaseOrderNoDetailPageReqVO extends PageParam {
|
|||||||
private String projectCode;
|
private String projectCode;
|
||||||
@Schema(description = "项目编码")
|
@Schema(description = "项目编码")
|
||||||
private Integer goodsType;
|
private Integer goodsType;
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
private String customerName;
|
||||||
|
@Schema(description = "供应商简称")
|
||||||
|
private String supplierName;
|
||||||
|
@Schema(description = "采购员")
|
||||||
|
private String ownerName;
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ public class StorageController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storageService.updateMatLogList(targetDo.getId(),status);
|
storageService.updateLogList(targetDo.getId(),status,targetDo.getStockType(),targetDo.getStockNo());
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
@PutMapping("/update-update-statusok")
|
@PutMapping("/update-update-statusok")
|
||||||
|
|||||||
@ -84,8 +84,8 @@ public class StorageLogController {
|
|||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得入/出库日志分页")
|
@Operation(summary = "获得入/出库日志分页")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:storage-log:query')")
|
@PreAuthorize("@ss.hasPermission('heli:storage-log:query')")
|
||||||
public CommonResult<PageResult<StorageLogAllDO>> getStorageLogPage(@Valid StorageLogPageReqVO pageReqVO) {
|
public CommonResult<PageResult<StorageLogDO>> getStorageLogPage(@Valid StorageLogPageReqVO pageReqVO) {
|
||||||
PageResult<StorageLogAllDO> pageResult = storageLogService.getStorageLogPage(pageReqVO);
|
PageResult<StorageLogDO> pageResult = storageLogService.getStorageLogPage(pageReqVO);
|
||||||
return success(pageResult);
|
return success(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,11 +161,11 @@ public class StorageLogController {
|
|||||||
@OperateLog(type = EXPORT)
|
@OperateLog(type = EXPORT)
|
||||||
public void exportStorageLogExcel(@Valid StorageLogPageReqVO pageReqVO,
|
public void exportStorageLogExcel(@Valid StorageLogPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<StorageLogAllDO> list = storageLogService.getStorageLogPage(pageReqVO).getList();
|
// List<StorageLogAllDO> list = storageLogService.getStorageLogPage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// // 导出 Excel
|
||||||
ExcelUtils.write(response, "入/出库日志.xls", "数据", StorageLogRespVO.class,
|
// ExcelUtils.write(response, "入/出库日志.xls", "数据", StorageLogRespVO.class,
|
||||||
BeanUtils.toBean(list, StorageLogRespVO.class));
|
// BeanUtils.toBean(list, StorageLogRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getSupplementPage")
|
@GetMapping("/getSupplementPage")
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.fpuserdetail.FpUserDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.fpuserdetail.FpUserDetailMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.taskdispatch.TaskDispatchService;
|
import com.chanko.yunxi.mes.module.heli.service.taskdispatch.TaskDispatchService;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -230,6 +231,15 @@ public class TaskDispatchController {
|
|||||||
List<HashMap<String, String>> owner = taskDispatchService.getOwner(id, type);
|
List<HashMap<String, String>> owner = taskDispatchService.getOwner(id, type);
|
||||||
return success(owner);
|
return success(owner);
|
||||||
}
|
}
|
||||||
|
@GetMapping("/task-dispatch-detail/getOwnerUserList")
|
||||||
|
@Operation(summary = "获取责任人名单")
|
||||||
|
@Parameter(name = "id", description = "人员id", required = false)
|
||||||
|
@Parameter(name = "type", description = "类型", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')")
|
||||||
|
public CommonResult<List<AdminUserDO>> getOwnerUserList(@RequestParam("id") Long id, @RequestParam("type")Long type) {
|
||||||
|
if(id.intValue() ==0) id = null;
|
||||||
|
return success(taskDispatchService.getOwnerUserList(id, type));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/assmebleDispatchPage")
|
@GetMapping("/assmebleDispatchPage")
|
||||||
@Operation(summary = "获取装配报工责任人名单")
|
@Operation(summary = "获取装配报工责任人名单")
|
||||||
@ -246,6 +256,12 @@ public class TaskDispatchController {
|
|||||||
List<TaskDispatchDO> list= taskDispatchService.getListJg(id,projectSubId);
|
List<TaskDispatchDO> list= taskDispatchService.getListJg(id,projectSubId);
|
||||||
return success( list);
|
return success( list);
|
||||||
}
|
}
|
||||||
|
@GetMapping("/getListZp")
|
||||||
|
@Operation(summary = "获得装配成本")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:deliver-order:query')")
|
||||||
|
public CommonResult<List<TaskDispatchDO>> getListZp(@RequestParam("id") Long id, @RequestParam("projectSubId") Long projectSubId ) {
|
||||||
|
List<TaskDispatchDO> list= taskDispatchService.getListZp(id,projectSubId);
|
||||||
|
return success( list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class TaskDispatchDetailVO {
|
|||||||
@NotNull(message = "id不能为空")
|
@NotNull(message = "id不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Min(value = 0, message = "报工数量超出限定范围")
|
@Min(value = 0, message = "报工数量不能小于0")
|
||||||
@Schema(description = "报工数量")
|
@Schema(description = "报工数量")
|
||||||
private Integer amount;
|
private Integer amount;
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ public class TaskDispatchDetailVO {
|
|||||||
@Schema(description = "操作意见")
|
@Schema(description = "操作意见")
|
||||||
private String activeOpinion;
|
private String activeOpinion;
|
||||||
|
|
||||||
@Positive(message = "报工工时超出限定范围")
|
@Positive(message = "报工工时必须大于0")
|
||||||
@Schema(description = "报工工时")
|
@Schema(description = "报工工时")
|
||||||
private BigDecimal workTime;
|
private BigDecimal workTime;
|
||||||
|
|
||||||
|
|||||||
@ -59,5 +59,6 @@ public class TaskPlanJDBaoBiaoPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "负责人")
|
@Schema(description = "负责人")
|
||||||
private Long owner;
|
private Long owner;
|
||||||
|
@Schema(description = "子项目简码")
|
||||||
|
private String projectSubCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ public class TaskReportController {
|
|||||||
@Resource
|
@Resource
|
||||||
private TaskReportService taskReportService;
|
private TaskReportService taskReportService;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建任务报工")
|
@Operation(summary = "创建任务报工")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:task-report:create')")
|
@PreAuthorize("@ss.hasPermission('heli:task-report:create')")
|
||||||
@ -48,8 +49,7 @@ public class TaskReportController {
|
|||||||
@Operation(summary = "更新任务报工")
|
@Operation(summary = "更新任务报工")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:task-report:update')")
|
@PreAuthorize("@ss.hasPermission('heli:task-report:update')")
|
||||||
public CommonResult<Boolean> updateTaskReport(@Valid @RequestBody TaskReportSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateTaskReport(@Valid @RequestBody TaskReportSaveReqVO updateReqVO) {
|
||||||
taskReportService.updateTaskReport(updateReqVO);
|
return taskReportService.updateTaskReport(updateReqVO);
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@ -57,8 +57,8 @@ public class TaskReportController {
|
|||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('heli:task-report:delete')")
|
@PreAuthorize("@ss.hasPermission('heli:task-report:delete')")
|
||||||
public CommonResult<Boolean> deleteTaskReport(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteTaskReport(@RequestParam("id") Long id) {
|
||||||
taskReportService.deleteTaskReport(id);
|
|
||||||
return success(true);
|
return taskReportService.deleteTaskReport(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification;
|
package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
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.CommonResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
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.PageResult;
|
||||||
@ -14,8 +16,12 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification
|
|||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationRespVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationRespVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationSaveReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationSaveReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.bgmasterline.BgMasterLineMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjbgmasterline.ZjBgMasterLineMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotification.UnqualifiedNotificationService;
|
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotification.UnqualifiedNotificationService;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
||||||
@ -45,6 +51,7 @@ import java.util.List;
|
|||||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.error;
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.error;
|
||||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 品质异常通知单审核")
|
@Tag(name = "管理后台 - 品质异常通知单审核")
|
||||||
@RestController
|
@RestController
|
||||||
@ -56,6 +63,10 @@ public class UnqualifiedNotificationController {
|
|||||||
private UnqualifiedNotificationService unqualifiedNotificationService;
|
private UnqualifiedNotificationService unqualifiedNotificationService;
|
||||||
@Resource
|
@Resource
|
||||||
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
||||||
|
@Resource
|
||||||
|
private BgMasterLineMapper bgMasterLineMapper;
|
||||||
|
@Resource
|
||||||
|
private ZjBgMasterLineMapper zjBgMasterLineMapper;
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建品质异常通知单审核")
|
@Operation(summary = "创建品质异常通知单审核")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:unqualified-notification:create')")
|
@PreAuthorize("@ss.hasPermission('heli:unqualified-notification:create')")
|
||||||
@ -246,6 +257,25 @@ public class UnqualifiedNotificationController {
|
|||||||
public CommonResult<PageResult<QualityStatistics>> getUnqualifiedNotificationStatisticPage(@Valid UnqualifiedNotificationPageReqVO pageReqVO) {
|
public CommonResult<PageResult<QualityStatistics>> getUnqualifiedNotificationStatisticPage(@Valid UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||||
try {
|
try {
|
||||||
PageResult<QualityStatistics> pageResult = unqualifiedNotificationService.getUnqualifiedNotificationStatisticPage(pageReqVO);
|
PageResult<QualityStatistics> pageResult = unqualifiedNotificationService.getUnqualifiedNotificationStatisticPage(pageReqVO);
|
||||||
|
List<QualityStatistics> list = pageResult.getList();
|
||||||
|
if(CollUtil.isNotEmpty(list)){
|
||||||
|
for (QualityStatistics qualityStatistics : list) {
|
||||||
|
List<String> fileUrlList = new ArrayList<>();
|
||||||
|
Integer type = 0;
|
||||||
|
if (qualityStatistics.getType()==0){
|
||||||
|
type = 1;
|
||||||
|
}else if (qualityStatistics.getType()==1){
|
||||||
|
type = 2;
|
||||||
|
}
|
||||||
|
List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(qualityStatistics.getId(),type);
|
||||||
|
if(CollUtil.isNotEmpty(unqualifiedNotificationFileDOS)){
|
||||||
|
for (UnqualifiedNotificationFileDO unqualifiedNotificationFileDO : unqualifiedNotificationFileDOS) {
|
||||||
|
fileUrlList.add(unqualifiedNotificationFileDO.getFileUrl());
|
||||||
|
}
|
||||||
|
qualityStatistics.setFileUrlList(fileUrlList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return success(pageResult);
|
return success(pageResult);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -266,6 +296,20 @@ public class UnqualifiedNotificationController {
|
|||||||
@PostMapping("/review")
|
@PostMapping("/review")
|
||||||
@Operation(summary = "质量异常统计审核")
|
@Operation(summary = "质量异常统计审核")
|
||||||
public CommonResult<Boolean> review(@Valid @RequestBody UnqualifiedNotificationPageReqVO pageReqVO) {
|
public CommonResult<Boolean> review(@Valid @RequestBody UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||||
|
if (pageReqVO.getStatus()==1){
|
||||||
|
if ("0".equals(pageReqVO.getType())){
|
||||||
|
BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectById(pageReqVO.getId());
|
||||||
|
if (ObjectUtil.isNotEmpty(bgMasterLineDO)&&"2".equals(bgMasterLineDO.getAuditOpinion())&&bgMasterLineDO.getConStatus()==2){
|
||||||
|
return CommonResult.error(400,"该过程检已确认,请刷新页面");
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
ZjBgMasterLineDO zjBgMasterLineDO = zjBgMasterLineMapper.selectById(pageReqVO.getId());
|
||||||
|
if (ObjectUtil.isNotEmpty(zjBgMasterLineDO)&&"2".equals(zjBgMasterLineDO.getAuditOpinion())&&zjBgMasterLineDO.getConStatus()==2){
|
||||||
|
return CommonResult.error(400,"该装配检已确认,请刷新页面");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
unqualifiedNotificationService.review(pageReqVO);
|
unqualifiedNotificationService.review(pageReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
@ -313,4 +357,16 @@ public class UnqualifiedNotificationController {
|
|||||||
public CommonResult<Long> countWx1(@Valid UnqualifiedNotificationPageReqVO pageReqVO) {
|
public CommonResult<Long> countWx1(@Valid UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||||
return success(unqualifiedNotificationService.countWx1(pageReqVO));
|
return success(unqualifiedNotificationService.countWx1(pageReqVO));
|
||||||
}
|
}
|
||||||
|
@GetMapping("/workrecord")
|
||||||
|
@Operation(summary = "获得检验报工分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:unqualified-notification:query')")
|
||||||
|
public CommonResult<PageResult<QualityStatistics>> workrecord(@Valid UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||||
|
try {
|
||||||
|
PageResult<QualityStatistics> pageResult = unqualifiedNotificationService.workrecord(pageReqVO);
|
||||||
|
return success(pageResult);
|
||||||
|
} catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo;
|
package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat;
|
import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat;
|
||||||
import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert;
|
import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert;
|
||||||
@ -12,6 +13,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
@ -59,7 +61,10 @@ public class QualityStatistics {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private String notificationStatus;
|
private String notificationStatus;
|
||||||
|
private String workTime;
|
||||||
|
private String modRemark;
|
||||||
|
private String conStatus;
|
||||||
|
private List<String> fileUrlList;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -94,4 +94,13 @@ public class UnqualifiedNotificationPageReqVO extends PageParam {
|
|||||||
private LocalDateTime maxCreateTime;
|
private LocalDateTime maxCreateTime;
|
||||||
|
|
||||||
private Integer queryType;
|
private Integer queryType;
|
||||||
|
@Schema(description = "报工人姓名")
|
||||||
|
private String userName;
|
||||||
|
@Schema(description = "零件名称")
|
||||||
|
private String materialName;
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime endTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,8 +67,8 @@ public class ZjBgMasterLineController {
|
|||||||
@Operation(summary = "更新终检报工")
|
@Operation(summary = "更新终检报工")
|
||||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:update')")
|
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:update')")
|
||||||
public CommonResult<Boolean> updateZjBgMasterLine(@Valid @RequestBody ZjBgMasterLineSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateZjBgMasterLine(@Valid @RequestBody ZjBgMasterLineSaveReqVO updateReqVO) {
|
||||||
zjBgMasterLineService.updateZjBgMasterLine(updateReqVO);
|
return zjBgMasterLineService.updateZjBgMasterLine(updateReqVO);
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@ -76,8 +76,8 @@ public class ZjBgMasterLineController {
|
|||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:delete')")
|
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:delete')")
|
||||||
public CommonResult<Boolean> deleteZjBgMasterLine(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteZjBgMasterLine(@RequestParam("id") Long id) {
|
||||||
zjBgMasterLineService.deleteZjBgMasterLine(id);
|
|
||||||
return success(true);
|
return zjBgMasterLineService.deleteZjBgMasterLine(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
|
|||||||
@ -62,5 +62,6 @@ public class ZjBgMasterLineRespVO {
|
|||||||
private Integer auditor;
|
private Integer auditor;
|
||||||
private LocalDateTime audit_time;
|
private LocalDateTime audit_time;
|
||||||
private List<String> fileUrlList;
|
private List<String> fileUrlList;
|
||||||
|
private String modRemark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,6 +66,8 @@ public class BgMasterLineDO extends BaseDO {
|
|||||||
private Integer notificationStatus;
|
private Integer notificationStatus;
|
||||||
private Integer conStatus;
|
private Integer conStatus;
|
||||||
private String auditOpinion;
|
private String auditOpinion;
|
||||||
|
private String modRemark;
|
||||||
|
|
||||||
private Integer auditor;
|
private Integer auditor;
|
||||||
private LocalDateTime audit_time;
|
private LocalDateTime audit_time;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|||||||
@ -54,5 +54,8 @@ public class CompositionDO extends BaseDO {
|
|||||||
* 密度
|
* 密度
|
||||||
*/
|
*/
|
||||||
private BigDecimal density;
|
private BigDecimal density;
|
||||||
|
/**
|
||||||
|
* 单价
|
||||||
|
*/
|
||||||
|
private BigDecimal price;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,10 +122,12 @@ public class DeliverOrderDO extends BaseDO {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer amounts;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String property;
|
private String property;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal weights;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String customerName;
|
private String customerName;
|
||||||
|
|
||||||
|
|||||||
@ -100,5 +100,8 @@ public class DeliverOrderSubDO extends BaseDO {
|
|||||||
* 运费
|
* 运费
|
||||||
*/
|
*/
|
||||||
private BigDecimal yunFei;
|
private BigDecimal yunFei;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer remAmount;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private LocalDateTime deliverDate;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,4 +174,28 @@ public class ProcessDesignDO extends BaseDO {
|
|||||||
private String delayReason2d;
|
private String delayReason2d;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String delayReason3d;
|
private String delayReason3d;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private LocalDateTime startDate;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private LocalDateTime endDate;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Date startReportingTime;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Date endReportingTime;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal workTime;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String startDates;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String endDates;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String startReportingTimes;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String endReportingTimes;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String workTimes;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String completed;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -292,6 +292,8 @@ public class ProjectOrderDO extends BaseDO {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private BigDecimal neibuCost;
|
private BigDecimal neibuCost;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
private BigDecimal zpCost;
|
||||||
|
@TableField(exist = false)
|
||||||
private BigDecimal biaoZhunJianCost;
|
private BigDecimal biaoZhunJianCost;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private BigDecimal waixeiCost;
|
private BigDecimal waixeiCost;
|
||||||
|
|||||||
@ -131,4 +131,6 @@ public class ProjectOrderSubDO extends BaseDO {
|
|||||||
// private Date projectStartTime;
|
// private Date projectStartTime;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer property;
|
private Integer property;
|
||||||
|
private Integer remAmount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -215,4 +215,16 @@ public class PurchaseOrderNoDetailDO extends BaseDO {
|
|||||||
private String requireTimes;
|
private String requireTimes;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long projectSubId;
|
private Long projectSubId;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private LocalDateTime acarrDate;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String boomCode;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Date ordDate;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String ordDates;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String acarrDates;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,6 +108,7 @@ public class StorageDO extends BaseDO {
|
|||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
private String vMatName;
|
private String vMatName;
|
||||||
|
private Integer stockMode;
|
||||||
|
|
||||||
|
|
||||||
private String projectSubName;
|
private String projectSubName;
|
||||||
@ -140,5 +141,6 @@ public class StorageDO extends BaseDO {
|
|||||||
private Date date;
|
private Date date;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long headerId;
|
private Long headerId;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String type;
|
||||||
}
|
}
|
||||||
@ -65,5 +65,27 @@ public class StorageLogDO extends BaseDO {
|
|||||||
* 状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
private Integer isExport;
|
||||||
|
private Integer stockMode;
|
||||||
|
private Integer stockType;
|
||||||
|
private Integer goodsType;
|
||||||
|
private BigDecimal storageAft;
|
||||||
|
private BigDecimal storageBef;
|
||||||
|
private String codeNo;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String matCode;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String matName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String matSpec;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String matUnit;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String whName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String rgName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String pnName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -12,6 +12,8 @@ import lombok.*;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 派工单 DO
|
* 派工单 DO
|
||||||
@ -133,7 +135,8 @@ public class TaskDispatchDO extends BaseDO {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer quantity;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
@ -160,6 +163,12 @@ public class TaskDispatchDO extends BaseDO {
|
|||||||
private LocalDateTime assembleBeginDate;
|
private LocalDateTime assembleBeginDate;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private LocalDateTime assembleEndDate;
|
private LocalDateTime assembleEndDate;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Map<String,BigDecimal> map;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal assemblyLaborCost;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal assemblyLaborSum;
|
||||||
public boolean canSave(){
|
public boolean canSave(){
|
||||||
return TaskDispatchStatusEnum.SAVE.getCode() == this.dispatchStatus.intValue();
|
return TaskDispatchStatusEnum.SAVE.getCode() == this.dispatchStatus.intValue();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,6 +69,7 @@ public class ZjBgMasterLineDO extends BaseDO {
|
|||||||
private String auditOpinion;
|
private String auditOpinion;
|
||||||
private Integer auditor;
|
private Integer auditor;
|
||||||
private LocalDateTime audit_time;
|
private LocalDateTime audit_time;
|
||||||
|
private String modRemark;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<String> fileUrlList;
|
private List<String> fileUrlList;
|
||||||
|
|
||||||
|
|||||||
@ -131,8 +131,6 @@ public class ZjPgMasterLineDO extends BaseDO {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String creator;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
|||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过程检报工 Mapper
|
* 过程检报工 Mapper
|
||||||
@ -115,4 +116,6 @@ public interface BgMasterLineMapper extends BaseMapperX<BgMasterLineDO> {
|
|||||||
.eq(PgMasterLineDO::getDeleted,0);
|
.eq(PgMasterLineDO::getDeleted,0);
|
||||||
return selectCount(query);
|
return selectCount(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deleteByIds(@Param("id") Integer id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,6 +243,7 @@ public interface MaterialPlanBoomMapper extends BaseMapperX<MaterialPlanBoomDO>
|
|||||||
.like(!StringUtils.isEmpty(pageReqVO.getMatName()), MaterialPlanBoomDO::getMatName, pageReqVO.getMatName())
|
.like(!StringUtils.isEmpty(pageReqVO.getMatName()), MaterialPlanBoomDO::getMatName, pageReqVO.getMatName())
|
||||||
.like(!StringUtils.isEmpty(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode())
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode())
|
||||||
.like(!StringUtils.isEmpty(pageReqVO.getDuEmpName()), AdminUserDO::getNickname, pageReqVO.getDuEmpName())
|
.like(!StringUtils.isEmpty(pageReqVO.getDuEmpName()), AdminUserDO::getNickname, pageReqVO.getDuEmpName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProcedureName()), ProcedureDO::getName, pageReqVO.getProcedureName())
|
||||||
.eq(!StringUtils.isEmpty(pageReqVO.getMatType()), MaterialPlanDO::getMatType, pageReqVO.getMatType())
|
.eq(!StringUtils.isEmpty(pageReqVO.getMatType()), MaterialPlanDO::getMatType, pageReqVO.getMatType())
|
||||||
.eq(!StringUtils.isEmpty(pageReqVO.getStatus()), MaterialPlanBoomDO::getIsPurYard, pageReqVO.getStatus())
|
.eq(!StringUtils.isEmpty(pageReqVO.getStatus()), MaterialPlanBoomDO::getIsPurYard, pageReqVO.getStatus())
|
||||||
.in(Objects.nonNull(pageReqVO.getMplanStatus()), MaterialPlanBoomDO::getMplanStatus, pageReqVO.getMplanStatus() != null && pageReqVO.getMplanStatus() != 0 ? Arrays.asList(pageReqVO.getMplanStatus()) : Arrays.asList(0, 3))
|
.in(Objects.nonNull(pageReqVO.getMplanStatus()), MaterialPlanBoomDO::getMplanStatus, pageReqVO.getMplanStatus() != null && pageReqVO.getMplanStatus() != 0 ? Arrays.asList(pageReqVO.getMplanStatus()) : Arrays.asList(0, 3))
|
||||||
|
|||||||
@ -201,8 +201,9 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
|
|||||||
.select("d.name as projectSubName,d.id as projectSubId,d.name_sim as nameSim,f.name as compositionName")
|
.select("d.name as projectSubName,d.id as projectSubId,d.name_sim as nameSim,f.name as compositionName")
|
||||||
.select("b.id as projectId,g.plan_id as planId,c.id as customerId")
|
.select("b.id as projectId,g.plan_id as planId,c.id as customerId")
|
||||||
.select("u.nickname as nickname,t.amount*d.amount as amounts")
|
.select("u.nickname as nickname,t.amount*d.amount as amounts")
|
||||||
.select("DATE_FORMAT(p.boom_arrive_date, '%Y-%m-%d') AS boomArriveDates")
|
.select("DATE_FORMAT(COALESCE(p.boom_arrive_date, plan.require_end_date), '%Y-%m-%d') AS boomArriveDates")
|
||||||
.select("p.boom_arrive_date as boomArriveDate,p.du_emp_id as duEmpId,h.project_material_plan_no as projectMaterialPlanNo")
|
.select("p.du_emp_id as duEmpId,h.project_material_plan_no as projectMaterialPlanNo")
|
||||||
|
.select("COALESCE(p.boom_arrive_date, plan.require_end_date) as boomArriveDate")
|
||||||
.leftJoin(ProcessBomDO.class,"g",ProcessBomDO::getId,ProcessBomDetailDO::getBomId)
|
.leftJoin(ProcessBomDO.class,"g",ProcessBomDO::getId,ProcessBomDetailDO::getBomId)
|
||||||
.leftJoin(ProjectOrderDO.class, "b", ProjectOrderDO::getId, ProcessBomDO::getProjectId)
|
.leftJoin(ProjectOrderDO.class, "b", ProjectOrderDO::getId, ProcessBomDO::getProjectId)
|
||||||
.leftJoin(CustomerDO.class, "c", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
.leftJoin(CustomerDO.class, "c", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
||||||
@ -213,6 +214,7 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
|
|||||||
.leftJoin("project_material_plan h on (h.project_material_plan_no = t.project_material_plan_no and h.deleted=0)")
|
.leftJoin("project_material_plan h on (h.project_material_plan_no = t.project_material_plan_no and h.deleted=0)")
|
||||||
.leftJoin("project_material_plan_boom p on (p.boom_detail_id = t.id and p.deleted=0)")
|
.leftJoin("project_material_plan_boom p on (p.boom_detail_id = t.id and p.deleted=0)")
|
||||||
.leftJoin(AdminUserDO.class,"u",AdminUserDO::getId,ProcessBomDetailDO::getDuEmpId)
|
.leftJoin(AdminUserDO.class,"u",AdminUserDO::getId,ProcessBomDetailDO::getDuEmpId)
|
||||||
|
.leftJoin(PlanTaskBomDO.class,"plan",PlanTaskBomDO::getBomDetailId,ProcessBomDetailDO::getId)
|
||||||
.groupBy(ProcessBomDetailDO::getId)
|
.groupBy(ProcessBomDetailDO::getId)
|
||||||
.orderByDesc(ProcessBomDO::getId)
|
.orderByDesc(ProcessBomDO::getId)
|
||||||
.disableSubLogicDel();
|
.disableSubLogicDel();
|
||||||
@ -257,6 +259,7 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
|
|||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectName()),ProjectOrderDO::getProjectName,pageReqVO.getProjectName())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectName()),ProjectOrderDO::getProjectName,pageReqVO.getProjectName())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getTaskNo()),PlanTaskDO::getTaskNo,pageReqVO.getTaskNo())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getTaskNo()),PlanTaskDO::getTaskNo,pageReqVO.getTaskNo())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectSubName()),ProjectOrderSubDO::getName,pageReqVO.getProjectSubName())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectSubName()),ProjectOrderSubDO::getName,pageReqVO.getProjectSubName())
|
||||||
|
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectSubCode()),ProjectOrderSubDO::getNameSim,pageReqVO.getProjectSubCode())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getMaterialName()),ProcessBomDetailDO::getMaterialName,pageReqVO.getMaterialName())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getMaterialName()),ProcessBomDetailDO::getMaterialName,pageReqVO.getMaterialName())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getOwner()),AdminUserDO::getNickname,pageReqVO.getOwner())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getOwner()),AdminUserDO::getNickname,pageReqVO.getOwner())
|
||||||
.eq(ProcessBomDetailDO::getType,2);
|
.eq(ProcessBomDetailDO::getType,2);
|
||||||
@ -292,6 +295,7 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
|
|||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectName()),ProjectOrderDO::getProjectName,pageReqVO.getProjectName())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectName()),ProjectOrderDO::getProjectName,pageReqVO.getProjectName())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getTaskNo()),PlanTaskDO::getTaskNo,pageReqVO.getTaskNo())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getTaskNo()),PlanTaskDO::getTaskNo,pageReqVO.getTaskNo())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectSubName()),ProjectOrderSubDO::getName,pageReqVO.getProjectSubName())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectSubName()),ProjectOrderSubDO::getName,pageReqVO.getProjectSubName())
|
||||||
|
.like(!ObjectUtils.isEmpty(pageReqVO.getProjectSubCode()),ProjectOrderSubDO::getNameSim,pageReqVO.getProjectSubCode())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getMaterialName()),ProcessBomDetailDO::getMaterialName,pageReqVO.getMaterialName())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getMaterialName()),ProcessBomDetailDO::getMaterialName,pageReqVO.getMaterialName())
|
||||||
.like(!ObjectUtils.isEmpty(pageReqVO.getOwner()),AdminUserDO::getNickname,pageReqVO.getOwner())
|
.like(!ObjectUtils.isEmpty(pageReqVO.getOwner()),AdminUserDO::getNickname,pageReqVO.getOwner())
|
||||||
.eq(ProcessBomDetailDO::getType,1);
|
.eq(ProcessBomDetailDO::getType,1);
|
||||||
|
|||||||
@ -195,4 +195,6 @@ public interface ProcessBomMapper extends BaseMapperX<ProcessBomDO> {
|
|||||||
BigDecimal bubbleFees(@Param("id") Long id,@Param("projectSubId") Long projectSubId);
|
BigDecimal bubbleFees(@Param("id") Long id,@Param("projectSubId") Long projectSubId);
|
||||||
|
|
||||||
BigDecimal internalLaborCost(@Param("id") Long id,@Param("projectSubId") Long projectSubId);
|
BigDecimal internalLaborCost(@Param("id") Long id,@Param("projectSubId") Long projectSubId);
|
||||||
|
|
||||||
|
BigDecimal assemblyLaborCost(@Param("id") Long id,@Param("projectSubId") Long projectSubId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -162,4 +162,129 @@ public interface ProcessDesignMapper extends BaseMapperX<ProcessDesignDO> {
|
|||||||
return selectPage(reqVO, query);
|
return selectPage(reqVO, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default PageResult<ProcessDesignDO> getProcessDesignPages(ProcessDesignPageReqVO reqVO){
|
||||||
|
MPJLambdaWrapper<ProcessDesignDO> query = new MPJLambdaWrapper<>();
|
||||||
|
query.selectAll(ProcessDesignDO.class)
|
||||||
|
.select("e.brief as customerName","d.project_name as projectName","c.name as projectSubName")
|
||||||
|
// .select("b.blank_date as blankDate", "b.two_dim_date as twoDimDate", "b.three_dim_date as threeDimDate")
|
||||||
|
// .select("b.start_blank_date as startBlankDate", "b.start_two_dim_date as startTwoDimDate", "b.start_three_dim_date as startThreeDimDate")
|
||||||
|
//
|
||||||
|
.select("u3.nickname as blankOwnerName", "u4.nickname as twoDimOwnerName", "u5.nickname as threeDimOwnerName")
|
||||||
|
.select( "CASE t.process_design_type " +
|
||||||
|
"WHEN 'BLUEPRINT_WORKBLANK' THEN u3.nickname " +
|
||||||
|
"WHEN 'BLUEPRINT_2D' THEN u4.nickname " +
|
||||||
|
"WHEN 'BLUEPRINT_3D' THEN u5.nickname " +
|
||||||
|
"ELSE '' " + // 默认值
|
||||||
|
"END as userName")
|
||||||
|
|
||||||
|
.select(
|
||||||
|
"CASE t.process_design_type " +
|
||||||
|
"WHEN 'BLUEPRINT_WORKBLANK' THEN b.start_blank_date " +
|
||||||
|
"WHEN 'BLUEPRINT_2D' THEN b.start_two_dim_Date " +
|
||||||
|
"WHEN 'BLUEPRINT_3D' THEN b.start_three_dim_date " +
|
||||||
|
"ELSE '' " +
|
||||||
|
"END as startDate"
|
||||||
|
)
|
||||||
|
.select(
|
||||||
|
"CASE t.process_design_type " +
|
||||||
|
"WHEN 'BLUEPRINT_WORKBLANK' THEN b.blank_date " +
|
||||||
|
"WHEN 'BLUEPRINT_2D' THEN b.two_dim_date " +
|
||||||
|
"WHEN 'BLUEPRINT_3D' THEN b.three_dim_date " +
|
||||||
|
"ELSE '' " +
|
||||||
|
"END as endDate"
|
||||||
|
)
|
||||||
|
.leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessDesignDO::getPlanId)
|
||||||
|
.leftJoin("project_plan_sub b on b.project_plan_id = t.plan_id and b.project_sub_id = t.project_sub_id")
|
||||||
|
.leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId)
|
||||||
|
.leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId)
|
||||||
|
.leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
||||||
|
.leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, PlanDO::getProjectOwner)
|
||||||
|
.leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, PlanDO::getCraftOwner)
|
||||||
|
.leftJoin("system_users u3 on u3.id = b.blank_owner")
|
||||||
|
.leftJoin("system_users u4 on u4.id = b.two_dim_owner")
|
||||||
|
.leftJoin("system_users u5 on u5.id = b.three_dim_owner")
|
||||||
|
.disableSubLogicDel();
|
||||||
|
query.orderByDesc(ProcessDesignDO::getCreateTime);
|
||||||
|
query
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getCustomerName()), CustomerDO::getName, reqVO.getCustomerName())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName())
|
||||||
|
.in(reqVO.getProcessDesignTypeList() != null && !reqVO.getProcessDesignTypeList().isEmpty(), ProcessDesignDO::getProcessDesignType, reqVO.getProcessDesignTypeList())
|
||||||
|
;
|
||||||
|
|
||||||
|
if(!StringUtils.isEmpty(reqVO.getOwnerName())){
|
||||||
|
query.and(QueryWrapper -> QueryWrapper.apply("u2.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_FOUNDRY_TECHNOLOGY.name())
|
||||||
|
.or()
|
||||||
|
.apply("u3.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_WORKBLANK.name())
|
||||||
|
.or()
|
||||||
|
.apply("u4.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_2D.name())
|
||||||
|
.or()
|
||||||
|
.apply("u5.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_3D.name()));
|
||||||
|
}
|
||||||
|
return selectPage(reqVO, query);
|
||||||
|
}
|
||||||
|
default PageResult<ProcessDesignDO> getExportExcel(ProcessDesignPageReqVO reqVO){
|
||||||
|
MPJLambdaWrapper<ProcessDesignDO> query = new MPJLambdaWrapper<>();
|
||||||
|
query.selectAll(ProcessDesignDO.class)
|
||||||
|
.select("e.brief as customerName","d.project_name as projectName","c.name as projectSubName")
|
||||||
|
// .select("b.blank_date as blankDate", "b.two_dim_date as twoDimDate", "b.three_dim_date as threeDimDate")
|
||||||
|
// .select("b.start_blank_date as startBlankDate", "b.start_two_dim_date as startTwoDimDate", "b.start_three_dim_date as startThreeDimDate")
|
||||||
|
//
|
||||||
|
.select("u3.nickname as blankOwnerName", "u4.nickname as twoDimOwnerName", "u5.nickname as threeDimOwnerName")
|
||||||
|
.select( "CASE t.process_design_type " +
|
||||||
|
"WHEN 'BLUEPRINT_WORKBLANK' THEN u3.nickname " +
|
||||||
|
"WHEN 'BLUEPRINT_2D' THEN u4.nickname " +
|
||||||
|
"WHEN 'BLUEPRINT_3D' THEN u5.nickname " +
|
||||||
|
"ELSE '' " + // 默认值
|
||||||
|
"END as userName")
|
||||||
|
|
||||||
|
.select(
|
||||||
|
"CASE t.process_design_type " +
|
||||||
|
"WHEN 'BLUEPRINT_WORKBLANK' THEN DATE_FORMAT(b.start_blank_date, '%y-%m-%d') " +
|
||||||
|
"WHEN 'BLUEPRINT_2D' THEN DATE_FORMAT(b.start_two_dim_Date, '%y-%m-%d') " +
|
||||||
|
"WHEN 'BLUEPRINT_3D' THEN DATE_FORMAT(b.start_three_dim_date, '%y-%m-%d') " +
|
||||||
|
"ELSE '' " +
|
||||||
|
"END as startDates"
|
||||||
|
)
|
||||||
|
.select(
|
||||||
|
"CASE t.process_design_type " +
|
||||||
|
"WHEN 'BLUEPRINT_WORKBLANK' THEN DATE_FORMAT(b.blank_date, '%y-%m-%d') " +
|
||||||
|
"WHEN 'BLUEPRINT_2D' THEN DATE_FORMAT(b.two_dim_date, '%y-%m-%d') " +
|
||||||
|
"WHEN 'BLUEPRINT_3D' THEN DATE_FORMAT(b.three_dim_date, '%y-%m-%d') " +
|
||||||
|
"ELSE '' " +
|
||||||
|
"END as endDates"
|
||||||
|
)
|
||||||
|
.leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessDesignDO::getPlanId)
|
||||||
|
.leftJoin("project_plan_sub b on b.project_plan_id = t.plan_id and b.project_sub_id = t.project_sub_id")
|
||||||
|
.leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId)
|
||||||
|
.leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId)
|
||||||
|
.leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId)
|
||||||
|
.leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, PlanDO::getProjectOwner)
|
||||||
|
.leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, PlanDO::getCraftOwner)
|
||||||
|
.leftJoin("system_users u3 on u3.id = b.blank_owner")
|
||||||
|
.leftJoin("system_users u4 on u4.id = b.two_dim_owner")
|
||||||
|
.leftJoin("system_users u5 on u5.id = b.three_dim_owner")
|
||||||
|
.disableSubLogicDel();
|
||||||
|
query.orderByDesc(ProcessDesignDO::getCreateTime);
|
||||||
|
query
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getCustomerName()), CustomerDO::getName, reqVO.getCustomerName())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName())
|
||||||
|
.in(reqVO.getProcessDesignTypeList() != null && !reqVO.getProcessDesignTypeList().isEmpty(), ProcessDesignDO::getProcessDesignType, reqVO.getProcessDesignTypeList())
|
||||||
|
;
|
||||||
|
|
||||||
|
if(!StringUtils.isEmpty(reqVO.getOwnerName())){
|
||||||
|
query.and(QueryWrapper -> QueryWrapper.apply("u2.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_FOUNDRY_TECHNOLOGY.name())
|
||||||
|
.or()
|
||||||
|
.apply("u3.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_WORKBLANK.name())
|
||||||
|
.or()
|
||||||
|
.apply("u4.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_2D.name())
|
||||||
|
.or()
|
||||||
|
.apply("u5.nickname = {0} and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.BLUEPRINT_3D.name()));
|
||||||
|
}
|
||||||
|
System.out.println(query.getSqlSelect()); // 查看实际执行的 SQL
|
||||||
|
return selectPage(reqVO, query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,10 +55,23 @@ public interface ProjectOrderSubMapper extends BaseMapperX<ProjectOrderSubDO> {
|
|||||||
.leftJoin(CompositionDO.class, "b", CompositionDO::getId, ProjectOrderSubDO::getCompositionId)
|
.leftJoin(CompositionDO.class, "b", CompositionDO::getId, ProjectOrderSubDO::getCompositionId)
|
||||||
.disableSubLogicDel()
|
.disableSubLogicDel()
|
||||||
.orderByAsc(ProjectOrderSubDO::getId)
|
.orderByAsc(ProjectOrderSubDO::getId)
|
||||||
.eq(ProjectOrderSubDO::getProjectOrderId, projectOrderId);
|
.eq(ProjectOrderSubDO::getProjectOrderId, projectOrderId)
|
||||||
|
;
|
||||||
|
return selectList(query);
|
||||||
|
}
|
||||||
|
default List<ProjectOrderSubDO> selectListByProjectOrderId1(Long projectOrderId) {
|
||||||
|
MPJLambdaWrapper<ProjectOrderSubDO> query = new MPJLambdaWrapper<>();
|
||||||
|
query.selectAll(ProjectOrderSubDO.class)
|
||||||
|
.select("b.name as compositionName", "p.code as projectOrderCode","p.property as property ", "e.name as deviceName")
|
||||||
|
.leftJoin(EquipDO.class, "e", EquipDO::getId, ProjectOrderSubDO::getDeviceModel)
|
||||||
|
.leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, ProjectOrderSubDO::getProjectOrderId)
|
||||||
|
.leftJoin(CompositionDO.class, "b", CompositionDO::getId, ProjectOrderSubDO::getCompositionId)
|
||||||
|
.disableSubLogicDel()
|
||||||
|
.orderByAsc(ProjectOrderSubDO::getId)
|
||||||
|
.eq(ProjectOrderSubDO::getProjectOrderId, projectOrderId)
|
||||||
|
.gt(ProjectOrderSubDO::getRemAmount, 0);
|
||||||
return selectList(query);
|
return selectList(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
default int deleteByProjectOrderId(Long projectOrderId) {
|
default int deleteByProjectOrderId(Long projectOrderId) {
|
||||||
return delete(ProjectOrderSubDO::getProjectOrderId, projectOrderId);
|
return delete(ProjectOrderSubDO::getProjectOrderId, projectOrderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ public interface PurchaseOrderMakeMapper extends BaseMapperX<PurchaseOrderMakeDO
|
|||||||
.like(Objects.nonNull(reqVO.getProjectSubName()), PurchaseOrderMakeDetailDO::getName, reqVO.getProjectSubName())
|
.like(Objects.nonNull(reqVO.getProjectSubName()), PurchaseOrderMakeDetailDO::getName, reqVO.getProjectSubName())
|
||||||
|
|
||||||
.leftJoin(SupplierDO.class, "b", SupplierDO::getId, PurchaseOrderMakeDetailDO::getSupplierId)
|
.leftJoin(SupplierDO.class, "b", SupplierDO::getId, PurchaseOrderMakeDetailDO::getSupplierId)
|
||||||
.like(Objects.nonNull(reqVO.getSupplierName()), SupplierDO::getName, reqVO.getSupplierName())
|
.like(Objects.nonNull(reqVO.getSupplierName()), SupplierDO::getBrief, reqVO.getSupplierName())
|
||||||
|
|
||||||
// eqIfPresent 替换为 eq 方法,并结合 Objects.nonNull 判断
|
// eqIfPresent 替换为 eq 方法,并结合 Objects.nonNull 判断
|
||||||
.eq(Objects.nonNull(reqVO.getPurchaseNo()), PurchaseOrderMakeDO::getPurchaseNo, reqVO.getPurchaseNo())
|
.eq(Objects.nonNull(reqVO.getPurchaseNo()), PurchaseOrderMakeDO::getPurchaseNo, reqVO.getPurchaseNo())
|
||||||
|
|||||||
@ -86,7 +86,7 @@ public interface PurchaseOrderMakeDetailMapper extends BaseMapperX<PurchaseOrder
|
|||||||
PurchaseOrderMakeDO::getProjectNameSim,
|
PurchaseOrderMakeDO::getProjectNameSim,
|
||||||
PurchaseOrderMakeDO::getStatus)
|
PurchaseOrderMakeDO::getStatus)
|
||||||
.select("c.nickname as duEmpName")
|
.select("c.nickname as duEmpName")
|
||||||
.select("d.name as supplierName")
|
.select("d.brief as supplierName")
|
||||||
.select("e.name as procedureName")
|
.select("e.name as procedureName")
|
||||||
.leftJoin(PurchaseOrderMakeDO.class,"a",PurchaseOrderMakeDO::getId,PurchaseOrderMakeDetailDO::getPurchaseOrderId)
|
.leftJoin(PurchaseOrderMakeDO.class,"a",PurchaseOrderMakeDO::getId,PurchaseOrderMakeDetailDO::getPurchaseOrderId)
|
||||||
.leftJoin(ProjectOrderDO.class,"b",ProjectOrderDO::getId,PurchaseOrderMakeDO::getProjectId)
|
.leftJoin(ProjectOrderDO.class,"b",ProjectOrderDO::getId,PurchaseOrderMakeDO::getProjectId)
|
||||||
@ -106,7 +106,7 @@ public interface PurchaseOrderMakeDetailMapper extends BaseMapperX<PurchaseOrder
|
|||||||
.eq(Objects.nonNull(pageReqVO.getStatus()), PurchaseOrderMakeDetailDO::getOrderStatus, pageReqVO.getStatus())
|
.eq(Objects.nonNull(pageReqVO.getStatus()), PurchaseOrderMakeDetailDO::getOrderStatus, pageReqVO.getStatus())
|
||||||
.eq(Objects.nonNull(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode())
|
.eq(Objects.nonNull(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode())
|
||||||
.like(Objects.nonNull(pageReqVO.getOwnerName()), AdminUserDO::getNickname, pageReqVO.getOwnerName())
|
.like(Objects.nonNull(pageReqVO.getOwnerName()), AdminUserDO::getNickname, pageReqVO.getOwnerName())
|
||||||
.like(Objects.nonNull(pageReqVO.getSupplierName()), SupplierDO::getName, pageReqVO.getSupplierName());
|
.like(Objects.nonNull(pageReqVO.getSupplierName()), SupplierDO::getBrief, pageReqVO.getSupplierName());
|
||||||
|
|
||||||
PageResult<PartPurchaseOrderPageRespVO> pageResult = selectJoinPage(pageReqVO, PartPurchaseOrderPageRespVO.class, query);
|
PageResult<PartPurchaseOrderPageRespVO> pageResult = selectJoinPage(pageReqVO, PartPurchaseOrderPageRespVO.class, query);
|
||||||
return pageResult;
|
return pageResult;
|
||||||
@ -122,7 +122,7 @@ public interface PurchaseOrderMakeDetailMapper extends BaseMapperX<PurchaseOrder
|
|||||||
PurchaseOrderMakeDO::getProjectNameSim,
|
PurchaseOrderMakeDO::getProjectNameSim,
|
||||||
PurchaseOrderMakeDO::getStatus)
|
PurchaseOrderMakeDO::getStatus)
|
||||||
.select("c.nickname as duEmpName")
|
.select("c.nickname as duEmpName")
|
||||||
.select("d.name as supplierName")
|
.select("d.brief as supplierName")
|
||||||
.select("e.name as procedureName")
|
.select("e.name as procedureName")
|
||||||
.leftJoin(PurchaseOrderMakeDO.class,"a",PurchaseOrderMakeDO::getId,PurchaseOrderMakeDetailDO::getPurchaseOrderId)
|
.leftJoin(PurchaseOrderMakeDO.class,"a",PurchaseOrderMakeDO::getId,PurchaseOrderMakeDetailDO::getPurchaseOrderId)
|
||||||
.leftJoin(ProjectOrderDO.class,"b",ProjectOrderDO::getId,PurchaseOrderMakeDO::getProjectId)
|
.leftJoin(ProjectOrderDO.class,"b",ProjectOrderDO::getId,PurchaseOrderMakeDO::getProjectId)
|
||||||
@ -152,7 +152,7 @@ public interface PurchaseOrderMakeDetailMapper extends BaseMapperX<PurchaseOrder
|
|||||||
default List<PurchaseOrderMakeDetailDO> getByPurchaseOrderId(Long id){
|
default List<PurchaseOrderMakeDetailDO> getByPurchaseOrderId(Long id){
|
||||||
MPJLambdaWrapper<PurchaseOrderMakeDetailDO> query = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<PurchaseOrderMakeDetailDO> query = new MPJLambdaWrapper<>();
|
||||||
query.selectAll(PurchaseOrderMakeDetailDO.class)
|
query.selectAll(PurchaseOrderMakeDetailDO.class)
|
||||||
.select("p.name as procedureName,s.name as supplierName")
|
.select("p.name as procedureName,s.brief as supplierName")
|
||||||
.select("m.project_name as projectName")
|
.select("m.project_name as projectName")
|
||||||
.leftJoin(PurchaseOrderMakeDO.class,"m",PurchaseOrderMakeDO::getId,PurchaseOrderMakeDetailDO::getPurchaseOrderId)
|
.leftJoin(PurchaseOrderMakeDO.class,"m",PurchaseOrderMakeDO::getId,PurchaseOrderMakeDetailDO::getPurchaseOrderId)
|
||||||
.leftJoin(ProcedureDO.class,"p", ProcedureDO::getId, PurchaseOrderMakeDetailDO::getProcedureId)
|
.leftJoin(ProcedureDO.class,"p", ProcedureDO::getId, PurchaseOrderMakeDetailDO::getProcedureId)
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public interface PurchaseOrderNoMapper extends BaseMapperX<PurchaseOrderNoDO> {
|
|||||||
MPJLambdaWrapper<PurchaseOrderNoDO> query = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<PurchaseOrderNoDO> query = new MPJLambdaWrapper<>();
|
||||||
|
|
||||||
query.selectAll(PurchaseOrderNoDO.class)
|
query.selectAll(PurchaseOrderNoDO.class)
|
||||||
.select("s.name as supplierName","m.project_material_plan_no as materialPlanNo")
|
.select("s.brief as supplierName","m.project_material_plan_no as materialPlanNo")
|
||||||
.select("u1.nickname as submitUserName")
|
.select("u1.nickname as submitUserName")
|
||||||
.select("CASE " +
|
.select("CASE " +
|
||||||
" WHEN COUNT(d.id) = 0 THEN 1 " + // 无子记录
|
" WHEN COUNT(d.id) = 0 THEN 1 " + // 无子记录
|
||||||
@ -49,7 +49,7 @@ public interface PurchaseOrderNoMapper extends BaseMapperX<PurchaseOrderNoDO> {
|
|||||||
.groupBy(PurchaseOrderNoDO::getId)
|
.groupBy(PurchaseOrderNoDO::getId)
|
||||||
.orderByDesc(PurchaseOrderNoDO::getCreateTime);
|
.orderByDesc(PurchaseOrderNoDO::getCreateTime);
|
||||||
query.like(!StringUtils.isEmpty(reqVO.getPurchaseNo()), PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
query.like(!StringUtils.isEmpty(reqVO.getPurchaseNo()), PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
||||||
.like(!StringUtils.isEmpty(reqVO.getSupplierName()), "s.name", reqVO.getSupplierName())
|
.like(!StringUtils.isEmpty(reqVO.getSupplierName()), "s.brief", reqVO.getSupplierName())
|
||||||
.like(!StringUtils.isEmpty(reqVO.getMaterialPlanNo()), "m.project_material_plan_no", reqVO.getMaterialPlanNo())
|
.like(!StringUtils.isEmpty(reqVO.getMaterialPlanNo()), "m.project_material_plan_no", reqVO.getMaterialPlanNo())
|
||||||
.apply(!StringUtils.isEmpty(reqVO.getCreateTime()), "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", reqVO.getCreateTime())
|
.apply(!StringUtils.isEmpty(reqVO.getCreateTime()), "DATE_FORMAT(t.create_time,'%Y-%m-%d') = {0}", reqVO.getCreateTime())
|
||||||
.eq(reqVO.getStatus() != null, PurchaseOrderNoDO::getStatus, reqVO.getStatus())
|
.eq(reqVO.getStatus() != null, PurchaseOrderNoDO::getStatus, reqVO.getStatus())
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail;
|
package com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
@ -8,12 +9,14 @@ import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
|||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.ProcessBoomPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.ProcessBoomPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.PurchaseOrderMaterialPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.PurchaseOrderMaterialPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
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.projectorder.ProjectOrderSubDO;
|
||||||
@ -25,10 +28,12 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.Pur
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageinventory.StorageInventoryDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageinventory.StorageInventoryDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
||||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
||||||
|
import org.checkerframework.checker.units.qual.C;
|
||||||
import org.springframework.beans.PropertyValues;
|
import org.springframework.beans.PropertyValues;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
@ -93,7 +98,7 @@ public interface PurchaseOrderNoDetailMapper extends BaseMapperX<PurchaseOrderNo
|
|||||||
MPJLambdaWrapper<PurchaseOrderNoDetailDO> query = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<PurchaseOrderNoDetailDO> query = new MPJLambdaWrapper<>();
|
||||||
|
|
||||||
query.selectAll(PurchaseOrderNoDetailDO.class)
|
query.selectAll(PurchaseOrderNoDetailDO.class)
|
||||||
.select("s.name as supplierName","m.code as matCode","p.purchase_no as purchaseNo","t.purchase_rem_amount as purchaseRemAmounts")
|
.select("s.brief as supplierName","m.code as matCode","p.purchase_no as purchaseNo","t.purchase_rem_amount as purchaseRemAmounts")
|
||||||
.select("DATE_FORMAT(t.require_time,'%Y-%m-%d') as requireTimes","DATE_FORMAT(t.arrive_time,'%Y-%m-%d') as arriveTimes")
|
.select("DATE_FORMAT(t.require_time,'%Y-%m-%d') as requireTimes","DATE_FORMAT(t.arrive_time,'%Y-%m-%d') as arriveTimes")
|
||||||
.leftJoin(PurchaseOrderNoDO.class,"p", PurchaseOrderNoDO::getId, PurchaseOrderNoDetailDO::getPurchaseOrderId)
|
.leftJoin(PurchaseOrderNoDO.class,"p", PurchaseOrderNoDO::getId, PurchaseOrderNoDetailDO::getPurchaseOrderId)
|
||||||
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderNoDO::getSupplierId)
|
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderNoDO::getSupplierId)
|
||||||
@ -113,4 +118,77 @@ public interface PurchaseOrderNoDetailMapper extends BaseMapperX<PurchaseOrderNo
|
|||||||
|
|
||||||
return selectPage(pageReqVO, query);
|
return selectPage(pageReqVO, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default PageResult<PurchaseOrderNoDetailDO> getOutsourcingExpenses(PurchaseOrderNoDetailPageReqVO pageReqVO){
|
||||||
|
MPJLambdaWrapper<PurchaseOrderNoDetailDO> query = new MPJLambdaWrapper<>();
|
||||||
|
|
||||||
|
query.selectAll(PurchaseOrderNoDetailDO.class)
|
||||||
|
.select("s.brief as supplierName","b.code as boomCode","bom.blueprint_no as blueprintNo")
|
||||||
|
.select("d.name as procedureName","a.nickname as userName","p.ord_date as ordDate")
|
||||||
|
.leftJoin(PurchaseOrderNoDO.class,"p", PurchaseOrderNoDO::getId, PurchaseOrderNoDetailDO::getPurchaseOrderId)
|
||||||
|
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderNoDO::getSupplierId)
|
||||||
|
.leftJoin(ProjectOrderDO.class,"pro", ProjectOrderDO::getId, PurchaseOrderNoDetailDO::getProjectId)
|
||||||
|
.leftJoin(CustomerDO.class,"c", CustomerDO::getId, PurchaseOrderNoDetailDO::getCustomerId)
|
||||||
|
.leftJoin(AdminUserDO.class,"a", AdminUserDO::getId, PurchaseOrderNoDO::getCreator)
|
||||||
|
.leftJoin(ProcessBomDetailDO.class,"bom", ProcessBomDetailDO::getId, PurchaseOrderNoDetailDO::getBoomDetailId)
|
||||||
|
.leftJoin(ProcessBomDO.class,"b", ProcessBomDO::getId, ProcessBomDetailDO::getBomId)
|
||||||
|
.leftJoin(ProcedureDO.class, "d", ProcedureDO::getId, PurchaseOrderNoDetailDO::getProcedureId)
|
||||||
|
.disableSubLogicDel()
|
||||||
|
.groupBy(PurchaseOrderNoDetailDO::getId)
|
||||||
|
.orderByDesc(PurchaseOrderNoDetailDO::getCreateTime);
|
||||||
|
query
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectName()), PurchaseOrderNoDetailDO::getProjectName, pageReqVO.getProjectName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), PurchaseOrderNoDetailDO::getName, pageReqVO.getProjectSubName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getCustomerName()), CustomerDO::getName, pageReqVO.getCustomerName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getSupplierName()), SupplierDO::getBrief, pageReqVO.getSupplierName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getOwnerName()), AdminUserDO::getNickname, pageReqVO.getOwnerName());
|
||||||
|
if (pageReqVO.getCreateTime() != null) {
|
||||||
|
LocalDateTime endDateTime = pageReqVO.getCreateTime()[1];
|
||||||
|
// 重置时间为 23:59:59
|
||||||
|
LocalDateTime endOfDay = endDateTime
|
||||||
|
.withHour(23)
|
||||||
|
.withMinute(59)
|
||||||
|
.withSecond(59);
|
||||||
|
query.between(PurchaseOrderNoDO::getOrdDate, pageReqVO.getCreateTime() [0], endOfDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectPage(pageReqVO, query);
|
||||||
|
}
|
||||||
|
default PageResult<PurchaseOrderNoDetailDO> exportOutsourcing(PurchaseOrderNoDetailPageReqVO pageReqVO){
|
||||||
|
MPJLambdaWrapper<PurchaseOrderNoDetailDO> query = new MPJLambdaWrapper<>();
|
||||||
|
|
||||||
|
query.selectAll(PurchaseOrderNoDetailDO.class)
|
||||||
|
.select("s.brief as supplierName","b.code as boomCode","bom.blueprint_no as blueprintNo")
|
||||||
|
.select("d.name as procedureName","a.nickname as userName","DATE_FORMAT(p.ord_date,'%Y-%m-%d') as ordDates")
|
||||||
|
.leftJoin(PurchaseOrderNoDO.class,"p", PurchaseOrderNoDO::getId, PurchaseOrderNoDetailDO::getPurchaseOrderId)
|
||||||
|
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderNoDO::getSupplierId)
|
||||||
|
.leftJoin(ProjectOrderDO.class,"pro", ProjectOrderDO::getId, PurchaseOrderNoDetailDO::getProjectId)
|
||||||
|
.leftJoin(CustomerDO.class,"c", CustomerDO::getId, PurchaseOrderNoDetailDO::getCustomerId)
|
||||||
|
.leftJoin(AdminUserDO.class,"a", AdminUserDO::getId, PurchaseOrderNoDO::getCreator)
|
||||||
|
.leftJoin(ProcessBomDetailDO.class,"bom", ProcessBomDetailDO::getId, PurchaseOrderNoDetailDO::getBoomDetailId)
|
||||||
|
.leftJoin(ProcessBomDO.class,"b", ProcessBomDO::getId, ProcessBomDetailDO::getBomId)
|
||||||
|
.leftJoin(ProcedureDO.class, "d", ProcedureDO::getId, PurchaseOrderNoDetailDO::getProcedureId)
|
||||||
|
.disableSubLogicDel()
|
||||||
|
.groupBy(PurchaseOrderNoDetailDO::getId)
|
||||||
|
.orderByDesc(PurchaseOrderNoDetailDO::getCreateTime);
|
||||||
|
query
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectName()), PurchaseOrderNoDetailDO::getProjectName, pageReqVO.getProjectName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), PurchaseOrderNoDetailDO::getName, pageReqVO.getProjectSubName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getCustomerName()), CustomerDO::getName, pageReqVO.getCustomerName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getSupplierName()), SupplierDO::getBrief, pageReqVO.getSupplierName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getOwnerName()), AdminUserDO::getNickname, pageReqVO.getOwnerName());
|
||||||
|
if (pageReqVO.getCreateTime() != null) {
|
||||||
|
LocalDateTime endDateTime = pageReqVO.getCreateTime()[1];
|
||||||
|
// 重置时间为 23:59:59
|
||||||
|
LocalDateTime endOfDay = endDateTime
|
||||||
|
.withHour(23)
|
||||||
|
.withMinute(59)
|
||||||
|
.withSecond(59);
|
||||||
|
query.between(PurchaseOrderNoDO::getOrdDate, pageReqVO.getCreateTime() [0], endOfDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectPage(pageReqVO, query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -78,23 +78,9 @@ public interface StorageMapper extends BaseMapperX<StorageDO> {
|
|||||||
// .orderByDesc(StorageDO::getId));
|
// .orderByDesc(StorageDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<StorageDO> getList(Long id, Long projectSubId){
|
List<StorageDO> getList(@Param("id") Long id, @Param("projectSubId") Long projectSubId);
|
||||||
MPJLambdaWrapper<StorageDO> query = new MPJLambdaWrapper<>();
|
|
||||||
query.selectAll(StorageDO.class)
|
|
||||||
.select("mat.code as materialCode","mat.name as materialName","mat.material_type as materialType","mat.unit as unit","mat.spec as materialSpec")
|
|
||||||
.select("COALESCE(ROUND(sm.storage_ok_qty * sm.price, 2), 0) AS caiGouMoney","sm.storage_ok_qty as amount")
|
|
||||||
.leftJoin(StorageMatDO.class, "sm", StorageMatDO::getStockId, StorageDO::getId)
|
|
||||||
.leftJoin(MaterialDO.class, "mat", MaterialDO::getId, StorageMatDO::getMatId)
|
|
||||||
.disableSubLogicDel()
|
|
||||||
.orderByDesc(StorageDO::getCreateTime);
|
|
||||||
|
|
||||||
query.eq(StorageDO::getProjectNo,projectSubId)
|
|
||||||
.eq(StorageDO::getStockType,2)
|
|
||||||
.eq(StorageMatDO::getDeleted,0)
|
|
||||||
.eq(MaterialDO::getDeleted,0)
|
|
||||||
.ne(StorageDO::getStatus,3);
|
|
||||||
return selectList(query);
|
|
||||||
}
|
|
||||||
|
|
||||||
BigDecimal StandardPartsCost(@Param("id") Long id, @Param("projectSubId") Long projectSubId);
|
BigDecimal StandardPartsCost(@Param("id") Long id, @Param("projectSubId") Long projectSubId);
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@ public interface StorageInMapper extends BaseMapperX<StorageInDO> {
|
|||||||
MPJLambdaWrapper<StorageInDO> query = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<StorageInDO> query = new MPJLambdaWrapper<>();
|
||||||
|
|
||||||
query.selectAll(StorageInDO.class)
|
query.selectAll(StorageInDO.class)
|
||||||
.select("sup.name as supplierName")
|
.select("sup.brief as supplierName")
|
||||||
.leftJoin(StorageInDetailDO.class, "s", StorageInDetailDO::getStorageNoId, StorageInDO::getId)
|
.leftJoin(StorageInDetailDO.class, "s", StorageInDetailDO::getStorageNoId, StorageInDO::getId)
|
||||||
.leftJoin(SupplierDO.class,"sup", SupplierDO::getId, StorageInDetailDO::getSupplierId)
|
.leftJoin(SupplierDO.class,"sup", SupplierDO::getId, StorageInDetailDO::getSupplierId)
|
||||||
.disableSubLogicDel()
|
.disableSubLogicDel()
|
||||||
@ -37,7 +37,7 @@ public interface StorageInMapper extends BaseMapperX<StorageInDO> {
|
|||||||
query.like(!StringUtils.isEmpty(reqVO.getStorageNo()), StorageInDO::getStorageNo, reqVO.getStorageNo());
|
query.like(!StringUtils.isEmpty(reqVO.getStorageNo()), StorageInDO::getStorageNo, reqVO.getStorageNo());
|
||||||
query.like(!StringUtils.isEmpty(reqVO.getProjectName()), StorageInDetailDO::getProjectName, reqVO.getProjectName());
|
query.like(!StringUtils.isEmpty(reqVO.getProjectName()), StorageInDetailDO::getProjectName, reqVO.getProjectName());
|
||||||
query.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), StorageInDetailDO::getName, reqVO.getProjectSubName());
|
query.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), StorageInDetailDO::getName, reqVO.getProjectSubName());
|
||||||
query.like(!StringUtils.isEmpty(reqVO.getSupplierName()), SupplierDO::getName, reqVO.getSupplierName());
|
query.like(!StringUtils.isEmpty(reqVO.getSupplierName()), SupplierDO::getBrief, reqVO.getSupplierName());
|
||||||
query.eq(reqVO.getGoodsType() != null, StorageInDO::getGoodsType, reqVO.getGoodsType());
|
query.eq(reqVO.getGoodsType() != null, StorageInDO::getGoodsType, reqVO.getGoodsType());
|
||||||
return selectPage(reqVO, query);
|
return selectPage(reqVO, query);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public interface StorageInDetailMapper extends BaseMapperX<StorageInDetailDO> {
|
|||||||
MPJLambdaWrapper<StorageInDetailDO> query = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<StorageInDetailDO> query = new MPJLambdaWrapper<>();
|
||||||
|
|
||||||
query.selectAll(StorageInDetailDO.class)
|
query.selectAll(StorageInDetailDO.class)
|
||||||
.select("sup.name as supplierName","m.code as materialCode")
|
.select("sup.brief as supplierName","m.code as materialCode")
|
||||||
.select("d.label as unit")
|
.select("d.label as unit")
|
||||||
.leftJoin(SupplierDO.class,"sup", SupplierDO::getId, StorageInDetailDO::getSupplierId)
|
.leftJoin(SupplierDO.class,"sup", SupplierDO::getId, StorageInDetailDO::getSupplierId)
|
||||||
.leftJoin(MaterialDO.class,"m", MaterialDO::getId, StorageInDetailDO::getMaterialId)
|
.leftJoin(MaterialDO.class,"m", MaterialDO::getId, StorageInDetailDO::getMaterialId)
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||||
@ -24,28 +25,24 @@ import org.springframework.util.StringUtils;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface StorageLogMapper extends BaseMapperX<StorageLogDO> {
|
public interface StorageLogMapper extends BaseMapperX<StorageLogDO> {
|
||||||
|
|
||||||
// default PageResult<StorageLogDO> selectPage(StorageLogPageReqVO reqVO) {
|
default PageResult<StorageLogDO> selectPage(StorageLogPageReqVO reqVO) {
|
||||||
// MPJLambdaWrapper<StorageLogDO> query = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<StorageLogDO> query = new MPJLambdaWrapper<>();
|
||||||
//
|
|
||||||
// query.selectAll(StorageLogDO.class)
|
query.selectAll(StorageLogDO.class)
|
||||||
// .select("st.stock_no as stockNo", "st.stock_type as stockType","st.header_no as headerNo", "mat.name as matName","mat.code as matCode","mat.material_type as matType","wh.wh_name as whName","rg.rg_name as rgName","pn.pn_name as pnName")
|
.select( "mat.name as matName","mat.code as matCode","mat.unit as matUnit","wh.wh_name as whName","rg.rg_name as rgName","pn.pn_name as pnName")
|
||||||
// .leftJoin(StorageDO.class, "st", StorageDO::getId, StorageLogDO::getStockId)
|
.leftJoin(StorageDO.class, "st", StorageDO::getId, StorageLogDO::getStockId)
|
||||||
// .leftJoin(MaterialDO.class,"mat", MaterialDO::getId,StorageLogDO::getMatId)
|
.leftJoin(MaterialDO.class,"mat", MaterialDO::getId,StorageLogDO::getMatId)
|
||||||
// .leftJoin(WarehouseDO.class,"wh", WarehouseDO::getId,StorageLogDO::getWhId)
|
.leftJoin(WarehouseDO.class,"wh", WarehouseDO::getId,StorageLogDO::getWhId)
|
||||||
// .leftJoin(RgDO.class,"rg", RgDO::getId,StorageLogDO::getRgId)
|
.leftJoin(RgDO.class,"rg", RgDO::getId,StorageLogDO::getRgId)
|
||||||
// .leftJoin(PnDO.class,"pn", PnDO::getId,StorageLogDO::getPnId)
|
.leftJoin(PnDO.class,"pn", PnDO::getId,StorageLogDO::getPnId)
|
||||||
// .disableSubLogicDel()
|
.disableSubLogicDel()
|
||||||
// .orderByDesc(StorageLogDO::getId);
|
.orderByDesc(StorageLogDO::getId);
|
||||||
//
|
|
||||||
// query.eq(reqVO.getMatType() != null,"mat.material_type", reqVO.getMatType())
|
query
|
||||||
// .eq(reqVO.getStockType() != null,"st.stock_type", reqVO.getStockType())
|
.eq(reqVO.getStockType() != null,StorageLogDO::getStockType, reqVO.getStockType())
|
||||||
// .like(!StringUtils.isEmpty(reqVO.getMatName()), "mat.name", reqVO.getMatName())
|
.like(!StringUtils.isEmpty(reqVO.getMatName()), MaterialDO::getName, reqVO.getMatName())
|
||||||
// .like(!StringUtils.isEmpty(reqVO.getMatCode()), "mat.code", reqVO.getMatCode())
|
.eq(!ObjectUtil.isEmpty(reqVO.getWhId()), StorageLogDO::getWhId, reqVO.getWhId());
|
||||||
// .like(!StringUtils.isEmpty(reqVO.getStockNo()), "st.stock_no", reqVO.getStockNo())
|
return selectPage(reqVO,query);
|
||||||
// .like(!StringUtils.isEmpty(reqVO.getHeaderNo()), "st.header_no", reqVO.getHeaderNo())
|
}
|
||||||
// .like(!StringUtils.isEmpty(reqVO.getLotNo()),StorageLogDO::getLotNo, reqVO.getLotNo());
|
|
||||||
//
|
|
||||||
// return selectPage(reqVO);
|
|
||||||
// }
|
|
||||||
// PageResult<StorageLogAllDO> selectAllPage(StorageLogPageReqVO reqVO);
|
// PageResult<StorageLogAllDO> selectAllPage(StorageLogPageReqVO reqVO);
|
||||||
}
|
}
|
||||||
@ -24,6 +24,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDeta
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
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.projectorder.ProjectOrderSubDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermakedetail.PurchaseOrderMakeDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermakedetail.PurchaseOrderMakeDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetailowner.TaskDispatchDetailOwnerDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetailowner.TaskDispatchDetailOwnerDO;
|
||||||
@ -232,7 +233,7 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
|||||||
.select("a.code as dispatchCode")
|
.select("a.code as dispatchCode")
|
||||||
.select("b.code as projectCode", "b.project_name as projectName", "c.name as projectSubName")
|
.select("b.code as projectCode", "b.project_name as projectName", "c.name as projectSubName")
|
||||||
.select("d.material_name as materialName")
|
.select("d.material_name as materialName")
|
||||||
.select("e.name as procedureName","make.estimated_price as estimatedPrice")
|
.select("e.name as procedureName","no.estimated_price as estimatedPrice")
|
||||||
.selectSum(TaskReportDO::getAmount, "totalReportAmount")
|
.selectSum(TaskReportDO::getAmount, "totalReportAmount")
|
||||||
.selectSum(TaskReportDO::getWorkTime, "totalWorkTime")
|
.selectSum(TaskReportDO::getWorkTime, "totalWorkTime")
|
||||||
.leftJoin(TaskDispatchDO.class, "a", TaskDispatchDO::getId, TaskDispatchDetailDO::getDispatchId)
|
.leftJoin(TaskDispatchDO.class, "a", TaskDispatchDO::getId, TaskDispatchDetailDO::getDispatchId)
|
||||||
@ -243,6 +244,7 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
|||||||
.leftJoin(TaskReportDO.class, "f", TaskReportDO::getDispatchDetailId, TaskDispatchDetailDO::getId)
|
.leftJoin(TaskReportDO.class, "f", TaskReportDO::getDispatchDetailId, TaskDispatchDetailDO::getId)
|
||||||
.leftJoin(MaterialPlanBoomDO.class,"bom",MaterialPlanBoomDO::getId, TaskDispatchDetailDO::getProjectMaterialPlanDetailId)
|
.leftJoin(MaterialPlanBoomDO.class,"bom",MaterialPlanBoomDO::getId, TaskDispatchDetailDO::getProjectMaterialPlanDetailId)
|
||||||
.leftJoin(PurchaseOrderMakeDetailDO.class,"make",PurchaseOrderMakeDetailDO::getId, MaterialPlanBoomDO::getProjectPurchaseOrderMakeDetailId)
|
.leftJoin(PurchaseOrderMakeDetailDO.class,"make",PurchaseOrderMakeDetailDO::getId, MaterialPlanBoomDO::getProjectPurchaseOrderMakeDetailId)
|
||||||
|
.leftJoin(PurchaseOrderNoDetailDO.class,"no",PurchaseOrderNoDetailDO::getId, PurchaseOrderMakeDetailDO::getPurchaseOrderNoDetailId)
|
||||||
.groupBy(TaskDispatchDetailDO::getId)
|
.groupBy(TaskDispatchDetailDO::getId)
|
||||||
.orderByDesc(TaskDispatchDetailDO::getId)
|
.orderByDesc(TaskDispatchDetailDO::getId)
|
||||||
.disableSubLogicDel();
|
.disableSubLogicDel();
|
||||||
@ -763,6 +765,7 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
|||||||
.like(!StringUtils.isEmpty(pageReqVO.getProjectName()), ProjectOrderDO::getProjectName, pageReqVO.getProjectName())
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectName()), ProjectOrderDO::getProjectName, pageReqVO.getProjectName())
|
||||||
.like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), ProjectOrderSubDO::getName, pageReqVO.getProjectSubName())
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), ProjectOrderSubDO::getName, pageReqVO.getProjectSubName())
|
||||||
.like(!StringUtils.isEmpty(pageReqVO.getMaterialName()), ProcessBomDetailDO::getMaterialName, pageReqVO.getMaterialName())
|
.like(!StringUtils.isEmpty(pageReqVO.getMaterialName()), ProcessBomDetailDO::getMaterialName, pageReqVO.getMaterialName())
|
||||||
|
.like(!StringUtils.isEmpty(pageReqVO.getProcedureName()), ProcedureDO::getName, pageReqVO.getProcedureName())
|
||||||
.like(!StringUtils.isEmpty(pageReqVO.getProjectMaterialPlanNo()), MaterialPlanDO::getProjectMaterialPlanNo, pageReqVO.getProjectMaterialPlanNo())
|
.like(!StringUtils.isEmpty(pageReqVO.getProjectMaterialPlanNo()), MaterialPlanDO::getProjectMaterialPlanNo, pageReqVO.getProjectMaterialPlanNo())
|
||||||
.eq(!StringUtils.isEmpty(pageReqVO.getStatus()), TaskDispatchDetailDO::getPlanStatus, pageReqVO.getStatus())
|
.eq(!StringUtils.isEmpty(pageReqVO.getStatus()), TaskDispatchDetailDO::getPlanStatus, pageReqVO.getStatus())
|
||||||
.eq( TaskDispatchDetailDO::getIsOutsourcing, "Y");
|
.eq( TaskDispatchDetailDO::getIsOutsourcing, "Y");
|
||||||
@ -780,4 +783,6 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
|||||||
wrapper.eq(TaskDispatchDO::getBomDetailId, id);
|
wrapper.eq(TaskDispatchDO::getBomDetailId, id);
|
||||||
return selectList(wrapper);
|
return selectList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BigDecimal assemblyLaborCost(@Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,13 @@ public interface TaskReportMapper extends BaseMapperX<TaskReportDO> {
|
|||||||
// query.between( TaskReportDO::getStartTime, reqVO.getStartTime()[0], reqVO.getStartTime()[1]);
|
// query.between( TaskReportDO::getStartTime, reqVO.getStartTime()[0], reqVO.getStartTime()[1]);
|
||||||
// }
|
// }
|
||||||
if (reqVO.getEndTime() != null) {
|
if (reqVO.getEndTime() != null) {
|
||||||
query.between(TaskReportDO::getReportTime, reqVO.getEndTime()[0], reqVO.getEndTime()[1]);
|
LocalDateTime endDateTime = reqVO.getEndTime()[1];
|
||||||
|
// 重置时间为 23:59:59
|
||||||
|
LocalDateTime endOfDay = endDateTime
|
||||||
|
.withHour(23)
|
||||||
|
.withMinute(59)
|
||||||
|
.withSecond(59);
|
||||||
|
query.between(TaskReportDO::getReportTime, reqVO.getEndTime()[0], endOfDay);
|
||||||
}
|
}
|
||||||
return selectPage(reqVO, query);
|
return selectPage(reqVO, query);
|
||||||
}
|
}
|
||||||
@ -80,4 +86,5 @@ public interface TaskReportMapper extends BaseMapperX<TaskReportDO> {
|
|||||||
}
|
}
|
||||||
public Long hasReportNew(@Param("ownerId") Long dispatchOwnerId);
|
public Long hasReportNew(@Param("ownerId") Long dispatchOwnerId);
|
||||||
|
|
||||||
|
void deleteByIds(@Param("id")Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -146,4 +146,6 @@ public interface UnqualifiedNotificationMapper extends BaseMapperX<UnqualifiedNo
|
|||||||
@Param("offset") Integer offset,
|
@Param("offset") Integer offset,
|
||||||
@Param("limit") Integer limit,
|
@Param("limit") Integer limit,
|
||||||
@Param("userId") Integer userId);
|
@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
List<QualityStatistics> workrecord(@Param("page") Page<QualityStatistics> page, @Param("pageReqVO") UnqualifiedNotificationPageReqVO pageReqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMaster
|
|||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终检报工 Mapper
|
* 终检报工 Mapper
|
||||||
@ -75,4 +76,6 @@ public interface ZjBgMasterLineMapper extends BaseMapperX<ZjBgMasterLineDO> {
|
|||||||
|
|
||||||
return selectOne(query);
|
return selectOne(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deleteByIds(@Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,9 +195,9 @@ public class CrossOrderManager {
|
|||||||
|
|
||||||
if(allDone){
|
if(allDone){
|
||||||
projectOrderDO.setDeliveryStatus(ProjectOrderDeliverStatusEnum.ALL.getCode());
|
projectOrderDO.setDeliveryStatus(ProjectOrderDeliverStatusEnum.ALL.getCode());
|
||||||
projectOrderDO.setDeliveryDate(deliverDate);
|
// projectOrderDO.setDeliveryDate(deliverDate);
|
||||||
planDO.setStatus(3);
|
// planDO.setStatus(3);
|
||||||
planService.updateById(planDO);
|
// planService.updateById(planDO);
|
||||||
}else{
|
}else{
|
||||||
projectOrderDO.setDeliveryStatus(ProjectOrderDeliverStatusEnum.PART.getCode());
|
projectOrderDO.setDeliveryStatus(ProjectOrderDeliverStatusEnum.PART.getCode());
|
||||||
}
|
}
|
||||||
@ -210,7 +210,58 @@ public class CrossOrderManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 刷新项目订单发货状态
|
||||||
|
* @param deliverOrderSubs
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void refreshProjectOrderDeliverStatusNew1( List<DeliverOrderSubDO> deliverOrderSubs) {
|
||||||
|
//按销售订单号分组:
|
||||||
|
Map<Long, List<DeliverOrderSubDO>> groupBySaleId = deliverOrderSubs.stream().collect(Collectors.groupingBy(DeliverOrderSubDO::getSaleOrderId));
|
||||||
|
for (Map.Entry<Long, List<DeliverOrderSubDO>> projectIdEntity : groupBySaleId.entrySet()) {
|
||||||
|
ProjectOrderDO projectOrderDO = projectOrderMapper.selectOne(new LambdaQueryWrapper<ProjectOrderDO>() {{
|
||||||
|
eq(ProjectOrderDO::getId, projectIdEntity.getKey());
|
||||||
|
last("LIMIT 1 FOR UPDATE");
|
||||||
|
}});
|
||||||
|
|
||||||
|
// 查询关联子项
|
||||||
|
List<ProjectOrderSubDO> projectOrderSubDOList = projectOrderSubMapper.selectListByProjectOrderId(projectOrderDO.getId());
|
||||||
|
|
||||||
|
// 查询发货记录
|
||||||
|
MPJLambdaWrapper<DeliverOrderSubDO> historyDeliveredSubQuery = new MPJLambdaWrapper<>();
|
||||||
|
historyDeliveredSubQuery.selectAll(DeliverOrderSubDO.class)
|
||||||
|
.leftJoin(DeliverOrderDO.class, DeliverOrderDO::getId, DeliverOrderSubDO::getDeliveryOrderId)
|
||||||
|
.eq(DeliverOrderDO::getDeliverStatus, DeliverOrderStatusEnum.DELIVER.getCode())
|
||||||
|
.in(DeliverOrderSubDO::getSaleOrderSubId, projectOrderSubDOList.stream().map(ProjectOrderSubDO::getId).collect(Collectors.toSet()));
|
||||||
|
List<DeliverOrderSubDO> historyDeliveredSubList = deliverOrderSubMapper.selectList(historyDeliveredSubQuery);
|
||||||
|
//如果历史没发过 以本次为准
|
||||||
|
if(historyDeliveredSubList.isEmpty()) {
|
||||||
|
projectOrderDO.setDeliveryStatus(ProjectOrderDeliverStatusEnum.NOT.getCode());
|
||||||
|
}else {
|
||||||
|
Map<Long, List<DeliverOrderSubDO>> historyDeliveredSubsGroupBySaleSubId = historyDeliveredSubList.stream().collect(Collectors.groupingBy(DeliverOrderSubDO::getSaleOrderSubId));
|
||||||
|
|
||||||
|
// 考虑变更订单情况 只需判断历史发货是否大于等于订单子项数量
|
||||||
|
boolean allDone = projectOrderSubDOList.stream().allMatch(projectOrderSubDO -> {
|
||||||
|
List<DeliverOrderSubDO> historySubList = historyDeliveredSubsGroupBySaleSubId.get(projectOrderSubDO.getId());
|
||||||
|
int historyDeliveredAmount = historySubList == null || historySubList.isEmpty() ? 0 : historySubList.stream().mapToInt(DeliverOrderSubDO::getAmount).sum();
|
||||||
|
return historyDeliveredAmount >= projectOrderSubDO.getAmount();
|
||||||
|
});
|
||||||
|
|
||||||
|
if(allDone){
|
||||||
|
projectOrderDO.setDeliveryStatus(ProjectOrderDeliverStatusEnum.ALL.getCode());
|
||||||
|
}else{
|
||||||
|
projectOrderDO.setDeliveryStatus(ProjectOrderDeliverStatusEnum.PART.getCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
projectOrderMapper.updateById(projectOrderDO);
|
||||||
|
}
|
||||||
|
// 锁定订单
|
||||||
|
for (DeliverOrderSubDO deliverOrderSubDO : deliverOrderSubs) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 生成出货单
|
* 生成出货单
|
||||||
* @param updateReqVO
|
* @param updateReqVO
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.bgmasterline;
|
package com.chanko.yunxi.mes.module.heli.service.bgmasterline;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过程检报工 Service 接口
|
* 过程检报工 Service 接口
|
||||||
@ -35,14 +35,15 @@ public interface BgMasterLineService {
|
|||||||
*
|
*
|
||||||
* @param updateReqVO 更新信息
|
* @param updateReqVO 更新信息
|
||||||
*/
|
*/
|
||||||
void updateBgMasterLine(@Valid BgMasterLineSaveReqVO updateReqVO);
|
CommonResult<Boolean> updateBgMasterLine(@Valid BgMasterLineSaveReqVO updateReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除过程检报工
|
* 删除过程检报工
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteBgMasterLine(Integer id);
|
CommonResult<Boolean> deleteBgMasterLine(Integer id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得过程检报工
|
* 获得过程检报工
|
||||||
|
|||||||
@ -2,34 +2,31 @@ package com.chanko.yunxi.mes.module.heli.service.bgmasterline;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterDO;
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.pgmaster.PgMasterLineMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.pgmaster.PgMasterLineMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.pgmaster.PgMasterMapper;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.mysql.user.AdminUserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
|
||||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.bgmasterline.BgMasterLineMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.bgmasterline.BgMasterLineMapper;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,6 +46,9 @@ public class BgMasterLineServiceImpl implements BgMasterLineService {
|
|||||||
private TaskDispatchDetailMapper taskDispatchDetailMapper;
|
private TaskDispatchDetailMapper taskDispatchDetailMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
||||||
|
@Resource
|
||||||
|
private AdminUserMapper adminUserMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean validExceed(Long zjmxId,Integer amount){
|
public boolean validExceed(Long zjmxId,Integer amount){
|
||||||
@ -172,20 +172,44 @@ public class BgMasterLineServiceImpl implements BgMasterLineService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateBgMasterLine(BgMasterLineSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateBgMasterLine(BgMasterLineSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateBgMasterLineExists(updateReqVO.getId());
|
validateBgMasterLineExists(updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
|
BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectById(updateReqVO.getId());
|
||||||
|
PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(bgMasterLineDO.getZjMxId());
|
||||||
|
if (ObjectUtil.isNotEmpty(pgMasterLineDO)&&pgMasterLineDO.getPgType()==1) return CommonResult.error(400,"该过程检已质检结束,请确认");
|
||||||
|
if (bgMasterLineDO.getIsQua()==1&&bgMasterLineDO.getNotificationStatus()==3) return CommonResult.error(400,"该过程检已审核,请确认");
|
||||||
|
Long id = getLoginUser().getId();
|
||||||
|
if (!id.equals(Long.parseLong(bgMasterLineDO.getBgUser()))){
|
||||||
|
AdminUserDO adminUserDO = adminUserMapper.selectById(id);
|
||||||
|
AdminUserDO adminUser = adminUserMapper.selectById(bgMasterLineDO.getBgUser());
|
||||||
|
if (ObjectUtil.isNotEmpty(adminUserDO)&&ObjectUtil.isNotEmpty(adminUser)) return CommonResult.error(400,"当前登录人员"+adminUserDO.getNickname()+"跟报工人"+adminUser.getNickname()+"不一致,不允许修改!");
|
||||||
|
}
|
||||||
BgMasterLineDO updateObj = BeanUtils.toBean(updateReqVO, BgMasterLineDO.class);
|
BgMasterLineDO updateObj = BeanUtils.toBean(updateReqVO, BgMasterLineDO.class);
|
||||||
bgMasterLineMapper.updateById(updateObj);
|
bgMasterLineMapper.updateById(updateObj);
|
||||||
|
return CommonResult.success(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteBgMasterLine(Integer id) {
|
public CommonResult<Boolean> deleteBgMasterLine(Integer id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateBgMasterLineExists(id);
|
validateBgMasterLineExists(id);
|
||||||
|
BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectById(id);
|
||||||
|
PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(bgMasterLineDO.getZjMxId());
|
||||||
|
if (ObjectUtil.isNotEmpty(pgMasterLineDO)&&pgMasterLineDO.getPgType()==1) return CommonResult.error(400,"该过程检已质检结束,请确认");
|
||||||
|
if (bgMasterLineDO.getIsQua()==1&&bgMasterLineDO.getNotificationStatus()==3) return CommonResult.error(400,"该过程检已审核,请确认");
|
||||||
|
|
||||||
|
Long loginId = getLoginUser().getId();
|
||||||
|
if (!loginId.equals(Long.parseLong(bgMasterLineDO.getBgUser()))){
|
||||||
|
AdminUserDO adminUserDO = adminUserMapper.selectById(id);
|
||||||
|
AdminUserDO adminUser = adminUserMapper.selectById(bgMasterLineDO.getBgUser());
|
||||||
|
if (ObjectUtil.isNotEmpty(adminUserDO)&&ObjectUtil.isNotEmpty(adminUser)) return CommonResult.error(400,"当前登录人员"+adminUserDO.getNickname()+"跟报工人"+adminUser.getNickname()+"不一致,不允许修改!");
|
||||||
|
}
|
||||||
// 删除
|
// 删除
|
||||||
bgMasterLineMapper.deleteById(id);
|
bgMasterLineMapper.deleteByIds(id);
|
||||||
|
return CommonResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateBgMasterLineExists(Integer id) {
|
private void validateBgMasterLineExists(Integer id) {
|
||||||
|
|||||||
@ -72,4 +72,6 @@ public interface DeliverOrderService {
|
|||||||
|
|
||||||
|
|
||||||
List<DeliverOrderDO> getListYf(Long id, Long projectSubId);
|
List<DeliverOrderDO> getListYf(Long id, Long projectSubId);
|
||||||
|
|
||||||
|
List<DeliverOrderDO> getListYfDetails(Long id, Long projectSubId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.deliverorder;
|
package com.chanko.yunxi.mes.module.heli.service.deliverorder;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
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.common.util.object.BeanUtils;
|
||||||
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
||||||
@ -28,6 +30,8 @@ import com.chanko.yunxi.mes.module.heli.enums.DeliverOrderStatusEnum;
|
|||||||
import com.chanko.yunxi.mes.module.heli.enums.ProjectOrderDeliverStatusEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.ProjectOrderDeliverStatusEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager;
|
import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.mysql.user.AdminUserMapper;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -76,6 +80,8 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MaterialMapper materialMapper;
|
private MaterialMapper materialMapper;
|
||||||
|
@Resource
|
||||||
|
private AdminUserMapper adminUserMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -98,7 +104,16 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
|||||||
|
|
||||||
// 插入子表
|
// 插入子表
|
||||||
if(createReqVO.getDeliverOrderSubs() != null && !createReqVO.getDeliverOrderSubs().isEmpty()){
|
if(createReqVO.getDeliverOrderSubs() != null && !createReqVO.getDeliverOrderSubs().isEmpty()){
|
||||||
|
for (DeliverOrderSubDO deliverOrderOtherSub : createReqVO.getDeliverOrderSubs()) {
|
||||||
|
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(deliverOrderOtherSub.getSaleOrderSubId());
|
||||||
|
if (ObjectUtil.isNotEmpty(projectOrderSubDO)){
|
||||||
|
if (ObjectUtil.isEmpty(projectOrderSubDO.getRemAmount())){
|
||||||
|
projectOrderSubDO.setRemAmount(0);
|
||||||
|
}
|
||||||
|
projectOrderSubDO.setRemAmount(projectOrderSubDO.getRemAmount()-deliverOrderOtherSub.getAmount());
|
||||||
|
projectOrderSubMapper.updateById(projectOrderSubDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
createDeliverOrderSubList(deliverOrder.getId(), createReqVO.getDeliverOrderSubs());
|
createDeliverOrderSubList(deliverOrder.getId(), createReqVO.getDeliverOrderSubs());
|
||||||
}
|
}
|
||||||
if(createReqVO.getDeliverOrderOtherSubs() != null && !createReqVO.getDeliverOrderOtherSubs().isEmpty()){
|
if(createReqVO.getDeliverOrderOtherSubs() != null && !createReqVO.getDeliverOrderOtherSubs().isEmpty()){
|
||||||
@ -196,11 +211,38 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
|||||||
public void deleteDeliverOrder(Long id) {
|
public void deleteDeliverOrder(Long id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateDeliverOrderExists(id);
|
validateDeliverOrderExists(id);
|
||||||
|
DeliverOrderDO deliverOrderDO = deliverOrderMapper.selectById(id);
|
||||||
|
|
||||||
|
if(deliverOrderDO.getDeliverStatus()== DeliverOrderStatusEnum.DELIVER.getCode()){
|
||||||
|
LambdaQueryWrapper<DeliverOrderSubDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(DeliverOrderSubDO::getDeliveryOrderId, id);
|
||||||
|
wrapper.ne(DeliverOrderSubDO::getCategory,"OTHER_LIST");
|
||||||
|
List<DeliverOrderSubDO> deliverOrderSubDOList = deliverOrderSubMapper.selectList(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(deliverOrderSubDOList)){
|
||||||
|
deliverOrderSubDOList.forEach(deliverOrderSubDO -> {
|
||||||
|
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(deliverOrderSubDO.getSaleOrderSubId());
|
||||||
|
if (ObjectUtil.isNotEmpty(projectOrderSubDO)){
|
||||||
|
if (ObjectUtil.isEmpty(projectOrderSubDO.getRemAmount())){
|
||||||
|
projectOrderSubDO.setRemAmount(0);
|
||||||
|
}
|
||||||
|
projectOrderSubDO.setRemAmount(projectOrderSubDO.getRemAmount()+deliverOrderSubDO.getAmount());
|
||||||
|
projectOrderSubMapper.updateById(projectOrderSubDO);
|
||||||
|
|
||||||
|
} });
|
||||||
|
deliverOrderMapper.deleteById(id);
|
||||||
|
|
||||||
|
// 删除子表
|
||||||
|
deleteDeliverOrderSubByDeliveryOrderId(id);
|
||||||
|
crossOrderManager.refreshProjectOrderDeliverStatusNew1(deliverOrderSubDOList);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
// 删除
|
// 删除
|
||||||
deliverOrderMapper.deleteById(id);
|
deliverOrderMapper.deleteById(id);
|
||||||
|
|
||||||
// 删除子表
|
// 删除子表
|
||||||
deleteDeliverOrderSubByDeliveryOrderId(id);
|
deleteDeliverOrderSubByDeliveryOrderId(id);
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@ -247,7 +289,14 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeliverOrderSubDO> getDeliverOrderSubListByDeliveryOrderId(Long deliveryOrderId) {
|
public List<DeliverOrderSubDO> getDeliverOrderSubListByDeliveryOrderId(Long deliveryOrderId) {
|
||||||
return deliverOrderSubMapper.selectListByDeliveryOrderId(deliveryOrderId);
|
List<DeliverOrderSubDO> deliverOrderSubDOS = deliverOrderSubMapper.selectListByDeliveryOrderId(deliveryOrderId);
|
||||||
|
deliverOrderSubDOS.forEach(deliverOrderSubDO -> {
|
||||||
|
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(deliverOrderSubDO.getSaleOrderSubId());
|
||||||
|
if (ObjectUtil.isNotEmpty(projectOrderSubDO)){
|
||||||
|
deliverOrderSubDO.setRemAmount(projectOrderSubDO.getRemAmount());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return deliverOrderSubDOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -277,6 +326,7 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
|||||||
DeliverOrderSubDO deliverOrderSubDO = deliverOrderSubMapper.searchNum(subId);
|
DeliverOrderSubDO deliverOrderSubDO = deliverOrderSubMapper.searchNum(subId);
|
||||||
//再获取订单中的生产数量
|
//再获取订单中的生产数量
|
||||||
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.searchNum(subId);
|
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.searchNum(subId);
|
||||||
|
|
||||||
//根据发货数量和生产数量进行对比(不相等时说明没有全部发货,不往下执行程序)
|
//根据发货数量和生产数量进行对比(不相等时说明没有全部发货,不往下执行程序)
|
||||||
// System.out.println("发货总数量"+deliverOrderSubDO.getAmount());
|
// System.out.println("发货总数量"+deliverOrderSubDO.getAmount());
|
||||||
// System.out.println("订单数量"+projectOrderSubDO.getAmount());
|
// System.out.println("订单数量"+projectOrderSubDO.getAmount());
|
||||||
@ -366,6 +416,51 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeliverOrderDO> getListYfDetails(Long id, Long projectSubId) {
|
||||||
|
LambdaQueryWrapper<DeliverOrderDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.like(DeliverOrderDO::getSaleOrderIds,id);
|
||||||
|
wrapper.eq(DeliverOrderDO::getDeliverStatus,2);
|
||||||
|
wrapper.orderByDesc(DeliverOrderDO::getDeliverDate);
|
||||||
|
List<DeliverOrderDO> deliverOrderDOS = deliverOrderMapper.selectList(wrapper);
|
||||||
|
LambdaQueryWrapper<ProjectOrderSubDO> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper1.eq(ProjectOrderSubDO::getProjectOrderId,id);
|
||||||
|
List<ProjectOrderSubDO> projectOrderSubDOS = projectOrderSubMapper.selectList(queryWrapper1);
|
||||||
|
if (deliverOrderDOS!=null&&deliverOrderDOS.size()>0&&projectOrderSubDOS!=null&&projectOrderSubDOS.size()>0){
|
||||||
|
List<Long> ids = projectOrderSubDOS.stream()
|
||||||
|
.map(ProjectOrderSubDO::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
for (DeliverOrderDO deliverOrderDO : deliverOrderDOS) {
|
||||||
|
LambdaQueryWrapper<DeliverOrderSubDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(DeliverOrderSubDO::getDeliveryOrderId,deliverOrderDO.getId());
|
||||||
|
queryWrapper.in(DeliverOrderSubDO::getSaleOrderSubId,ids);
|
||||||
|
List<DeliverOrderSubDO> deliverOrderSubDOS = deliverOrderSubMapper.selectList(queryWrapper);
|
||||||
|
BigDecimal totalAmount = deliverOrderSubDOS.stream()
|
||||||
|
.map(deliverOrderSubDO -> deliverOrderSubDO.getYunFei() != null ? deliverOrderSubDO.getYunFei() : BigDecimal.ZERO)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
deliverOrderDO.setYunFeiMoney(totalAmount);
|
||||||
|
int amounts = deliverOrderSubDOS.stream()
|
||||||
|
.mapToInt(deliverOrderSubDO ->
|
||||||
|
deliverOrderSubDO.getAmount() != null
|
||||||
|
? deliverOrderSubDO.getAmount()
|
||||||
|
: 0
|
||||||
|
)
|
||||||
|
.sum();
|
||||||
|
deliverOrderDO.setAmounts( amounts);
|
||||||
|
BigDecimal weight = deliverOrderSubDOS.stream()
|
||||||
|
.map(deliverOrderSubDO -> deliverOrderSubDO.getWeight() != null ? new BigDecimal(deliverOrderSubDO.getWeight()) : BigDecimal.ZERO)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
deliverOrderDO.setWeights(weight);
|
||||||
|
AdminUserDO adminUserDO = adminUserMapper.selectById(deliverOrderDO.getDeliverPerson());
|
||||||
|
if (ObjectUtil.isNotEmpty(adminUserDO)){
|
||||||
|
deliverOrderDO.setDeliverPersonName(adminUserDO.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return deliverOrderDOS;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void createDeliverOrderSubList(Long deliveryOrderId, List<DeliverOrderSubDO> list) {
|
private void createDeliverOrderSubList(Long deliveryOrderId, List<DeliverOrderSubDO> list) {
|
||||||
@ -379,7 +474,16 @@ public class DeliverOrderServiceImpl implements DeliverOrderService {
|
|||||||
deleteDeliverOrderSubByDeliveryOrderId(deliveryOrderId);
|
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)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
|
||||||
//计算分摊运费
|
//计算分摊运费
|
||||||
|
for (DeliverOrderSubDO deliverOrderOtherSub : list) {
|
||||||
|
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(deliverOrderOtherSub.getSaleOrderSubId());
|
||||||
|
if (ObjectUtil.isNotEmpty(projectOrderSubDO)){
|
||||||
|
if (ObjectUtil.isEmpty(projectOrderSubDO.getRemAmount())){
|
||||||
|
projectOrderSubDO.setRemAmount(0);
|
||||||
|
}
|
||||||
|
projectOrderSubDO.setRemAmount(projectOrderSubDO.getRemAmount()-deliverOrderOtherSub.getAmount());
|
||||||
|
projectOrderSubMapper.updateById(projectOrderSubDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
createDeliverOrderSubList(deliveryOrderId, list);
|
createDeliverOrderSubList(deliveryOrderId, list);
|
||||||
if(deliverOrderOtherSubs != null && !deliverOrderOtherSubs.isEmpty()){
|
if(deliverOrderOtherSubs != null && !deliverOrderOtherSubs.isEmpty()){
|
||||||
|
|||||||
@ -204,7 +204,8 @@ private TaskReportMapper taskReportMapper;
|
|||||||
pageReqVO.setPageNo(1);
|
pageReqVO.setPageNo(1);
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<PlanSubDO> list = planSubMapper.selectPage(pageReqVO).getList();
|
List<PlanSubDO> list = planSubMapper.selectPage(pageReqVO).getList();
|
||||||
|
ProjectOrderDO projectOrderDO = projectOrderMapper.selectById(projectId);
|
||||||
|
CustomerDO customer = customerService.getCustomer(projectOrderDO.getCustomerId());
|
||||||
for(ProjectOrderSubDO item : projectOrderSubDOs){
|
for(ProjectOrderSubDO item : projectOrderSubDOs){
|
||||||
if(!list.stream().anyMatch(a ->a.getProjectSubId().equals(item.getId()))) {
|
if(!list.stream().anyMatch(a ->a.getProjectSubId().equals(item.getId()))) {
|
||||||
PlanSubDO planSubDO = new PlanSubDO();
|
PlanSubDO planSubDO = new PlanSubDO();
|
||||||
@ -214,7 +215,8 @@ private TaskReportMapper taskReportMapper;
|
|||||||
if(!StringUtils.isEmpty(item.getDeviceModel())){
|
if(!StringUtils.isEmpty(item.getDeviceModel())){
|
||||||
planSubDO.setEquipId(Long.parseLong(item.getDeviceModel()));
|
planSubDO.setEquipId(Long.parseLong(item.getDeviceModel()));
|
||||||
}
|
}
|
||||||
|
planSubDO.setProjectSubCode(customer.getBrief()+'-'+projectOrderDO.getProjectNameSim()+'-'+item.getNameSim());
|
||||||
|
planSubDO.setProjectSubShortName(item.getNameSim());
|
||||||
planSubMapper.insert(planSubDO);
|
planSubMapper.insert(planSubDO);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -222,7 +224,8 @@ private TaskReportMapper taskReportMapper;
|
|||||||
if(!StringUtils.isEmpty(item.getDeviceModel())){
|
if(!StringUtils.isEmpty(item.getDeviceModel())){
|
||||||
planSubDO.setEquipId(Long.parseLong(item.getDeviceModel()));
|
planSubDO.setEquipId(Long.parseLong(item.getDeviceModel()));
|
||||||
}
|
}
|
||||||
|
planSubDO.setProjectSubCode(customer.getBrief()+'-'+projectOrderDO.getProjectNameSim()+'-'+item.getNameSim());
|
||||||
|
planSubDO.setProjectSubShortName(item.getNameSim());
|
||||||
planSubMapper.updateById(planSubDO);
|
planSubMapper.updateById(planSubDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,4 +111,6 @@ public interface ProcessBomService {
|
|||||||
BigDecimal outsourcedProcessingFee(Long id, Long projectSubId);
|
BigDecimal outsourcedProcessingFee(Long id, Long projectSubId);
|
||||||
|
|
||||||
BigDecimal internalLaborCost(Long id, Long projectSubId);
|
BigDecimal internalLaborCost(Long id, Long projectSubId);
|
||||||
|
|
||||||
|
BigDecimal assemblyLaborCost(Long id, Long projectSubId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1324,6 +1324,13 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
|||||||
if (ObjectUtil.isEmpty(cost)) cost=BigDecimal.ZERO;
|
if (ObjectUtil.isEmpty(cost)) cost=BigDecimal.ZERO;
|
||||||
return cost; }
|
return cost; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal assemblyLaborCost(Long id, Long projectSubId) {
|
||||||
|
BigDecimal cost=processBomMapper.assemblyLaborCost(id,projectSubId);
|
||||||
|
if (ObjectUtil.isEmpty(cost)) cost=BigDecimal.ZERO;
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void createProcessBomDetailList(String bomCode,Long bomId, List<ProcessBomDetailDO> list,Integer num) {
|
private void createProcessBomDetailList(String bomCode,Long bomId, List<ProcessBomDetailDO> list,Integer num) {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|||||||
@ -85,4 +85,8 @@ public interface ProcessDesignService {
|
|||||||
void send(ProcessDesignSaveReqVO createReqVO);
|
void send(ProcessDesignSaveReqVO createReqVO);
|
||||||
|
|
||||||
void reWork(ProcessDesignSaveReqVO createReqVO);
|
void reWork(ProcessDesignSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
PageResult<ProcessDesignDO> getProcessDesignPages(ProcessDesignPageReqVO pageReqVO);
|
||||||
|
PageResult<ProcessDesignDO> getExportExcel(ProcessDesignPageReqVO pageReqVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.Attentionto
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress.ProcessDesignProgressDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress.ProcessDesignProgressDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper;
|
||||||
@ -34,14 +35,12 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
@ -561,6 +560,105 @@ public class ProcessDesignServiceImpl implements ProcessDesignService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProcessDesignDO> getProcessDesignPages(ProcessDesignPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProcessDesignDO> processDesignDOPageResult = processDesignMapper.getProcessDesignPages(pageReqVO);
|
||||||
|
List<ProcessDesignDO> list = processDesignDOPageResult.getList();
|
||||||
|
for (ProcessDesignDO processDesignDO : list) {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<ProcessDesignProgressDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(ProcessDesignProgressDO::getProcessDesignId, processDesignDO.getId());
|
||||||
|
wrapper.orderByAsc(ProcessDesignProgressDO::getBeginTime);
|
||||||
|
List<ProcessDesignProgressDO> processDesignProgressDOS = processDesignProgressMapper.selectList(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(processDesignProgressDOS)){
|
||||||
|
BigDecimal workTime = processDesignProgressDOS.stream()
|
||||||
|
.filter(Objects::nonNull) // 过滤掉空对象
|
||||||
|
.map(ProcessDesignProgressDO::getWorkTime)
|
||||||
|
.filter(Objects::nonNull) // 过滤掉空值
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add); // 累加求和
|
||||||
|
processDesignDO.setWorkTime(workTime);
|
||||||
|
processDesignDO.setStartReportingTime(processDesignProgressDOS.get(0).getBeginTime());
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<ProcessDesignProgressDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ProcessDesignProgressDO::getProcessDesignId, processDesignDO.getId());
|
||||||
|
queryWrapper.orderByDesc(ProcessDesignProgressDO::getEndTime);
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
|
ProcessDesignProgressDO processDesignProgressDO = processDesignProgressMapper.selectOne(queryWrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(processDesignProgressDO)){
|
||||||
|
processDesignDO.setEndReportingTime(processDesignProgressDO.getEndTime());
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<ProcessDesignProgressDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ProcessDesignProgressDO::getProcessDesignId, processDesignDO.getId());
|
||||||
|
lambdaQueryWrapper.orderByDesc(ProcessDesignProgressDO::getCreateTime);
|
||||||
|
lambdaQueryWrapper.isNotNull(ProcessDesignProgressDO::getRemark);
|
||||||
|
lambdaQueryWrapper.ne(ProcessDesignProgressDO::getRemark,"");
|
||||||
|
lambdaQueryWrapper.last("limit 1");
|
||||||
|
ProcessDesignProgressDO progressDO = processDesignProgressMapper.selectOne(lambdaQueryWrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(progressDO)){
|
||||||
|
processDesignDO.setRemark(progressDO.getRemark());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return processDesignDOPageResult;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProcessDesignDO> getExportExcel(ProcessDesignPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProcessDesignDO> processDesignDOPageResult = processDesignMapper.getExportExcel(pageReqVO);
|
||||||
|
List<ProcessDesignDO> list = processDesignDOPageResult.getList();
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm");
|
||||||
|
for (ProcessDesignDO processDesignDO : list) {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<ProcessDesignProgressDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(ProcessDesignProgressDO::getProcessDesignId, processDesignDO.getId());
|
||||||
|
wrapper.orderByAsc(ProcessDesignProgressDO::getBeginTime);
|
||||||
|
List<ProcessDesignProgressDO> processDesignProgressDOS = processDesignProgressMapper.selectList(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(processDesignProgressDOS)){
|
||||||
|
BigDecimal workTime = processDesignProgressDOS.stream()
|
||||||
|
.filter(Objects::nonNull) // 过滤掉空对象
|
||||||
|
.map(ProcessDesignProgressDO::getWorkTime)
|
||||||
|
.filter(Objects::nonNull) // 过滤掉空值
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add); // 累加求和
|
||||||
|
processDesignDO.setWorkTimes(workTime+"H");
|
||||||
|
processDesignDO.setStartReportingTimes(format.format(processDesignProgressDOS.get(0).getBeginTime()));
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<ProcessDesignProgressDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ProcessDesignProgressDO::getProcessDesignId, processDesignDO.getId());
|
||||||
|
queryWrapper.orderByDesc(ProcessDesignProgressDO::getEndTime);
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
|
ProcessDesignProgressDO processDesignProgressDO = processDesignProgressMapper.selectOne(queryWrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(processDesignProgressDO)){
|
||||||
|
processDesignDO.setEndReportingTimes(format.format(processDesignProgressDO.getEndTime()));
|
||||||
|
}
|
||||||
|
if (processDesignDO.getIsOverProcess()==1) {
|
||||||
|
processDesignDO.setCompleted("完成");
|
||||||
|
}else {
|
||||||
|
processDesignDO.setCompleted("未完成");
|
||||||
|
}
|
||||||
|
if ("BLUEPRINT_WORKBLANK".equals(processDesignDO.getProcessDesignType())){
|
||||||
|
processDesignDO.setProcessDesignType("毛坯");
|
||||||
|
}else if ("BLUEPRINT_3D".equals(processDesignDO.getProcessDesignType())){
|
||||||
|
processDesignDO.setProcessDesignType("3D");
|
||||||
|
}else if ("BLUEPRINT_2D".equals(processDesignDO.getProcessDesignType())){
|
||||||
|
processDesignDO.setProcessDesignType("2D");
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<ProcessDesignProgressDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ProcessDesignProgressDO::getProcessDesignId, processDesignDO.getId());
|
||||||
|
lambdaQueryWrapper.orderByDesc(ProcessDesignProgressDO::getCreateTime);
|
||||||
|
lambdaQueryWrapper.isNotNull(ProcessDesignProgressDO::getRemark);
|
||||||
|
lambdaQueryWrapper.ne(ProcessDesignProgressDO::getRemark,"");
|
||||||
|
lambdaQueryWrapper.last("limit 1");
|
||||||
|
ProcessDesignProgressDO progressDO = processDesignProgressMapper.selectOne(lambdaQueryWrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(progressDO)){
|
||||||
|
processDesignDO.setRemark(progressDO.getRemark());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return processDesignDOPageResult;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void createProcessDesignProgressList(Long processDesignId, List<ProcessDesignProgressDO> list) {
|
private void createProcessDesignProgressList(Long processDesignId, List<ProcessDesignProgressDO> list) {
|
||||||
list.forEach(o -> o.setProcessDesignId(processDesignId));
|
list.forEach(o -> o.setProcessDesignId(processDesignId));
|
||||||
// 按创建时间排序
|
// 按创建时间排序
|
||||||
|
|||||||
@ -86,4 +86,6 @@ public interface ProjectOrderService {
|
|||||||
PageResult<ProjectOrderSubDO> getProjectOrderSubPage(ProjectOrderSubPageReqVO pageReqVO);
|
PageResult<ProjectOrderSubDO> getProjectOrderSubPage(ProjectOrderSubPageReqVO pageReqVO);
|
||||||
|
|
||||||
void showzbmoney(Long id);
|
void showzbmoney(Long id);
|
||||||
|
|
||||||
|
List<ProjectOrderSubDO> getProjectOrderSubListByProjectOrderIdGt(Long projectOrderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
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.common.util.object.BeanUtils;
|
||||||
import com.chanko.yunxi.mes.framework.common.util.object.ObjectUtils;
|
|
||||||
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
||||||
import com.chanko.yunxi.mes.framework.security.core.LoginUser;
|
|
||||||
import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderCostPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderCostPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO;
|
||||||
@ -17,7 +15,6 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.Project
|
|||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageLogPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageLogPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO;
|
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.deliverorder.DeliverOrderSubDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||||
@ -27,7 +24,6 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumber
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper;
|
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.deliverorder.DeliverOrderSubMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper;
|
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.dal.mysql.projectorder.ProjectOrderSubMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||||
@ -205,6 +201,60 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectOrderSubDO> getProjectOrderSubListByProjectOrderIdGt(Long projectOrderId) {
|
||||||
|
List<ProjectOrderSubDO> projectOrderSubDOList = projectOrderSubMapper.selectListByProjectOrderId1(projectOrderId);
|
||||||
|
if(!projectOrderSubDOList.isEmpty()){
|
||||||
|
// 查询最近归档历史并对比变化字段
|
||||||
|
try {
|
||||||
|
ProjectOrderDO lastSnapshot = projectOrderMapper.selectOne(new LambdaQueryWrapper<ProjectOrderDO>() {{
|
||||||
|
eq(ProjectOrderDO::getSnapshotId, projectOrderId);
|
||||||
|
orderByDesc(ProjectOrderDO::getId);
|
||||||
|
last("LIMIT 1");
|
||||||
|
}});
|
||||||
|
if(lastSnapshot != null){
|
||||||
|
List<ProjectOrderSubDO> lastSnapshotSubDOList = projectOrderSubMapper.selectList(ProjectOrderSubDO::getProjectOrderId, lastSnapshot.getId());
|
||||||
|
Map<String, List<ProjectOrderSubDO>> nameGroups = lastSnapshotSubDOList.stream().collect(Collectors.groupingBy(ProjectOrderSubDO::getName));
|
||||||
|
projectOrderSubDOList.forEach(projectOrderSubDO -> {
|
||||||
|
List<ProjectOrderSubDO> lastSnapshotSubs = nameGroups.get(projectOrderSubDO.getName());
|
||||||
|
if(lastSnapshotSubs == null || lastSnapshotSubs.isEmpty()){
|
||||||
|
// 如为新增行 则整行标记
|
||||||
|
projectOrderSubDO.setAlterFieldNames(new HashSet<String>(1){{add("NEW");}});
|
||||||
|
}else{
|
||||||
|
List<FieldInfo> diffFields = FIELD_EQUATOR.getDiffFields(projectOrderSubDO, lastSnapshotSubs.get(0));
|
||||||
|
projectOrderSubDO.setAlterFieldNames(diffFields.stream().map(FieldInfo::getFieldName).collect(Collectors.toSet()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("generate sub alterFieldNames error, id: {}, exception: {}", projectOrderId, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!projectOrderSubDOList.isEmpty()){
|
||||||
|
// 已发货数量
|
||||||
|
MPJLambdaWrapper<DeliverOrderSubDO> historyDeliveredSubQuery = new MPJLambdaWrapper<>();
|
||||||
|
historyDeliveredSubQuery.selectAll(DeliverOrderSubDO.class)
|
||||||
|
.leftJoin(DeliverOrderDO.class, DeliverOrderDO::getId, DeliverOrderSubDO::getDeliveryOrderId)
|
||||||
|
.eq(DeliverOrderDO::getDeliverStatus, DeliverOrderStatusEnum.DELIVER.getCode())
|
||||||
|
.in(DeliverOrderSubDO::getSaleOrderSubId, projectOrderSubDOList.stream().map(ProjectOrderSubDO::getId).collect(Collectors.toList()));
|
||||||
|
List<DeliverOrderSubDO> historyDeliveredSubList = deliverOrderSubMapper.selectList(historyDeliveredSubQuery);
|
||||||
|
Map<Long, List<DeliverOrderSubDO>> historyDeliveredSubsGroupBySaleSubId = historyDeliveredSubList.stream().collect(Collectors.groupingBy(DeliverOrderSubDO::getSaleOrderSubId));
|
||||||
|
projectOrderSubDOList.forEach(projectOrderSubDO -> {
|
||||||
|
int deliverAmount = 0;
|
||||||
|
List<DeliverOrderSubDO> deliverOrderSubDOList = historyDeliveredSubsGroupBySaleSubId.get(projectOrderSubDO.getId());
|
||||||
|
if(deliverOrderSubDOList != null && !deliverOrderSubDOList.isEmpty()){
|
||||||
|
deliverAmount = deliverOrderSubDOList.stream().mapToInt(DeliverOrderSubDO::getAmount).sum();
|
||||||
|
}
|
||||||
|
projectOrderSubDO.setDeliverAmount(deliverAmount);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return projectOrderSubDOList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateProjectOrderPrice(ProjectOrderSaveReqVO updateReqVO) {
|
public void updateProjectOrderPrice(ProjectOrderSaveReqVO updateReqVO) {
|
||||||
@ -586,7 +636,13 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
|||||||
// 分组更新与插入
|
// 分组更新与插入
|
||||||
List<ProjectOrderSubDO> updateList = list.stream().filter(o -> o.getId() != null).collect(Collectors.toList());
|
List<ProjectOrderSubDO> updateList = list.stream().filter(o -> o.getId() != null).collect(Collectors.toList());
|
||||||
List<ProjectOrderSubDO> insertList = list.stream().filter(o -> o.getId() == null).collect(Collectors.toList());
|
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());
|
||||||
|
if (ObjectUtil.isNotEmpty(subDO)){
|
||||||
|
projectOrderSubDO.setRemAmount(subDO.getRemAmount()+(projectOrderSubDO.getAmount()-subDO.getAmount()));
|
||||||
|
}
|
||||||
|
}
|
||||||
if(!updateList.isEmpty()) projectOrderSubMapper.updateBatch(updateList);
|
if(!updateList.isEmpty()) projectOrderSubMapper.updateBatch(updateList);
|
||||||
if(!insertList.isEmpty()) projectOrderSubMapper.insertBatch(insertList);
|
if(!insertList.isEmpty()) projectOrderSubMapper.insertBatch(insertList);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import javax.validation.*;
|
|||||||
|
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.storage.StorageController;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
@ -61,4 +62,8 @@ public interface PurchaseOrderNoDetailService {
|
|||||||
CommonResult<Boolean> receiveGoods(List<PurchaseOrderNoDetailDO> list);
|
CommonResult<Boolean> receiveGoods(List<PurchaseOrderNoDetailDO> list);
|
||||||
|
|
||||||
PageResult<PurchaseOrderNoDetailDO> received(PurchaseOrderNoDetailPageReqVO pageReqVO);
|
PageResult<PurchaseOrderNoDetailDO> received(PurchaseOrderNoDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
PageResult<PurchaseOrderNoDetailDO> getOutsourcingExpenses(PurchaseOrderNoDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
PageResult<PurchaseOrderNoDetailDO> exportOutsourcing(PurchaseOrderNoDetailPageReqVO pageReqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,9 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDeta
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein.StorageInDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelog.StorageLogDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper;
|
||||||
@ -26,6 +29,9 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMap
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorderno.PurchaseOrderNoMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorderno.PurchaseOrderNoMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storage.StorageMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storage.StorageMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagein.StorageInMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storageindetail.StorageInDetailMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.CodeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.CodeEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
||||||
@ -42,8 +48,10 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -58,8 +66,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.Purchase
|
|||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.STOCK_IN;
|
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.*;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.STOCK_OUT;
|
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,12 +105,18 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
@Resource
|
@Resource
|
||||||
private AttentiontodoService attentiontodoService;
|
private AttentiontodoService attentiontodoService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private StorageInMapper storageInMapper;
|
||||||
|
@Resource
|
||||||
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
|
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AdminUserService adminUserService;
|
private AdminUserService adminUserService;
|
||||||
@Resource
|
@Resource
|
||||||
private AttentiontodoMapper attentiontodoMapper;
|
private AttentiontodoMapper attentiontodoMapper;
|
||||||
|
@Resource
|
||||||
|
private StorageInDetailMapper storageInDetailMapper;
|
||||||
|
@Resource
|
||||||
|
private StorageLogMapper storageLogMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createPurchaseOrderNoDetail(PurchaseOrderNoDetailSaveReqVO createReqVO) {
|
public Long createPurchaseOrderNoDetail(PurchaseOrderNoDetailSaveReqVO createReqVO) {
|
||||||
@ -168,6 +181,7 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
if (byId.getPurchaseRemAmount().compareTo(purchaseOrderNoDetailDO.getPurchaseRemAmounts())<0) {
|
if (byId.getPurchaseRemAmount().compareTo(purchaseOrderNoDetailDO.getPurchaseRemAmounts())<0) {
|
||||||
throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"入库数量"+purchaseOrderNoDetailDO.getPurchaseRemAmounts()+"大于剩余数量"+byId.getPurchaseRemAmount()+"请确认!"));
|
throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"入库数量"+purchaseOrderNoDetailDO.getPurchaseRemAmounts()+"大于剩余数量"+byId.getPurchaseRemAmount()+"请确认!"));
|
||||||
}
|
}
|
||||||
|
if (BigDecimal.ZERO.compareTo(purchaseOrderNoDetailDO.getEstimatedPrice())>=0) throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"预估总价等于0,请确认!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -176,40 +190,57 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public CommonResult<Boolean> receiveGoods(List<PurchaseOrderNoDetailDO> list) {
|
public CommonResult<Boolean> receiveGoods(List<PurchaseOrderNoDetailDO> list) {
|
||||||
List<MaterialDO> materialDOList=new ArrayList<MaterialDO>();
|
// List<MaterialDO> materialDOList=new ArrayList<MaterialDO>();
|
||||||
//自动生成入库单
|
//自动生成入库单
|
||||||
StorageDO storageDO = new StorageDO();
|
// StorageDO storageDO = new StorageDO();
|
||||||
storageDO.setStockType(1);
|
// storageDO.setStockType(1);
|
||||||
// 月度流水号
|
// // 月度流水号
|
||||||
SerialNumberDO serialNumberDO = serialNumberService.getSerialNumber(CodeEnum.STOCK_IN.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
// SerialNumberDO serialNumberDO = serialNumberService.getSerialNumber(CodeEnum.STOCK_IN.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||||
serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1);
|
// serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1);
|
||||||
// 入库前缀
|
// // 入库前缀
|
||||||
storageDO.setStockNo(STOCK_IN.getCode(serialNumberDO.getSerialNumber().toString()));
|
// storageDO.setStockNo(STOCK_IN.getCode(serialNumberDO.getSerialNumber().toString()));
|
||||||
serialNumberService.updateSerialNumber(serialNumberDO);
|
// serialNumberService.updateSerialNumber(serialNumberDO);
|
||||||
storageDO.setStatus(2);
|
// storageDO.setStatus(2);
|
||||||
storageDO.setKeeper(getLoginUser().getId());
|
// storageDO.setKeeper(getLoginUser().getId());
|
||||||
storageDO.setKeeperTime(LocalDateTime.now());
|
// storageDO.setKeeperTime(LocalDateTime.now());
|
||||||
storageMapper.insert(storageDO);
|
// storageMapper.insert(storageDO);
|
||||||
//自动生成出库单
|
//自动生成出库单
|
||||||
StorageDO out = new StorageDO();
|
// StorageDO out = new StorageDO();
|
||||||
out.setStockType(2);
|
// out.setStockType(2);
|
||||||
// 月度流水号
|
// // 月度流水号
|
||||||
SerialNumberDO serialNumber = serialNumberService.getSerialNumber(CodeEnum.STOCK_OUT.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
// SerialNumberDO serialNumber = serialNumberService.getSerialNumber(CodeEnum.STOCK_OUT.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||||
serialNumber.setSerialNumber(serialNumber.getSerialNumber()+1);
|
// serialNumber.setSerialNumber(serialNumber.getSerialNumber()+1);
|
||||||
// 出库前缀
|
// // 出库前缀
|
||||||
out.setStockNo(STOCK_OUT.getCode(serialNumber.getSerialNumber().toString()));
|
// out.setStockNo(STOCK_OUT.getCode(serialNumber.getSerialNumber().toString()));
|
||||||
serialNumberService.updateSerialNumber(serialNumber);
|
// serialNumberService.updateSerialNumber(serialNumber);
|
||||||
out.setStatus(2);
|
// out.setStatus(2);
|
||||||
out.setOutbound(getLoginUser().getId());
|
// out.setOutbound(getLoginUser().getId());
|
||||||
out.setOutboundTime(LocalDateTime.now());
|
// out.setOutboundTime(LocalDateTime.now());
|
||||||
storageMapper.insert(out);
|
// storageMapper.insert(out);
|
||||||
//入库物料集合
|
// //入库物料集合
|
||||||
ArrayList<StorageMatDO> storageMatDOS = new ArrayList<>();
|
// ArrayList<StorageMatDO> storageMatDOS = new ArrayList<>();
|
||||||
//出库库物料集合
|
// //出库库物料集合
|
||||||
ArrayList<StorageMatDO> outList = new ArrayList<>();
|
// ArrayList<StorageMatDO> outList = new ArrayList<>();
|
||||||
|
ArrayList<StorageLogDO> logList = new ArrayList<>();
|
||||||
|
|
||||||
|
//生成入库单
|
||||||
|
StorageInDO storageInDO = new StorageInDO();
|
||||||
|
SerialNumberDO numberDO = new SerialNumberDO();
|
||||||
|
numberDO = serialNumberService.getSerialNumber(PURCHASE_ORDER.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||||
|
numberDO.setSerialNumber(numberDO.getSerialNumber()+1);
|
||||||
|
storageInDO.setStorageNo(STOCK_IN.getCode(numberDO.getSerialNumber().toString()));
|
||||||
|
storageInDO.setGoodsType(2);
|
||||||
|
storageInDO.setStatus(1);
|
||||||
|
storageInDO.setIsPrint("N");
|
||||||
|
storageInDO.setOrdDate(new Date());
|
||||||
|
storageInMapper.insert(storageInDO);
|
||||||
|
// 回写序列记录
|
||||||
|
serialNumberService.updateSerialNumber(numberDO);
|
||||||
|
|
||||||
for (PurchaseOrderNoDetailDO detailDO : list) {
|
for (PurchaseOrderNoDetailDO detailDO : list) {
|
||||||
PurchaseOrderNoDetailDO byId = purchaseOrderNoDetailMapper.selectById(detailDO.getId());
|
PurchaseOrderNoDetailDO byId = purchaseOrderNoDetailMapper.selectById(detailDO.getId());
|
||||||
if (ObjectUtil.isNotEmpty(byId)){
|
if (ObjectUtil.isNotEmpty(byId)){
|
||||||
|
byId.setEstimatedPrice(detailDO.getEstimatedPrice());
|
||||||
if (byId.getPurchaseRemAmount().compareTo(detailDO.getPurchaseRemAmounts())==0){
|
if (byId.getPurchaseRemAmount().compareTo(detailDO.getPurchaseRemAmounts())==0){
|
||||||
byId.setReceivingStatus(3);
|
byId.setReceivingStatus(3);
|
||||||
}else {
|
}else {
|
||||||
@ -217,17 +248,18 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
}
|
}
|
||||||
byId.setPurchaseRemAmount(byId.getPurchaseRemAmount().subtract(detailDO.getPurchaseRemAmounts()));
|
byId.setPurchaseRemAmount(byId.getPurchaseRemAmount().subtract(detailDO.getPurchaseRemAmounts()));
|
||||||
purchaseOrderNoDetailMapper.updateById(byId);
|
purchaseOrderNoDetailMapper.updateById(byId);
|
||||||
StorageMatDO storageMatDO = new StorageMatDO();
|
// StorageMatDO storageMatDO = new StorageMatDO();
|
||||||
StorageMatDO outMat = new StorageMatDO();
|
// StorageMatDO outMat = new StorageMatDO();
|
||||||
storageMatDO.setStockId(storageDO.getId());
|
// storageMatDO.setStockId(storageDO.getId());
|
||||||
storageMatDO.setStorageOkQty(detailDO.getPurchaseRemAmounts());
|
// storageMatDO.setStorageOkQty(detailDO.getPurchaseRemAmounts());
|
||||||
storageMatDO.setProjectNo(byId.getProjectPlanSubId().toString());
|
// storageMatDO.setProjectNo(byId.getProjectPlanSubId().toString());
|
||||||
storageMatDO.setProjectSubName(byId.getName());
|
// storageMatDO.setProjectSubName(byId.getName());
|
||||||
outMat.setStockId(out.getId());
|
// outMat.setStockId(out.getId());
|
||||||
outMat.setStorageOkQty(detailDO.getPurchaseRemAmounts());
|
// outMat.setStorageOkQty(detailDO.getPurchaseRemAmounts());
|
||||||
outMat.setProjectNo(byId.getProjectPlanSubId().toString());
|
// outMat.setProjectNo(byId.getProjectPlanSubId().toString());
|
||||||
outMat.setProjectSubName(byId.getName());
|
// outMat.setProjectSubName(byId.getName());
|
||||||
ProcessBomDetailDO bomDetailDO = processBomDetailMapper.selectById(detailDO.getBoomDetailId());
|
ProcessBomDetailDO bomDetailDO = processBomDetailMapper.selectById(detailDO.getBoomDetailId());
|
||||||
|
StorageLogDO logDO = new StorageLogDO();
|
||||||
if (ObjectUtil.isNotEmpty(bomDetailDO)){
|
if (ObjectUtil.isNotEmpty(bomDetailDO)){
|
||||||
String bomCode="";
|
String bomCode="";
|
||||||
String blueprintNo="";
|
String blueprintNo="";
|
||||||
@ -263,23 +295,84 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
if (ObjectUtil.isEmpty(material)){
|
if (ObjectUtil.isEmpty(material)){
|
||||||
// materialDOList.add(materialDO);
|
// materialDOList.add(materialDO);
|
||||||
materialMapper.insert(materialDO);
|
materialMapper.insert(materialDO);
|
||||||
storageMatDO.setMatId(materialDO.getId());
|
// storageMatDO.setMatId(materialDO.getId());
|
||||||
outMat.setMatId(materialDO.getId());
|
// outMat.setMatId(materialDO.getId());
|
||||||
|
logDO.setMatId(materialDO.getId());
|
||||||
}else {
|
}else {
|
||||||
storageMatDO.setMatId(material.getId());
|
// storageMatDO.setMatId(material.getId());
|
||||||
outMat.setMatId(material.getId());
|
// outMat.setMatId(material.getId());
|
||||||
|
logDO.setMatId(material.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storageMatDOS.add(storageMatDO);
|
// storageMatDOS.add(storageMatDO);
|
||||||
outList.add(outMat);
|
// outList.add(outMat);
|
||||||
|
|
||||||
|
StorageInDetailDO storageInDetailDO = new StorageInDetailDO();
|
||||||
|
storageInDetailDO.setStorageNoId(storageInDO.getId());
|
||||||
|
storageInDetailDO.setProjectSubCode(byId.getProjectSubCode());
|
||||||
|
storageInDetailDO.setBoomDetailId(byId.getBoomDetailId());
|
||||||
|
storageInDetailDO.setBoomName(byId.getBoomName());
|
||||||
|
storageInDetailDO.setBoomSpec(byId.getBoomSpec());
|
||||||
|
storageInDetailDO.setBoomUnit(byId.getBoomUnit());
|
||||||
|
storageInDetailDO.setComposition(byId.getComposition());
|
||||||
|
storageInDetailDO.setPurchaseAmount(byId.getPurchaseAmount());
|
||||||
|
BigDecimal result = BigDecimal.ZERO;
|
||||||
|
BigDecimal estimatedPrice = detailDO.getEstimatedPrice();
|
||||||
|
BigDecimal purchaseAmount = detailDO.getPurchaseAmount();
|
||||||
|
// 检查两个值是否为null或0
|
||||||
|
if (estimatedPrice != null &&
|
||||||
|
purchaseAmount != null &&
|
||||||
|
purchaseAmount.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
// 当两个值非空且除数非零时才进行计算
|
||||||
|
result = estimatedPrice.divide(purchaseAmount, 10, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
if (result.compareTo(BigDecimal.ZERO)==0){
|
||||||
|
storageInDetailDO.setEstimatedPrice(BigDecimal.ZERO);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
storageInDetailDO.setEstimatedPrice(detailDO.getPurchaseRemAmounts().multiply( result).setScale(1, RoundingMode.HALF_UP));
|
||||||
|
|
||||||
|
}
|
||||||
|
storageInDetailDO.setActualPrice(byId.getActualPrice());
|
||||||
|
storageInDetailDO.setBoomAmount(byId.getBoomAmount());
|
||||||
|
storageInDetailDO.setRequireTime(byId.getRequireTime());
|
||||||
|
storageInDetailDO.setProjectMaterialPlanId(byId.getProjectMaterialPlanId());
|
||||||
|
storageInDetailDO.setProjectMaterialPlanBoomId(byId.getProjectMaterialPlanBoomId());
|
||||||
|
storageInDetailDO.setProjectPlanSubId(byId.getProjectPlanSubId());
|
||||||
|
storageInDetailDO.setName(byId.getName());
|
||||||
|
storageInDetailDO.setNameSim(byId.getNameSim());
|
||||||
|
storageInDetailDO.setProjectId(byId.getProjectId());
|
||||||
|
storageInDetailDO.setProjectPlanId(byId.getProjectPlanId());
|
||||||
|
storageInDetailDO.setCustomerId(byId.getCustomerId());
|
||||||
|
storageInDetailDO.setBrief(byId.getBrief());
|
||||||
|
storageInDetailDO.setProjectName(byId.getProjectName());
|
||||||
|
storageInDetailDO.setProjectNameSim(byId.getProjectNameSim());
|
||||||
|
storageInDetailDO.setMaterialId(byId.getMaterialId());
|
||||||
|
storageInDetailDO.setStorageAmount(detailDO.getPurchaseRemAmounts());
|
||||||
|
PurchaseOrderNoDO purchaseOrderNoDO = purchaseOrderNoMapper.selectById(byId.getPurchaseOrderId());
|
||||||
|
if (ObjectUtil.isNotEmpty(purchaseOrderNoDO)){
|
||||||
|
storageInDetailDO.setSupplierId(purchaseOrderNoDO.getSupplierId());
|
||||||
|
}
|
||||||
|
storageInDetailDO.setPurchaseOrderNoId(byId.getPurchaseOrderId());
|
||||||
|
storageInDetailDO.setPurchaseOrderNoDetailId(byId.getId());
|
||||||
|
storageInDetailDO.setAcarrDate(byId.getBoomArriveDates());
|
||||||
|
storageInDetailMapper.insert(storageInDetailDO);
|
||||||
|
logDO.setStockId(storageInDetailDO.getId());
|
||||||
|
logDO.setStorageOkQty(detailDO.getPurchaseRemAmounts());
|
||||||
|
logDO.setStockMode(11);
|
||||||
|
logDO.setStockType(1);
|
||||||
|
logDO.setGoodsType(2);
|
||||||
|
logDO.setCodeNo(storageInDO.getStorageNo());
|
||||||
|
logList.add(logDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storageMatMapper.insertBatch(storageMatDOS);
|
storageLogMapper.insertBatch(logList);
|
||||||
storageMatMapper.insertBatch(outList);
|
// storageMatMapper.insertBatch(storageMatDOS);
|
||||||
storageService.updateMatLogList(storageDO.getId(),2);
|
// storageMatMapper.insertBatch(outList);
|
||||||
storageService.updateMatLogList(out.getId(),2);
|
// storageService.updateMatLogList(storageDO.getId(),2);
|
||||||
storageMapper.deleteById(storageDO);
|
// storageService.updateMatLogList(out.getId(),2);
|
||||||
storageMapper.deleteById(out);
|
// storageMapper.deleteById(storageDO);
|
||||||
|
// storageMapper.deleteById(out);
|
||||||
|
|
||||||
// materialMapper.insertBatch(materialDOList);
|
// materialMapper.insertBatch(materialDOList);
|
||||||
List<Long> idList = list.stream()
|
List<Long> idList = list.stream()
|
||||||
@ -380,5 +473,41 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
public PageResult<PurchaseOrderNoDetailDO> received(PurchaseOrderNoDetailPageReqVO pageReqVO) {
|
public PageResult<PurchaseOrderNoDetailDO> received(PurchaseOrderNoDetailPageReqVO pageReqVO) {
|
||||||
return purchaseOrderNoDetailMapper.received(pageReqVO);
|
return purchaseOrderNoDetailMapper.received(pageReqVO);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public PageResult<PurchaseOrderNoDetailDO> getOutsourcingExpenses(PurchaseOrderNoDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<PurchaseOrderNoDetailDO> outsourcingExpenses = purchaseOrderNoDetailMapper.getOutsourcingExpenses(pageReqVO);
|
||||||
|
List<PurchaseOrderNoDetailDO> list = outsourcingExpenses.getList();
|
||||||
|
list.forEach(purchaseOrderNoDetailDO -> {
|
||||||
|
BigDecimal bigDecimal = purchaseOrderNoDetailDO.getEstimatedPrice().divide(purchaseOrderNoDetailDO.getPurchaseAmount(),2, RoundingMode.HALF_UP);
|
||||||
|
purchaseOrderNoDetailDO.setUnitPrice(bigDecimal);
|
||||||
|
LambdaQueryWrapper<StorageInDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(StorageInDetailDO::getPurchaseOrderNoDetailId,purchaseOrderNoDetailDO.getId());
|
||||||
|
wrapper.orderByDesc(StorageInDetailDO::getCreateTime);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
StorageInDetailDO storageInDetailDO = storageInDetailMapper.selectOne(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(storageInDetailDO)){
|
||||||
|
purchaseOrderNoDetailDO.setAcarrDate(storageInDetailDO.getCreateTime());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return outsourcingExpenses;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public PageResult<PurchaseOrderNoDetailDO> exportOutsourcing(PurchaseOrderNoDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<PurchaseOrderNoDetailDO> outsourcingExpenses = purchaseOrderNoDetailMapper.exportOutsourcing(pageReqVO);
|
||||||
|
List<PurchaseOrderNoDetailDO> list = outsourcingExpenses.getList();
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
list.forEach(purchaseOrderNoDetailDO -> {
|
||||||
|
BigDecimal bigDecimal = purchaseOrderNoDetailDO.getEstimatedPrice().divide(purchaseOrderNoDetailDO.getPurchaseAmount(),2, RoundingMode.HALF_UP);
|
||||||
|
purchaseOrderNoDetailDO.setUnitPrice(bigDecimal);
|
||||||
|
LambdaQueryWrapper<StorageInDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(StorageInDetailDO::getPurchaseOrderNoDetailId,purchaseOrderNoDetailDO.getId());
|
||||||
|
wrapper.orderByDesc(StorageInDetailDO::getCreateTime);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
StorageInDetailDO storageInDetailDO = storageInDetailMapper.selectOne(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(storageInDetailDO)){
|
||||||
|
purchaseOrderNoDetailDO.setAcarrDates(storageInDetailDO.getCreateTime().format(formatter));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return outsourcingExpenses;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,7 @@ public interface StorageService {
|
|||||||
*/
|
*/
|
||||||
StorageDO getStorage(Long id);
|
StorageDO getStorage(Long id);
|
||||||
public void updateMatLogList(Long stockId,int status);
|
public void updateMatLogList(Long stockId,int status);
|
||||||
|
public void updateLogList(Long stockId,int status,Integer type,String stockNo);
|
||||||
/**
|
/**
|
||||||
* 获得入/出库分页
|
* 获得入/出库分页
|
||||||
*
|
*
|
||||||
|
|||||||
@ -32,6 +32,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.outsourcestockmaterial.Outsour
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storageinventory.StorageInventoryMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storageinventory.StorageInventoryMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogNowMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogNowMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||||
@ -107,6 +108,8 @@ public class StorageServiceImpl implements StorageService {
|
|||||||
private StorageInventoryMapper storageInventoryMapper;
|
private StorageInventoryMapper storageInventoryMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private AdminUserService adminUserService;
|
private AdminUserService adminUserService;
|
||||||
|
@Resource
|
||||||
|
private StorageLogMapper storageLogMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private StorageLogService storageLogService;
|
private StorageLogService storageLogService;
|
||||||
@ -461,7 +464,32 @@ private StorageLogService storageLogService;
|
|||||||
// 批量保存当前库存物料日志信息
|
// 批量保存当前库存物料日志信息
|
||||||
storageLogService.createStorageLogBatch(logList);
|
storageLogService.createStorageLogBatch(logList);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void updateLogList(Long stockId,int status,Integer type,String stockNo) {
|
||||||
|
// 获取当前库存下所有物料信息
|
||||||
|
List<StorageMatDO> matList = storageMatMapper.selectMatByStorckID(stockId);
|
||||||
|
// 将物料信息转化日志信息
|
||||||
|
List<StorageLogDO> logList = BeanUtils.toBean(matList,StorageLogDO.class);
|
||||||
|
// 同步库存单状态到日志,便于以后统计
|
||||||
|
|
||||||
|
for (StorageLogDO log : logList){
|
||||||
|
log.setId(null);
|
||||||
|
log.setStatus(status);
|
||||||
|
if (type==1){
|
||||||
|
log.setStockMode(13);
|
||||||
|
log.setStockType(1);
|
||||||
|
log.setGoodsType(1);
|
||||||
|
log.setCodeNo(stockNo);
|
||||||
|
}else {
|
||||||
|
log.setStockMode(25);
|
||||||
|
log.setStockType(2);
|
||||||
|
log.setGoodsType(1);
|
||||||
|
log.setCodeNo(stockNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 批量保存当前库存物料日志信息
|
||||||
|
storageLogService.createStorageLogBatch(logList);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public PageResult<StorageDO> getStoragePage(StoragePageReqVO pageReqVO) {
|
public PageResult<StorageDO> getStoragePage(StoragePageReqVO pageReqVO) {
|
||||||
return storageMapper.selectPage(pageReqVO);
|
return storageMapper.selectPage(pageReqVO);
|
||||||
@ -491,6 +519,7 @@ private StorageLogService storageLogService;
|
|||||||
storageDO.setStockInType(1);
|
storageDO.setStockInType(1);
|
||||||
storageDO.setKeeper(getLoginUser().getId());
|
storageDO.setKeeper(getLoginUser().getId());
|
||||||
storageDO.setKeeperTime(LocalDateTime.now());
|
storageDO.setKeeperTime(LocalDateTime.now());
|
||||||
|
storageDO.setStockMode(12);
|
||||||
storageMapper.insert(storageDO);
|
storageMapper.insert(storageDO);
|
||||||
|
|
||||||
|
|
||||||
@ -504,11 +533,12 @@ private StorageLogService storageLogService;
|
|||||||
storageMatDO.setWhId(createReqVO.getWhId());
|
storageMatDO.setWhId(createReqVO.getWhId());
|
||||||
storageMatDO.setRgId(createReqVO.getRgId());
|
storageMatDO.setRgId(createReqVO.getRgId());
|
||||||
storageMatDO.setPnId(createReqVO.getPnId());
|
storageMatDO.setPnId(createReqVO.getPnId());
|
||||||
storageMatMapper.insert(storageMatDO);
|
|
||||||
//入库日志
|
|
||||||
updateMatLogList(storageDO.getId(),2);
|
|
||||||
|
|
||||||
storageMapper.deleteById(storageDO);
|
|
||||||
|
|
||||||
|
//入库日志
|
||||||
|
// updateMatLogList(storageDO.getId(),2);
|
||||||
|
// storageMapper.deleteById(storageDO);
|
||||||
|
|
||||||
LambdaUpdateWrapper<PurchaseOrderNoDetailDO> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<PurchaseOrderNoDetailDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(PurchaseOrderNoDetailDO::getId,createReqVO.getId());
|
updateWrapper.eq(PurchaseOrderNoDetailDO::getId,createReqVO.getId());
|
||||||
@ -529,6 +559,7 @@ private StorageLogService storageLogService;
|
|||||||
if (ObjectUtil.isNotEmpty(purchaseOrderNoDetailDO)){
|
if (ObjectUtil.isNotEmpty(purchaseOrderNoDetailDO)){
|
||||||
purchasePrice= purchaseOrderNoDetailDO.getEstimatedPrice().divide(purchaseOrderNoDetailDO.getPurchaseAmount(), 2, RoundingMode.HALF_UP);
|
purchasePrice= purchaseOrderNoDetailDO.getEstimatedPrice().divide(purchaseOrderNoDetailDO.getPurchaseAmount(), 2, RoundingMode.HALF_UP);
|
||||||
}
|
}
|
||||||
|
storageMatDO.setPrice(purchasePrice);
|
||||||
if (ObjectUtil.isEmpty(storageInventoryDO)){
|
if (ObjectUtil.isEmpty(storageInventoryDO)){
|
||||||
storageInventoryDO = new StorageInventoryDO();
|
storageInventoryDO = new StorageInventoryDO();
|
||||||
storageInventoryDO.setMaterialId(createReqVO.getMaterialId());
|
storageInventoryDO.setMaterialId(createReqVO.getMaterialId());
|
||||||
@ -545,15 +576,30 @@ private StorageLogService storageLogService;
|
|||||||
storageInventoryDO.setBoomCode(materialDO.getCode());
|
storageInventoryDO.setBoomCode(materialDO.getCode());
|
||||||
}
|
}
|
||||||
storageInventoryDO.setPrice(purchasePrice);
|
storageInventoryDO.setPrice(purchasePrice);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
BigDecimal totalNumber = storageInventoryDO.getYardAmount().add(createReqVO.getStorageAmount());
|
BigDecimal totalNumber = storageInventoryDO.getYardAmount().add(createReqVO.getStorageAmount());
|
||||||
BigDecimal inventoryPrice = storageInventoryDO.getYardAmount().multiply(storageInventoryDO.getPrice());
|
BigDecimal inventoryPrice = storageInventoryDO.getYardAmount().multiply(storageInventoryDO.getPrice());
|
||||||
BigDecimal inPrice = createReqVO.getStorageAmount().multiply(purchasePrice);
|
BigDecimal inPrice = createReqVO.getStorageAmount().multiply(purchasePrice);
|
||||||
BigDecimal sumPrice = inventoryPrice.add(inPrice);
|
BigDecimal sumPrice = inventoryPrice.add(inPrice);
|
||||||
storageInventoryDO.setPrice(sumPrice.divide(totalNumber,2, RoundingMode.HALF_UP));
|
BigDecimal divide = sumPrice.divide(totalNumber, 2, RoundingMode.HALF_UP);
|
||||||
|
storageInventoryDO.setPrice(divide);
|
||||||
storageInventoryDO.setYardAmount(storageInventoryDO.getYardAmount().add(createReqVO.getStorageAmount()));
|
storageInventoryDO.setYardAmount(storageInventoryDO.getYardAmount().add(createReqVO.getStorageAmount()));
|
||||||
}
|
}
|
||||||
storageInventoryMapper.insertOrUpdate(storageInventoryDO);
|
storageInventoryMapper.insertOrUpdate(storageInventoryDO);
|
||||||
|
storageMatMapper.insert(storageMatDO);
|
||||||
|
StorageLogDO logDO = new StorageLogDO();
|
||||||
|
logDO.setStockId(storageMatDO.getId());
|
||||||
|
logDO.setMatId(createReqVO.getMaterialId());
|
||||||
|
logDO.setStorageOkQty(createReqVO.getStorageAmount());
|
||||||
|
logDO.setWhId(createReqVO.getWhId());
|
||||||
|
logDO.setRgId(createReqVO.getRgId());
|
||||||
|
logDO.setPnId(createReqVO.getPnId());
|
||||||
|
logDO.setStockMode(12);
|
||||||
|
logDO.setGoodsType(1);
|
||||||
|
logDO.setStockType(1);
|
||||||
|
logDO.setCodeNo(storageDO.getStockNo());
|
||||||
|
storageLogMapper.insert(logDO);
|
||||||
return CommonResult.success(true);
|
return CommonResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,11 +19,9 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
|||||||
import com.chanko.yunxi.mes.module.heli.enums.CodeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.CodeEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.storagecheckmat.StorageCheckMatService;
|
import com.chanko.yunxi.mes.module.heli.service.storagecheckmat.StorageCheckMatService;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.print.DocFlavor;
|
|
||||||
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -140,9 +138,12 @@ public class StorageCheckServiceImpl implements StorageCheckService {
|
|||||||
|
|
||||||
// long hasStockIn = storageCheckMats.stream().filter(item->item.getStorageOkQty().subtract(item.getMatRest()).intValue()>0).count();
|
// long hasStockIn = storageCheckMats.stream().filter(item->item.getStorageOkQty().subtract(item.getMatRest()).intValue()>0).count();
|
||||||
// long hasStockOut = storageCheckMats.stream().filter(item->item.getStorageOkQty().subtract(item.getMatRest()).intValue()<0).count();
|
// long hasStockOut = storageCheckMats.stream().filter(item->item.getStorageOkQty().subtract(item.getMatRest()).intValue()<0).count();
|
||||||
|
ArrayList<StorageLogDO> logList = new ArrayList<>();
|
||||||
//20250705新逻辑
|
//20250705新逻辑
|
||||||
for (StorageCheckMatDO storageMatDO : storageCheckMats) {
|
for (StorageCheckMatDO storageMatDO : storageCheckMats) {
|
||||||
BigDecimal dif = storageMatDO.getStorageOkQty().subtract(storageMatDO.getMatRest());
|
BigDecimal dif = storageMatDO.getStorageOkQty().subtract(storageMatDO.getMatRest());
|
||||||
|
// 插入库存日志表
|
||||||
|
StorageLogDO storageLogDO = new StorageLogDO();
|
||||||
if (dif.compareTo(BigDecimal.ZERO) > 0) {
|
if (dif.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
//大于0 入库,增加库额度
|
//大于0 入库,增加库额度
|
||||||
LambdaQueryWrapper<StorageInventoryDO> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<StorageInventoryDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
@ -182,7 +183,8 @@ public class StorageCheckServiceImpl implements StorageCheckService {
|
|||||||
}else{
|
}else{
|
||||||
storageInventoryMapper.insert(storageInventoryDO);
|
storageInventoryMapper.insert(storageInventoryDO);
|
||||||
}
|
}
|
||||||
|
storageLogDO.setStockMode(14);
|
||||||
|
storageLogDO.setStockType(1);
|
||||||
} else {
|
} else {
|
||||||
//不然就是出库
|
//不然就是出库
|
||||||
LambdaQueryWrapper<StorageInventoryDO> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<StorageInventoryDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
@ -200,20 +202,25 @@ public class StorageCheckServiceImpl implements StorageCheckService {
|
|||||||
storageInventoryDO.setPrice(bigDecimal);
|
storageInventoryDO.setPrice(bigDecimal);
|
||||||
}
|
}
|
||||||
storageInventoryMapper.updateById(storageInventoryDO);
|
storageInventoryMapper.updateById(storageInventoryDO);
|
||||||
|
storageLogDO.setStockMode(24);
|
||||||
|
storageLogDO.setStockType(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 插入库存日志表
|
|
||||||
StorageLogDO storageLogDO = new StorageLogDO();
|
|
||||||
storageLogDO.setStockId(storageMatDO.getCheckId());
|
storageLogDO.setStockId(storageMatDO.getCheckId());
|
||||||
storageLogDO.setMatId(storageMatDO.getMatId());
|
storageLogDO.setMatId(storageMatDO.getMatId());
|
||||||
storageLogDO.setWhId(storageMatDO.getWhId());
|
storageLogDO.setWhId(storageMatDO.getWhId());
|
||||||
storageLogDO.setRgId(storageMatDO.getRgId());
|
storageLogDO.setRgId(storageMatDO.getRgId());
|
||||||
storageLogDO.setPnId(storageMatDO.getPnId());
|
storageLogDO.setPnId(storageMatDO.getPnId());
|
||||||
storageLogDO.setStorageOkQty(storageMatDO.getStorageOkQty().subtract(storageMatDO.getMatRest()));
|
storageLogDO.setStorageOkQty(storageMatDO.getStorageOkQty().subtract(storageMatDO.getMatRest()));
|
||||||
storageLogDO.setLotNo(storageMatDO.getLotNo());
|
storageLogDO.setCodeNo(storageCheckDO.getStockNo());
|
||||||
|
storageLogDO.setStorageAft(storageMatDO.getStorageOkQty());
|
||||||
|
storageLogDO.setStorageBef(storageMatDO.getMatRest());
|
||||||
storageLogDO.setStatus(2);
|
storageLogDO.setStatus(2);
|
||||||
storageLogMapper.insert(storageLogDO);
|
storageLogDO.setGoodsType(1);
|
||||||
|
logList.add(storageLogDO);
|
||||||
}
|
}
|
||||||
|
storageLogMapper.insertBatch(logList);
|
||||||
//同步插入日志
|
//同步插入日志
|
||||||
// if(hasStockIn>0){
|
// if(hasStockIn>0){
|
||||||
// // 库存类型为入库
|
// // 库存类型为入库
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.Pur
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelog.StorageLogDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
||||||
@ -20,6 +21,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorderno.PurchaseOrderN
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storage.StorageMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storage.StorageMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storageindetail.StorageInDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storageindetail.StorageInDetailMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.CodeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.CodeEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
||||||
@ -88,6 +90,8 @@ public class StorageInServiceImpl implements StorageInService {
|
|||||||
@Resource
|
@Resource
|
||||||
private AttentiontodoService attentiontodoService;
|
private AttentiontodoService attentiontodoService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private StorageLogMapper storageLogMapper;
|
||||||
|
@Resource
|
||||||
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
|
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
|
||||||
@Override
|
@Override
|
||||||
public Long createStorageIn(StorageInSaveReqVO createReqVO) {
|
public Long createStorageIn(StorageInSaveReqVO createReqVO) {
|
||||||
@ -136,6 +140,33 @@ public class StorageInServiceImpl implements StorageInService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LambdaQueryWrapper<StorageInDetailDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(StorageInDetailDO::getStorageNoId,id);
|
||||||
|
List<StorageInDetailDO> storageInDetailDOList = storageInDetailMapper.selectList(queryWrapper);
|
||||||
|
StorageInDO storageInDO = storageInMapper.selectById(id);
|
||||||
|
List<Long> idList = storageInDetailDOList.stream()
|
||||||
|
.filter(Objects::nonNull) // 过滤空对象
|
||||||
|
.map(StorageInDetailDO::getId)
|
||||||
|
.filter(Objects::nonNull) // 过滤空ID
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (ObjectUtil.isNotEmpty(idList)){
|
||||||
|
LambdaQueryWrapper<StorageLogDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(StorageLogDO::getStockId,idList);
|
||||||
|
lambdaQueryWrapper.eq(StorageLogDO::getCodeNo,storageInDO.getStorageNo());
|
||||||
|
List<StorageLogDO> storageLogDOS = storageLogMapper.selectList(lambdaQueryWrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(storageLogDOS)){
|
||||||
|
storageLogDOS.forEach(storageLogDO -> {
|
||||||
|
storageLogDO.setId(null);
|
||||||
|
if (storageLogDO.getGoodsType()==1){
|
||||||
|
storageLogDO.setStockMode(20);
|
||||||
|
}else {
|
||||||
|
storageLogDO.setStockMode(21);
|
||||||
|
}
|
||||||
|
storageLogDO.setStockType(2);
|
||||||
|
});
|
||||||
|
storageLogMapper.insertBatch(storageLogDOS);
|
||||||
|
}
|
||||||
|
}
|
||||||
storageInDetailMapper.delete(new LambdaQueryWrapper<StorageInDetailDO>().eq(StorageInDetailDO::getStorageNoId,id));
|
storageInDetailMapper.delete(new LambdaQueryWrapper<StorageInDetailDO>().eq(StorageInDetailDO::getStorageNoId,id));
|
||||||
// 删除
|
// 删除
|
||||||
storageInMapper.deleteById(id);
|
storageInMapper.deleteById(id);
|
||||||
@ -228,9 +259,9 @@ public class StorageInServiceImpl implements StorageInService {
|
|||||||
StorageInDO storageInDO = new StorageInDO();
|
StorageInDO storageInDO = new StorageInDO();
|
||||||
|
|
||||||
//入库物料集合
|
//入库物料集合
|
||||||
ArrayList<StorageMatDO> storageMatDOS = new ArrayList<>();
|
// ArrayList<StorageMatDO> storageMatDOS = new ArrayList<>();
|
||||||
//出库库物料集合
|
//出库库物料集合
|
||||||
ArrayList<StorageMatDO> outList = new ArrayList<>();
|
// ArrayList<StorageMatDO> outList = new ArrayList<>();
|
||||||
// 月度流水号
|
// 月度流水号
|
||||||
SerialNumberDO serialNumberDO = new SerialNumberDO();
|
SerialNumberDO serialNumberDO = new SerialNumberDO();
|
||||||
serialNumberDO = serialNumberService.getSerialNumber(PURCHASE_ORDER.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
serialNumberDO = serialNumberService.getSerialNumber(PURCHASE_ORDER.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||||
@ -244,49 +275,50 @@ public class StorageInServiceImpl implements StorageInService {
|
|||||||
// 回写序列记录
|
// 回写序列记录
|
||||||
serialNumberService.updateSerialNumber(serialNumberDO);
|
serialNumberService.updateSerialNumber(serialNumberDO);
|
||||||
//自动生成入库单
|
//自动生成入库单
|
||||||
StorageDO storageDO = new StorageDO();
|
// StorageDO storageDO = new StorageDO();
|
||||||
storageDO.setStockType(1);
|
// storageDO.setStockType(1);
|
||||||
// 月度流水号
|
// // 月度流水号
|
||||||
SerialNumberDO serialNumberDO1 = serialNumberService.getSerialNumber(CodeEnum.STOCK_IN.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
// SerialNumberDO serialNumberDO1 = serialNumberService.getSerialNumber(CodeEnum.STOCK_IN.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||||
serialNumberDO1.setSerialNumber(serialNumberDO1.getSerialNumber()+1);
|
// serialNumberDO1.setSerialNumber(serialNumberDO1.getSerialNumber()+1);
|
||||||
// 入库前缀
|
// // 入库前缀
|
||||||
storageDO.setStockNo(STOCK_IN.getCode(serialNumberDO1.getSerialNumber().toString()));
|
// storageDO.setStockNo(STOCK_IN.getCode(serialNumberDO1.getSerialNumber().toString()));
|
||||||
serialNumberService.updateSerialNumber(serialNumberDO1);
|
// serialNumberService.updateSerialNumber(serialNumberDO1);
|
||||||
storageDO.setStatus(2);
|
// storageDO.setStatus(2);
|
||||||
storageDO.setKeeper(getLoginUser().getId());
|
// storageDO.setKeeper(getLoginUser().getId());
|
||||||
storageDO.setKeeperTime(LocalDateTime.now());
|
// storageDO.setKeeperTime(LocalDateTime.now());
|
||||||
storageMapper.insert(storageDO);
|
// storageMapper.insert(storageDO);
|
||||||
// 自动生成出库单
|
// 自动生成出库单
|
||||||
StorageDO out = new StorageDO();
|
// StorageDO out = new StorageDO();
|
||||||
out.setStockType(2);
|
// out.setStockType(2);
|
||||||
// 月度流水号
|
// // 月度流水号
|
||||||
SerialNumberDO serialNumber = serialNumberService.getSerialNumber(CodeEnum.STOCK_OUT.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
// SerialNumberDO serialNumber = serialNumberService.getSerialNumber(CodeEnum.STOCK_OUT.name(), new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||||
serialNumber.setSerialNumber(serialNumber.getSerialNumber()+1);
|
// serialNumber.setSerialNumber(serialNumber.getSerialNumber()+1);
|
||||||
// 出库前缀
|
// // 出库前缀
|
||||||
out.setStockNo(STOCK_OUT.getCode(serialNumber.getSerialNumber().toString()));
|
// out.setStockNo(STOCK_OUT.getCode(serialNumber.getSerialNumber().toString()));
|
||||||
serialNumberService.updateSerialNumber(serialNumber);
|
// serialNumberService.updateSerialNumber(serialNumber);
|
||||||
out.setStatus(2);
|
// out.setStatus(2);
|
||||||
out.setOutbound(getLoginUser().getId());
|
// out.setOutbound(getLoginUser().getId());
|
||||||
out.setOutboundTime(LocalDateTime.now());
|
// out.setOutboundTime(LocalDateTime.now());
|
||||||
storageMapper.insert(out);
|
// storageMapper.insert(out);
|
||||||
List<StorageInDetailDO> storageInDetailDOList = new ArrayList<>();
|
// List<StorageInDetailDO> storageInDetailDOList = new ArrayList<>();
|
||||||
|
List<StorageLogDO> storageLogDOList = new ArrayList<>();
|
||||||
for (PurchaseOrderNoDetailDO orderNoDetailDO : list) {
|
for (PurchaseOrderNoDetailDO orderNoDetailDO : list) {
|
||||||
//入库明细
|
//入库明细
|
||||||
StorageMatDO storageMatDO = new StorageMatDO();
|
// StorageMatDO storageMatDO = new StorageMatDO();
|
||||||
storageMatDO.setStockId(storageDO.getId());
|
// storageMatDO.setStockId(storageDO.getId());
|
||||||
storageMatDO.setStorageOkQty(orderNoDetailDO.getPurchaseRemAmounts());
|
// storageMatDO.setStorageOkQty(orderNoDetailDO.getPurchaseRemAmounts());
|
||||||
storageMatDO.setProjectNo(ObjectUtil.isEmpty(orderNoDetailDO.getProjectPlanSubId())?null:orderNoDetailDO.getProjectPlanSubId().toString());
|
// storageMatDO.setProjectNo(ObjectUtil.isEmpty(orderNoDetailDO.getProjectPlanSubId())?null:orderNoDetailDO.getProjectPlanSubId().toString());
|
||||||
storageMatDO.setProjectSubName(orderNoDetailDO.getName());
|
// storageMatDO.setProjectSubName(orderNoDetailDO.getName());
|
||||||
storageMatDO.setMatId(orderNoDetailDO.getMaterialId());
|
// storageMatDO.setMatId(orderNoDetailDO.getMaterialId());
|
||||||
storageMatDOS.add(storageMatDO);
|
// storageMatDOS.add(storageMatDO);
|
||||||
// 出库明细
|
// 出库明细
|
||||||
StorageMatDO outMat = new StorageMatDO();
|
// StorageMatDO outMat = new StorageMatDO();
|
||||||
outMat.setStockId(out.getId());
|
// outMat.setStockId(out.getId());
|
||||||
outMat.setStorageOkQty(orderNoDetailDO.getPurchaseRemAmounts());
|
// outMat.setStorageOkQty(orderNoDetailDO.getPurchaseRemAmounts());
|
||||||
outMat.setProjectNo(ObjectUtil.isEmpty(orderNoDetailDO.getProjectPlanSubId())?null:orderNoDetailDO.getProjectPlanSubId().toString());
|
// outMat.setProjectNo(ObjectUtil.isEmpty(orderNoDetailDO.getProjectPlanSubId())?null:orderNoDetailDO.getProjectPlanSubId().toString());
|
||||||
outMat.setProjectSubName(orderNoDetailDO.getName());
|
// outMat.setProjectSubName(orderNoDetailDO.getName());
|
||||||
outMat.setMatId(orderNoDetailDO.getMaterialId());
|
// outMat.setMatId(orderNoDetailDO.getMaterialId());
|
||||||
outList.add(outMat);
|
// outList.add(outMat);
|
||||||
|
|
||||||
|
|
||||||
StorageInDetailDO storageInDetailDO = new StorageInDetailDO();
|
StorageInDetailDO storageInDetailDO = new StorageInDetailDO();
|
||||||
@ -306,7 +338,7 @@ public class StorageInServiceImpl implements StorageInService {
|
|||||||
purchaseAmount != null &&
|
purchaseAmount != null &&
|
||||||
purchaseAmount.compareTo(BigDecimal.ZERO) != 0) {
|
purchaseAmount.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
// 当两个值非空且除数非零时才进行计算
|
// 当两个值非空且除数非零时才进行计算
|
||||||
result = estimatedPrice.divide(purchaseAmount, 1, RoundingMode.HALF_UP);
|
result = estimatedPrice.divide(purchaseAmount, 10, RoundingMode.HALF_UP);
|
||||||
}
|
}
|
||||||
if (result.compareTo(BigDecimal.ZERO)==0){
|
if (result.compareTo(BigDecimal.ZERO)==0){
|
||||||
storageInDetailDO.setEstimatedPrice(BigDecimal.ZERO);
|
storageInDetailDO.setEstimatedPrice(BigDecimal.ZERO);
|
||||||
@ -345,15 +377,28 @@ public class StorageInServiceImpl implements StorageInService {
|
|||||||
}
|
}
|
||||||
orderNoDetailDO.setPurchaseRemAmount(orderNoDetailDO.getPurchaseRemAmount().subtract(orderNoDetailDO.getPurchaseRemAmounts()));
|
orderNoDetailDO.setPurchaseRemAmount(orderNoDetailDO.getPurchaseRemAmount().subtract(orderNoDetailDO.getPurchaseRemAmounts()));
|
||||||
purchaseOrderNoDetailMapper.updateById(orderNoDetailDO);
|
purchaseOrderNoDetailMapper.updateById(orderNoDetailDO);
|
||||||
storageInDetailDOList.add(storageInDetailDO);
|
storageInDetailMapper.insert(storageInDetailDO);
|
||||||
|
StorageLogDO logDO = new StorageLogDO();
|
||||||
|
logDO.setStockId(storageInDetailDO.getId());
|
||||||
|
logDO.setStorageOkQty(orderNoDetailDO.getPurchaseRemAmounts());
|
||||||
|
logDO.setMatId(orderNoDetailDO.getMaterialId());
|
||||||
|
logDO.setStockMode(10);
|
||||||
|
logDO.setStockType(1);
|
||||||
|
logDO.setGoodsType(1);
|
||||||
|
logDO.setCodeNo(storageInDO.getStorageNo());
|
||||||
|
storageLogDOList.add(logDO);
|
||||||
|
// storageMatDOS.add(storageMatDO);
|
||||||
|
// storageInDetailDOList.add(storageInDetailDO);
|
||||||
}
|
}
|
||||||
storageInDetailMapper.insertBatch(storageInDetailDOList);
|
storageLogMapper.insertBatch(storageLogDOList);
|
||||||
storageMatMapper.insertBatch(storageMatDOS);
|
// storageInDetailMapper.insertBatch(storageInDetailDOList);
|
||||||
storageMatMapper.insertBatch(outList);
|
// storageMatMapper.insertBatch(storageMatDOS);
|
||||||
storageService.updateMatLogList(storageDO.getId(),2);
|
// storageMatMapper.insertBatch(outList);
|
||||||
storageService.updateMatLogList(out.getId(),2);
|
// storageService.updateMatLogList(storageDO.getId(),2);
|
||||||
storageMapper.deleteById(storageDO);
|
// storageService.updateMatLogList(out.getId(),2);
|
||||||
storageMapper.deleteById(out);
|
// storageMapper.deleteById(storageDO);
|
||||||
|
// storageMapper.deleteById(out);
|
||||||
|
|
||||||
List<Long> ids = purchaseOrderNoDetailDOS.stream()
|
List<Long> ids = purchaseOrderNoDetailDOS.stream()
|
||||||
.filter(Objects::nonNull) // 过滤空对象
|
.filter(Objects::nonNull) // 过滤空对象
|
||||||
.map(PurchaseOrderNoDetailDO::getPurchaseOrderId)
|
.map(PurchaseOrderNoDetailDO::getPurchaseOrderId)
|
||||||
@ -362,7 +407,7 @@ public class StorageInServiceImpl implements StorageInService {
|
|||||||
LambdaQueryWrapper<PurchaseOrderNoDO> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PurchaseOrderNoDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(PurchaseOrderNoDO::getId,ids);
|
queryWrapper.in(PurchaseOrderNoDO::getId,ids);
|
||||||
|
|
||||||
List<PurchaseOrderNoDO> purchaseOrderNoDOS = purchaseOrderNoMapper.selectList(queryWrapper);
|
// List<PurchaseOrderNoDO> purchaseOrderNoDOS = purchaseOrderNoMapper.selectList(queryWrapper);
|
||||||
// for (PurchaseOrderNoDO purchaseOrderNoDO : purchaseOrderNoDOS) {
|
// for (PurchaseOrderNoDO purchaseOrderNoDO : purchaseOrderNoDOS) {
|
||||||
// LambdaQueryWrapper<PurchaseOrderNoDetailDO> wrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<PurchaseOrderNoDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
// wrapper.eq(PurchaseOrderNoDetailDO::getPurchaseOrderId,purchaseOrderNoDO.getId());
|
// wrapper.eq(PurchaseOrderNoDetailDO::getPurchaseOrderId,purchaseOrderNoDO.getId());
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public interface StorageLogService {
|
|||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 入/出库日志分页
|
* @return 入/出库日志分页
|
||||||
*/
|
*/
|
||||||
PageResult<StorageLogAllDO> getStorageLogPage(StorageLogPageReqVO pageReqVO);
|
PageResult<StorageLogDO> getStorageLogPage(StorageLogPageReqVO pageReqVO);
|
||||||
|
|
||||||
PageResult<StorageLogNowDO> getStorageNowPage(StorageLogPageReqVO pageReqVO);
|
PageResult<StorageLogNowDO> getStorageNowPage(StorageLogPageReqVO pageReqVO);
|
||||||
// List<StorageLogNowDO> getStorageNowPagesmall(StorageLogPageReqVO pageReqVO);
|
// List<StorageLogNowDO> getStorageNowPagesmall(StorageLogPageReqVO pageReqVO);
|
||||||
|
|||||||
@ -99,8 +99,9 @@ public class StorageLogServiceImpl implements StorageLogService {
|
|||||||
return storageLogMapper.delete(StorageLogDO::getStockId,stockId);
|
return storageLogMapper.delete(StorageLogDO::getStockId,stockId);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public PageResult<StorageLogAllDO> getStorageLogPage(StorageLogPageReqVO pageReqVO) {
|
public PageResult<StorageLogDO> getStorageLogPage(StorageLogPageReqVO pageReqVO) {
|
||||||
return storageLogAllMapper.selectPage(pageReqVO);
|
// return storageLogAllMapper.selectPage(pageReqVO);
|
||||||
|
return storageLogMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatch
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetailowner.TaskDispatchDetailOwnerDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetailowner.TaskDispatchDetailOwnerDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -99,4 +100,8 @@ public interface TaskDispatchService {
|
|||||||
List<TaskDispatchDO> getListJg(Long id, Long projectSubId);
|
List<TaskDispatchDO> getListJg(Long id, Long projectSubId);
|
||||||
|
|
||||||
List<TaskDispatchDetailDO> getTaskDispatchDetailListByDispatchIdAssembly(Long dispatchId);
|
List<TaskDispatchDetailDO> getTaskDispatchDetailListByDispatchIdAssembly(Long dispatchId);
|
||||||
|
|
||||||
|
List<AdminUserDO> getOwnerUserList(Long id, Long type);
|
||||||
|
|
||||||
|
List<TaskDispatchDO> getListZp(Long id, Long projectSubId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthing
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuserdetail.FpUserDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuserdetail.FpUserDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||||
@ -30,6 +31,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMappe
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.equipmanufacture.EquipManufactureMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.equipmanufacture.EquipManufactureMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.fpuserdetail.FpUserDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.fpuserdetail.FpUserDetailMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.plansub.PlanSubMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.procedure.ProcedureMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.procedure.ProcedureMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper;
|
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.processbom.ProcessBomMapper;
|
||||||
@ -41,6 +43,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport.TaskReportMapper;
|
|||||||
import com.chanko.yunxi.mes.module.heli.enums.*;
|
import com.chanko.yunxi.mes.module.heli.enums.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager;
|
import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.pgmaster.PgMasterService;
|
import com.chanko.yunxi.mes.module.heli.service.pgmaster.PgMasterService;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.service.plansub.PlanSubService;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.zjpgmaster.ZjPgMasterService;
|
import com.chanko.yunxi.mes.module.heli.service.zjpgmaster.ZjPgMasterService;
|
||||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
@ -110,6 +113,8 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
private ProcessBomDetailMapper processBomDetailMapper;
|
private ProcessBomDetailMapper processBomDetailMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private ProcessBomMapper processBomMapper;
|
private ProcessBomMapper processBomMapper;
|
||||||
|
@Resource
|
||||||
|
private PlanSubMapper planSubMapper;
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Long createTaskDispatch(TaskDispatchSaveReqVO createReqVO) {
|
public Long createTaskDispatch(TaskDispatchSaveReqVO createReqVO) {
|
||||||
@ -705,9 +710,9 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
// if (!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
// if (!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
||||||
// throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
// throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
||||||
// }
|
// }
|
||||||
if ( taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
// if ( taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
||||||
throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
// throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
lastReportDO = new TaskReportDO();
|
lastReportDO = new TaskReportDO();
|
||||||
}else{
|
}else{
|
||||||
@ -730,9 +735,9 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
// if(!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
// if(!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
||||||
// throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
// throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
||||||
// }
|
// }
|
||||||
if ( taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
// if ( taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
||||||
throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
// throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
||||||
}
|
// }
|
||||||
if( taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
if( taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
||||||
throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
||||||
}
|
}
|
||||||
@ -861,9 +866,9 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(productionList)){
|
if (CollUtil.isNotEmpty(productionList)){
|
||||||
if (CollUtil.isNotEmpty(dispatchDetailDOHashMap)){
|
// if (CollUtil.isNotEmpty(dispatchDetailDOHashMap)){
|
||||||
productionList = productionList.stream().filter((e -> !dispatchDetailDOHashMap.keySet().contains(e.getId()))).collect(Collectors.toList());
|
// productionList = productionList.stream().filter((e -> !dispatchDetailDOHashMap.keySet().contains(e.getId()))).collect(Collectors.toList());
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (TaskDispatchDetailDO dispatchDetailDO : productionList) {
|
for (TaskDispatchDetailDO dispatchDetailDO : productionList) {
|
||||||
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) && dispatchDetailDO.getProcedureStatus() !=TaskDispatchProcedureStatusEnum.COMPLETED.getCode()){
|
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) && dispatchDetailDO.getProcedureStatus() !=TaskDispatchProcedureStatusEnum.COMPLETED.getCode()){
|
||||||
@ -1052,6 +1057,70 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
|
|
||||||
return result; }
|
return result; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AdminUserDO> getOwnerUserList(Long id, Long type) {
|
||||||
|
List<FpUserDetailDO> fpUserDetailDOS = fpUserDetailMapper.selectOwnerList(id, type);
|
||||||
|
List<AdminUserDO> fpUserMapList = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(fpUserDetailDOS)) {
|
||||||
|
//按人员
|
||||||
|
Map<Long, List<FpUserDetailDO>> collect = fpUserDetailDOS.stream().collect(Collectors.groupingBy(vo -> vo.getBusyId() == null ? 0 : vo.getBusyId()));
|
||||||
|
collect.forEach((userId, list) -> {
|
||||||
|
if (userId.intValue() != 0) {
|
||||||
|
AdminUserDO adminUserDO = adminUserMapper.selectById(userId);
|
||||||
|
if (ObjectUtil.isNotEmpty(adminUserDO)){
|
||||||
|
fpUserMapList.add(adminUserDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return fpUserMapList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TaskDispatchDO> getListZp(Long id, Long projectSubId) {
|
||||||
|
LambdaQueryWrapper<TaskDispatchDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(TaskDispatchDO::getProjectId, id);
|
||||||
|
List<TaskDispatchDO> taskDispatchDOS = taskDispatchMapper.selectList(queryWrapper);
|
||||||
|
for (TaskDispatchDO taskDispatchDO : taskDispatchDOS) {
|
||||||
|
LambdaQueryWrapper<TaskDispatchDetailDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDO.getId());
|
||||||
|
List<TaskDispatchDetailDO> detailDOS = taskDispatchDetailMapper.selectList(wrapper);
|
||||||
|
Map<String, BigDecimal> map = new HashMap<>();
|
||||||
|
ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.selectById(taskDispatchDO.getProjectSubId());
|
||||||
|
|
||||||
|
BigDecimal assemblyLaborCost = BigDecimal.ONE;
|
||||||
|
for (TaskDispatchDetailDO detailDO : detailDOS) {
|
||||||
|
ProcedureDO procedureDO = procedureMapper.selectById(detailDO.getProcedureId());
|
||||||
|
BigDecimal cost=taskDispatchDetailMapper.assemblyLaborCost(detailDO.getId());
|
||||||
|
if (ObjectUtil.isEmpty(cost)) cost=BigDecimal.ZERO;
|
||||||
|
if (ObjectUtil.isNotEmpty(procedureDO)){
|
||||||
|
if (map.containsKey(procedureDO.getName())){
|
||||||
|
map.put(procedureDO.getName(),map.get(procedureDO.getName()).add(cost));
|
||||||
|
}else {
|
||||||
|
map.put(procedureDO.getName(),cost);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemblyLaborCost.add(cost);
|
||||||
|
}
|
||||||
|
taskDispatchDO.setAssemblyLaborSum(assemblyLaborCost);
|
||||||
|
taskDispatchDO.setMap( map);
|
||||||
|
if (ObjectUtil.isNotEmpty(projectOrderSubDO)){
|
||||||
|
taskDispatchDO.setAssemblyLaborCost(assemblyLaborCost.divide(new BigDecimal(projectOrderSubDO.getAmount()),1,RoundingMode.HALF_UP));
|
||||||
|
taskDispatchDO.setProjectSubName(projectOrderSubDO.getName());
|
||||||
|
taskDispatchDO.setQuantity(projectOrderSubDO.getAmount());
|
||||||
|
LambdaQueryWrapper<PlanSubDO> planSubDOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
planSubDOLambdaQueryWrapper.eq(PlanSubDO::getProjectPlanId,taskDispatchDO.getPlanId())
|
||||||
|
.eq(PlanSubDO::getProjectSubId,projectOrderSubDO.getId());
|
||||||
|
PlanSubDO planSubDO = planSubMapper.selectOne(planSubDOLambdaQueryWrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(planSubDO)){
|
||||||
|
taskDispatchDO.setProjectSubCode(planSubDO.getProjectSubCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private void updateAssembleDetail(OperateTypeEnum operateTypeEnum,Long dispatchId, List<TaskDispatchDetailOwnerDO> list) {
|
private void updateAssembleDetail(OperateTypeEnum operateTypeEnum,Long dispatchId, List<TaskDispatchDetailOwnerDO> list) {
|
||||||
list.forEach(o -> o.setDispatchId(dispatchId));
|
list.forEach(o -> o.setDispatchId(dispatchId));
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.taskreport;
|
package com.chanko.yunxi.mes.module.heli.service.taskreport;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务报工 Service 接口
|
* 任务报工 Service 接口
|
||||||
@ -26,15 +26,17 @@ public interface TaskReportService {
|
|||||||
* 更新任务报工
|
* 更新任务报工
|
||||||
*
|
*
|
||||||
* @param updateReqVO 更新信息
|
* @param updateReqVO 更新信息
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
void updateTaskReport(@Valid TaskReportSaveReqVO updateReqVO);
|
CommonResult<Boolean> updateTaskReport(@Valid TaskReportSaveReqVO updateReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除任务报工
|
* 删除任务报工
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteTaskReport(Long id);
|
CommonResult<Boolean> deleteTaskReport(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得任务报工
|
* 获得任务报工
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.taskreport;
|
package com.chanko.yunxi.mes.module.heli.service.taskreport;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
|
||||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport.TaskReportMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport.TaskReportMapper;
|
||||||
@ -28,7 +29,8 @@ public class TaskReportServiceImpl implements TaskReportService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TaskReportMapper taskReportMapper;
|
private TaskReportMapper taskReportMapper;
|
||||||
|
@Resource
|
||||||
|
private TaskDispatchDetailMapper taskDispatchDetailMapper;
|
||||||
@Override
|
@Override
|
||||||
public Long createTaskReport(TaskReportSaveReqVO createReqVO) {
|
public Long createTaskReport(TaskReportSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
@ -39,20 +41,33 @@ public class TaskReportServiceImpl implements TaskReportService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTaskReport(TaskReportSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateTaskReport(TaskReportSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateTaskReportExists(updateReqVO.getId());
|
validateTaskReportExists(updateReqVO.getId());
|
||||||
|
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(updateReqVO.getDispatchDetailId());
|
||||||
|
if (ObjectUtil.isNotEmpty(taskDispatchDetailDO)){
|
||||||
|
if (taskDispatchDetailDO.getProcedureStatus() == 2) return CommonResult.error(400,"该派工单已报工完成,不允许修改!");
|
||||||
|
}
|
||||||
// 更新
|
// 更新
|
||||||
TaskReportDO updateObj = BeanUtils.toBean(updateReqVO, TaskReportDO.class);
|
TaskReportDO updateObj = BeanUtils.toBean(updateReqVO, TaskReportDO.class);
|
||||||
taskReportMapper.updateById(updateObj);
|
taskReportMapper.updateById(updateObj);
|
||||||
|
return CommonResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteTaskReport(Long id) {
|
public CommonResult<Boolean> deleteTaskReport(Long id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateTaskReportExists(id);
|
validateTaskReportExists(id);
|
||||||
|
TaskReportDO taskReportDO = taskReportMapper.selectById(id);
|
||||||
|
if (ObjectUtil.isNotEmpty(taskReportDO)){
|
||||||
|
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskReportDO.getDispatchDetailId());
|
||||||
|
if (ObjectUtil.isNotEmpty(taskDispatchDetailDO)){
|
||||||
|
if (taskDispatchDetailDO.getProcedureStatus() == 2) return CommonResult.error(400,"该派工单已报工完成,不允许删除!");
|
||||||
|
}
|
||||||
|
}
|
||||||
// 删除
|
// 删除
|
||||||
taskReportMapper.deleteById(id);
|
taskReportMapper.deleteByIds(id);
|
||||||
|
return CommonResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateTaskReportExists(Long id) {
|
private void validateTaskReportExists(Long id) {
|
||||||
|
|||||||
@ -65,4 +65,6 @@ public interface UnqualifiedNotificationService {
|
|||||||
void confirm(UnqualifiedNotificationSaveReqVO operateReqVO);
|
void confirm(UnqualifiedNotificationSaveReqVO operateReqVO);
|
||||||
|
|
||||||
Long countWx1(UnqualifiedNotificationPageReqVO pageReqVO);
|
Long countWx1(UnqualifiedNotificationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
PageResult<QualityStatistics> workrecord(UnqualifiedNotificationPageReqVO pageReqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.unqualifiednotification;
|
package com.chanko.yunxi.mes.module.heli.service.unqualifiednotification;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
@ -14,6 +15,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.Attentionto
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||||
@ -42,6 +44,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
|
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.obtainAuthorization;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.INVALID_OPERATE;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.INVALID_OPERATE;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.UNQUALIFIED_NOTIFICATION_NOT_EXISTS;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.UNQUALIFIED_NOTIFICATION_NOT_EXISTS;
|
||||||
|
|
||||||
@ -355,4 +358,23 @@ try {
|
|||||||
return unqualifiedNotificationMapper.selectCountConfirmPageWx(1, 5,5, Objects.requireNonNull(getLoginUser()).getId().intValue());
|
return unqualifiedNotificationMapper.selectCountConfirmPageWx(1, 5,5, Objects.requireNonNull(getLoginUser()).getId().intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<QualityStatistics> workrecord(UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||||
|
Page<QualityStatistics> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
|
if (ObjectUtil.isNotEmpty(pageReqVO.getCreateTime())){
|
||||||
|
LocalDateTime startTime = pageReqVO.getCreateTime()[0];
|
||||||
|
|
||||||
|
LocalDateTime endDateTime = pageReqVO.getCreateTime()[1];
|
||||||
|
// 重置时间为 23:59:59
|
||||||
|
LocalDateTime endTime = endDateTime
|
||||||
|
.withHour(23)
|
||||||
|
.withMinute(59)
|
||||||
|
.withSecond(59);
|
||||||
|
pageReqVO.setStartTime(startTime);
|
||||||
|
pageReqVO.setEndTime(endTime);
|
||||||
|
}
|
||||||
|
List<QualityStatistics> qualityStatistics = unqualifiedNotificationMapper.workrecord(page, pageReqVO);
|
||||||
|
return new PageResult<>(qualityStatistics, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package com.chanko.yunxi.mes.module.heli.service.zjbgmasterline;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
@ -36,15 +38,16 @@ public interface ZjBgMasterLineService {
|
|||||||
* 更新终检报工
|
* 更新终检报工
|
||||||
*
|
*
|
||||||
* @param updateReqVO 更新信息
|
* @param updateReqVO 更新信息
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
void updateZjBgMasterLine(@Valid ZjBgMasterLineSaveReqVO updateReqVO);
|
CommonResult<Boolean> updateZjBgMasterLine(@Valid ZjBgMasterLineSaveReqVO updateReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除终检报工
|
* 删除终检报工
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
*/
|
*/
|
||||||
void deleteZjBgMasterLine(Long id);
|
CommonResult<Boolean> deleteZjBgMasterLine(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得终检报工
|
* 获得终检报工
|
||||||
|
|||||||
@ -1,32 +1,32 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.zjbgmasterline;
|
package com.chanko.yunxi.mes.module.heli.service.zjbgmasterline;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.BgMasterLineSaveReqVO;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjpgmaster.ZjPgMasterDO;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjpgmaster.ZjPgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjpgmaster.ZjPgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterLineMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterLineMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.mysql.user.AdminUserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
|
||||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjbgmasterline.ZjBgMasterLineMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjbgmasterline.ZjBgMasterLineMapper;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,6 +45,8 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ZjPgMasterLineMapper zjPgMasterLineMapper;
|
private ZjPgMasterLineMapper zjPgMasterLineMapper;
|
||||||
|
@Resource
|
||||||
|
private AdminUserMapper adminUserMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
||||||
@ -191,20 +193,44 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateZjBgMasterLine(ZjBgMasterLineSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateZjBgMasterLine(ZjBgMasterLineSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateZjBgMasterLineExists(updateReqVO.getId());
|
validateZjBgMasterLineExists(updateReqVO.getId());
|
||||||
|
ZjBgMasterLineDO zjBgMasterLineDO = zjBgMasterLineMapper.selectById(updateReqVO.getId());
|
||||||
|
ZjPgMasterLineDO zjPgMasterLineDO = zjPgMasterLineMapper.selectById(zjBgMasterLineDO.getZjMxId());
|
||||||
|
if (ObjectUtil.isNotEmpty(zjPgMasterLineDO)&&zjPgMasterLineDO.getPgType()==1) return CommonResult.error(400,"该终检已质检结束,请确认");
|
||||||
|
if (zjBgMasterLineDO.getIsQua()==1&&zjBgMasterLineDO.getNotificationStatus()==3) return CommonResult.error(400,"该终检已审核,请确认");
|
||||||
|
Long id = getLoginUser().getId();
|
||||||
|
if (!id.equals(Long.parseLong(zjBgMasterLineDO.getBgUser()))){
|
||||||
|
AdminUserDO adminUserDO = adminUserMapper.selectById(id);
|
||||||
|
AdminUserDO adminUser = adminUserMapper.selectById(zjBgMasterLineDO.getBgUser());
|
||||||
|
if (ObjectUtil.isNotEmpty(adminUserDO)&&ObjectUtil.isNotEmpty(adminUser)) return CommonResult.error(400,"当前登录人员"+adminUserDO.getNickname()+"跟报工人"+adminUser.getNickname()+"不一致,不允许修改!");
|
||||||
|
}
|
||||||
// 更新
|
// 更新
|
||||||
ZjBgMasterLineDO updateObj = BeanUtils.toBean(updateReqVO, ZjBgMasterLineDO.class);
|
ZjBgMasterLineDO updateObj = BeanUtils.toBean(updateReqVO, ZjBgMasterLineDO.class);
|
||||||
zjBgMasterLineMapper.updateById(updateObj);
|
zjBgMasterLineMapper.updateById(updateObj);
|
||||||
|
return CommonResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteZjBgMasterLine(Long id) {
|
public CommonResult<Boolean> deleteZjBgMasterLine(Long id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateZjBgMasterLineExists(id);
|
validateZjBgMasterLineExists(id);
|
||||||
|
ZjBgMasterLineDO zjBgMasterLineDO = zjBgMasterLineMapper.selectById(id);
|
||||||
|
ZjPgMasterLineDO zjPgMasterLineDO = zjPgMasterLineMapper.selectById(zjBgMasterLineDO.getZjMxId());
|
||||||
|
if (ObjectUtil.isNotEmpty(zjPgMasterLineDO)&&zjPgMasterLineDO.getPgType()==1) {
|
||||||
|
return CommonResult.error(400,"该终检已质检结束,请确认");
|
||||||
|
}
|
||||||
|
if (zjBgMasterLineDO.getIsQua()==1&&zjBgMasterLineDO.getNotificationStatus()==3) return CommonResult.error(400,"该终检已审核,请确认");
|
||||||
|
Long loginId = getLoginUser().getId();
|
||||||
|
if (!loginId.equals(Long.parseLong(zjBgMasterLineDO.getBgUser()))){
|
||||||
|
AdminUserDO adminUserDO = adminUserMapper.selectById(id);
|
||||||
|
AdminUserDO adminUser = adminUserMapper.selectById(zjBgMasterLineDO.getBgUser());
|
||||||
|
if (ObjectUtil.isNotEmpty(adminUserDO)&&ObjectUtil.isNotEmpty(adminUser)) return CommonResult.error(400,"当前登录人员"+adminUserDO.getNickname()+"跟报工人"+adminUser.getNickname()+"不一致,不允许修改!");
|
||||||
|
}
|
||||||
// 删除
|
// 删除
|
||||||
zjBgMasterLineMapper.deleteById(id);
|
zjBgMasterLineMapper.deleteByIds(id);
|
||||||
|
return CommonResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateZjBgMasterLineExists(Long id) {
|
private void validateZjBgMasterLineExists(Long id) {
|
||||||
|
|||||||
@ -32,6 +32,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterMapper;
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterLineMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterLineMapper;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -9,4 +9,7 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
DELETE FROM quality_bg_master_line WHERE id =#{id}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -49,10 +49,19 @@
|
|||||||
where t1.is_outsourcing='Y' and t.deleted=0 and t.dispatch_type='PRODUCTION' and r.work_type=2 and t.project_id=#{id}
|
where t1.is_outsourcing='Y' and t.deleted=0 and t.dispatch_type='PRODUCTION' and r.work_type=2 and t.project_id=#{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="bubbleFees" resultType="java.math.BigDecimal">
|
<select id="bubbleFees" resultType="java.math.BigDecimal">
|
||||||
SELECT sum(make.foam_price) cost
|
SELECT
|
||||||
from pro_process_bom_detail t
|
SUM(COALESCE(p.mat_weight, 0) * COALESCE(c.price, 0)) AS cost
|
||||||
left join project_purchase_order_make_detail make on make.boom_detail_id=t.id and make.deleted=0 and make.tenant_id=2
|
FROM
|
||||||
where make.is_foam='Y' and t.deleted=0 and t.type=2 and make.project_plan_sub_id=#{projectSubId}
|
pro_process_bom_detail t
|
||||||
|
LEFT JOIN project_material_plan_boom p ON p.boom_detail_id = t.id
|
||||||
|
AND p.deleted = 0
|
||||||
|
AND p.tenant_id = 2
|
||||||
|
LEFT JOIN base_composition c ON t.composition_id = c.id
|
||||||
|
AND c.deleted = 0
|
||||||
|
AND c.tenant_id = 2
|
||||||
|
WHERE
|
||||||
|
t.type = 2
|
||||||
|
AND p.project_plan_sub_id =#{projectSubId}
|
||||||
</select>
|
</select>
|
||||||
<select id="internalLaborCost" resultType="java.math.BigDecimal">
|
<select id="internalLaborCost" resultType="java.math.BigDecimal">
|
||||||
SELECT sum(COALESCE(r.work_time, 0) * p.grade_cost) cost
|
SELECT sum(COALESCE(r.work_time, 0) * p.grade_cost) cost
|
||||||
@ -63,6 +72,15 @@
|
|||||||
left join system_post p on p.id=u.post_id and u.deleted=0 and p.tenant_id=2 and p.status=0
|
left join system_post p on p.id=u.post_id and u.deleted=0 and p.tenant_id=2 and p.status=0
|
||||||
where t1.is_outsourcing='N' and t.deleted=0 and t.dispatch_type='PRODUCTION' and r.work_type=1 and t.project_id=#{id}
|
where t1.is_outsourcing='N' and t.deleted=0 and t.dispatch_type='PRODUCTION' and r.work_type=1 and t.project_id=#{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="assemblyLaborCost" resultType="java.math.BigDecimal">
|
||||||
|
SELECT sum(COALESCE(r.work_time, 0) * p.grade_cost) cost
|
||||||
|
from pro_task_dispatch t
|
||||||
|
left join pro_task_dispatch_detail t1 on t.id=t1.dispatch_id and t1.deleted=0 and t1.tenant_id=2
|
||||||
|
left join pro_task_report r on r.dispatch_detail_id=t1.id and r.deleted=0 and r.tenant_id=2
|
||||||
|
left join system_user_post u on u.user_id=r.owner and u.deleted=0 and u.tenant_id=2
|
||||||
|
left join system_post p on p.id=u.post_id and u.deleted=0 and p.tenant_id=2 and p.status=0
|
||||||
|
where t.deleted=0 and t.dispatch_type='ASSEMBLE' and t.project_id=#{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateDetailEditStatusById" parameterType="Long">
|
<update id="updateDetailEditStatusById" parameterType="Long">
|
||||||
UPDATE pro_process_bom_detail
|
UPDATE pro_process_bom_detail
|
||||||
|
|||||||
@ -17,4 +17,61 @@
|
|||||||
where sto.stock_in_type=5 and m.material_type=5 and sto.status=4 and sto.project_no=#{projectSubId}
|
where sto.stock_in_type=5 and m.material_type=5 and sto.status=4 and sto.project_no=#{projectSubId}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getList" resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO">
|
||||||
|
SELECT
|
||||||
|
m.CODE AS materialCode,
|
||||||
|
m.NAME AS materialName,
|
||||||
|
0 AS type,
|
||||||
|
m.material_type AS materialType,
|
||||||
|
m.spec AS materialSpec,
|
||||||
|
o.purchase_amount AS amount,
|
||||||
|
m.unit AS unit,
|
||||||
|
ROUND(o.estimated_price * ROUND((bd.amount * d.amount) / o.purchase_amount, 2), 2) AS caiGouMoney,
|
||||||
|
o1.purchase_no AS stockNo
|
||||||
|
FROM
|
||||||
|
pro_process_bom bom
|
||||||
|
LEFT JOIN pro_process_bom_detail bd ON bd.bom_id = bom.id
|
||||||
|
AND bd.deleted = 0
|
||||||
|
AND bd.tenant_id = 2
|
||||||
|
INNER JOIN project_purchase_order_no_detail o ON o.boom_detail_id = bd.id
|
||||||
|
AND o.deleted = 0
|
||||||
|
AND o.tenant_id = 2
|
||||||
|
LEFT JOIN project_purchase_order_no o1 ON o1.id = o.purchase_order_id
|
||||||
|
AND o1.deleted = 0
|
||||||
|
AND o1.tenant_id = 2
|
||||||
|
LEFT JOIN project_sale_order_sub d ON d.id = bom.project_sub_id
|
||||||
|
AND d.deleted = 0
|
||||||
|
AND d.tenant_id = 2
|
||||||
|
LEFT JOIN base_material m ON m.id = o.material_id
|
||||||
|
AND m.deleted = 0
|
||||||
|
AND m.tenant_id = 2
|
||||||
|
WHERE
|
||||||
|
bom.deleted = 0
|
||||||
|
AND bd.type = 1
|
||||||
|
AND bom.project_id =#{id}
|
||||||
|
AND bom.project_sub_id = #{projectSubId} UNION ALL
|
||||||
|
SELECT
|
||||||
|
m.CODE AS materialCode,
|
||||||
|
m.NAME AS materialName,
|
||||||
|
1 AS type,
|
||||||
|
m.material_type AS materialType,
|
||||||
|
m.spec AS materialSpec,
|
||||||
|
mat.storage_ok_qty AS amount,
|
||||||
|
m.unit AS unit,
|
||||||
|
ROUND(COALESCE(mat.storage_ok_qty, 0) * COALESCE(mat.price, 0), 2) AS caiGouMoney,
|
||||||
|
sto.stock_no AS stockNo
|
||||||
|
FROM
|
||||||
|
wms_storage sto
|
||||||
|
LEFT JOIN wms_storage_mat mat ON mat.stock_id = sto.id
|
||||||
|
AND mat.deleted = 0
|
||||||
|
AND mat.tenant_id = 2
|
||||||
|
LEFT JOIN base_material m ON mat.mat_id = m.id
|
||||||
|
AND m.deleted = 0
|
||||||
|
AND m.tenant_id = 2
|
||||||
|
WHERE
|
||||||
|
sto.stock_in_type = 5
|
||||||
|
AND m.material_type = 5
|
||||||
|
AND sto.STATUS = 4
|
||||||
|
AND sto.project_no = #{projectSubId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -110,4 +110,12 @@
|
|||||||
and t.has_report = 1
|
and t.has_report = 1
|
||||||
group by t.dispatch_detail_id
|
group by t.dispatch_detail_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="assemblyLaborCost" resultType="java.math.BigDecimal">
|
||||||
|
SELECT sum(COALESCE(r.work_time, 0) * p.grade_cost) cost
|
||||||
|
from
|
||||||
|
pro_task_report r
|
||||||
|
left join system_user_post u on u.user_id=r.owner and u.deleted=0 and u.tenant_id=2
|
||||||
|
left join system_post p on p.id=u.post_id and u.deleted=0 and p.tenant_id=2 and p.status=0
|
||||||
|
where r.deleted=0 and r.dispatch_detail_id=#{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -20,4 +20,7 @@
|
|||||||
LEFT JOIN pro_task_dispatch_detail g ON t.dispatch_detail_id = g.id AND g.tenant_id = 2
|
LEFT JOIN pro_task_dispatch_detail g ON t.dispatch_detail_id = g.id AND g.tenant_id = 2
|
||||||
WHERE t.deleted = 0 AND g.deleted = 0 AND g.detail_owner_id = #{ownerId} AND t.tenant_id = 2
|
WHERE t.deleted = 0 AND g.deleted = 0 AND g.detail_owner_id = #{ownerId} AND t.tenant_id = 2
|
||||||
</select>
|
</select>
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
DELETE FROM pro_task_report WHERE id =#{id}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -40,7 +40,8 @@
|
|||||||
DATE_FORMAT(t.audit_time, '%Y-%m-%d') AS auditTime,
|
DATE_FORMAT(t.audit_time, '%Y-%m-%d') AS auditTime,
|
||||||
t.audit_opinion AS auditOpinion,
|
t.audit_opinion AS auditOpinion,
|
||||||
p.CODE AS projectCode,
|
p.CODE AS projectCode,
|
||||||
pg.project_sub_number AS projectSubNumber
|
pg.project_sub_number AS projectSubNumber,
|
||||||
|
t.con_status as conStatus
|
||||||
FROM
|
FROM
|
||||||
quality_bg_master_line t
|
quality_bg_master_line t
|
||||||
left join quality_pg_master_line pg on t.zj_mx_id=pg.id
|
left join quality_pg_master_line pg on t.zj_mx_id=pg.id
|
||||||
@ -81,7 +82,8 @@
|
|||||||
DATE_FORMAT(t.audit_time, '%Y-%m-%d') AS auditTime,
|
DATE_FORMAT(t.audit_time, '%Y-%m-%d') AS auditTime,
|
||||||
t.audit_opinion AS auditOpinion,
|
t.audit_opinion AS auditOpinion,
|
||||||
p.CODE AS projectCode,
|
p.CODE AS projectCode,
|
||||||
pg.project_sub_number AS projectSubNumber
|
pg.project_sub_number AS projectSubNumber,
|
||||||
|
t.con_status as conStatus
|
||||||
FROM
|
FROM
|
||||||
quality_zj_bg_master_line t
|
quality_zj_bg_master_line t
|
||||||
left join quality_zj_pg_master_line pg on t.zj_mx_id=pg.id
|
left join quality_zj_pg_master_line pg on t.zj_mx_id=pg.id
|
||||||
@ -96,19 +98,21 @@
|
|||||||
) t
|
) t
|
||||||
where 1=1
|
where 1=1
|
||||||
<if test="pageReqVO.projectCode!=null and pageReqVO.projectCode!=''">
|
<if test="pageReqVO.projectCode!=null and pageReqVO.projectCode!=''">
|
||||||
and t.projectCode =#{pageReqVO.projectCode}
|
and t.projectCode LIKE CONCAT('%',#{pageReqVO.projectCode}, '%')
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
<if test="pageReqVO.projectName!=null and pageReqVO.projectName!=''">
|
<if test="pageReqVO.projectName!=null and pageReqVO.projectName!=''">
|
||||||
and t.projectName =#{pageReqVO.projectName}
|
and t.projectName LIKE CONCAT('%',#{pageReqVO.projectName}, '%')
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
<if test="pageReqVO.projectSubCode!=null and pageReqVO.projectSubCode!=''">
|
<if test="pageReqVO.projectSubCode!=null and pageReqVO.projectSubCode!=''">
|
||||||
and t.projectSubNumber =#{pageReqVO.projectSubCode}
|
and t.projectSubNumber LIKE CONCAT('%',#{pageReqVO.projectSubCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="pageReqVO.projectCode!=null and pageReqVO.projectCode!=''">
|
<if test="pageReqVO.projectCode!=null and pageReqVO.projectCode!=''">
|
||||||
and t.projectCode =#{pageReqVO.projectCode}
|
and t.projectCode LIKE CONCAT('%',#{pageReqVO.projectCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="pageReqVO.projectSubName!=null and pageReqVO.projectSubName!=''">
|
<if test="pageReqVO.projectSubName!=null and pageReqVO.projectSubName!=''">
|
||||||
and t.projectSubName =#{pageReqVO.projectSubName}
|
and t.projectSubName LIKE CONCAT('%',#{pageReqVO.projectSubName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="pageReqVO.type!=null and pageReqVO.type!=''">
|
<if test="pageReqVO.type!=null and pageReqVO.type!=''">
|
||||||
and t.type =#{pageReqVO.type}
|
and t.type =#{pageReqVO.type}
|
||||||
@ -316,4 +320,138 @@
|
|||||||
) gh
|
) gh
|
||||||
ORDER BY gh.createTime DESC LIMIT #{offset}, #{limit}
|
ORDER BY gh.createTime DESC LIMIT #{offset}, #{limit}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="workrecord"
|
||||||
|
resultType="com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.QualityStatistics">
|
||||||
|
SELECT
|
||||||
|
t.*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
t.id as id,
|
||||||
|
t.notification_status as notificationStatus,
|
||||||
|
t.create_time as createTime,
|
||||||
|
p.project_name AS projectName,
|
||||||
|
c.NAME AS customerName,
|
||||||
|
pg.project_sub_name AS projectSubName,
|
||||||
|
pg.bom_name AS bomName,
|
||||||
|
t.remark AS remark,
|
||||||
|
0 AS type,
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.is_qua = 0 THEN
|
||||||
|
'是'
|
||||||
|
WHEN t.is_qua = 1 THEN
|
||||||
|
'否' ELSE '未知'
|
||||||
|
END AS isQua,
|
||||||
|
t.amount AS amount,
|
||||||
|
u1.nickname AS userName,
|
||||||
|
DATE_FORMAT(t.create_time, '%Y-%m-%d') AS testingTime,
|
||||||
|
pro.NAME AS procedureName,
|
||||||
|
u2.nickname AS auditorName,
|
||||||
|
DATE_FORMAT(t.audit_time, '%Y-%m-%d') AS auditTime,
|
||||||
|
t.audit_opinion AS auditOpinion,
|
||||||
|
p.CODE AS projectCode,
|
||||||
|
pg.project_sub_number AS projectSubNumber,
|
||||||
|
t.con_status as conStatus,
|
||||||
|
t.work_time as workTime,
|
||||||
|
t.mod_remark as modRemark,
|
||||||
|
u3.nickname AS bgName,
|
||||||
|
t.bg_time as dateTime
|
||||||
|
FROM
|
||||||
|
quality_bg_master_line t
|
||||||
|
left join quality_pg_master_line pg on t.zj_mx_id=pg.id
|
||||||
|
LEFT JOIN project_sale_order p ON pg.project_id = p.id
|
||||||
|
LEFT JOIN base_customer c ON p.customer_id = c.id
|
||||||
|
LEFT JOIN system_users u1 ON pg.detil_user = u1.id
|
||||||
|
LEFT JOIN system_users u2 ON t.auditor = u2.id
|
||||||
|
LEFT JOIN system_users u3 ON t.bg_user = u3.id
|
||||||
|
LEFT JOIN base_procedure pro ON pg.procedure_id = pro.id
|
||||||
|
WHERE
|
||||||
|
t.deleted = 0
|
||||||
|
group by t.id
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
t.id as id,
|
||||||
|
t.notification_status as notificationStatus,
|
||||||
|
t.create_time as createTime,
|
||||||
|
|
||||||
|
pg.project_name AS projectName,
|
||||||
|
c.NAME AS customerName,
|
||||||
|
pg.project_sub_name AS projectSubName,
|
||||||
|
'' AS bomName,
|
||||||
|
t.remark AS remark,
|
||||||
|
1 AS type,
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.is_qua = 0 THEN
|
||||||
|
'是'
|
||||||
|
WHEN t.is_qua = 1 THEN
|
||||||
|
'否' ELSE '未知'
|
||||||
|
END AS isQua,
|
||||||
|
t.amount AS amount,
|
||||||
|
u1.nickname AS userName,
|
||||||
|
|
||||||
|
DATE_FORMAT(t.create_time, '%Y-%m-%d') AS testingTime,
|
||||||
|
'' AS procedureName,
|
||||||
|
u2.nickname AS auditorName,
|
||||||
|
DATE_FORMAT(t.audit_time, '%Y-%m-%d') AS auditTime,
|
||||||
|
t.audit_opinion AS auditOpinion,
|
||||||
|
p.CODE AS projectCode,
|
||||||
|
pg.project_sub_number AS projectSubNumber,
|
||||||
|
t.con_status as conStatus,
|
||||||
|
t.work_time as workTime,
|
||||||
|
t.mod_remark as modRemark,
|
||||||
|
u3.nickname AS bgName,
|
||||||
|
t.bg_time as dateTime
|
||||||
|
|
||||||
|
FROM
|
||||||
|
quality_zj_bg_master_line t
|
||||||
|
left join quality_zj_pg_master_line pg on t.zj_mx_id=pg.id
|
||||||
|
LEFT JOIN project_sale_order p ON pg.project_id = p.id
|
||||||
|
LEFT JOIN base_customer c ON p.customer_id = c.id
|
||||||
|
LEFT JOIN system_users u1 ON pg.detil_user = u1.id
|
||||||
|
LEFT JOIN system_users u2 ON t.auditor = u2.id
|
||||||
|
LEFT JOIN system_users u3 ON t.bg_user = u3.id
|
||||||
|
WHERE
|
||||||
|
t.deleted = 0
|
||||||
|
group by t.id
|
||||||
|
) t
|
||||||
|
where 1=1
|
||||||
|
<if test="pageReqVO.projectCode!=null and pageReqVO.projectCode!=''">
|
||||||
|
and t.projectCode LIKE CONCAT('%',#{pageReqVO.projectCode}, '%')
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.createTime!=null and pageReqVO.createTime!=''">
|
||||||
|
and t.dateTime between #{pageReqVO.startTime} and #{pageReqVO.endTime}
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.materialName!=null and pageReqVO.materialName!=''">
|
||||||
|
and t.bomName LIKE CONCAT('%',#{pageReqVO.materialName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.userName!=null and pageReqVO.userName!=''">
|
||||||
|
and t.bgName LIKE CONCAT('%',#{pageReqVO.userName}, '%')
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.projectName!=null and pageReqVO.projectName!=''">
|
||||||
|
and t.projectName LIKE CONCAT('%',#{pageReqVO.projectName}, '%')
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.projectSubCode!=null and pageReqVO.projectSubCode!=''">
|
||||||
|
and t.projectSubNumber LIKE CONCAT('%',#{pageReqVO.projectSubCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.projectCode!=null and pageReqVO.projectCode!=''">
|
||||||
|
and t.projectCode LIKE CONCAT('%',#{pageReqVO.projectCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.projectSubName!=null and pageReqVO.projectSubName!=''">
|
||||||
|
and t.projectSubName LIKE CONCAT('%',#{pageReqVO.projectSubName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.type!=null and pageReqVO.type!=''">
|
||||||
|
and t.type =#{pageReqVO.type}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.auditOpinion!=null and pageReqVO.auditOpinion!=''">
|
||||||
|
and t.auditOpinion =#{pageReqVO.auditOpinion}
|
||||||
|
</if>
|
||||||
|
order by t.createTime desc
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -9,4 +9,8 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
DELETE FROM quality_zj_bg_master_line WHERE id =#{id}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
41
mes-ui/mes-ui-admin-vue3/src/api/heli/bgmasterline/index.ts
Normal file
41
mes-ui/mes-ui-admin-vue3/src/api/heli/bgmasterline/index.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface BgMasterLineVO {
|
||||||
|
id: number
|
||||||
|
zjId: number
|
||||||
|
zjMxId: number
|
||||||
|
bgUser: string
|
||||||
|
amount: number
|
||||||
|
bgTime: Date
|
||||||
|
workTime: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询过程检报工分页
|
||||||
|
export const getBgMasterLinePage = async (params) => {
|
||||||
|
return await request.get({ url: `/heli/bg-master-line/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询过程检报工详情
|
||||||
|
export const getBgMasterLine = async (id: number) => {
|
||||||
|
return await request.get({ url: `/heli/bg-master-line/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增过程检报工
|
||||||
|
export const createBgMasterLine = async (data: BgMasterLineVO) => {
|
||||||
|
return await request.post({ url: `/heli/bg-master-line/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改过程检报工
|
||||||
|
export const updateBgMasterLine = async (data: BgMasterLineVO) => {
|
||||||
|
return await request.put({ url: `/heli/bg-master-line/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除过程检报工
|
||||||
|
export const deleteBgMasterLine = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/heli/bg-master-line/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出过程检报工 Excel
|
||||||
|
export const exportBgMasterLine = async (params) => {
|
||||||
|
return await request.download({ url: `/heli/bg-master-line/export-excel`, params })
|
||||||
|
}
|
||||||
@ -63,3 +63,11 @@ export const send = async (data: ProcessDesignVO) => {
|
|||||||
export const reWork = async (data: ProcessDesignVO) => {
|
export const reWork = async (data: ProcessDesignVO) => {
|
||||||
return await request.post({ url: `/heli/process-design/reWork`, data })
|
return await request.post({ url: `/heli/process-design/reWork`, data })
|
||||||
}
|
}
|
||||||
|
// 查询工艺设计分页
|
||||||
|
export const getProcessDesignPages = async (params) => {
|
||||||
|
return await request.get({ url: `/heli/process-design/pages`, params })
|
||||||
|
}
|
||||||
|
// 导出工艺设计 Excel
|
||||||
|
export const exportProcessDesigns = async (params) => {
|
||||||
|
return await request.download({ url: `/heli/process-design/exportExcel`, params })
|
||||||
|
}
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export const exportProjectOrder = async (params) => {
|
|||||||
return await request.download({ url: `/heli/project-order/export-excel`, params })
|
return await request.download({ url: `/heli/project-order/export-excel`, params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== 子表(项目订单子项目) ====================
|
// ==================== 子表(项目订单子项目R) ====================
|
||||||
|
|
||||||
// 获得项目订单子项目列表
|
// 获得项目订单子项目列表
|
||||||
export const getProjectOrderSubListByProjectOrderId = async (projectOrderId) => {
|
export const getProjectOrderSubListByProjectOrderId = async (projectOrderId) => {
|
||||||
@ -91,7 +91,10 @@ export const getProjectOrderSubPage = async (params) => {
|
|||||||
return await request.get({ url: `/heli/project-order/project-order-sub/page`, params })
|
return await request.get({ url: `/heli/project-order/project-order-sub/page`, params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得项目订单子项目列表
|
||||||
|
export const getProjectOrderSubListByProjectOrderIdGt = async (projectOrderId) => {
|
||||||
|
return await request.get({ url: `/heli/project-order/project-order-sub/list-by-project-order-id-gt?projectOrderId=` + projectOrderId })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -81,3 +81,10 @@ export const received = async (params) => {
|
|||||||
export const exportReceived = async (params) => {
|
export const exportReceived = async (params) => {
|
||||||
return await request.download({ url: `/heli/purchase-order-no-detail/exportReceived`, params })
|
return await request.download({ url: `/heli/purchase-order-no-detail/exportReceived`, params })
|
||||||
}
|
}
|
||||||
|
export const getOutsourcingExpenses = async (params) => {
|
||||||
|
return await request.get({ url: `/heli/purchase-order-no-detail/getOutsourcingExpenses`, params })
|
||||||
|
}
|
||||||
|
// 导出外协费用 Excel
|
||||||
|
export const exportOutsourcing = async (params) => {
|
||||||
|
return await request.download({ url: `/heli/purchase-order-no-detail/exportOutsourcing`, params })
|
||||||
|
}
|
||||||
|
|||||||
@ -39,3 +39,15 @@ export const getList = async (id: number,projectSubId: number) => {
|
|||||||
export const getListqt = async (id: number,projectSubId: number) => {
|
export const getListqt = async (id: number,projectSubId: number) => {
|
||||||
return await request.get({ url: `/heli/purchase-order/getListqt?id=`+id+`&projectSubId=`+projectSubId })
|
return await request.get({ url: `/heli/purchase-order/getListqt?id=`+id+`&projectSubId=`+projectSubId })
|
||||||
}
|
}
|
||||||
|
//查询运费成本明细
|
||||||
|
export const getListYfDetails = async (id: number,projectSubId: number) => {
|
||||||
|
return await request.get({ url: `/heli/deliver-order/getListYfDetails?id=`+id+`&projectSubId=`+projectSubId })
|
||||||
|
}
|
||||||
|
//查询材料成本
|
||||||
|
export const getListcl = async (id: number,projectSubId: number) => {
|
||||||
|
return await request.get({ url: `/heli/task-dispatch/getListcl?id=`+id+`&projectSubId=`+projectSubId })
|
||||||
|
}
|
||||||
|
//查询装配成本
|
||||||
|
export const getListZp = async (id: number,projectSubId: number) => {
|
||||||
|
return await request.get({ url: `/heli/task-dispatch/getListZp?id=`+id+`&projectSubId=`+projectSubId })
|
||||||
|
}
|
||||||
|
|||||||
@ -88,3 +88,6 @@ export const judgeHasOver = async(id:number)=>{
|
|||||||
export const getTaskDispatchDetailListByDispatchIdAssembly = async (dispatchId) => {
|
export const getTaskDispatchDetailListByDispatchIdAssembly = async (dispatchId) => {
|
||||||
return await request.get({ url: `/heli/task-dispatch/task-dispatch-detail/list-by-dispatch-id-assembly?dispatchId=` + dispatchId })
|
return await request.get({ url: `/heli/task-dispatch/task-dispatch-detail/list-by-dispatch-id-assembly?dispatchId=` + dispatchId })
|
||||||
}
|
}
|
||||||
|
export const getOwnerUserList = async(id:number,type:number)=>{
|
||||||
|
return await request.get({url:`/heli/task-dispatch/task-dispatch-detail/getOwnerUserList?id=`+id+`&type=`+type})
|
||||||
|
}
|
||||||
|
|||||||
@ -61,3 +61,6 @@ export const exportStatisticPage = async (params) => {
|
|||||||
export const review = async (data) => {
|
export const review = async (data) => {
|
||||||
return await request.post({ url: `/heli/unqualified-notification/review`, data })
|
return await request.post({ url: `/heli/unqualified-notification/review`, data })
|
||||||
}
|
}
|
||||||
|
export const workrecord = async (params) => {
|
||||||
|
return await request.get({ url: `/heli/unqualified-notification/workrecord`, params })
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user