|
@@ -1,7 +1,6 @@
|
|
|
package cn.ezhizao.project.business.controller;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -15,11 +14,7 @@ import cn.ezhizao.framework.web.page.TableDataInfo;
|
|
|
import cn.ezhizao.project.business.domain.*;
|
|
|
import cn.ezhizao.project.business.service.*;
|
|
|
import cn.ezhizao.project.system.service.ISysDeptService;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.Data;
|
|
|
-import org.apache.poi.ss.formula.functions.T;
|
|
|
-import org.springframework.cloud.client.loadbalancer.RequestData;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -40,15 +35,15 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/business/amend")
|
|
|
-public class BizTechnologicalAmendController extends BaseController {
|
|
|
+public class BizLotTechnologicalProcessController extends BaseController {
|
|
|
@Resource
|
|
|
- private IBizTechnologicalAmendService bizTechnologicalAmendService;
|
|
|
+ private IBizLotTechnologicalProcessService bizTechnologicalAmendService;
|
|
|
|
|
|
@Resource
|
|
|
private IBizTechnologicalProcessService bizTechnologicalProcessService;
|
|
|
|
|
|
@Resource
|
|
|
- private IBizTechnologicalAmendDetailService bizTechnologicalAmendDetailService;
|
|
|
+ private IBizLotTechnologicalProcessDeatilService bizTechnologicalAmendDetailService;
|
|
|
|
|
|
@Resource
|
|
|
private IBizTechnologicalProcessDetailService bizTechnologicalProcessDetailService;
|
|
@@ -103,10 +98,10 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('business:amend:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(BizTechnologicalAmend bizTechnologicalAmend) throws NoSuchFieldException, IllegalAccessException {
|
|
|
- setTenantId(bizTechnologicalAmend);
|
|
|
+ public TableDataInfo list(BizLotTechnologicalProcess bizLotTechnologicalProcess) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ setTenantId(bizLotTechnologicalProcess);
|
|
|
startPage();
|
|
|
- List<BizTechnologicalAmend> list = bizTechnologicalAmendService.getList(bizTechnologicalAmend);
|
|
|
+ List<BizLotTechnologicalProcess> list = bizTechnologicalAmendService.getList(bizLotTechnologicalProcess);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
@@ -124,7 +119,7 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
*/
|
|
|
@GetMapping("/standardProcess/{processId}")
|
|
|
public TableDataInfo standardProcess(@PathVariable("processId") Long processId) throws NoSuchFieldException, IllegalAccessException {
|
|
|
- BizTechnologicalAmend amend = bizTechnologicalAmendService.getById(processId);
|
|
|
+ BizLotTechnologicalProcess amend = bizTechnologicalAmendService.getById(processId);
|
|
|
|
|
|
return getDataTable(bizTechnologicalProcessDetailService.getProcessDetailsByTechnicalProcessId(amend.getTechnologicalProcessId()));
|
|
|
}
|
|
@@ -204,11 +199,11 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
//是否单批单改
|
|
|
if (lot.getIsAmend() == 1) {
|
|
|
//查询更改后的数据
|
|
|
- BizTechnologicalAmendDetail amendDetail = new BizTechnologicalAmendDetail();
|
|
|
- amendDetail.setTechnologicalAmendId(lot.getTechnologicalProcessId());
|
|
|
- List<BizTechnologicalAmendDetail> amendDetailList = bizTechnologicalAmendDetailService.getList(amendDetail);
|
|
|
+ BizLotTechnologicalProcessDetail amendDetail = new BizLotTechnologicalProcessDetail();
|
|
|
+ amendDetail.setLotTechnologicalProcessId(lot.getTechnologicalProcessId());
|
|
|
+ List<BizLotTechnologicalProcessDetail> amendDetailList = bizTechnologicalAmendDetailService.getList(amendDetail);
|
|
|
|
|
|
- for (BizTechnologicalAmendDetail item : amendDetailList) {
|
|
|
+ for (BizLotTechnologicalProcessDetail item : amendDetailList) {
|
|
|
BizTechnologicalProcessDetail process = new BizTechnologicalProcessDetail();
|
|
|
process.setProcessId(item.getProcessId());
|
|
|
process.setProcessStepNumber(item.getProcessStepNumber());
|
|
@@ -217,7 +212,7 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
process.setProcessKey(item.getProcessKey());
|
|
|
process.setProductShaftCategory(item.getProductShaftCategory());
|
|
|
process.setProductShaftCategoryName(item.getProductShaftCategoryName());
|
|
|
- process.setTechnologicalProcessId(item.getTechnologicalAmendId());
|
|
|
+ process.setTechnologicalProcessId(item.getLotTechnologicalProcessId());
|
|
|
process.setProductId(item.getProductId());
|
|
|
process.setProductDescription(item.getProductDescription());
|
|
|
processDetailList.add(process);
|
|
@@ -333,10 +328,10 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('business:amend:export')")
|
|
|
@Log(title = "修改后工艺", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, BizTechnologicalAmend bizTechnologicalAmend) throws NoSuchFieldException, IllegalAccessException {
|
|
|
- setTenantId(bizTechnologicalAmend);
|
|
|
- List<BizTechnologicalAmend> list = bizTechnologicalAmendService.getList(bizTechnologicalAmend);
|
|
|
- ExcelUtil<BizTechnologicalAmend> util = new ExcelUtil<BizTechnologicalAmend>(BizTechnologicalAmend.class);
|
|
|
+ public void export(HttpServletResponse response, BizLotTechnologicalProcess bizLotTechnologicalProcess) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ setTenantId(bizLotTechnologicalProcess);
|
|
|
+ List<BizLotTechnologicalProcess> list = bizTechnologicalAmendService.getList(bizLotTechnologicalProcess);
|
|
|
+ ExcelUtil<BizLotTechnologicalProcess> util = new ExcelUtil<BizLotTechnologicalProcess>(BizLotTechnologicalProcess.class);
|
|
|
util.exportExcel(response, list, "修改后工艺数据");
|
|
|
}
|
|
|
|
|
@@ -355,7 +350,7 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
|
|
|
BizTechnologicalProcess technologicalProcess = new BizTechnologicalProcess();
|
|
|
//新增修改后工艺信息
|
|
|
- BizTechnologicalAmend amend = new BizTechnologicalAmend();
|
|
|
+ BizLotTechnologicalProcess amend = new BizLotTechnologicalProcess();
|
|
|
amend.setTenantId(lot.getTenantId());
|
|
|
amend.setLotId(lot.getId());
|
|
|
amend.setLotCode(lot.getLotCode());
|
|
@@ -373,16 +368,17 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
amend.setProductDescription(technologicalProcess.getProductDescription());
|
|
|
bizTechnologicalAmendService.save(amend);
|
|
|
|
|
|
- List<BizTechnologicalAmendDetail> amendDetailList = new ArrayList<>();
|
|
|
+ List<BizLotTechnologicalProcessDetail> amendDetailList = new ArrayList<>();
|
|
|
|
|
|
for (BizTechnologicalProcessDetail detail : processDetailList) {
|
|
|
- BizTechnologicalAmendDetail amendDetail = new BizTechnologicalAmendDetail();
|
|
|
- amendDetail.setTechnologicalAmendId(amend.getId());
|
|
|
+ BizLotTechnologicalProcessDetail amendDetail = new BizLotTechnologicalProcessDetail();
|
|
|
+ amendDetail.setLotTechnologicalProcessId(amend.getId());
|
|
|
amendDetail.setTenantId(amend.getTenantId());
|
|
|
amendDetail.setTechnologyVersion(amend.getTechnologyVersion());
|
|
|
amendDetail.setProductId(amend.getProductId());
|
|
|
amendDetail.setProductCode(amend.getProductCode());
|
|
|
amendDetail.setProcessStepNumber(detail.getProcessStepNumber());
|
|
|
+ amendDetail.setLotId(lot.getId());
|
|
|
amendDetail.setProcessId(detail.getProcessId());
|
|
|
amendDetail.setProcessKey(detail.getProcessKey());
|
|
|
amendDetail.setProcessCode(detail.getProcessCode());
|
|
@@ -420,12 +416,12 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
//是否进行过单批单改
|
|
|
if (lot.getIsAmend() == 1) {
|
|
|
//查询单批单改信息
|
|
|
- BizTechnologicalAmend technologicalAmend = bizTechnologicalAmendService.getById(lot.getTechnologicalProcessId());
|
|
|
+ BizLotTechnologicalProcess technologicalAmend = bizTechnologicalAmendService.getById(lot.getTechnologicalProcessId());
|
|
|
|
|
|
//先将lot的工艺id设置为原始工艺id,为了给新改的原始工艺赋值
|
|
|
lot.setTechnologicalProcessId(technologicalAmend.getTechnologicalProcessId());
|
|
|
//查询修改过几次
|
|
|
- List<BizTechnologicalAmend> list = bizTechnologicalAmendService.selectUpdateList(lot.getId());
|
|
|
+ List<BizLotTechnologicalProcess> list = bizTechnologicalAmendService.selectUpdateList(lot.getId());
|
|
|
num = list.size();
|
|
|
//设为停用
|
|
|
technologicalAmend.setIsStop(1);
|
|
@@ -440,7 +436,7 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
}
|
|
|
|
|
|
//新增修改后工艺信息
|
|
|
- BizTechnologicalAmend amend = new BizTechnologicalAmend();
|
|
|
+ BizLotTechnologicalProcess amend = new BizLotTechnologicalProcess();
|
|
|
amend.setTenantId(lot.getTenantId());
|
|
|
amend.setLotId(lot.getId());
|
|
|
amend.setLotCode(lot.getLotCode());
|
|
@@ -458,17 +454,18 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
amend.setProductDescription(technologicalProcess.getProductDescription());
|
|
|
bizTechnologicalAmendService.save(amend);
|
|
|
|
|
|
- List<BizTechnologicalAmendDetail> amendDetailList = new ArrayList<>();
|
|
|
+ List<BizLotTechnologicalProcessDetail> amendDetailList = new ArrayList<>();
|
|
|
|
|
|
for (BizTechnologicalProcessDetail detail : detailList) {
|
|
|
- BizTechnologicalAmendDetail amendDetail = new BizTechnologicalAmendDetail();
|
|
|
- amendDetail.setTechnologicalAmendId(amend.getId());
|
|
|
+ BizLotTechnologicalProcessDetail amendDetail = new BizLotTechnologicalProcessDetail();
|
|
|
+ amendDetail.setLotTechnologicalProcessId(amend.getId());
|
|
|
amendDetail.setTenantId(amend.getTenantId());
|
|
|
amendDetail.setTechnologyVersion(amend.getTechnologyVersion());
|
|
|
amendDetail.setProductId(amend.getProductId());
|
|
|
amendDetail.setProductCode(amend.getProductCode());
|
|
|
amendDetail.setProcessStepNumber(detail.getProcessStepNumber());
|
|
|
amendDetail.setProcessId(detail.getProcessId());
|
|
|
+ amendDetail.setLotId(lot.getId());
|
|
|
amendDetail.setProcessKey(detail.getProcessKey());
|
|
|
amendDetail.setProcessCode(detail.getProcessCode());
|
|
|
amendDetail.setProcessAlias(detail.getProcessAlias());
|
|
@@ -535,9 +532,9 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('business:amend:add')")
|
|
|
@Log(title = "修改后工艺", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody BizTechnologicalAmend bizTechnologicalAmend) throws NoSuchFieldException, IllegalAccessException {
|
|
|
- setTenantId(bizTechnologicalAmend);
|
|
|
- return toAjax(bizTechnologicalAmendService.save(bizTechnologicalAmend));
|
|
|
+ public AjaxResult add(@RequestBody BizLotTechnologicalProcess bizLotTechnologicalProcess) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ setTenantId(bizLotTechnologicalProcess);
|
|
|
+ return toAjax(bizTechnologicalAmendService.save(bizLotTechnologicalProcess));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -546,9 +543,9 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('business:amend:edit')")
|
|
|
@Log(title = "修改后工艺", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody BizTechnologicalAmend bizTechnologicalAmend) throws NoSuchFieldException, IllegalAccessException {
|
|
|
- setTenantId(bizTechnologicalAmend);
|
|
|
- return toAjax(bizTechnologicalAmendService.updateById(bizTechnologicalAmend));
|
|
|
+ public AjaxResult edit(@RequestBody BizLotTechnologicalProcess bizLotTechnologicalProcess) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ setTenantId(bizLotTechnologicalProcess);
|
|
|
+ return toAjax(bizTechnologicalAmendService.updateById(bizLotTechnologicalProcess));
|
|
|
}
|
|
|
|
|
|
/**
|