/*
|
* Copyright (c) 2018-2025, ztt All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: ztt
|
*/
|
|
package com.chinaztt.mes.plan.controller;
|
|
import com.alibaba.fastjson.JSONObject;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.chinaztt.mes.basic.service.StaffService;
|
import com.chinaztt.mes.common.wrapper.QueryWrapperUtil;
|
import com.chinaztt.mes.plan.dto.*;
|
import com.chinaztt.mes.plan.entity.CustomerOrder;
|
import com.chinaztt.mes.plan.entity.MoTestStandardParam;
|
import com.chinaztt.mes.plan.service.*;
|
import com.chinaztt.mes.plan.vo.CustomerOrderVO1;
|
import com.chinaztt.mes.quality.dto.CustomOrderSyncDTO;
|
import com.chinaztt.mes.quality.entity.TestStandardParam;
|
import com.chinaztt.mes.quality.service.TestStandardParamService;
|
import com.chinaztt.mes.technology.service.BomService;
|
import com.chinaztt.mes.technology.service.DocumentService;
|
import com.chinaztt.mes.technology.service.RoutingService;
|
import com.chinaztt.mes.warehouse.dto.PackagingDTO;
|
import com.chinaztt.ztt.admin.api.entity.SysDictItem;
|
import com.chinaztt.ztt.common.core.constant.CacheConstants;
|
import com.chinaztt.ztt.common.core.util.R;
|
import com.chinaztt.ztt.common.log.annotation.SysLog;
|
import com.chinaztt.ztt.common.security.annotation.Inner;
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.io.IOException;
|
import java.io.UnsupportedEncodingException;
|
import java.net.URL;
|
import java.net.URLDecoder;
|
import java.nio.charset.StandardCharsets;
|
import java.util.List;
|
|
|
/**
|
* 客户订单表
|
*
|
* @author cxf
|
* @date 2020-09-14 16:35:26
|
*/
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/plan/customerOrder")
|
@Api(value = "customerOrder", tags = "客户订单表管理")
|
@Slf4j
|
public class CustomerOrderController {
|
|
private final CustomerOrderService customerOrderService;
|
|
private final ProcessConfigService processConfigService;
|
|
private final BomService bomService;
|
|
private final RoutingService routingService;
|
|
private final DocumentService documentService;
|
|
private final MoTestStandardService moTestStandardService;
|
|
private final MoTestStandardParamService moTestStandardParamService;
|
|
private final TestStandardParamService testStandardParamService;
|
|
private final SysDictItemService sysDictItemService;
|
|
private final StaffService staffService;
|
|
/**
|
* 分页查询
|
*
|
* @param page 分页对象
|
* @param planCustomerOrder 客户订单表
|
* @return
|
*/
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
@GetMapping("/page/{type}")
|
public R getCustomerOrderPage(Page page, CustomerOrderDTO planCustomerOrder, @PathVariable("type") String type) {
|
return R.ok(customerOrderService.getCustomerOrderPage(page, QueryWrapperUtil.gen(planCustomerOrder), type));
|
}
|
|
/**
|
* 同步otc订单数据
|
*
|
* @param selectTime 选择日期,查询该日期后至当前时间的数据
|
* @param orderNo 订单编号
|
* @return
|
*/
|
@GetMapping("/otcCustomerOrderSync")
|
public R otcCustomerOrderSync(@RequestParam("selectTime") String selectTime, @RequestParam("orderNo") String orderNo) {
|
return customerOrderService.otcCustomerOrderSync(selectTime, orderNo);
|
}
|
|
/**
|
*选择绑定人员
|
* @return
|
*/
|
@ApiOperation(value = "选择绑定人员", notes = "选择绑定人员")
|
@GetMapping("/chooseStaff")
|
public R chooseStaff() {
|
return R.ok(staffService.chooseStaff());
|
}
|
|
/**
|
* 对接志邦国际鹰联 erp 同步合同
|
*
|
* @param customOrderSyncDTO
|
* @return
|
*/
|
@ApiOperation(value = "同步销售订单", notes = "同步销售订单")
|
@PostMapping("/syncOrder")
|
@XxlJob("syncOrder")
|
public R syncOrder(@RequestBody CustomOrderSyncDTO customOrderSyncDTO) {
|
return R.ok("共更新" + customerOrderService.syncOrder(customOrderSyncDTO) + "条数据");
|
}
|
|
/**
|
* 通过id作废
|
*
|
* @param id
|
* @return
|
*/
|
@ApiOperation(value = "通过id作废", notes = "通过id作废")
|
@GetMapping("/dropByContractNo")
|
public R dropByContractNo(@RequestParam("id") Long id) {
|
customerOrderService.removeById(id);
|
return R.ok();
|
}
|
|
/**
|
* 通过id查询客户订单表
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
@GetMapping("/{id}")
|
public R getById(@PathVariable("id") Long id) {
|
return R.ok(customerOrderService.getCustomerOrderById(id));
|
}
|
|
/**
|
* 新增客户订单表
|
*
|
* @param planCustomerOrder 客户订单表
|
* @return R
|
*/
|
@ApiOperation(value = "新增客户订单表", notes = "新增客户订单表")
|
@SysLog("新增客户订单表")
|
@PostMapping
|
public R save(@RequestBody CustomerOrder planCustomerOrder) {
|
// 添加订单编号唯一验证
|
CustomerOrder customerOrderByFind = customerOrderService.getOne(Wrappers.<CustomerOrder>lambdaQuery().eq(CustomerOrder::getCustomerOrderNo, planCustomerOrder.getCustomerOrderNo()), false);
|
if (customerOrderByFind != null) {
|
throw new RuntimeException("客户订单号重复:" + customerOrderByFind.getCustomerOrderNo());
|
}
|
return R.ok(customerOrderService.save(planCustomerOrder));
|
}
|
|
/**
|
* 修改客户订单表
|
*
|
* @param customerOrderDTO 客户订单表
|
* @return R
|
*/
|
@ApiOperation(value = "修改客户订单表", notes = "修改客户订单表")
|
@SysLog("修改客户订单表")
|
@PutMapping("/updateById")
|
public R updateById(@RequestBody CustomerOrderVO1 customerOrderDTO) {
|
return customerOrderService.fullUpdate(customerOrderDTO);
|
}
|
|
/**
|
* 批量修改销售件
|
*
|
* @param
|
* @return R
|
*/
|
@ApiOperation(value = "批量修改销售件", notes = "批量修改销售件")
|
@SysLog("批量修改销售件")
|
@PostMapping("/batchUpdateSalePartNo")
|
public R batchUpdateSalePartNo(@RequestBody CustomerOrderDTO customerOrderDTO) {
|
return R.ok(customerOrderService.batchUpdateSalePartNo(customerOrderDTO));
|
}
|
|
|
/**
|
* 通过id删除客户订单表
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "通过id删除客户订单表", notes = "通过id删除客户订单表")
|
@SysLog("通过id删除客户订单表")
|
@DeleteMapping("/{id}")
|
public R removeById(@PathVariable Long id) {
|
return R.ok(customerOrderService.removeById(id));
|
}
|
|
/**
|
* Description: 创建主生产计划
|
*
|
* @param: customerOrderDTO
|
* @return: R
|
*/
|
@ApiOperation(value = "创建主生产计划", notes = "创建主生产计划")
|
@PostMapping("/createMasterProductionSchedule")
|
public R createMasterProductionSchedule(@RequestBody List<CustomerOrderDTO> customerOrderDTO) {
|
return R.ok(customerOrderService.createMasterProductionSchedule(customerOrderDTO));
|
}
|
|
/**
|
* Description: 创建主生产计划前校验
|
*
|
* @param: customerOrderDTO
|
* @return: R
|
*/
|
@ApiOperation(value = "创建主生产计划前校验", notes = "创建主生产计划前校验")
|
@PostMapping("/createScheduleCheck")
|
public R createScheduleCheck(@RequestBody List<CustomerOrderDTO> customerOrderDTO) {
|
return customerOrderService.createScheduleCheck(customerOrderDTO);
|
}
|
|
/**
|
* 创建主生产计划需求
|
*
|
* @param mpsRequirements 主生产计划需求
|
* @return R
|
*/
|
@ApiOperation(value = "创建主生产计划需求", notes = "创建主生产计划需求")
|
@SysLog("创建主生产计划需求")
|
@PostMapping("/createMpsRequirements")
|
public R createMpsRequirements(@RequestBody List<MpsRequirementsDTO> mpsRequirements) {
|
return R.ok(customerOrderService.createMpsRequirements(mpsRequirements));
|
}
|
|
|
/**
|
* Description: 绑定工艺文件
|
*
|
* @param: mpsRequirementsDTOList
|
* @return: R
|
*/
|
@ApiOperation(value = "绑定工艺文件", notes = "绑定工艺文件")
|
@PostMapping("/handleDocument/{docId}")
|
public R handleDocument(@RequestBody List<Long> ids, @PathVariable Long docId) {
|
return customerOrderService.handleDocument(ids, docId);
|
}
|
|
/**
|
* Description: 取消关联工艺文件
|
*
|
* @param: mpsRequirementsDTOList
|
* @return: R
|
*/
|
@ApiOperation(value = "取消绑定工艺文件", notes = "取消绑定工艺文件")
|
@PostMapping("/rejectHandleDocument")
|
public R rejectHandleDocument(@RequestBody List<Long> ids) {
|
return customerOrderService.rejectHandleDocument(ids);
|
}
|
|
/**
|
* 手动修改审核状态
|
*
|
* @param ids id
|
* @param isAudit 状态
|
* @return
|
*/
|
@ApiOperation(value = "状态修改", notes = "状态修改")
|
@PostMapping("/changeAudit/{isAudit}")
|
public R changeAudit(@RequestBody List<Long> ids, @PathVariable("isAudit") String isAudit) {
|
return R.ok(customerOrderService.changeCheckState(ids, isAudit));
|
}
|
|
/**
|
* 标记已计划
|
*
|
* @param ids
|
* @return R
|
*/
|
@ApiOperation(value = "标记已计划", notes = "标记已计划")
|
@SysLog("标记已计划")
|
@PostMapping("/markPlanned/{coState}")
|
public R changeMarkPlanned(@RequestBody List<Long> ids, @PathVariable("coState") String coState) {
|
return R.ok(customerOrderService.changeMarkPlanned(ids, coState));
|
}
|
|
/**
|
* @param response
|
* @param customerOrderExportDTO
|
* @throws IOException
|
*/
|
@GetMapping("/exportCustomerOrderSplit")
|
public void export(HttpServletResponse response, CustomerOrderExportDTO customerOrderExportDTO) throws IOException {
|
customerOrderService.exportCustomerOrderSplit(response, customerOrderExportDTO);
|
}
|
|
/**
|
* 校验箱码和SN对应销售订单是否一致
|
*/
|
@ApiOperation(value = "根据箱码和SN校验对应销售订单是否一致", notes = "根据箱码和SN校验对应销售订单是否一致")
|
@PostMapping("/validatePackageCodeSnCustomerOrder")
|
public R validatePackageCodeSnCustomerOrder(@RequestBody PackagingDTO packagingDTO) {
|
return R.ok(customerOrderService.validatePackageCodeSnCustomerOrder(packagingDTO));
|
}
|
|
/**
|
* 更新订单行说明
|
*
|
* @param customerOrder
|
* @return
|
*/
|
@ApiOperation(value = "更新订单行说明", notes = "更新订单行说明")
|
@SysLog("更新订单行说明")
|
@PostMapping("/updateOrderDescription")
|
public R updateOrderDescription(@RequestBody CustomerOrderDTO customerOrder) {
|
return R.ok(customerOrderService.updateOrderDescription(customerOrder));
|
}
|
|
/**
|
* 自动同步otc订单数据用于定时任务
|
*
|
* @return
|
*/
|
@GetMapping("/otcCustomerOrderSyncAuto")
|
@XxlJob("otcCustomerOrderSyncAutoHandler")
|
public R otcCustomerOrderSyncAuto() {
|
return customerOrderService.otcCustomerOrderSyncAuto();
|
}
|
|
/**
|
* 查询库存件
|
*
|
* @param salesPartDTO
|
* @return
|
*/
|
@ApiOperation(value = "查询库存件", notes = "查询库存件")
|
@SysLog("查询库存件")
|
@PostMapping("/querySalesPartStd")
|
public R querySalesPartStd(@RequestBody SalesPartDTO salesPartDTO) {
|
return customerOrderService.querySalesPartStd(salesPartDTO);
|
}
|
|
/**
|
* 同步ifs行和交货数据
|
*
|
* @param ids
|
* @return R
|
*/
|
@ApiOperation(value = "同步ifs行和交货数据", notes = "同步ifs行和交货数据")
|
@SysLog("同步ifs行和交货数据")
|
@PostMapping("/syncIfsLineNo")
|
public R syncIfsLineNo(@RequestBody List<Long> ids) {
|
return customerOrderService.syncIfsLineNo(ids);
|
}
|
|
/**
|
* 自动同步ifs行和交货数据 用于定时任务
|
*
|
* @return R
|
*/
|
@ApiOperation(value = "自动同步ifs行和交货数据", notes = "自动同步ifs行和交货数据")
|
@SysLog("同步ifs行和交货数据")
|
@PostMapping("/syncIfsLineNoAuto")
|
public R syncIfsLineNoAuto() {
|
return customerOrderService.syncIfsLineNoAuto();
|
}
|
|
/**
|
* OA对接
|
*
|
* @param ids
|
*/
|
@PostMapping("/oa")
|
public R oa(@RequestBody List<Long> ids) {
|
return R.ok().setMsg(customerOrderService.oa(ids));
|
}
|
|
/**
|
* 零件推送到otc
|
*
|
* @param ids
|
*/
|
@PostMapping("/pushotc")
|
public R pushotc(@RequestBody List<Long> ids, @RequestParam("pathCode") String pathCode) {
|
return R.ok(customerOrderService.pushotc(ids, pathCode));
|
}
|
|
|
/**
|
* 下载附件
|
*
|
* @param id
|
* @param response
|
*/
|
@GetMapping("/otcDownload/{id}")
|
public void otcDownload(@PathVariable Long id, HttpServletResponse response) {
|
customerOrderService.otcDownload(id, response);
|
}
|
|
|
/**
|
* @param orderNumber
|
* @return
|
*/
|
@GetMapping("getOtcCustomerOrderFileList")
|
public R getOtcFiles(String orderNumber) {
|
return customerOrderService.getOtcCustomerOrderFileList(orderNumber);
|
}
|
|
|
/**
|
* 导出
|
*
|
* @return
|
*/
|
@ApiOperation(value = "导出", notes = "导出")
|
@GetMapping("/export")
|
public void export(HttpServletResponse response, CustomerOrderDTO planCustomerOrder) throws IOException {
|
customerOrderService.export(response, QueryWrapperUtil.gen(planCustomerOrder));
|
}
|
|
/**
|
* 零件属性查询
|
*
|
* @return
|
*/
|
@ApiOperation(value = "零件属性查询", notes = "零件属性查询")
|
@GetMapping("/queryPartPropertiesStd")
|
public R queryPartPropertiesStd(String key, String value) {
|
return R.ok(customerOrderService.queryPartPropertiesStd(key, value));
|
}
|
|
/**
|
* @param file
|
* @param orderNumber
|
* @param lineNumber
|
* @return
|
*/
|
@PostMapping("/upload")
|
@ApiOperation(value = "上传附件", notes = "上传附件")
|
public R upload(@RequestParam("file") MultipartFile file,
|
@RequestParam("orderNumber") String orderNumber,
|
@RequestParam("lineNumber") String lineNumber) {
|
return customerOrderService.uploadProcessConfigFile(file, orderNumber, lineNumber);
|
}
|
|
/**
|
* @param orderNumber
|
* @param lineNumber
|
* @return
|
*/
|
@GetMapping("/processConfigFiles")
|
@ApiOperation("获取附件上传记录")
|
@Inner(false)
|
public R processConfigFiles(String orderNumber, String lineNumber) {
|
try {
|
orderNumber = URLDecoder.decode(orderNumber, StandardCharsets.UTF_8.name());
|
return R.ok(customerOrderService.getProcessConfigFiles(orderNumber, lineNumber));
|
} catch (UnsupportedEncodingException e) {
|
return R.failed(e.getMessage());
|
}
|
}
|
|
//@PostMapping("/updateRange")
|
//@ApiOperation("修改工艺配置单适用范围")
|
// public R updateRange(@RequestBody OrderProcessConfigFileDTO configFileDTO){
|
// return R.ok(customerOrderService.updateRange(configFileDTO.getId() , configFileDTO.getEffectiveRange()));
|
//}
|
|
/**
|
* @param fileAssociatedOrderDTO
|
* @return
|
*/
|
@PostMapping("/fileAssociatedOrder")
|
@ApiOperation("工艺配置单关联销售订单")
|
public R fileAssociatedOrder(@RequestBody FileAssociatedOrderDTO fileAssociatedOrderDTO) {
|
return R.ok(customerOrderService.fileAssociatedOrder(fileAssociatedOrderDTO));
|
}
|
|
/**
|
* @param id
|
* @return
|
*/
|
@GetMapping("/processConfigMapping")
|
@ApiOperation("获取当前工艺配置单适用销售订单")
|
public R processConfigMapping(@RequestParam("id") Long id) {
|
return R.ok(customerOrderService.processConfigMapping(id));
|
}
|
|
/**
|
* @param bucket
|
* @param fileName
|
* @param response
|
*/
|
@PostMapping("/processConfig/{bucket}/{fileName}")
|
@Inner(false)
|
public void file(@PathVariable String bucket, @PathVariable String fileName, HttpServletResponse response) {
|
customerOrderService.getFile(bucket, fileName, response);
|
}
|
|
/**
|
* @param id
|
* @return
|
*/
|
@DeleteMapping("/processConfigFile/{id}")
|
public R processConfigFile(@PathVariable Long id) {
|
return customerOrderService.deleteProcessConfigFile(id);
|
}
|
|
/**
|
* 新工艺配置单批量新增(接口停用)
|
*
|
* @param processConfigDTO
|
* @return R
|
*/
|
@ApiOperation(value = "新工艺配置单批量新增(接口停用)", notes = "新工艺配置单批量新增(接口停用)")
|
@SysLog("新工艺配置单批量新增(接口停用)")
|
@PostMapping("/processConfig")
|
public R saveProcessConfig(@RequestBody ProcessConfigDTO processConfigDTO) {
|
return R.ok(processConfigService.fullSave(processConfigDTO));
|
}
|
|
|
/**
|
* 新工艺配置单单条新增
|
*
|
* @param processConfigDTO
|
* @return R
|
*/
|
@ApiOperation(value = "新工艺配置单单条新增", notes = "新工艺配置单单条新增")
|
@SysLog("新工艺配置单单条新增")
|
@PostMapping("/oneProcessConfig")
|
public R saveOneProcessConfig(@RequestBody ProcessConfigDTO processConfigDTO) {
|
return R.ok(processConfigService.saveOneProcessConfig(processConfigDTO));
|
}
|
|
|
/**
|
* 新工艺配置单单条编辑
|
*
|
* @param processConfigDTO
|
* @return R
|
*/
|
@ApiOperation(value = "新工艺配置单单条编辑", notes = "新工艺配置单单条编辑")
|
@SysLog("新工艺配置单单条编辑")
|
@PutMapping("/oneProcessConfig")
|
public R updateOneProcessConfig(@RequestBody ProcessConfigDTO processConfigDTO) {
|
return R.ok(processConfigService.updateById(processConfigDTO));
|
}
|
|
/**
|
* 新工艺配置单应用至所选订单行
|
*
|
* @param processConfigDTO
|
* @return R
|
*/
|
@ApiOperation(value = "新工艺配置单应用至所选订单行", notes = "新工艺配置单应用至所选订单行")
|
@SysLog("新工艺配置单应用至所选订单行")
|
@PutMapping("/processConfig")
|
public R updateProcessConfig(@RequestBody ProcessConfigDTO processConfigDTO) {
|
return R.ok(processConfigService.updateBatch(processConfigDTO));
|
}
|
|
/**
|
* 新工艺配置单删除
|
*
|
* @param id
|
* @return R
|
*/
|
@ApiOperation(value = "新工艺配置单删除", notes = "新工艺配置单删除")
|
@SysLog("新工艺配置单删除")
|
@DeleteMapping("/processConfig/{id}")
|
public R deleteProcessConfig(@PathVariable Long id) {
|
return R.ok(processConfigService.deleteById(id));
|
}
|
|
/**
|
* 通过订单编号和行号查询工艺配置单
|
*
|
* @param orderNo
|
* @param otcLineNo
|
* @return R
|
*/
|
@ApiOperation(value = "通过订单编号和行号查询工艺配置单", notes = "通过订单编号和行号查询工艺配置单")
|
@SysLog("通过订单编号和行号查询工艺配置单")
|
@GetMapping("/processConfig/getByOrderNoAndOtcNo")
|
@Inner(value = false)
|
public R getByOrderNoAndOtcNo(@RequestParam("orderNo") String orderNo, @RequestParam("otcLineNo") String otcLineNo) {
|
try {
|
orderNo = URLDecoder.decode(orderNo, StandardCharsets.UTF_8.name());
|
return R.ok(processConfigService.getByOrderNoAndOtcNo(orderNo, otcLineNo));
|
} catch (Exception e) {
|
return R.failed(e.getMessage());
|
}
|
}
|
|
/**
|
* 通过销售订单id查询工艺配置单
|
*
|
* @param id
|
* @return R
|
*/
|
@ApiOperation(value = "通过销售订单id查询工艺配置单", notes = "通过销售订单id查询工艺配置单")
|
@SysLog("通过销售订单id查询工艺配置单")
|
@GetMapping("/processConfig/{id}")
|
public R getProcessConfigByOrderId(@PathVariable Long id) {
|
return R.ok(processConfigService.getProcessConfig(id));
|
|
}
|
|
/**
|
* 工艺配置单分页查询
|
*
|
* @param page 分页对象
|
* @param processConfigDTO 工艺配置单
|
* @return
|
*/
|
@ApiOperation(value = "工艺配置单分页查询", notes = "工艺配置单分页查询")
|
@GetMapping("/getProcessConfigPage")
|
public R getProcessConfigPage(Page page, ProcessConfigDTO processConfigDTO) {
|
return R.ok(processConfigService.getProcessConfigPage(page, QueryWrapperUtil.gen(processConfigDTO)));
|
}
|
|
/**
|
* OA流程审核
|
*
|
* @param ids
|
* @return
|
*/
|
@ApiOperation(value = "OA流程审核", notes = "OA流程审核")
|
@PostMapping("/checkOA")
|
@Inner(false)
|
public R checkOA(@RequestBody List<Long> ids) {
|
return customerOrderService.checkOA(ids);
|
}
|
|
/**
|
* 查询OA工艺详情页面
|
*
|
* @param ids
|
* @return
|
*/
|
@ApiOperation(value = "查询OA工艺详情页面", notes = "查询OA工艺详情页面")
|
@PostMapping("OA/getOADetailDTO")
|
@Inner(false)
|
public R getOADetailDTOPage(@RequestBody List<Long> ids) {
|
return R.ok(customerOrderService.getOADetailDTO(ids));
|
}
|
|
/**
|
* 查询OA工艺附件
|
*
|
* @param customerOrderNo
|
* @return
|
*/
|
@ApiOperation(value = "查询OA工艺附件", notes = "查询OA工艺附件")
|
@GetMapping("OA/getProcessConfigFiles")
|
@Inner(false)
|
public R getProcessConfigFiles(String customerOrderNo) {
|
return customerOrderService.getProcessConfigFiles(customerOrderNo);
|
}
|
|
/**
|
* 查询OA工艺结构
|
*
|
* @param technologyDocumentId
|
* @return
|
*/
|
@ApiOperation(value = "查询OA工艺结构", notes = "查询OA工艺结构")
|
@GetMapping("OA/getTechnologyDocument")
|
@Inner(false)
|
public R getTechnologyDocument(Long technologyDocumentId) {
|
return customerOrderService.getTechnologyDocument(technologyDocumentId);
|
}
|
|
/**
|
* 查询OA工艺文件结构图
|
*
|
* @param technologyDocumentId
|
* @return
|
*/
|
@ApiOperation(value = "查询OA工艺文件结构图", notes = "查询OA工艺文件结构图")
|
@GetMapping("OA/getDocumentJgt")
|
@Inner(false)
|
public R getDocumentJgt(Long technologyDocumentId) {
|
return customerOrderService.getDocumentJgt(technologyDocumentId);
|
}
|
|
|
/**
|
* 通过id查询完整bom树
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "通过id查询完整bom树", notes = "通过id查询完整bom树")
|
@GetMapping("OA/getBom/{id}")
|
@Inner(false)
|
public R getBomById(@PathVariable("id") Long id) {
|
return R.ok(bomService.getBomDtoById(id));
|
}
|
|
|
/**
|
* 通过id查询工序参数
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "通过id查询工序参数", notes = "通过id查询工序参数")
|
@GetMapping("OA/getRouting/{id}")
|
@Inner(false)
|
public R getRoutingById(@PathVariable("id") Long id) {
|
return R.ok(routingService.getRoutingById(id));
|
}
|
|
|
/**
|
* 查询模板与参数
|
*
|
* @param routingOperationId
|
* @return
|
*/
|
@ApiOperation(value = "查询模板与参数", notes = "查询模板与参数")
|
@GetMapping("OA/templateAndParam/{routingOperationId}")
|
@Inner(false)
|
public R getOperationTemplateAndParam(@PathVariable Long routingOperationId) {
|
return routingService.getOperationTemplateAndParam(routingOperationId);
|
}
|
|
/**
|
* 根据工艺文件-工艺路线-工序id查询检测标准
|
*
|
* @param docBomId 工艺文件与BOM关系表id
|
* @param routingOperationId 工艺工序id
|
* @return
|
*/
|
@ApiOperation(value = "根据工艺文件-工艺路线-查询检测标准", notes = "传参:工艺文件与BOM关系表id&工序id")
|
@GetMapping("oa/qryDocTestStandard")
|
@Inner(false)
|
public R qryDocTestStandard(@RequestParam("docBomId") Long docBomId, @RequestParam("routingOperationId") Long
|
routingOperationId) {
|
return documentService.qryDocTestStandard(docBomId, routingOperationId);
|
}
|
|
/**
|
* OA下载otc附件
|
*
|
* @param id
|
* @param response
|
*/
|
@ApiOperation(value = "OA下载otc附件", notes = "OA下载otc附件")
|
@GetMapping("oa/otcDownload/{id}")
|
@Inner(false)
|
public void otcDownloadByOA(@PathVariable Long id, HttpServletResponse response) {
|
customerOrderService.otcDownload(id, response);
|
}
|
|
/**
|
* OA查询otc附件
|
*
|
* @param orderNumber
|
* @return
|
*/
|
@ApiOperation(value = "OA查询otc附件", notes = "OA查询otc附件")
|
@GetMapping("oa/getOtcCustomerOrderFileList")
|
@Inner(false)
|
public R getOaOtcFiles(String orderNumber) {
|
return customerOrderService.getOtcCustomerOrderFileList(orderNumber);
|
}
|
|
/**
|
* 根据工艺id和工序id获取复制的检测标准
|
*
|
* @param manufacturingOrderDTO 制造订单表
|
* @return
|
*/
|
@ApiOperation(value = "根据工艺id和工序id获取复制的检测标准", notes = "根据工艺id和工序id获取复制的检测标准")
|
@GetMapping("oa/getRoutingTestStandardList")
|
@Inner(false)
|
public R getRoutingTestStandardList(ManufacturingOrderDTO manufacturingOrderDTO) {
|
return R.ok(moTestStandardService.getRoutingTestStandardList(manufacturingOrderDTO));
|
}
|
|
/**
|
* 根据工序检测标准id获取检测标准参数
|
*
|
* @param moTestStandardParam 检测标准参数
|
* @return
|
*/
|
@ApiOperation(value = "根据工序检测标准id获取检测标准参数", notes = "根据工序检测标准id获取检测标准参数")
|
@GetMapping("oa/getOperationTestStandardParam")
|
@Inner(false)
|
public R getOperationTestStandardParam(MoTestStandardParam moTestStandardParam) {
|
return R.ok(moTestStandardParamService.list(Wrappers.query(moTestStandardParam).orderByAsc("index")));
|
}
|
|
/**
|
* 查询
|
*
|
* @param testStandardParam 检测标准参数
|
* @return
|
*/
|
@ApiOperation(value = "查询", notes = "查询")
|
@GetMapping("oa/testStandardParam/list")
|
@Inner(false)
|
public R getQualityTestStandardParamList(TestStandardParam testStandardParam) {
|
return R.ok(testStandardParamService.list(QueryWrapperUtil.gen(testStandardParam)));
|
}
|
|
/**
|
* 根据工艺文件-工艺路线-工序-检测标准id查询检测参数明细
|
*
|
* @param standardId 检测标准id
|
* @return
|
*/
|
@ApiOperation(value = "根据工艺文件-工艺路线-工序-查询检测参数明细", notes = "传参:检测标准id")
|
@GetMapping("oa/qryDocTestStandardDetailsByStandardId")
|
@Inner(false)
|
public R qryDocTestStandardDetailsByStandardId(@RequestParam("standardId") Long standardId) {
|
return documentService.qryDocTestStandardDetailsByStandardId(standardId);
|
}
|
|
/**
|
* 通过字典类型查找字典
|
*
|
* @param type 类型
|
* @return 同类型字典
|
*/
|
@GetMapping("dict/type/{type}")
|
@Cacheable(value = CacheConstants.DICT_DETAILS, key = "#type", unless = "#result.data.isEmpty()")
|
@Inner(false)
|
public R getDictByType(@PathVariable String type) {
|
return R.ok(sysDictItemService.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getType, type).orderByAsc(SysDictItem::getSort)));
|
}
|
|
/**
|
* 销售订单行状态为零件待选,则发送消息
|
*/
|
@GetMapping("sendWxMsgAuto")
|
@XxlJob("sendWxMsgAutoHandler")
|
public R sendWxMsgAuto() {
|
customerOrderService.sendWxMsgAuto();
|
return R.ok();
|
}
|
|
/**
|
* 同步更新工艺配置单订单行待选列表
|
*
|
* @param customerOrderNo
|
* @param id
|
* @return R
|
*/
|
@ApiOperation(value = "同步更新工艺配置单订单行待选列表", notes = "同步更新工艺配置单订单行待选列表")
|
@SysLog("同步更新工艺配置单订单行待选列表")
|
@GetMapping("/getBeSelectedLineNoList")
|
public R getBeSelectedLineNoList(@RequestParam String customerOrderNo, @RequestParam Long id) {
|
return R.ok(customerOrderService.getBeSelectedLineNoList(customerOrderNo, id));
|
|
}
|
|
/**
|
* 订单退回
|
*/
|
@ApiOperation(value = "订单退回", notes = "订单退回")
|
@PostMapping("/returnOrder")
|
@PreAuthorize("@pms.hasPermission('plan_customerorder_return')")
|
public R returnOrder(@RequestBody CustomerOrderDTO customerOrderDTO) {
|
return R.ok(customerOrderService.returnOrder(customerOrderDTO));
|
}
|
|
/**
|
* 获取已审核的订单号
|
*
|
* @param customerOrderNo
|
* @param page
|
*/
|
@ApiOperation(value = "获取已审核的订单号", notes = "获取已审核的订单号")
|
@GetMapping("/getAuditedOrderNoList")
|
public R getAuditedOrderNoPage(String customerOrderNo, Page page) {
|
return R.ok(customerOrderService.getAuditedOrderNoPage(customerOrderNo, page));
|
}
|
}
|