批次加工单、工序详情查看、处理接口修改
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);
|
||||
|
||||
ProcessAndMaterialsBom queryProcessDetail(MtAloneProcessParams params);
|
||||
ProcessHo queryProcessDetail(MtAloneProcessParams params);
|
||||
|
||||
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> {
|
||||
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);
|
||||
|
||||
ProductAndProcess queryProductProcessDetail(ProductProcessParams params);
|
||||
|
||||
void saveInitial(ProductProcessHo productProcessHo, CurrentUser currentUser);
|
||||
ProductProcessHo queryProductProcessDetail(ProductProcessParams params);
|
||||
|
||||
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
package com.deer.wms.produce.manage.service.impl;
|
||||
|
||||
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.ProcessMaterialsMapper;
|
||||
import com.deer.wms.produce.manage.model.*;
|
||||
import com.deer.wms.produce.manage.service.MtAloneProcessService;
|
||||
import com.deer.wms.produce.manage.service.ProcessBomService;
|
||||
@ -16,7 +14,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -62,21 +59,19 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessAndMaterialsBom queryProcessDetail(MtAloneProcessParams params) {
|
||||
public ProcessHo queryProcessDetail(MtAloneProcessParams params) {
|
||||
//根据工序id查询工序详细信息
|
||||
MtAloneProcessVo processVo = (MtAloneProcessVo) mtAloneProcessMapper.selectProcessVoByProcessId(params);
|
||||
|
||||
//根据工序bom的id查询物料bom信息
|
||||
ProcessMaterialsBomParams procMatBomParams = new ProcessMaterialsBomParams();
|
||||
procMatBomParams.setProcessBomId(processVo.getProcessBomId());
|
||||
procMatBomParams.setCompanyId(params.getCompanyId());
|
||||
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||
|
||||
ProcessAndMaterialsBom processAndMaterialsBom = new ProcessAndMaterialsBom();
|
||||
processAndMaterialsBom.setProcessVo(processVo);
|
||||
processAndMaterialsBom.setProcMatBomVoList(procMatBomVoList);
|
||||
|
||||
return processAndMaterialsBom;
|
||||
//根据工序id查询物料信息
|
||||
List<ProcessMaterialsVo> procMatVoList = processMaterialsService.findProcMatVoListByProcess(params);
|
||||
ProcessHo processHo = new ProcessHo();
|
||||
if(null != processVo){
|
||||
System.out.println("----------"+processVo.getId());
|
||||
System.out.println("----------"+processVo.getProcessName());
|
||||
BeanUtils.copyProperties(processVo, processHo);
|
||||
processHo.setProcessMaterialsVoList(procMatVoList);
|
||||
}
|
||||
return processHo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,55 +97,29 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductAndProcess queryProductProcessDetail(ProductProcessParams params) {
|
||||
public ProductProcessHo queryProductProcessDetail(ProductProcessParams params) {
|
||||
//根据批次生产加工id查询批次产品加工单信息
|
||||
ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId());
|
||||
//根据批次产品加工id查询工序信息
|
||||
List<MtAloneProcessVo> tempProcessVoList = processService.findProcessVoListByProductProcess(params);
|
||||
|
||||
ProductAndProcess productAndProcess = new ProductAndProcess();
|
||||
productAndProcess.setProductProcess(productProcess);
|
||||
List<MtAloneProcessVo> processVoList;
|
||||
if(null != tempProcessVoList) {
|
||||
processVoList = new ArrayList<MtAloneProcessVo>(tempProcessVoList.size());
|
||||
ProductProcessHo productProcessHo = new ProductProcessHo();
|
||||
if(null != productProcess) {
|
||||
BeanUtils.copyProperties(productProcess, productProcessHo);
|
||||
if (null != tempProcessVoList) {
|
||||
List<ProcessHo> processHoList = new ArrayList<ProcessHo>(tempProcessVoList.size());
|
||||
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
|
||||
public ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params) {
|
||||
@ -153,6 +127,7 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
||||
|
||||
//批次产品加工单初步赋值,关联bom
|
||||
ProductProcessBom productProcessBom = productProcessBomService.selectByProdProcBom(params);
|
||||
if(null != productProcessBom) {
|
||||
productProcessHo.setProductBomId(productProcessBom.getId());
|
||||
productProcessHo.setProductProcessBomName(productProcessBom.getProductProcessName());
|
||||
//工序初步赋值,关联bom
|
||||
@ -161,9 +136,9 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
||||
processBomParams.setCompanyId(params.getCompanyId());
|
||||
List<ProcessBom> processBomList = processBomService.findListByProductBom(processBomParams);
|
||||
List<ProcessHo> processHoList;
|
||||
if(null != processBomList){
|
||||
if (null != processBomList) {
|
||||
processHoList = new ArrayList<ProcessHo>(processBomList.size());
|
||||
for(ProcessBom processBom : processBomList){
|
||||
for (ProcessBom processBom : processBomList) {
|
||||
ProcessHo processHo = new ProcessHo();
|
||||
processHo.setProcessBomId(processBom.getId());
|
||||
processHo.setProcessBomName(processBom.getProcessName());
|
||||
@ -178,15 +153,16 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
||||
procMatBomParams.setCompanyId(processBomParams.getCompanyId());
|
||||
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||
List<ProcessMaterialsVo> procMatVoList;
|
||||
if(null != procMatBomVoList){
|
||||
if (null != procMatBomVoList) {
|
||||
procMatVoList = new ArrayList<ProcessMaterialsVo>(procMatBomVoList.size());
|
||||
for (ProcessMaterialsBomVo procMatBomVo : procMatBomVoList){
|
||||
for (ProcessMaterialsBomVo procMatBomVo : procMatBomVoList) {
|
||||
ProcessMaterialsVo procMatVo = new ProcessMaterialsVo();
|
||||
procMatVo.setMaterialsBomId(procMatBomVo.getId());
|
||||
procMatVo.setMaterialsName(procMatBomVo.getMaterialsName());
|
||||
procMatVo.setSpecification(procMatBomVo.getSpecification());
|
||||
procMatVo.setUnitId(procMatBomVo.getUnitId());
|
||||
procMatVo.setUnitName0(procMatBomVo.getUnitName());
|
||||
procMatVo.setDosage(procMatBomVo.getDosage());//先按照模板对用量赋值,前端在将匹数乘以用量计算后展示在表格
|
||||
procMatVoList.add(procMatVo);
|
||||
}
|
||||
processHo.setProcessMaterialsVoList(procMatVoList);
|
||||
@ -195,6 +171,7 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
||||
}
|
||||
productProcessHo.setProcessHoList(processHoList);
|
||||
}
|
||||
}
|
||||
|
||||
return productProcessHo;
|
||||
|
||||
|
@ -129,13 +129,40 @@ public class MtAloneProcessController {
|
||||
* @param currentUser
|
||||
* @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({
|
||||
@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 = "查询")
|
||||
@OperateLog(description = "工序详情查询", type = "查询")
|
||||
@GetMapping("/query/process/detail")
|
||||
public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
|
||||
if(currentUser==null){
|
||||
@ -143,9 +170,8 @@ public class MtAloneProcessController {
|
||||
}
|
||||
|
||||
params.setCompanyId(currentUser.getCompanyId());
|
||||
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
||||
ProcessAndMaterialsBom processAndMaterialsBom = mtAloneProcessService.queryProcessDetail(params);
|
||||
return ResultGenerator.genSuccessResult(processAndMaterialsBom);
|
||||
ProcessHo processHo = mtAloneProcessService.queryProcessDetail(params);
|
||||
return ResultGenerator.genSuccessResult(processHo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +129,6 @@ public class ProductProcessController {
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* hy正在用
|
||||
* 点击批次生产加工单列表最后一列查看或处理按钮,
|
||||
@ -142,7 +141,6 @@ public class ProductProcessController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
|
||||
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||
|
||||
})
|
||||
@OperateLog(description = "批次生产加工单详情查询", type = "查询")
|
||||
@GetMapping("/query/product/process/detail")
|
||||
@ -152,8 +150,8 @@ public class ProductProcessController {
|
||||
}
|
||||
|
||||
params.setCompanyId(currentUser.getCompanyId());
|
||||
ProductAndProcess productAndProcess = productProcessService.queryProductProcessDetail(params);
|
||||
return ResultGenerator.genSuccessResult(productAndProcess);
|
||||
ProductProcessHo productProcessHo = productProcessService.queryProductProcessDetail(params);
|
||||
return ResultGenerator.genSuccessResult(productProcessHo);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,5 +203,4 @@ public class ProductProcessController {
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user