|
@@ -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 bizLotTechnologicalProcessServic;
|
|
|
|
|
|
@Resource
|
|
|
private IBizTechnologicalProcessService bizTechnologicalProcessService;
|
|
|
|
|
|
@Resource
|
|
|
- private IBizTechnologicalAmendDetailService bizTechnologicalAmendDetailService;
|
|
|
+ private IBizLotTechnologicalProcessDetailService bizLotTechnologicalProcessDetailService;
|
|
|
|
|
|
@Resource
|
|
|
private IBizTechnologicalProcessDetailService bizTechnologicalProcessDetailService;
|
|
@@ -77,12 +72,6 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
@Resource
|
|
|
private IBizLotWasteService bizLotWasteService;
|
|
|
|
|
|
- @Resource
|
|
|
- private IBizTechnologicalWasteRecyclingService bizTechnologicalWasteRecyclingService;
|
|
|
-
|
|
|
- @Resource
|
|
|
- private IBizTechnologicalWasteRecyclingDetailService bizTechnologicalWasteRecyclingDetailService;
|
|
|
-
|
|
|
@Resource
|
|
|
private IBizProductionPlanDetailSubDetailService bizProductionPlanDetailSubDetailService;
|
|
|
|
|
@@ -103,10 +92,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 = bizLotTechnologicalProcessServic.getList(bizLotTechnologicalProcess);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
@@ -124,7 +113,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 = bizLotTechnologicalProcessServic.getById(processId);
|
|
|
|
|
|
return getDataTable(bizTechnologicalProcessDetailService.getProcessDetailsByTechnicalProcessId(amend.getTechnologicalProcessId()));
|
|
|
}
|
|
@@ -202,32 +191,13 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
List<BizTechnologicalProcessDetail> processDetailList = new ArrayList<>();
|
|
|
|
|
|
//是否单批单改
|
|
|
- if (lot.getIsAmend() == 1) {
|
|
|
+ if (lot.getIsAmend() == 1 || lot.getIsWasteRecycling() == 1) {
|
|
|
//查询更改后的数据
|
|
|
- BizTechnologicalAmendDetail amendDetail = new BizTechnologicalAmendDetail();
|
|
|
- amendDetail.setTechnologicalAmendId(lot.getTechnologicalProcessId());
|
|
|
- List<BizTechnologicalAmendDetail> amendDetailList = bizTechnologicalAmendDetailService.getList(amendDetail);
|
|
|
-
|
|
|
- for (BizTechnologicalAmendDetail item : amendDetailList) {
|
|
|
- BizTechnologicalProcessDetail process = new BizTechnologicalProcessDetail();
|
|
|
- process.setProcessId(item.getProcessId());
|
|
|
- process.setProcessStepNumber(item.getProcessStepNumber());
|
|
|
- process.setProcessCode(item.getProcessCode());
|
|
|
- process.setProcessAlias(item.getProcessAlias());
|
|
|
- process.setProcessKey(item.getProcessKey());
|
|
|
- process.setProductShaftCategory(item.getProductShaftCategory());
|
|
|
- process.setProductShaftCategoryName(item.getProductShaftCategoryName());
|
|
|
- process.setTechnologicalProcessId(item.getTechnologicalAmendId());
|
|
|
- process.setProductId(item.getProductId());
|
|
|
- process.setProductDescription(item.getProductDescription());
|
|
|
- processDetailList.add(process);
|
|
|
- }
|
|
|
- } else if (lot.getIsWasteRecycling() == 1) { //是否废品回用
|
|
|
- BizTechnologicalWasteRecyclingDetail wasteRecyclingDetail = new BizTechnologicalWasteRecyclingDetail();
|
|
|
- wasteRecyclingDetail.setTechnologicalWasteRecyclingId(lot.getTechnologicalProcessId());
|
|
|
- List<BizTechnologicalWasteRecyclingDetail> processList = bizTechnologicalWasteRecyclingDetailService.getList(wasteRecyclingDetail);
|
|
|
+ BizLotTechnologicalProcessDetail amendDetail = new BizLotTechnologicalProcessDetail();
|
|
|
+ amendDetail.setLotTechnologicalProcessId(lot.getTechnologicalProcessId());
|
|
|
+ List<BizLotTechnologicalProcessDetail> amendDetailList = bizLotTechnologicalProcessDetailService.getList(amendDetail);
|
|
|
|
|
|
- for (BizTechnologicalWasteRecyclingDetail item : processList) {
|
|
|
+ for (BizLotTechnologicalProcessDetail item : amendDetailList) {
|
|
|
BizTechnologicalProcessDetail process = new BizTechnologicalProcessDetail();
|
|
|
process.setProcessId(item.getProcessId());
|
|
|
process.setProcessStepNumber(item.getProcessStepNumber());
|
|
@@ -236,17 +206,38 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
process.setProcessKey(item.getProcessKey());
|
|
|
process.setProductShaftCategory(item.getProductShaftCategory());
|
|
|
process.setProductShaftCategoryName(item.getProductShaftCategoryName());
|
|
|
- process.setTechnologicalProcessId(item.getTechnologicalWasteRecyclingId());
|
|
|
+ process.setTechnologicalProcessId(item.getLotTechnologicalProcessId());
|
|
|
process.setProductId(item.getProductId());
|
|
|
process.setProductDescription(item.getProductDescription());
|
|
|
processDetailList.add(process);
|
|
|
}
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
//查询工序信息
|
|
|
processDetail.setTechnologicalProcessId(lot.getTechnologicalProcessId());
|
|
|
processDetailList = bizTechnologicalProcessDetailService.getProcessDetailsByTechnicalProcessId(lot.getTechnologicalProcessId());
|
|
|
|
|
|
}
|
|
|
+// 修改使用方式,暂时注释
|
|
|
+// else if (lot.getIsWasteRecycling() == 1) { //是否废品回用
|
|
|
+// BizTechnologicalWasteRecyclingDetail wasteRecyclingDetail = new BizTechnologicalWasteRecyclingDetail();
|
|
|
+// wasteRecyclingDetail.setTechnologicalWasteRecyclingId(lot.getTechnologicalProcessId());
|
|
|
+// List<BizTechnologicalWasteRecyclingDetail> processList = bizTechnologicalWasteRecyclingDetailService.getList(wasteRecyclingDetail);
|
|
|
+//
|
|
|
+// for (BizTechnologicalWasteRecyclingDetail item : processList) {
|
|
|
+// BizTechnologicalProcessDetail process = new BizTechnologicalProcessDetail();
|
|
|
+// process.setProcessId(item.getProcessId());
|
|
|
+// process.setProcessStepNumber(item.getProcessStepNumber());
|
|
|
+// process.setProcessCode(item.getProcessCode());
|
|
|
+// process.setProcessAlias(item.getProcessAlias());
|
|
|
+// process.setProcessKey(item.getProcessKey());
|
|
|
+// process.setProductShaftCategory(item.getProductShaftCategory());
|
|
|
+// process.setProductShaftCategoryName(item.getProductShaftCategoryName());
|
|
|
+// process.setTechnologicalProcessId(item.getTechnologicalWasteRecyclingId());
|
|
|
+// process.setProductId(item.getProductId());
|
|
|
+// process.setProductDescription(item.getProductDescription());
|
|
|
+// processDetailList.add(process);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
//查询报工信息
|
|
|
lot.setTechnologicalProcessDetailList(selectDayworkItem(processDetailList, lot));
|
|
@@ -333,10 +324,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 = bizLotTechnologicalProcessServic.getList(bizLotTechnologicalProcess);
|
|
|
+ ExcelUtil<BizLotTechnologicalProcess> util = new ExcelUtil<BizLotTechnologicalProcess>(BizLotTechnologicalProcess.class);
|
|
|
util.exportExcel(response, list, "修改后工艺数据");
|
|
|
}
|
|
|
|
|
@@ -355,7 +346,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());
|
|
@@ -371,18 +362,19 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
amend.setProductShaftCategoryName(technologicalProcess.getProductShaftCategoryName());
|
|
|
amend.setProductCode(technologicalProcess.getProductCode());
|
|
|
amend.setProductDescription(technologicalProcess.getProductDescription());
|
|
|
- bizTechnologicalAmendService.save(amend);
|
|
|
+ bizLotTechnologicalProcessServic.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());
|
|
@@ -397,7 +389,7 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
//修改批次工艺信息
|
|
|
lot.setTechnologicalProcessId(amend.getId());
|
|
|
lot.setIsAmend(1);
|
|
|
- bizTechnologicalAmendDetailService.saveBatch(amendDetailList) ;
|
|
|
+ bizLotTechnologicalProcessDetailService.saveBatch(amendDetailList) ;
|
|
|
newLotList.add(lot);
|
|
|
// bizLotService.updateById(lot);
|
|
|
}
|
|
@@ -418,29 +410,32 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
int num = 0;//修改过的次数
|
|
|
|
|
|
//是否进行过单批单改
|
|
|
- if (lot.getIsAmend() == 1) {
|
|
|
+ if (lot.getIsAmend() == 1||lot.getIsWasteRecycling() == 1) {
|
|
|
//查询单批单改信息
|
|
|
- BizTechnologicalAmend technologicalAmend = bizTechnologicalAmendService.getById(lot.getTechnologicalProcessId());
|
|
|
+ BizLotTechnologicalProcess technologicalAmend = bizLotTechnologicalProcessServic.getById(lot.getTechnologicalProcessId());
|
|
|
|
|
|
//先将lot的工艺id设置为原始工艺id,为了给新改的原始工艺赋值
|
|
|
lot.setTechnologicalProcessId(technologicalAmend.getTechnologicalProcessId());
|
|
|
//查询修改过几次
|
|
|
- List<BizTechnologicalAmend> list = bizTechnologicalAmendService.selectUpdateList(lot.getId());
|
|
|
+ List<BizLotTechnologicalProcess> list = bizLotTechnologicalProcessServic.selectUpdateList(lot.getId());
|
|
|
num = list.size();
|
|
|
//设为停用
|
|
|
technologicalAmend.setIsStop(1);
|
|
|
- bizTechnologicalAmendService.saveOrUpdate(technologicalAmend);
|
|
|
+ bizLotTechnologicalProcessServic.saveOrUpdate(technologicalAmend);
|
|
|
//查询原始工艺信息
|
|
|
technologicalProcess = bizTechnologicalProcessService.getById(technologicalAmend.getTechnologicalProcessId());
|
|
|
- } else if (lot.getIsWasteRecycling() == 1) { //是否废品回用
|
|
|
- BizTechnologicalWasteRecycling wasteRecycling = bizTechnologicalWasteRecyclingService.getById(lot.getTechnologicalProcessId());
|
|
|
- technologicalProcess = bizTechnologicalProcessService.getById(wasteRecycling.getTechnologicalProcessId());
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
technologicalProcess = bizTechnologicalProcessService.getById(lot.getTechnologicalProcessId());
|
|
|
}
|
|
|
|
|
|
+// 使用新方法暂时注释
|
|
|
+// else if (lot.getIsWasteRecycling() == 1) { //是否废品回用
|
|
|
+// BizTechnologicalWasteRecycling wasteRecycling = bizTechnologicalWasteRecyclingService.getById(lot.getTechnologicalProcessId());
|
|
|
+// technologicalProcess = bizTechnologicalProcessService.getById(wasteRecycling.getTechnologicalProcessId());
|
|
|
+// }
|
|
|
+
|
|
|
//新增修改后工艺信息
|
|
|
- BizTechnologicalAmend amend = new BizTechnologicalAmend();
|
|
|
+ BizLotTechnologicalProcess amend = new BizLotTechnologicalProcess();
|
|
|
amend.setTenantId(lot.getTenantId());
|
|
|
amend.setLotId(lot.getId());
|
|
|
amend.setLotCode(lot.getLotCode());
|
|
@@ -456,19 +451,20 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
amend.setProductShaftCategoryName(technologicalProcess.getProductShaftCategoryName());
|
|
|
amend.setProductCode(technologicalProcess.getProductCode());
|
|
|
amend.setProductDescription(technologicalProcess.getProductDescription());
|
|
|
- bizTechnologicalAmendService.save(amend);
|
|
|
+ bizLotTechnologicalProcessServic.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());
|
|
@@ -482,7 +478,7 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
//修改批次工艺信息
|
|
|
lot.setTechnologicalProcessId(amend.getId());
|
|
|
lot.setIsAmend(1);
|
|
|
- return success(bizTechnologicalAmendDetailService.saveBatch(amendDetailList) && bizLotService.updateById(lot));
|
|
|
+ return success(bizLotTechnologicalProcessDetailService.saveBatch(amendDetailList) && bizLotService.updateById(lot));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -526,7 +522,7 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('business:amend:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
- return success(bizTechnologicalAmendService.getById(id));
|
|
|
+ return success(bizLotTechnologicalProcessServic.getById(id));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -535,9 +531,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(bizLotTechnologicalProcessServic.save(bizLotTechnologicalProcess));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -546,9 +542,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(bizLotTechnologicalProcessServic.updateById(bizLotTechnologicalProcess));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -558,6 +554,6 @@ public class BizTechnologicalAmendController extends BaseController {
|
|
|
@Log(title = "修改后工艺", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
public AjaxResult remove(@PathVariable List<Long> ids) {
|
|
|
- return toAjax(bizTechnologicalAmendService.removeBatchByIds(ids));
|
|
|
+ return toAjax(bizLotTechnologicalProcessServic.removeBatchByIds(ids));
|
|
|
}
|
|
|
}
|