mes上位机接口迁移scada
parent
5bb40f28e5
commit
749c2cf67d
@ -0,0 +1,186 @@
|
||||
package com.op.quality.controller;
|
||||
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import com.op.quality.domain.QcBomComponent;
|
||||
import com.op.quality.domain.QcCheckReportIncome;
|
||||
import com.op.quality.domain.QcCheckTaskDetail;
|
||||
import com.op.quality.domain.QcSupplier;
|
||||
import com.op.quality.service.IQcCheckReportProduceService;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 来料检验Controller
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qcProduceReport")
|
||||
public class QcCheckReportProduceController extends BaseController {
|
||||
@Autowired
|
||||
private IQcCheckReportProduceService qcCheckReportProduceService;
|
||||
|
||||
/**
|
||||
* 查询来料检验列表
|
||||
*/
|
||||
@RequiresPermissions("quality:produceReport:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) {
|
||||
|
||||
//默认时间范围T 00:00:00~T+1 00:00:00
|
||||
/*if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
|
||||
qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
|
||||
LocalDate date = LocalDate.now();
|
||||
LocalDate dateEnd = date.plusDays(1);
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
|
||||
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
|
||||
}*/
|
||||
|
||||
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
|
||||
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
|
||||
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
|
||||
// }
|
||||
|
||||
startPage();
|
||||
List<QcCheckReportIncome> list = qcCheckReportProduceService.selectQcCheckReportIncomeList(qcCheckReportIncome);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出来料检验列表
|
||||
*/
|
||||
@RequiresPermissions("quality:produceReport:export")
|
||||
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
|
||||
|
||||
//默认时间范围T 00:00:00~T+1 00:00:00
|
||||
if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
|
||||
qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
|
||||
LocalDate date = LocalDate.now();
|
||||
LocalDate dateEnd = date.plusDays(1);
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
|
||||
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
|
||||
}
|
||||
|
||||
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
|
||||
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
|
||||
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
|
||||
// }
|
||||
|
||||
List<QcCheckReportIncome> list = qcCheckReportProduceService.selectQcCheckReportIncomeList(qcCheckReportIncome);
|
||||
ExcelUtil<QcCheckReportIncome> util = new ExcelUtil<QcCheckReportIncome>(QcCheckReportIncome.class);
|
||||
util.exportExcel(response, list, "来料检验数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取来料检验详细信息
|
||||
*/
|
||||
@RequiresPermissions("quality:produceReport:query")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
|
||||
return success(qcCheckReportProduceService.selectQcCheckReportIncomeByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验
|
||||
*/
|
||||
@RequiresPermissions("quality:produceReport:add")
|
||||
@Log(title = "来料检验", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
|
||||
int r = qcCheckReportProduceService.insertQcCheckReportIncome(qcCheckReportIncome);
|
||||
if(r>0){
|
||||
return toAjax(r);
|
||||
}
|
||||
return error("添加失败:请检查物料的关联检测项");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验
|
||||
*/
|
||||
@RequiresPermissions("quality:produceReport:edit")
|
||||
@Log(title = "来料检验", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
|
||||
return toAjax(qcCheckReportProduceService.updateQcCheckReportIncome(qcCheckReportIncome));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验
|
||||
*/
|
||||
@RequiresPermissions("quality:produceReport:remove")
|
||||
@Log(title = "来料检验", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable String[] recordIds) {
|
||||
return toAjax(qcCheckReportProduceService.deleteQcCheckReportIncomeByRecordIds(recordIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BOM物料管理列表
|
||||
*/
|
||||
@GetMapping("/getQcListBom")
|
||||
public TableDataInfo getQcListBom(QcBomComponent bomComponent) {
|
||||
startPage();
|
||||
List<QcBomComponent> list = qcCheckReportProduceService.getQcListBom(bomComponent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询供应商列表
|
||||
*/
|
||||
@GetMapping("/getQcListSupplier")
|
||||
public TableDataInfo getQcListSupplier(QcSupplier qcSupplier) {
|
||||
startPage();
|
||||
List<QcSupplier> list = qcCheckReportProduceService.getQcListSupplier(qcSupplier);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询人员列表
|
||||
*/
|
||||
@GetMapping("/getQcListUser")
|
||||
public TableDataInfo getQcListUser(SysUser sysUser) {
|
||||
startPage();
|
||||
List<SysUser> list = qcCheckReportProduceService.getQcListUser(sysUser);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PutMapping("/changeIncomeStatus")
|
||||
public AjaxResult changeIncomeStatus(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
|
||||
qcCheckReportIncome.setUpdateBy(SecurityUtils.getUsername());
|
||||
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(qcCheckReportProduceService.updateIncomeStatus(qcCheckReportIncome));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检验项目弹窗列表
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getCkeckProjectList")
|
||||
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
|
||||
startPage();
|
||||
List<QcCheckTaskDetail> list = qcCheckReportProduceService.getCkeckProjectList(qcCheckTaskDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,186 @@
|
||||
package com.op.quality.controller;
|
||||
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import com.op.quality.domain.QcBomComponent;
|
||||
import com.op.quality.domain.QcCheckReportIncome;
|
||||
import com.op.quality.domain.QcCheckTaskDetail;
|
||||
import com.op.quality.domain.QcSupplier;
|
||||
import com.op.quality.service.IQcCheckReportProductService;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 来料检验Controller
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qcProductReport")
|
||||
public class QcCheckReportProductController extends BaseController {
|
||||
@Autowired
|
||||
private IQcCheckReportProductService qcCheckReportProductService;
|
||||
|
||||
/**
|
||||
* 查询来料检验列表
|
||||
*/
|
||||
@RequiresPermissions("quality:productReport:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) {
|
||||
|
||||
//默认时间范围T 00:00:00~T+1 00:00:00
|
||||
/*if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
|
||||
qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
|
||||
LocalDate date = LocalDate.now();
|
||||
LocalDate dateEnd = date.plusDays(1);
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
|
||||
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
|
||||
}*/
|
||||
|
||||
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
|
||||
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
|
||||
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
|
||||
// }
|
||||
|
||||
startPage();
|
||||
List<QcCheckReportIncome> list = qcCheckReportProductService.selectQcCheckReportIncomeList(qcCheckReportIncome);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出来料检验列表
|
||||
*/
|
||||
@RequiresPermissions("quality:productReport:export")
|
||||
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
|
||||
|
||||
//默认时间范围T 00:00:00~T+1 00:00:00
|
||||
if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
|
||||
qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
|
||||
LocalDate date = LocalDate.now();
|
||||
LocalDate dateEnd = date.plusDays(1);
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
|
||||
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
|
||||
}
|
||||
|
||||
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
|
||||
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
|
||||
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
|
||||
// }
|
||||
|
||||
List<QcCheckReportIncome> list = qcCheckReportProductService.selectQcCheckReportIncomeList(qcCheckReportIncome);
|
||||
ExcelUtil<QcCheckReportIncome> util = new ExcelUtil<QcCheckReportIncome>(QcCheckReportIncome.class);
|
||||
util.exportExcel(response, list, "来料检验数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取来料检验详细信息
|
||||
*/
|
||||
@RequiresPermissions("quality:productReport:query")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
|
||||
return success(qcCheckReportProductService.selectQcCheckReportIncomeByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验
|
||||
*/
|
||||
@RequiresPermissions("quality:productReport:add")
|
||||
@Log(title = "来料检验", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
|
||||
int r = qcCheckReportProductService.insertQcCheckReportIncome(qcCheckReportIncome);
|
||||
if(r>0){
|
||||
return toAjax(r);
|
||||
}
|
||||
return error("添加失败:请检查物料的关联检测项");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验
|
||||
*/
|
||||
@RequiresPermissions("quality:productReport:edit")
|
||||
@Log(title = "来料检验", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
|
||||
return toAjax(qcCheckReportProductService.updateQcCheckReportIncome(qcCheckReportIncome));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验
|
||||
*/
|
||||
@RequiresPermissions("quality:productReport:remove")
|
||||
@Log(title = "来料检验", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable String[] recordIds) {
|
||||
return toAjax(qcCheckReportProductService.deleteQcCheckReportIncomeByRecordIds(recordIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BOM物料管理列表
|
||||
*/
|
||||
@GetMapping("/getQcListBom")
|
||||
public TableDataInfo getQcListBom(QcBomComponent bomComponent) {
|
||||
startPage();
|
||||
List<QcBomComponent> list = qcCheckReportProductService.getQcListBom(bomComponent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询供应商列表
|
||||
*/
|
||||
@GetMapping("/getQcListSupplier")
|
||||
public TableDataInfo getQcListSupplier(QcSupplier qcSupplier) {
|
||||
startPage();
|
||||
List<QcSupplier> list = qcCheckReportProductService.getQcListSupplier(qcSupplier);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询人员列表
|
||||
*/
|
||||
@GetMapping("/getQcListUser")
|
||||
public TableDataInfo getQcListUser(SysUser sysUser) {
|
||||
startPage();
|
||||
List<SysUser> list = qcCheckReportProductService.getQcListUser(sysUser);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PutMapping("/changeIncomeStatus")
|
||||
public AjaxResult changeIncomeStatus(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
|
||||
qcCheckReportIncome.setUpdateBy(SecurityUtils.getUsername());
|
||||
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(qcCheckReportProductService.updateIncomeStatus(qcCheckReportIncome));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检验项目弹窗列表
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getCkeckProjectList")
|
||||
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
|
||||
startPage();
|
||||
List<QcCheckTaskDetail> list = qcCheckReportProductService.getCkeckProjectList(qcCheckTaskDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.op.quality.service;
|
||||
|
||||
import com.op.quality.domain.QcBomComponent;
|
||||
import com.op.quality.domain.QcCheckReportIncome;
|
||||
import com.op.quality.domain.QcCheckTaskDetail;
|
||||
import com.op.quality.domain.QcSupplier;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产过程报告Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-19
|
||||
*/
|
||||
public interface IQcCheckReportProduceService {
|
||||
/**
|
||||
* 查询生产过程报告
|
||||
*
|
||||
* @param recordId 生产过程报告主键
|
||||
* @return 生产过程检验
|
||||
*/
|
||||
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询生产过程报告列表
|
||||
*
|
||||
* @param qcCheckReportIncome 生产过程报告
|
||||
* @return 生产过程检验集合
|
||||
*/
|
||||
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
/**
|
||||
* 新增生产过程报告
|
||||
*
|
||||
* @param qcCheckReportIncome 生产过程报告
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
/**
|
||||
* 修改生产过程报告
|
||||
*
|
||||
* @param qcCheckReportIncome 生产过程报告
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
/**
|
||||
* 批量删除生产过程报告
|
||||
*
|
||||
* @param recordIds 需要删除的生产过程报告主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除生产过程报告信息
|
||||
*
|
||||
* @param recordId 生产过程报告主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckReportIncomeByRecordId(String recordId);
|
||||
|
||||
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent);
|
||||
|
||||
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier);
|
||||
|
||||
public List<SysUser> getQcListUser(SysUser sysUser);
|
||||
|
||||
int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
|
||||
|
||||
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome);
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.op.quality.service;
|
||||
|
||||
import com.op.quality.domain.QcBomComponent;
|
||||
import com.op.quality.domain.QcCheckReportIncome;
|
||||
import com.op.quality.domain.QcCheckTaskDetail;
|
||||
import com.op.quality.domain.QcSupplier;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 成品入库报告Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-19
|
||||
*/
|
||||
public interface IQcCheckReportProductService {
|
||||
/**
|
||||
* 查询成品入库报告
|
||||
*
|
||||
* @param recordId 成品入库报告主键
|
||||
* @return 成品入库检验
|
||||
*/
|
||||
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询成品入库报告列表
|
||||
*
|
||||
* @param qcCheckReportIncome 成品入库报告
|
||||
* @return 成品入库检验集合
|
||||
*/
|
||||
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
/**
|
||||
* 新增成品入库报告
|
||||
*
|
||||
* @param qcCheckReportIncome 成品入库报告
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
/**
|
||||
* 修改成品入库报告
|
||||
*
|
||||
* @param qcCheckReportIncome 成品入库报告
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
/**
|
||||
* 批量删除成品入库报告
|
||||
*
|
||||
* @param recordIds 需要删除的成品入库报告主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除成品入库报告信息
|
||||
*
|
||||
* @param recordId 成品入库报告主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckReportIncomeByRecordId(String recordId);
|
||||
|
||||
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent);
|
||||
|
||||
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier);
|
||||
|
||||
public List<SysUser> getQcListUser(SysUser sysUser);
|
||||
|
||||
int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome);
|
||||
|
||||
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
|
||||
|
||||
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome);
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
package com.op.quality.service.serviceImpl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import com.op.quality.domain.*;
|
||||
import com.op.quality.mapper.QcCheckReportIncomeMapper;
|
||||
import com.op.quality.mapper.QcCheckTaskDetailMapper;
|
||||
import com.op.quality.mapper.QcCheckTypeProjectMapper;
|
||||
import com.op.quality.mapper.QcMaterialGroupDetailMapper;
|
||||
import com.op.quality.service.IQcCheckReportProduceService;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 来料检验Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-19
|
||||
*/
|
||||
@Service
|
||||
public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceService {
|
||||
@Autowired
|
||||
private QcCheckReportIncomeMapper qcCheckReportIncomeMapper;
|
||||
|
||||
@Autowired
|
||||
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
|
||||
|
||||
@Autowired
|
||||
private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper;
|
||||
|
||||
@Autowired
|
||||
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询来料检验
|
||||
*
|
||||
* @param recordId 来料检验主键
|
||||
* @return 来料检验
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) {
|
||||
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询来料检验列表
|
||||
*
|
||||
* @param qcCheckReportIncome 来料检验
|
||||
* @return 来料检验
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome) {
|
||||
qcCheckReportIncome.setDelFlag("0");
|
||||
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验
|
||||
*
|
||||
* @param qcCheckReportIncome 来料检验
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
|
||||
|
||||
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
|
||||
int liushuiNum = qcCheckReportIncomeMapper.getTodayMaxNum(qcCheckReportIncome);
|
||||
String liushuiStr = String.format("%04d", liushuiNum);
|
||||
|
||||
String createBy = SecurityUtils.getUsername();
|
||||
Date nowDate= DateUtils.getNowDate();
|
||||
//获取当前所选工厂
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
String key = "#header.poolName";
|
||||
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
|
||||
|
||||
qcCheckReportIncome.setCheckNo(bpDD+liushuiStr);
|
||||
|
||||
/**qc_check_task_income**/
|
||||
String beLongId = IdUtils.fastSimpleUUID();
|
||||
qcCheckReportIncome.setRecordId(beLongId);
|
||||
qcCheckReportIncome.setFactoryCode(factoryCode);
|
||||
qcCheckReportIncome.setCreateTime(nowDate);
|
||||
qcCheckReportIncomeMapper.insertQcCheckReportIncome(qcCheckReportIncome);
|
||||
|
||||
/**取检测项**/
|
||||
QcCheckTypeProject qctp= new QcCheckTypeProject();
|
||||
qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验
|
||||
qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性
|
||||
/**qc_check_type_project**/
|
||||
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
|
||||
if(CollectionUtils.isEmpty(items)){
|
||||
/**qc_material_group_detail**/
|
||||
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode());
|
||||
if(group == null){
|
||||
return 0;//没有找到检测项目
|
||||
}
|
||||
qctp.setGroupId(group.getGroupId());//共性
|
||||
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
|
||||
}
|
||||
|
||||
/**qc_check_task_detail**/
|
||||
if(CollectionUtils.isEmpty(items)){
|
||||
return 0;//没有找到检测项目
|
||||
}
|
||||
|
||||
for(QcCheckTaskDetail item:items){
|
||||
item.setRecordId(IdUtils.fastSimpleUUID());
|
||||
item.setBelongTo(beLongId);
|
||||
item.setCreateTime(nowDate);
|
||||
item.setCreateBy(createBy);
|
||||
item.setFactoryCode(factoryCode);
|
||||
item.setStatus("N");
|
||||
}
|
||||
return qcCheckTaskDetailMapper.addBatch(items);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验
|
||||
*
|
||||
* @param qcCheckReportIncome 来料检验
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
|
||||
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
|
||||
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除来料检验
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds) {
|
||||
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验信息
|
||||
*
|
||||
* @param recordId 来料检验主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcCheckReportIncomeByRecordId(String recordId) {
|
||||
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent) {
|
||||
return qcCheckReportIncomeMapper.getQcListBom(bomComponent);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier) {
|
||||
return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier);
|
||||
}
|
||||
|
||||
//在公共库里不需要切库
|
||||
@Override
|
||||
public List<SysUser> getQcListUser(SysUser sysUser) {
|
||||
return qcCheckReportIncomeMapper.getQcListUser(sysUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome) {
|
||||
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
|
||||
return qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
package com.op.quality.service.serviceImpl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import com.op.quality.domain.*;
|
||||
import com.op.quality.mapper.QcCheckReportIncomeMapper;
|
||||
import com.op.quality.mapper.QcCheckTaskDetailMapper;
|
||||
import com.op.quality.mapper.QcCheckTypeProjectMapper;
|
||||
import com.op.quality.mapper.QcMaterialGroupDetailMapper;
|
||||
import com.op.quality.service.IQcCheckReportProductService;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 来料检验Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-19
|
||||
*/
|
||||
@Service
|
||||
public class QcCheckReportProductServiceImpl implements IQcCheckReportProductService {
|
||||
@Autowired
|
||||
private QcCheckReportIncomeMapper qcCheckReportIncomeMapper;
|
||||
|
||||
@Autowired
|
||||
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
|
||||
|
||||
@Autowired
|
||||
private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper;
|
||||
|
||||
@Autowired
|
||||
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询来料检验
|
||||
*
|
||||
* @param recordId 来料检验主键
|
||||
* @return 来料检验
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) {
|
||||
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询来料检验列表
|
||||
*
|
||||
* @param qcCheckReportIncome 来料检验
|
||||
* @return 来料检验
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome) {
|
||||
qcCheckReportIncome.setDelFlag("0");
|
||||
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验
|
||||
*
|
||||
* @param qcCheckReportIncome 来料检验
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
|
||||
|
||||
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
|
||||
int liushuiNum = qcCheckReportIncomeMapper.getTodayMaxNum(qcCheckReportIncome);
|
||||
String liushuiStr = String.format("%04d", liushuiNum);
|
||||
|
||||
String createBy = SecurityUtils.getUsername();
|
||||
Date nowDate= DateUtils.getNowDate();
|
||||
//获取当前所选工厂
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
String key = "#header.poolName";
|
||||
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
|
||||
|
||||
qcCheckReportIncome.setCheckNo(bpDD+liushuiStr);
|
||||
|
||||
/**qc_check_task_income**/
|
||||
String beLongId = IdUtils.fastSimpleUUID();
|
||||
qcCheckReportIncome.setRecordId(beLongId);
|
||||
qcCheckReportIncome.setFactoryCode(factoryCode);
|
||||
qcCheckReportIncome.setCreateTime(nowDate);
|
||||
qcCheckReportIncomeMapper.insertQcCheckReportIncome(qcCheckReportIncome);
|
||||
|
||||
/**取检测项**/
|
||||
QcCheckTypeProject qctp= new QcCheckTypeProject();
|
||||
qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验
|
||||
qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性
|
||||
/**qc_check_type_project**/
|
||||
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
|
||||
if(CollectionUtils.isEmpty(items)){
|
||||
/**qc_material_group_detail**/
|
||||
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode());
|
||||
if(group == null){
|
||||
return 0;//没有找到检测项目
|
||||
}
|
||||
qctp.setGroupId(group.getGroupId());//共性
|
||||
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
|
||||
}
|
||||
|
||||
/**qc_check_task_detail**/
|
||||
if(CollectionUtils.isEmpty(items)){
|
||||
return 0;//没有找到检测项目
|
||||
}
|
||||
|
||||
for(QcCheckTaskDetail item:items){
|
||||
item.setRecordId(IdUtils.fastSimpleUUID());
|
||||
item.setBelongTo(beLongId);
|
||||
item.setCreateTime(nowDate);
|
||||
item.setCreateBy(createBy);
|
||||
item.setFactoryCode(factoryCode);
|
||||
item.setStatus("N");
|
||||
}
|
||||
return qcCheckTaskDetailMapper.addBatch(items);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验
|
||||
*
|
||||
* @param qcCheckReportIncome 来料检验
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
|
||||
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
|
||||
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除来料检验
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds) {
|
||||
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验信息
|
||||
*
|
||||
* @param recordId 来料检验主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcCheckReportIncomeByRecordId(String recordId) {
|
||||
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent) {
|
||||
return qcCheckReportIncomeMapper.getQcListBom(bomComponent);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier) {
|
||||
return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier);
|
||||
}
|
||||
|
||||
//在公共库里不需要切库
|
||||
@Override
|
||||
public List<SysUser> getQcListUser(SysUser sysUser) {
|
||||
return qcCheckReportIncomeMapper.getQcListUser(sysUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome) {
|
||||
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
|
||||
return qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.op.scada.mapper;
|
||||
|
||||
import com.op.system.api.domain.mes.ProRfidProcessDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产rfid流程Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScadaMapper {
|
||||
|
||||
public ProRfidProcessDetail getRfidInfo(String rfidNo);
|
||||
|
||||
public String getStationType(String equipmentCode);
|
||||
|
||||
Integer getEquipNum(String machineCode);
|
||||
|
||||
String getEquipStatus(String machineCode);
|
||||
|
||||
String getEquipMode(String machineCode);
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.op.scada.service;
|
||||
|
||||
import com.op.system.api.domain.dto.WCSDTO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-07-13
|
||||
*/
|
||||
public interface ScadaService {
|
||||
|
||||
WCSDTO requestDestinationStations(WCSDTO wcsdto);
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.op.scada.mapper.ScadaMapper">
|
||||
|
||||
<!--获取在邦rfid 工单的信息-->
|
||||
<select id="getRfidInfo" resultType="com.op.system.api.domain.mes.ProRfidProcessDetail">
|
||||
select
|
||||
top 1
|
||||
rfid.workorder_code workorderCode,
|
||||
rfid.now_process_id nowProcessId,
|
||||
rfid.next_process_id nextProcessId,
|
||||
p.equipment machineCode,
|
||||
bp.product_code productCode,
|
||||
bp.product_model productModel,
|
||||
w.prod_line_code prodLineCode
|
||||
from pro_rfid_process_detail rfid
|
||||
left join pro_process p on p.process_id = rfid.next_process_id
|
||||
left join pro_order_workorder w on w.workorder_code = rfid.workorder_code
|
||||
left join base_product bp on bp.product_code = w.product_code
|
||||
where rfid.bind_status = '1'
|
||||
and rfid.rfid = #{rfidNo}
|
||||
order by rfid.create_time desc
|
||||
</select>
|
||||
<select id="getStationType" resultType="java.lang.String">
|
||||
select
|
||||
case when equipment_type_code ='equ_type_spj' then '3'
|
||||
when equipment_type_code ='equ_type_hf' then '2'
|
||||
else '' end
|
||||
from base_equipment
|
||||
where equipment_code = #{equipmentCode}
|
||||
</select>
|
||||
|
||||
<select id="getEquipNum" resultType="java.lang.Integer">
|
||||
select isvalue from base_equipment_attached
|
||||
where property = 'dollyNumber'
|
||||
and device_code = #{machineCode}
|
||||
</select>
|
||||
<select id="getEquipStatus" resultType="java.lang.String">
|
||||
select status from base_equipment where equipment_code = #{machineCode} and del_flag = '0'
|
||||
</select>
|
||||
<select id="getEquipMode" resultType="java.lang.String">
|
||||
select isvalue from base_equipment_attached
|
||||
where property = 'Mode'
|
||||
and device_code = #{machineCode}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue