批次加工单、工序处理接口初步完成

This commit is contained in:
hy2250089 2020-01-02 19:19:21 +08:00
vanhempi d73f450488
commit 3c2c78c72a
6 muutettua tiedostoa jossa 76 lisäystä ja 44 poistoa

Näytä tiedosto

@ -17,4 +17,6 @@ public interface MtAloneProcessService extends Service<MtAloneProcess, Integer>
ProcessHo queryProcessDetail(MtAloneProcessParams params);
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
void updateProcess(ProcessHo processHo);
}

Näytä tiedosto

@ -21,4 +21,6 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser);
}

Näytä tiedosto

@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -87,39 +88,38 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
procMatBomParams.setProcessBomId(processAndProcMat.getMtAloneProcessVo().getProcessBomId());
procMatBomParams.setCompanyId(currentUser.getCompanyId());
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);
//if(null != processHo.getProcessMaterialsVoList()) {
// List<ProcessMaterialsVo> procMatVoList = processHo.getProcessMaterialsVoList();
// 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);
}
}
}
//@Override
//public List<MtAloneProcess> findList(MtAloneProcessParams params) {
// return mtAloneProcessMapper.findList(params);
//}
}

Näytä tiedosto

@ -242,4 +242,6 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
}
}
}

Näytä tiedosto

@ -169,16 +169,20 @@ public class MtAloneProcessController {
return ResultGenerator.genSuccessResult();
}
//@ApiOperation(value = "工序详情更新", notes = "工序详情更新")
//@ApiImplicitParams({
// @ApiImplicitParam(name = "processAndProcMat", value = "工序及物料", paramType = "body", dataType = "ProcessAndProcMat", required = true)
//})
//@OperateLog(description = "工序详情更新", type = "更新")
//@PostMapping("/update")
//public Result updateProcess(@RequestBody MtAloneProcess mtAloneProcess) {
// mtAloneProcess.setUpdateTime(new Date());
// mtAloneProcessService.update(mtAloneProcess);
// return ResultGenerator.genSuccessResult();
//}
/**
* hy正在用
* 工序处理完毕点提交按钮后同时更新工序和物料信息
* @param processHo
* @return
*/
@ApiOperation(value = "工序详情更新", notes = "工序详情更新")
@ApiImplicitParams({
@ApiImplicitParam(name = "processHo", value = "工序及物料", paramType = "body", dataType = "ProcessHo", required = true)
})
@OperateLog(description = "工序详情更新", type = "更新")
@PostMapping("/updateProcess")
public Result updateProcess(@RequestBody ProcessHo processHo) {
mtAloneProcessService.updateProcess(processHo);
return ResultGenerator.genSuccessResult();
}
}

Näytä tiedosto

@ -16,10 +16,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Date;
import java.util.List;
@ -203,4 +205,24 @@ public class ProductProcessController {
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();
}
}