|
|
|
@ -1,11 +1,18 @@
|
|
|
|
|
package com.op.quality.controller;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.op.quality.domain.QcBomComponent;
|
|
|
|
|
import com.op.quality.domain.QcCheckTaskDetail;
|
|
|
|
|
import com.op.quality.domain.QcSupplier;
|
|
|
|
|
import com.op.system.api.domain.SysRole;
|
|
|
|
|
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.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
@ -43,6 +50,22 @@ public class QcCheckTaskIncomeController extends BaseController {
|
|
|
|
|
@RequiresPermissions("quality:qcIncome:list")
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo list(QcCheckTaskIncome qcCheckTaskIncome) {
|
|
|
|
|
|
|
|
|
|
//默认时间范围T 00:00:00~T+1 00:00:00
|
|
|
|
|
if(StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())){
|
|
|
|
|
qcCheckTaskIncome.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";
|
|
|
|
|
qcCheckTaskIncome.setIncomeTimeEnd(dateEndStr);//end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){
|
|
|
|
|
qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start
|
|
|
|
|
qcCheckTaskIncome.setCheckTimeEnd(qcCheckTaskIncome.getIncomeTimeStart());//end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
startPage();
|
|
|
|
|
List<QcCheckTaskIncome> list = qcCheckTaskIncomeService.selectQcCheckTaskIncomeList(qcCheckTaskIncome);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
@ -55,6 +78,22 @@ public class QcCheckTaskIncomeController extends BaseController {
|
|
|
|
|
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(HttpServletResponse response, QcCheckTaskIncome qcCheckTaskIncome) {
|
|
|
|
|
|
|
|
|
|
//默认时间范围T 00:00:00~T+1 00:00:00
|
|
|
|
|
if(StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())){
|
|
|
|
|
qcCheckTaskIncome.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";
|
|
|
|
|
qcCheckTaskIncome.setIncomeTimeEnd(dateEndStr);//end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){
|
|
|
|
|
qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start
|
|
|
|
|
qcCheckTaskIncome.setCheckTimeEnd(qcCheckTaskIncome.getIncomeTimeStart());//end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<QcCheckTaskIncome> list = qcCheckTaskIncomeService.selectQcCheckTaskIncomeList(qcCheckTaskIncome);
|
|
|
|
|
ExcelUtil<QcCheckTaskIncome> util = new ExcelUtil<QcCheckTaskIncome>(QcCheckTaskIncome.class);
|
|
|
|
|
util.exportExcel(response, list, "来料检验数据");
|
|
|
|
@ -131,4 +170,53 @@ public class QcCheckTaskIncomeController extends BaseController {
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 状态修改
|
|
|
|
|
*/
|
|
|
|
|
@PutMapping("/changeIncomeStatus")
|
|
|
|
|
public AjaxResult changeIncomeStatus(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) {
|
|
|
|
|
qcCheckTaskIncome.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
qcCheckTaskIncome.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
return toAjax(qcCheckTaskIncomeService.updateIncomeStatus(qcCheckTaskIncome));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检验项目弹窗列表
|
|
|
|
|
* @param
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/getCkeckProjectList")
|
|
|
|
|
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<QcCheckTaskDetail> list = qcCheckTaskIncomeService.getCkeckProjectList(qcCheckTaskDetail);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 合格不合格
|
|
|
|
|
*/
|
|
|
|
|
@PutMapping("/changeCheckDetailStatus")
|
|
|
|
|
public AjaxResult changeCheckDetailStatus(@RequestBody QcCheckTaskDetail qcCheckTaskDetail) {
|
|
|
|
|
qcCheckTaskDetail.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
qcCheckTaskDetail.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
return toAjax(qcCheckTaskIncomeService.changeCheckDetailStatus(qcCheckTaskDetail));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 测量值提交
|
|
|
|
|
*/
|
|
|
|
|
@PutMapping("/commitActualValue")
|
|
|
|
|
public AjaxResult commitActualValue(@RequestBody QcCheckTaskDetail qcCheckTaskDetail) {
|
|
|
|
|
qcCheckTaskDetail.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
qcCheckTaskDetail.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
return toAjax(qcCheckTaskIncomeService.commitActualValue(qcCheckTaskDetail));
|
|
|
|
|
}
|
|
|
|
|
/**检测结果提交**/
|
|
|
|
|
@PutMapping("/commitCheckResult")
|
|
|
|
|
public AjaxResult commitCheckResult(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) {
|
|
|
|
|
qcCheckTaskIncome.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
qcCheckTaskIncome.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
return toAjax(qcCheckTaskIncomeService.commitCheckResult(qcCheckTaskIncome));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|