批次加工单、工序详情查看、处理接口修改
This commit is contained in:
parent
0ad2fce92d
commit
5bece0b46d
@ -14,11 +14,7 @@ public interface MtAloneProcessService extends Service<MtAloneProcess, Integer>
|
|||||||
|
|
||||||
List<MtAloneProcessVo> findProcessVoListByProductProcess(ProductProcessParams params);
|
List<MtAloneProcessVo> findProcessVoListByProductProcess(ProductProcessParams params);
|
||||||
|
|
||||||
ProcessAndMaterialsBom queryProcessDetail(MtAloneProcessParams params);
|
ProcessHo queryProcessDetail(MtAloneProcessParams params);
|
||||||
|
|
||||||
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
|
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
|
||||||
|
|
||||||
|
|
||||||
//List<MtAloneProcess> findList(MtAloneProcessParams params) ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,4 @@ import java.util.List;
|
|||||||
public interface ProcessMaterialsService extends Service<ProcessMaterials, Integer> {
|
public interface ProcessMaterialsService extends Service<ProcessMaterials, Integer> {
|
||||||
List<ProcessMaterialsVo> findProcMatVoListByProcess(MtAloneProcessParams params);
|
List<ProcessMaterialsVo> findProcMatVoListByProcess(MtAloneProcessParams params);
|
||||||
|
|
||||||
|
|
||||||
//List<ProcessMaterials> findList(ProcessMaterialsParams params) ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,7 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
|
|||||||
|
|
||||||
void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser);
|
void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser);
|
||||||
|
|
||||||
ProductAndProcess queryProductProcessDetail(ProductProcessParams params);
|
ProductProcessHo queryProductProcessDetail(ProductProcessParams params);
|
||||||
|
|
||||||
void saveInitial(ProductProcessHo productProcessHo, CurrentUser currentUser);
|
|
||||||
|
|
||||||
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
|
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package com.deer.wms.produce.manage.service.impl;
|
package com.deer.wms.produce.manage.service.impl;
|
||||||
|
|
||||||
import com.deer.wms.intercept.common.data.CurrentUser;
|
import com.deer.wms.intercept.common.data.CurrentUser;
|
||||||
import com.deer.wms.produce.manage.constant.ProduceManagePublicMethod;
|
|
||||||
import com.deer.wms.produce.manage.dao.MtAloneProcessMapper;
|
import com.deer.wms.produce.manage.dao.MtAloneProcessMapper;
|
||||||
import com.deer.wms.produce.manage.dao.ProcessMaterialsMapper;
|
|
||||||
import com.deer.wms.produce.manage.model.*;
|
import com.deer.wms.produce.manage.model.*;
|
||||||
import com.deer.wms.produce.manage.service.MtAloneProcessService;
|
import com.deer.wms.produce.manage.service.MtAloneProcessService;
|
||||||
import com.deer.wms.produce.manage.service.ProcessBomService;
|
import com.deer.wms.produce.manage.service.ProcessBomService;
|
||||||
@ -16,7 +14,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,21 +59,19 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessAndMaterialsBom queryProcessDetail(MtAloneProcessParams params) {
|
public ProcessHo queryProcessDetail(MtAloneProcessParams params) {
|
||||||
//根据工序id查询工序详细信息
|
//根据工序id查询工序详细信息
|
||||||
MtAloneProcessVo processVo = (MtAloneProcessVo) mtAloneProcessMapper.selectProcessVoByProcessId(params);
|
MtAloneProcessVo processVo = (MtAloneProcessVo) mtAloneProcessMapper.selectProcessVoByProcessId(params);
|
||||||
|
//根据工序id查询物料信息
|
||||||
//根据工序bom的id查询物料bom信息
|
List<ProcessMaterialsVo> procMatVoList = processMaterialsService.findProcMatVoListByProcess(params);
|
||||||
ProcessMaterialsBomParams procMatBomParams = new ProcessMaterialsBomParams();
|
ProcessHo processHo = new ProcessHo();
|
||||||
procMatBomParams.setProcessBomId(processVo.getProcessBomId());
|
if(null != processVo){
|
||||||
procMatBomParams.setCompanyId(params.getCompanyId());
|
System.out.println("----------"+processVo.getId());
|
||||||
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
System.out.println("----------"+processVo.getProcessName());
|
||||||
|
BeanUtils.copyProperties(processVo, processHo);
|
||||||
ProcessAndMaterialsBom processAndMaterialsBom = new ProcessAndMaterialsBom();
|
processHo.setProcessMaterialsVoList(procMatVoList);
|
||||||
processAndMaterialsBom.setProcessVo(processVo);
|
}
|
||||||
processAndMaterialsBom.setProcMatBomVoList(procMatBomVoList);
|
return processHo;
|
||||||
|
|
||||||
return processAndMaterialsBom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -97,55 +97,29 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProductAndProcess queryProductProcessDetail(ProductProcessParams params) {
|
public ProductProcessHo queryProductProcessDetail(ProductProcessParams params) {
|
||||||
//根据批次生产加工id查询批次产品加工单信息
|
//根据批次生产加工id查询批次产品加工单信息
|
||||||
ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId());
|
ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId());
|
||||||
//根据批次产品加工id查询工序信息
|
//根据批次产品加工id查询工序信息
|
||||||
List<MtAloneProcessVo> tempProcessVoList = processService.findProcessVoListByProductProcess(params);
|
List<MtAloneProcessVo> tempProcessVoList = processService.findProcessVoListByProductProcess(params);
|
||||||
|
|
||||||
ProductAndProcess productAndProcess = new ProductAndProcess();
|
ProductProcessHo productProcessHo = new ProductProcessHo();
|
||||||
productAndProcess.setProductProcess(productProcess);
|
if(null != productProcess) {
|
||||||
List<MtAloneProcessVo> processVoList;
|
BeanUtils.copyProperties(productProcess, productProcessHo);
|
||||||
if(null != tempProcessVoList) {
|
if (null != tempProcessVoList) {
|
||||||
processVoList = new ArrayList<MtAloneProcessVo>(tempProcessVoList.size());
|
List<ProcessHo> processHoList = new ArrayList<ProcessHo>(tempProcessVoList.size());
|
||||||
for (MtAloneProcessVo processVo : tempProcessVoList) {
|
for (MtAloneProcessVo processVo : tempProcessVoList) {
|
||||||
processVoList.add(processVo);
|
ProcessHo processHo = new ProcessHo();
|
||||||
|
BeanUtils.copyProperties(processVo, processHo);
|
||||||
|
processHoList.add(processHo);
|
||||||
|
}
|
||||||
|
productProcessHo.setProcessHoList(processHoList);
|
||||||
}
|
}
|
||||||
productAndProcess.setProcessVoList(processVoList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return productAndProcess;
|
return productProcessHo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void saveInitial(ProductProcessHo productProcessHo, CurrentUser currentUser) {
|
|
||||||
//ProductProcess productProcessHo = new ProductProcessHo();
|
|
||||||
//新增批次产品加工单信息,多数变量由前端赋值
|
|
||||||
// Date date = new Date();
|
|
||||||
// productProcess.setOperatorId(currentUser.getUserId());
|
|
||||||
// productProcess.setCreateTime(date);
|
|
||||||
// productProcess.setUpdateTime(date);
|
|
||||||
// productProcess.setVersion("1.1");
|
|
||||||
// productProcess.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
|
|
||||||
// productProcess.setWorkOrderCode(ProduceManagePublicMethod.creatUniqueCode("PCJGD"));
|
|
||||||
// productProcess.setShrinkage((productProcess.getDetectionLen()/productProcess.getLen())*100+"%");
|
|
||||||
// productProcess.setReviewStatus(ProduceManageConstant.REVIEW_STATUS_FORREVIEW);
|
|
||||||
// productProcess.setCompanyId(currentUser.getCompanyId());
|
|
||||||
// productProcessMapper.insert(productProcess);
|
|
||||||
//
|
|
||||||
// //保存由前端获取的工序信息
|
|
||||||
// List<MtAloneProcessVo> processVoList = productAndProcess.getProcessVoList();
|
|
||||||
// if(null != processVoList) {
|
|
||||||
// List<MtAloneProcess> processList = new ArrayList<MtAloneProcess>(processVoList.size());
|
|
||||||
// for (MtAloneProcess processVo : processVoList) {
|
|
||||||
// MtAloneProcess process = new MtAloneProcess();
|
|
||||||
// BeanUtils.copyProperties(processVo, process);
|
|
||||||
// process.setProductProcessId(productProcess.getId());
|
|
||||||
// processList.add(process);
|
|
||||||
// }
|
|
||||||
// processService.save(processList);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params) {
|
public ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params) {
|
||||||
@ -153,47 +127,50 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
|
|
||||||
//批次产品加工单初步赋值,关联bom
|
//批次产品加工单初步赋值,关联bom
|
||||||
ProductProcessBom productProcessBom = productProcessBomService.selectByProdProcBom(params);
|
ProductProcessBom productProcessBom = productProcessBomService.selectByProdProcBom(params);
|
||||||
productProcessHo.setProductBomId(productProcessBom.getId());
|
if(null != productProcessBom) {
|
||||||
productProcessHo.setProductProcessBomName(productProcessBom.getProductProcessName());
|
productProcessHo.setProductBomId(productProcessBom.getId());
|
||||||
//工序初步赋值,关联bom
|
productProcessHo.setProductProcessBomName(productProcessBom.getProductProcessName());
|
||||||
ProcessBomParams processBomParams = new ProcessBomParams();
|
//工序初步赋值,关联bom
|
||||||
processBomParams.setProductProcessId(params.getProductBomId());
|
ProcessBomParams processBomParams = new ProcessBomParams();
|
||||||
processBomParams.setCompanyId(params.getCompanyId());
|
processBomParams.setProductProcessId(params.getProductBomId());
|
||||||
List<ProcessBom> processBomList = processBomService.findListByProductBom(processBomParams);
|
processBomParams.setCompanyId(params.getCompanyId());
|
||||||
List<ProcessHo> processHoList;
|
List<ProcessBom> processBomList = processBomService.findListByProductBom(processBomParams);
|
||||||
if(null != processBomList){
|
List<ProcessHo> processHoList;
|
||||||
processHoList = new ArrayList<ProcessHo>(processBomList.size());
|
if (null != processBomList) {
|
||||||
for(ProcessBom processBom : processBomList){
|
processHoList = new ArrayList<ProcessHo>(processBomList.size());
|
||||||
ProcessHo processHo = new ProcessHo();
|
for (ProcessBom processBom : processBomList) {
|
||||||
processHo.setProcessBomId(processBom.getId());
|
ProcessHo processHo = new ProcessHo();
|
||||||
processHo.setProcessBomName(processBom.getProcessName());
|
processHo.setProcessBomId(processBom.getId());
|
||||||
processHo.setProcessStep(processBom.getProcessStep());
|
processHo.setProcessBomName(processBom.getProcessName());
|
||||||
processHo.setProcessName(processBom.getProcessName());
|
processHo.setProcessStep(processBom.getProcessStep());
|
||||||
processHo.setProcessContent(processBom.getProcessContent());
|
processHo.setProcessName(processBom.getProcessName());
|
||||||
processHo.setSpecification(processBom.getSpecification());
|
processHo.setProcessContent(processBom.getProcessContent());
|
||||||
|
processHo.setSpecification(processBom.getSpecification());
|
||||||
|
|
||||||
//物料初步赋值,关联bom
|
//物料初步赋值,关联bom
|
||||||
ProcessMaterialsBomParams procMatBomParams = new ProcessMaterialsBomParams();
|
ProcessMaterialsBomParams procMatBomParams = new ProcessMaterialsBomParams();
|
||||||
procMatBomParams.setProcessBomId(processBom.getId());
|
procMatBomParams.setProcessBomId(processBom.getId());
|
||||||
procMatBomParams.setCompanyId(processBomParams.getCompanyId());
|
procMatBomParams.setCompanyId(processBomParams.getCompanyId());
|
||||||
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||||
List<ProcessMaterialsVo> procMatVoList;
|
List<ProcessMaterialsVo> procMatVoList;
|
||||||
if(null != procMatBomVoList){
|
if (null != procMatBomVoList) {
|
||||||
procMatVoList = new ArrayList<ProcessMaterialsVo>(procMatBomVoList.size());
|
procMatVoList = new ArrayList<ProcessMaterialsVo>(procMatBomVoList.size());
|
||||||
for (ProcessMaterialsBomVo procMatBomVo : procMatBomVoList){
|
for (ProcessMaterialsBomVo procMatBomVo : procMatBomVoList) {
|
||||||
ProcessMaterialsVo procMatVo = new ProcessMaterialsVo();
|
ProcessMaterialsVo procMatVo = new ProcessMaterialsVo();
|
||||||
procMatVo.setMaterialsBomId(procMatBomVo.getId());
|
procMatVo.setMaterialsBomId(procMatBomVo.getId());
|
||||||
procMatVo.setMaterialsName(procMatBomVo.getMaterialsName());
|
procMatVo.setMaterialsName(procMatBomVo.getMaterialsName());
|
||||||
procMatVo.setSpecification(procMatBomVo.getSpecification());
|
procMatVo.setSpecification(procMatBomVo.getSpecification());
|
||||||
procMatVo.setUnitId(procMatBomVo.getUnitId());
|
procMatVo.setUnitId(procMatBomVo.getUnitId());
|
||||||
procMatVo.setUnitName0(procMatBomVo.getUnitName());
|
procMatVo.setUnitName0(procMatBomVo.getUnitName());
|
||||||
procMatVoList.add(procMatVo);
|
procMatVo.setDosage(procMatBomVo.getDosage());//先按照模板对用量赋值,前端在将匹数乘以用量计算后展示在表格
|
||||||
|
procMatVoList.add(procMatVo);
|
||||||
|
}
|
||||||
|
processHo.setProcessMaterialsVoList(procMatVoList);
|
||||||
}
|
}
|
||||||
processHo.setProcessMaterialsVoList(procMatVoList);
|
processHoList.add(processHo);
|
||||||
}
|
}
|
||||||
processHoList.add(processHo);
|
productProcessHo.setProcessHoList(processHoList);
|
||||||
}
|
}
|
||||||
productProcessHo.setProcessHoList(processHoList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return productProcessHo;
|
return productProcessHo;
|
||||||
|
@ -129,13 +129,40 @@ public class MtAloneProcessController {
|
|||||||
* @param currentUser
|
* @param currentUser
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "根据工序id查询工序详情及物料信息", notes = "根据工序id查询工序详情及物料信息")
|
//@ApiOperation(value = "根据工序id查询工序详情及物料信息", notes = "根据工序id查询工序详情及物料信息")
|
||||||
|
//@ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true),
|
||||||
|
// @ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
//
|
||||||
|
//})
|
||||||
|
//@OperateLog(description = "根据工序id查询工序详情及物料信息", type = "查询")
|
||||||
|
//@GetMapping("/query/process/detail")
|
||||||
|
//public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
|
||||||
|
// if(currentUser==null){
|
||||||
|
// return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// params.setCompanyId(currentUser.getCompanyId());
|
||||||
|
// PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
||||||
|
// ProcessAndMaterialsBom processAndMaterialsBom = mtAloneProcessService.queryProcessDetail(params);
|
||||||
|
// return ResultGenerator.genSuccessResult(processAndMaterialsBom);
|
||||||
|
//}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hy正在用
|
||||||
|
* 点击加工处理页面中工序列表最后一列查看或处理按钮,
|
||||||
|
* 由工序id获取该工序详情及包含的物料信息
|
||||||
|
* @param params
|
||||||
|
* @param currentUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "工序详情查询", notes = "工序详情查询")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true),
|
@ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true),
|
||||||
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
|
||||||
})
|
})
|
||||||
@OperateLog(description = "根据工序id查询工序详情及物料信息", type = "查询")
|
@OperateLog(description = "工序详情查询", type = "查询")
|
||||||
@GetMapping("/query/process/detail")
|
@GetMapping("/query/process/detail")
|
||||||
public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
|
public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
|
||||||
if(currentUser==null){
|
if(currentUser==null){
|
||||||
@ -143,9 +170,8 @@ public class MtAloneProcessController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
params.setCompanyId(currentUser.getCompanyId());
|
params.setCompanyId(currentUser.getCompanyId());
|
||||||
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
ProcessHo processHo = mtAloneProcessService.queryProcessDetail(params);
|
||||||
ProcessAndMaterialsBom processAndMaterialsBom = mtAloneProcessService.queryProcessDetail(params);
|
return ResultGenerator.genSuccessResult(processHo);
|
||||||
return ResultGenerator.genSuccessResult(processAndMaterialsBom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -129,7 +129,6 @@ public class ProductProcessController {
|
|||||||
return ResultGenerator.genSuccessResult();
|
return ResultGenerator.genSuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hy正在用
|
* hy正在用
|
||||||
* 点击批次生产加工单列表最后一列查看或处理按钮,
|
* 点击批次生产加工单列表最后一列查看或处理按钮,
|
||||||
@ -142,7 +141,6 @@ public class ProductProcessController {
|
|||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
|
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
|
||||||
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
|
||||||
})
|
})
|
||||||
@OperateLog(description = "批次生产加工单详情查询", type = "查询")
|
@OperateLog(description = "批次生产加工单详情查询", type = "查询")
|
||||||
@GetMapping("/query/product/process/detail")
|
@GetMapping("/query/product/process/detail")
|
||||||
@ -152,8 +150,8 @@ public class ProductProcessController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
params.setCompanyId(currentUser.getCompanyId());
|
params.setCompanyId(currentUser.getCompanyId());
|
||||||
ProductAndProcess productAndProcess = productProcessService.queryProductProcessDetail(params);
|
ProductProcessHo productProcessHo = productProcessService.queryProductProcessDetail(params);
|
||||||
return ResultGenerator.genSuccessResult(productAndProcess);
|
return ResultGenerator.genSuccessResult(productProcessHo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -205,5 +203,4 @@ public class ProductProcessController {
|
|||||||
return ResultGenerator.genSuccessResult();
|
return ResultGenerator.genSuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user