批次加工单、工序处理接口初步完成
This commit is contained in:
parent
d73f450488
commit
3c2c78c72a
@ -17,4 +17,6 @@ public interface MtAloneProcessService extends Service<MtAloneProcess, Integer>
|
|||||||
ProcessHo queryProcessDetail(MtAloneProcessParams params);
|
ProcessHo queryProcessDetail(MtAloneProcessParams params);
|
||||||
|
|
||||||
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
|
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
|
||||||
|
|
||||||
|
void updateProcess(ProcessHo processHo);
|
||||||
}
|
}
|
||||||
|
@ -21,4 +21,6 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
|
|||||||
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
|
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
|
||||||
|
|
||||||
void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser);
|
void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,39 +88,38 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
|
|||||||
procMatBomParams.setProcessBomId(processAndProcMat.getMtAloneProcessVo().getProcessBomId());
|
procMatBomParams.setProcessBomId(processAndProcMat.getMtAloneProcessVo().getProcessBomId());
|
||||||
procMatBomParams.setCompanyId(currentUser.getCompanyId());
|
procMatBomParams.setCompanyId(currentUser.getCompanyId());
|
||||||
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||||
|
|
||||||
////由物料bom对物料赋值,保存物料,其中前端赋值物料用量
|
|
||||||
//MtAloneProcessParams processParams = new MtAloneProcessParams();
|
|
||||||
//processParams.setProcessId(mtAloneProcessVo.getId());
|
|
||||||
//List<ProcessMaterialsVo> procMatVoList = processMaterialsService.findProcMatVoListByProcess(processParams);
|
|
||||||
//if(null == procMatVoList){
|
|
||||||
// procMatVoList = new ArrayList<ProcessMaterialsVo>(procMatBomVoList.size());
|
|
||||||
// Date date = new Date();
|
|
||||||
// for (ProcessMaterialsBomVo procMatBomVo : procMatBomVoList){
|
|
||||||
// ProcessMaterialsVo procMatVo = new ProcessMaterialsVo();
|
|
||||||
// procMatVo.setCreateTime(date);
|
|
||||||
// procMatVo.setUpdateTime(date);
|
|
||||||
// procMatVo.setStatus(0);
|
|
||||||
// procMatVo.setProcessId(mtAloneProcessVo.getId());
|
|
||||||
// procMatVo.setMaterialsBomId(procMatBomVo.getId());
|
|
||||||
// procMatVo.setMaterialsName(procMatBomVo.getMaterialsName());
|
|
||||||
// procMatVo.setCode(ProduceManagePublicMethod.creatUniqueCode("WL"));
|
|
||||||
// procMatVo.setSpecification(procMatBomVo.getSpecification());
|
|
||||||
// procMatVo.setUnitId(procMatBomVo.getUnitId());
|
|
||||||
// procMatVo.setCompanyId(currentUser.getCompanyId());
|
|
||||||
// procMatVoList.add(procMatVo);
|
|
||||||
// }
|
|
||||||
// processMaterialsService.save();
|
|
||||||
//}else{
|
|
||||||
// for ()
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProcess(ProcessHo processHo) {
|
||||||
|
Date date = new Date();
|
||||||
|
MtAloneProcess process = new MtAloneProcess();
|
||||||
|
processHo.setUpdateTime(date);
|
||||||
|
BeanUtils.copyProperties(processHo, process);
|
||||||
|
this.update(process);
|
||||||
|
|
||||||
//@Override
|
//if(null != processHo.getProcessMaterialsVoList()) {
|
||||||
//public List<MtAloneProcess> findList(MtAloneProcessParams params) {
|
// List<ProcessMaterialsVo> procMatVoList = processHo.getProcessMaterialsVoList();
|
||||||
// return mtAloneProcessMapper.findList(params);
|
// List<ProcessMaterials> procMatList = new ArrayList<ProcessMaterials>(procMatVoList.size());
|
||||||
|
// for (ProcessMaterialsVo processMaterialsVo : procMatVoList){
|
||||||
|
// ProcessMaterials processMaterials = new ProcessMaterials();
|
||||||
|
// processMaterialsVo.setUpdateTime(date);
|
||||||
|
// BeanUtils.copyProperties(processMaterialsVo, processMaterials);
|
||||||
|
// procMatList.add(processMaterials);
|
||||||
|
// }
|
||||||
|
// processMaterialsService.update(procMatList);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
if(null != processHo.getProcessMaterialsVoList()) {
|
||||||
|
List<ProcessMaterialsVo> procMatVoList = processHo.getProcessMaterialsVoList();
|
||||||
|
for (ProcessMaterialsVo processMaterialsVo : procMatVoList){
|
||||||
|
ProcessMaterials processMaterials = new ProcessMaterials();
|
||||||
|
processMaterialsVo.setUpdateTime(date);
|
||||||
|
BeanUtils.copyProperties(processMaterialsVo, processMaterials);
|
||||||
|
processMaterialsService.update(processMaterials);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -242,4 +242,6 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -169,16 +169,20 @@ public class MtAloneProcessController {
|
|||||||
return ResultGenerator.genSuccessResult();
|
return ResultGenerator.genSuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
//@ApiOperation(value = "工序详情更新", notes = "工序详情更新")
|
* hy正在用
|
||||||
//@ApiImplicitParams({
|
* 工序处理完毕点提交按钮后,同时更新工序和物料信息
|
||||||
// @ApiImplicitParam(name = "processAndProcMat", value = "工序及物料", paramType = "body", dataType = "ProcessAndProcMat", required = true)
|
* @param processHo
|
||||||
//})
|
* @return
|
||||||
//@OperateLog(description = "工序详情更新", type = "更新")
|
*/
|
||||||
//@PostMapping("/update")
|
@ApiOperation(value = "工序详情更新", notes = "工序详情更新")
|
||||||
//public Result updateProcess(@RequestBody MtAloneProcess mtAloneProcess) {
|
@ApiImplicitParams({
|
||||||
// mtAloneProcess.setUpdateTime(new Date());
|
@ApiImplicitParam(name = "processHo", value = "工序及物料", paramType = "body", dataType = "ProcessHo", required = true)
|
||||||
// mtAloneProcessService.update(mtAloneProcess);
|
})
|
||||||
// return ResultGenerator.genSuccessResult();
|
@OperateLog(description = "工序详情更新", type = "更新")
|
||||||
//}
|
@PostMapping("/updateProcess")
|
||||||
|
public Result updateProcess(@RequestBody ProcessHo processHo) {
|
||||||
|
mtAloneProcessService.updateProcess(processHo);
|
||||||
|
return ResultGenerator.genSuccessResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,12 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@ -203,4 +205,24 @@ public class ProductProcessController {
|
|||||||
return ResultGenerator.genSuccessResult();
|
return ResultGenerator.genSuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hy正在用
|
||||||
|
* 批次生产加工单处理完毕点保存按钮后,仅更新批次加工单信息
|
||||||
|
* @param productProcessHo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批次加工单详情更新", notes = "批次加工单详情更新")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "productProcessHo", value = "批次加工单", paramType = "body", dataType = "ProductProcessHo", required = true)
|
||||||
|
})
|
||||||
|
@OperateLog(description = "批次加工单详情更新", type = "更新")
|
||||||
|
@PostMapping("/updateProductProcess")
|
||||||
|
public Result updateProductProcess(@RequestBody ProductProcessHo productProcessHo) {
|
||||||
|
ProductProcess productProcess = new ProductProcess();
|
||||||
|
productProcessHo.setUpdateTime(new Date());
|
||||||
|
BeanUtils.copyProperties(productProcessHo, productProcess);
|
||||||
|
productProcessService.update(productProcess);
|
||||||
|
return ResultGenerator.genSuccessResult();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user