按新要求修改
This commit is contained in:
parent
ff71134a24
commit
f32b2aaed0
@ -126,6 +126,9 @@ public class ProcessBomController {
|
||||
@PreAuthorize("@ss.hasPermission('heli:process-bom:query')")
|
||||
public CommonResult<ProcessBomRespVO> getProcessBom(@RequestParam("id") Long id) {
|
||||
ProcessBomDO processBom = processBomService.getProcessBom(id);
|
||||
if (processBom != null){
|
||||
processBom.setBomCode(processBom.getCode() == null ? "":processBom.getCode());
|
||||
}
|
||||
return success(BeanUtils.toBean(processBom, ProcessBomRespVO.class));
|
||||
}
|
||||
|
||||
@ -194,8 +197,8 @@ public class ProcessBomController {
|
||||
@OperateLog(type = IMPORT)
|
||||
public CommonResult<ProcessBomImportRespVO> importExcel(HttpServletRequest request,@RequestParam("file") MultipartFile file) {
|
||||
try {
|
||||
String bomCode = request.getHeader("Bom-Code");
|
||||
processBomService.importExcel(file,bomCode);
|
||||
String bomId = request.getHeader("Bom-Code");
|
||||
processBomService.importExcel(file,bomId);
|
||||
return success(null);
|
||||
} catch (Exception e) {
|
||||
return error(500, "文件导入失败: " + e.getMessage());
|
||||
|
@ -84,6 +84,14 @@ public class ProcessDesignController {
|
||||
return success(BeanUtils.toBean(processDesign, ProcessDesignRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/over")
|
||||
@Operation(summary = "更新")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:process-design:query')")
|
||||
public CommonResult<Integer> over(@RequestParam("id") Long id) {
|
||||
return success(processDesignService.over(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得工艺设计分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:process-design:query')")
|
||||
|
@ -25,7 +25,7 @@ public class ProcessDesignRespVO {
|
||||
@Schema(description = "生产计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "87")
|
||||
@ExcelProperty("生产计划id")
|
||||
private Long planId;
|
||||
|
||||
private Date overTime;
|
||||
@Schema(description = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK", converter = DictConvert.class)
|
||||
@DictFormat("heli_process_design_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
@ -38,7 +38,7 @@ public class ProcessDesignRespVO {
|
||||
@Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态,1表示正常,2表示禁用")
|
||||
private Integer status;
|
||||
|
||||
private Integer isOverProcess;
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
@ -147,7 +147,8 @@ public class PgMasterLineDO extends BaseDO {
|
||||
* 报工状态
|
||||
*/
|
||||
private String active;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String procedureName;
|
||||
@TableField(exist = false)
|
||||
private Integer amounts;
|
||||
|
||||
|
@ -60,10 +60,12 @@ public class ProcessDesignDO extends BaseDO {
|
||||
private Date delayTime;
|
||||
|
||||
private String delayReason;
|
||||
private Integer isOverProcess;
|
||||
/**
|
||||
* 子项目id
|
||||
*/
|
||||
private Long projectSubId;
|
||||
private Date overTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String planCode;
|
||||
|
@ -77,10 +77,11 @@ public interface PgMasterLineMapper extends BaseMapperX<PgMasterLineDO> {
|
||||
MPJLambdaWrapper<PgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(PgMasterLineDO.class)
|
||||
.select("d.amounts,d.workTime")
|
||||
.select("pd.name as procedureName")
|
||||
.leftJoin("(select SUM(c.amount) as amounts ,SUM(c.work_time) as workTime,c.zj_mx_id from quality_bg_master_line c group by c.zj_mx_id) d on d.zj_mx_id = t.id")
|
||||
.leftJoin(ProjectOrderSubDO.class,"pos",ProjectOrderSubDO::getId,PgMasterLineDO::getProjectSubId)
|
||||
.leftJoin(PlanDO.class,"pl",PlanDO::getProjectId,ProjectOrderSubDO::getProjectOrderId)
|
||||
|
||||
.leftJoin(ProcedureDO.class,"pd",ProcedureDO::getId,PgMasterLineDO::getProcedureId)
|
||||
.eq(PlanDO::getStatus,2)
|
||||
.disableSubLogicDel();
|
||||
if (reqVO.getPgType() == 1){
|
||||
|
@ -68,6 +68,16 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
|
||||
;
|
||||
return selectCount(query);
|
||||
}
|
||||
default Long getBomDetailByBluePrintNoAndBomId(Long bomId,String bluePrintNo){
|
||||
MPJLambdaWrapper<ProcessBomDetailDO> query = new MPJLambdaWrapper<>();
|
||||
query.leftJoin(ProcessBomDO.class,"q",ProcessBomDO::getId,ProcessBomDetailDO::getBomId)
|
||||
.leftJoin(PlanSubDO.class, "g", PlanSubDO::getProjectSubId, ProcessBomDO::getProjectSubId)
|
||||
.eq(ProcessBomDetailDO::getBomId, bomId)
|
||||
.eq(ProcessBomDetailDO::getBlueprintNo,bluePrintNo)
|
||||
.eq(ProcessBomDetailDO::getDeleted,0)
|
||||
;
|
||||
return selectCount(query);
|
||||
}
|
||||
default PageResult<ProcessBomDetailDO> selectPageNew(ProcessBomPageReqVO reqVO) {
|
||||
MPJLambdaWrapper<ProcessBomDetailDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(ProcessBomDetailDO.class)
|
||||
|
@ -70,6 +70,8 @@ public interface ProcessBomMapper extends BaseMapperX<ProcessBomDO> {
|
||||
MPJLambdaWrapper<ProcessBomDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(ProcessBomDO.class)
|
||||
.select("concat('BOM-', e.project_sub_code) as bomCode", "e.project_sub_code as projectSubCode")
|
||||
// .select( "e.project_sub_code as projectSubCode")
|
||||
|
||||
.select("a.plan_no as planCode", "b.code as projectCode", "c.name as customerName", "b.project_name as projectName")
|
||||
.select("d.name as projectSubName")
|
||||
.leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessBomDO::getPlanId)
|
||||
@ -124,7 +126,9 @@ public interface ProcessBomMapper extends BaseMapperX<ProcessBomDO> {
|
||||
default ProcessBomDO selectById(Long id) {
|
||||
MPJLambdaWrapper<ProcessBomDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(ProcessBomDO.class)
|
||||
.select("concat('BOM-', e.project_sub_code) as bomCode", "e.project_sub_code as projectSubCode")
|
||||
// .select("concat('BOM-', e.project_sub_code) as bomCode", "e.project_sub_code as projectSubCode")
|
||||
.select( "e.project_sub_code as projectSubCode")
|
||||
|
||||
.select("a.plan_no as planCode", "b.code as projectCode", "c.name as customerName", "b.project_name as projectName","b.property as property")
|
||||
.select("c.brief as customerBrief,b.project_name_sim as projectNameSim,e.project_sub_short_name as subNameSim")
|
||||
.select("d.name as projectSubName")
|
||||
@ -150,16 +154,16 @@ public interface ProcessBomMapper extends BaseMapperX<ProcessBomDO> {
|
||||
return selectOne(query);
|
||||
}
|
||||
|
||||
default ProcessBomDO getProcessBomByBomCode(String bomCode) {
|
||||
MPJLambdaWrapper<ProcessBomDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(ProcessBomDO.class)
|
||||
.select("concat('BOM-', q.project_sub_code) as bomCode")
|
||||
.leftJoin(PlanSubDO.class, "q", PlanSubDO::getProjectSubId, ProcessBomDO::getProjectSubId)
|
||||
.eq(PlanSubDO::getProjectSubCode, bomCode)
|
||||
.eq(ProcessBomDO::getDeleted,0)
|
||||
;
|
||||
return selectOne(query);
|
||||
}
|
||||
// default ProcessBomDO getProcessBomByBomCode(String bomCode,String ss) {
|
||||
// MPJLambdaWrapper<ProcessBomDO> query = new MPJLambdaWrapper<>();
|
||||
// query.selectAll(ProcessBomDO.class)
|
||||
// .select("concat('BOM-', q.project_sub_code) as bomCode")
|
||||
// .leftJoin(PlanSubDO.class, "q", PlanSubDO::getProjectSubId, ProcessBomDO::getProjectSubId)
|
||||
// .eq(PlanSubDO::getProjectSubCode, bomCode)
|
||||
// .eq(ProcessBomDO::getDeleted,0)
|
||||
// ;
|
||||
// return selectOne(query);
|
||||
// }
|
||||
|
||||
default ProcessBomDO selectByIdbyid(Long id) {
|
||||
MPJLambdaWrapper<ProcessBomDO> query = new MPJLambdaWrapper<>();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.ProcessDesignPageReqVO;
|
||||
@ -15,6 +16,8 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 工艺设计 Mapper
|
||||
*
|
||||
@ -85,16 +88,23 @@ public interface ProcessDesignMapper extends BaseMapperX<ProcessDesignDO> {
|
||||
}
|
||||
if(reqVO.getPgType() != null){
|
||||
if(reqVO.getPgType()==0){
|
||||
query.and(QueryWrapper -> QueryWrapper.apply("z.progress < {0}" , 100).or().apply("z.progress is null"));
|
||||
query.eq(ProcessDesignDO::getIsOverProcess,0);
|
||||
// query.and(QueryWrapper -> QueryWrapper.apply("z.progress < {0}" , 100).or().apply("z.progress is null"));
|
||||
}else{
|
||||
query.and(QueryWrapper -> QueryWrapper.apply("z.progress >= {0}" , 100));
|
||||
query.eq(ProcessDesignDO::getIsOverProcess,1);
|
||||
// query.and(QueryWrapper -> QueryWrapper.apply("z.progress >= {0}" , 100));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
|
||||
default int over(Long id){
|
||||
UpdateWrapper<ProcessDesignDO> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("is_over_process",1).set("over_time",new Date())
|
||||
.eq("id", id);
|
||||
return update(updateWrapper);
|
||||
}
|
||||
default ProcessDesignDO selectById(Long id) {
|
||||
MPJLambdaWrapper<ProcessDesignDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(ProcessDesignDO.class)
|
||||
|
@ -95,6 +95,7 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
||||
MPJLambdaWrapper<TaskDispatchDetailDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(TaskDispatchDetailDO.class)
|
||||
.select("a.is_report as isReport")
|
||||
.select("a.name as procedureName")
|
||||
.leftJoin(ProcedureDO.class,"a",ProcedureDO::getId,TaskDispatchDetailDO::getProcedureId)
|
||||
.lt(TaskDispatchDetailDO::getSort,taskDispatchDetailDO.getSort())
|
||||
.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId());
|
||||
|
@ -60,7 +60,7 @@ public interface ProcessBomService {
|
||||
ProcessBomDO getProcessBom(Long id);
|
||||
|
||||
ProcessBomDO getProcessBomId(String code);
|
||||
ProcessBomDO getProcessBomByBomCode(String bomCode);
|
||||
// ProcessBomDO getProcessBomByBomCode(String bomCode);
|
||||
/**
|
||||
* 获得工艺bom分页
|
||||
*
|
||||
|
@ -130,7 +130,7 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importExcel(@Valid MultipartFile file,String bomCode) throws IOException {
|
||||
public void importExcel(@Valid MultipartFile file,String bomId) throws IOException {
|
||||
// 校验文件格式
|
||||
if (!file.getOriginalFilename().endsWith(".xlsx") && !file.getOriginalFilename().endsWith(".xls")) {
|
||||
throw exception(EXCEL_FILE_FORMAT_ERROR);
|
||||
@ -138,16 +138,16 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
// 读取Excel文件并转换为VO对象列表
|
||||
List<ProcessBomImportExcelVO> list = ExcelUtils.read(file, ProcessBomImportExcelVO.class);
|
||||
for (ProcessBomImportExcelVO processBomImportExcelVO : list) {
|
||||
processBomImportExcelVO.setCode(bomCode);
|
||||
processBomImportExcelVO.setCode(bomId);
|
||||
}
|
||||
HashSet<String> blueprintNoList = new HashSet<String>();
|
||||
Map<String, List<ProcessBomImportExcelVO>> groupedByCode = list.stream().collect(Collectors.groupingBy(vo -> vo.getCode() == null ? "NULL" : vo.getCode()));
|
||||
Map<String, List<ProcessBomImportExcelVO>> groupedByBluePrintfNo = list.stream().collect(Collectors.groupingBy(vo -> vo.getBlueprintNo() == null ? "NULL" : vo.getBlueprintNo()));
|
||||
Map<String, List<ProcessBomImportExcelVO>> groupedByMaterialName = list.stream().collect(Collectors.groupingBy(vo -> vo.getMaterialName() == null ? "NULL" : vo.getMaterialName()));
|
||||
Map<String, List<ProcessBomImportExcelVO>> groupedByMaterialName = list.stream().filter(e -> e.getType().equals("否")).collect(Collectors.groupingBy(vo -> vo.getMaterialName() == null ? "NULL" : vo.getMaterialName()));
|
||||
|
||||
if (CollUtil.isNotEmpty(groupedByCode.get("NULL"))) {
|
||||
throw exception(PROCESS_BOM_CODE_IS_EMPTY);
|
||||
}
|
||||
// if (CollUtil.isNotEmpty(groupedByCode.get("NULL"))) {
|
||||
// throw exception(PROCESS_BOM_CODE_IS_EMPTY);
|
||||
// }
|
||||
if (CollUtil.isNotEmpty(groupedByBluePrintfNo.get("NULL"))) {
|
||||
throw exception(PROCESS_BOM_DETAIL_BLUE_PRINT_NO_NOT_EXISTS);
|
||||
}
|
||||
@ -164,11 +164,11 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
Map<String, List<ProcessBomImportExcelVO>> bluePrintNoList = listtemp.stream().collect(Collectors.groupingBy(vo -> vo.getBlueprintNo() == null ? "NULL" : vo.getBlueprintNo()));
|
||||
bluePrintNoList.forEach((printNo, listTemp1) -> {
|
||||
if (listTemp1.size() > 1) {
|
||||
throw new RuntimeException("本次提交文件中,BOM编号为:" + code + "的图号:" + printNo + "重复!");
|
||||
throw new RuntimeException("图号:" + printNo + "重复!");
|
||||
} else {
|
||||
Long bomDetailByBluePrintNoAndBomId = processBomDetailMapper.getBomDetailByBluePrintNoAndBomId(code.substring(4, code.length()), printNo);
|
||||
Long bomDetailByBluePrintNoAndBomId = processBomDetailMapper.getBomDetailByBluePrintNoAndBomId(Long.valueOf(bomId), printNo);
|
||||
if (bomDetailByBluePrintNoAndBomId > 0) {
|
||||
throw new RuntimeException("数据库中BOM编号为:" + code + "的图号:" + printNo + "已存在,勿重复添加!");
|
||||
throw new RuntimeException("图号:" + printNo + "已存在,勿重复添加!");
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -179,10 +179,10 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
Map<String, List<ProcessBomImportExcelVO>> materialNameList = listtemp.stream() .filter(vo -> vo.getType().equals("否")).collect(Collectors.groupingBy(vo -> vo.getMaterialName() == null ? "NULL" : vo.getMaterialName()));
|
||||
materialNameList.forEach((materialName, listTemp2) -> {
|
||||
if (listTemp2.size() > 1) {
|
||||
throw new RuntimeException("本次提交文件中,BOM编号为:" + code + "的非标准件物料名称:" + materialName + "重复!");
|
||||
throw new RuntimeException("非标准件物料名称:" + materialName + "重复!");
|
||||
}else{
|
||||
if(listTemp2.get(0).getSpec() == null){
|
||||
throw new RuntimeException("本次提交文件中,BOM编号为:" + code + "的非标准件:" + materialName + "规格为空!");
|
||||
throw new RuntimeException("非标准件:" + materialName + "规格为空!");
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -200,9 +200,9 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
|
||||
//遍历List集合
|
||||
groupedByCode.forEach((key, listValue) -> {
|
||||
ProcessBomDO processBomDO = processBomMapper.getProcessBomByBomCode(key.substring(4, key.length()));
|
||||
ProcessBomDO processBomDO = processBomMapper.selectById(Long.valueOf(bomId));
|
||||
if (processBomDO == null) {
|
||||
throw new RuntimeException("未找到" + key + "工艺BOM");
|
||||
throw new RuntimeException("未找到工艺BOM");
|
||||
}else if (processBomDO.getBomStatus() == StatusEnum.SUBMITTED.getStatus()){
|
||||
//BOM状态已提交,不允许添加
|
||||
throw new RuntimeException(key+"工艺BOM状态为“已提交”,不允许新增零件");
|
||||
@ -212,25 +212,31 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
processBomDO.setBomStatus(StatusEnum.SAVED.getStatus());
|
||||
Integer bomStatus = BomEditStatusEnum.NEW_ADD.getStatus();
|
||||
updateProcessBomDoList.add(processBomDO);
|
||||
boolean standard = false;
|
||||
for (ProcessBomImportExcelVO o : listValue) {
|
||||
Integer bomOperateCount = 0;
|
||||
MaterialDO materialDO = new MaterialDO();
|
||||
String type = null;
|
||||
standard = false;
|
||||
if (unitDictData.get(o.getUnit())==null){
|
||||
throw new RuntimeException("bom为"+key+"下的明细行"+o.getMaterialName()+"单位非法,请维护字典基础数据后重试");
|
||||
throw new RuntimeException("bom下的明细行"+o.getMaterialName()+"单位非法,请维护字典基础数据后重试");
|
||||
}else {
|
||||
o.setUnit(unitDictData.get(o.getUnit()));
|
||||
}
|
||||
|
||||
if (o.getType()!=null){
|
||||
if (o.getType().equals("是")){
|
||||
standard = true;
|
||||
type = "1";
|
||||
materialDO = materialService.getMaterialId(o.getMaterialCode());
|
||||
if (materialDO == null) {
|
||||
throw new RuntimeException(o.getMaterialName() + "物料不存在");
|
||||
throw new RuntimeException("物料编码为:"+o.getMaterialCode() + "物料不存在");
|
||||
}
|
||||
|
||||
}
|
||||
else if (o.getType().equals("否")){
|
||||
type = "2";
|
||||
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("是否为标准件填写不正确,只能填写“是”或“否”,请检查");
|
||||
@ -238,11 +244,22 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
}else {
|
||||
throw new RuntimeException("是否为标准件项不得为空");
|
||||
}
|
||||
CompositionDO compositionDO = compositionService.getCompositionId(o.getComposition());
|
||||
if (compositionDO == null) {
|
||||
throw new RuntimeException(o.getComposition() + "材质不存在");
|
||||
}
|
||||
|
||||
|
||||
ProcessBomDetailDO processBomDetailDO = new ProcessBomDetailDO();
|
||||
if (standard && o.getComposition() != null && !o.getComposition().trim().equals("")){
|
||||
CompositionDO compositionDO = compositionService.getCompositionId(o.getComposition());
|
||||
if (compositionDO == null) {
|
||||
throw new RuntimeException(o.getComposition() + "材质不存在");
|
||||
}
|
||||
processBomDetailDO.setCompositionId(compositionDO.getId());//材质ID
|
||||
}else if (!standard){
|
||||
CompositionDO compositionDO = compositionService.getCompositionId(o.getComposition());
|
||||
if (compositionDO == null) {
|
||||
throw new RuntimeException(o.getComposition() + "材质不存在");
|
||||
}
|
||||
processBomDetailDO.setCompositionId(compositionDO.getId());//材质ID
|
||||
}
|
||||
List<ProcessBomDetailDO> processBomDetailDOS = null;
|
||||
if (!processBomDetailMap.containsKey(processBomDO.getBomId())) {
|
||||
processBomDetailDOS = getProcessBomDetailListByBomId(processBomDO.getId());
|
||||
@ -267,7 +284,7 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
}else{
|
||||
processBomDetailDO.setMaterialName(o.getMaterialName());
|
||||
}
|
||||
processBomDetailDO.setCompositionId(compositionDO.getId());//材质ID
|
||||
|
||||
processBomDetailDO.setSpec(o.getSpec());//规格
|
||||
|
||||
processBomDetailDO.setUnit(o.getUnit());//单位
|
||||
@ -371,28 +388,28 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
if (processBomDetail.getCompositionId() == null) {
|
||||
throw exception(new ErrorCode(1_006_9999,processBomDetail.getMaterialName()+"材质不能为空,请确认!"));
|
||||
}
|
||||
if(processBomDetail.getId() == null){
|
||||
if(updateReqVO.getCustomerBrief() != null && !updateReqVO.getCustomerBrief().equals("")){
|
||||
processBomDetail.setMaterialCode(updateReqVO.getCustomerBrief()+'-' );
|
||||
if(updateReqVO.getProjectNameSim() != null && !updateReqVO.getProjectNameSim().equals("")){
|
||||
processBomDetail.setMaterialCode(processBomDetail.getMaterialCode() + updateReqVO.getProjectNameSim() +'-');
|
||||
if(updateReqVO.getSubNameSim() != null && !updateReqVO.getSubNameSim().equals("")){
|
||||
processBomDetail.setMaterialCode(processBomDetail.getMaterialCode() + updateReqVO.getSubNameSim() + '-' );
|
||||
if(processBomDetail.getBlueprintNo() != null && ! processBomDetail.getBlueprintNo().equals("")){
|
||||
processBomDetail.setMaterialCode(processBomDetail.getMaterialCode()+processBomDetail.getBlueprintNo()) ;
|
||||
}else{
|
||||
processBomDetail.setMaterialCode("");
|
||||
}
|
||||
}else{
|
||||
processBomDetail.setMaterialCode("");
|
||||
}
|
||||
}else{
|
||||
processBomDetail.setMaterialCode("");
|
||||
}
|
||||
}else{
|
||||
processBomDetail.setMaterialCode("");
|
||||
}
|
||||
}
|
||||
// if(processBomDetail.getId() == null){
|
||||
// if(updateReqVO.getCustomerBrief() != null && !updateReqVO.getCustomerBrief().equals("")){
|
||||
// processBomDetail.setMaterialCode(updateReqVO.getCustomerBrief()+'-' );
|
||||
// if(updateReqVO.getProjectNameSim() != null && !updateReqVO.getProjectNameSim().equals("")){
|
||||
// processBomDetail.setMaterialCode(processBomDetail.getMaterialCode() + updateReqVO.getProjectNameSim() +'-');
|
||||
// if(updateReqVO.getSubNameSim() != null && !updateReqVO.getSubNameSim().equals("")){
|
||||
// processBomDetail.setMaterialCode(processBomDetail.getMaterialCode() + updateReqVO.getSubNameSim() + '-' );
|
||||
// if(processBomDetail.getBlueprintNo() != null && ! processBomDetail.getBlueprintNo().equals("")){
|
||||
// processBomDetail.setMaterialCode(processBomDetail.getMaterialCode()+processBomDetail.getBlueprintNo()) ;
|
||||
// }else{
|
||||
// processBomDetail.setMaterialCode("");
|
||||
// }
|
||||
// }else{
|
||||
// processBomDetail.setMaterialCode("");
|
||||
// }
|
||||
// }else{
|
||||
// processBomDetail.setMaterialCode("");
|
||||
// }
|
||||
// }else{
|
||||
// processBomDetail.setMaterialCode("");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@ -695,12 +712,12 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
|
||||
return processBomMapper.selectBom(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessBomDO getProcessBomByBomCode(String bomCode){
|
||||
|
||||
return processBomMapper.getProcessBomByBomCode(bomCode);
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// public ProcessBomDO getProcessBomByBomCode(String bomCode){
|
||||
//
|
||||
// return processBomMapper.getProcessBomByBomCode(bomCode);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessBomDO> getProcessBomPage(ProcessBomPageReqVO pageReqVO) {
|
||||
@ -712,7 +729,14 @@ public class ProcessBomServiceImpl implements ProcessBomService {
|
||||
}
|
||||
@Override
|
||||
public PageResult<ProcessBomDO> getProcessBomPages(ProcessBomPageReqVO pageReqVO) {
|
||||
return processBomMapper.selectPages(pageReqVO);
|
||||
PageResult<ProcessBomDO> processBomDOPageResult = processBomMapper.selectPages(pageReqVO);
|
||||
// if (processBomDOPageResult.getTotal() > 0l){
|
||||
// List<ProcessBomDO> list = processBomDOPageResult.getList();
|
||||
// for (ProcessBomDO processBomDO : list) {
|
||||
// processBomDO.setBomCode(processBomDO.getCode() == null ? "":processBomDO.getCode());
|
||||
// }
|
||||
// }
|
||||
return processBomDOPageResult;
|
||||
}
|
||||
@Override
|
||||
public PageResult<ProcessBomDO> getProcessBomPagesall() {
|
||||
|
@ -56,6 +56,8 @@ public interface ProcessDesignService {
|
||||
*/
|
||||
ProcessDesignDO getProcessDesign(Long id);
|
||||
|
||||
|
||||
int over(Long id);
|
||||
/**
|
||||
* 获得工艺设计分页
|
||||
*
|
||||
|
@ -236,6 +236,11 @@ public class ProcessDesignServiceImpl implements ProcessDesignService {
|
||||
return processDesignMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int over(Long id) {
|
||||
return processDesignMapper.over(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessDesignDO> getProcessDesignPage(ProcessDesignPageReqVO pageReqVO) {
|
||||
if(pageReqVO.getIsOverview()){
|
||||
@ -243,7 +248,7 @@ public class ProcessDesignServiceImpl implements ProcessDesignService {
|
||||
if(processDesignDOPageResult.getTotal() > 0){
|
||||
processDesignDOPageResult.getList().forEach(processDesignDO -> {
|
||||
ProcessDesignProgressDO processDesignProgressDO = processDesignProgressMapper.selectLaster(processDesignDO.getId());
|
||||
if (processDesignProgressDO.getIsOver() == 1){
|
||||
if (processDesignProgressDO != null && processDesignProgressDO.getIsOver() == 1){
|
||||
processDesignDO.setOver(true);
|
||||
if(processDesignProgressDO.getEndTime() != null ){
|
||||
processDesignDO.setLastDate(processDesignProgressDO.getEndTime());
|
||||
@ -283,7 +288,7 @@ public class ProcessDesignServiceImpl implements ProcessDesignService {
|
||||
if (processDesignDOPageResult.getTotal() > 0L){
|
||||
for (ProcessDesignDO processDesignDO : processDesignDOPageResult.getList()) {
|
||||
ProcessDesignProgressDO processDesignProgressDO = processDesignProgressMapper.selectLaster(processDesignDO.getId());
|
||||
if (processDesignProgressDO.getIsOver() == 1){
|
||||
if (processDesignProgressDO != null && processDesignProgressDO.getIsOver() == 1){
|
||||
processDesignDO.setOver(true);
|
||||
if(processDesignProgressDO.getEndTime() != null ){
|
||||
processDesignDO.setLastDate(processDesignProgressDO.getEndTime());
|
||||
|
@ -507,20 +507,31 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
// );
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(1);
|
||||
List<TaskDispatchDetailDO> taskDispatchDetailDO2 = taskDispatchDetailMapper.selectNoReportBeforeDo(taskDispatchDetailDO);
|
||||
List<TaskDispatchDetailDO> filteredList = taskDispatchDetailDO2.stream()
|
||||
.filter(task -> task.getProcedureStatus() != 2) // 筛选product不为"2"的记录
|
||||
.collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(filteredList)){
|
||||
//如果他之前的数据有未完成的且是需要报工的
|
||||
for (TaskDispatchDetailDO dispatchDetailDO : filteredList) {
|
||||
if (dispatchDetailDO.getIsReport() != 0){
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(0);
|
||||
break;
|
||||
if (CollUtil.isNotEmpty(taskDispatchDetailDO2)){
|
||||
//
|
||||
for (TaskDispatchDetailDO dispatchDetailDO : taskDispatchDetailDO2) {
|
||||
if (!dispatchDetailDO.getTestYn().equals("Y")){
|
||||
throw exception(new ErrorCode(102223_666,"上一道工序:"+dispatchDetailDO.getProcedureName() + "没有完成,请确认!"));
|
||||
}
|
||||
}
|
||||
|
||||
List<TaskDispatchDetailDO> filteredList = taskDispatchDetailDO2.stream()
|
||||
.filter(task -> task.getProcedureStatus() != 2) // 筛选product不为"2"的记录
|
||||
.collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(filteredList)){
|
||||
//如果他之前的数据有未完成的且是需要报工的
|
||||
for (TaskDispatchDetailDO dispatchDetailDO : filteredList) {
|
||||
if (dispatchDetailDO.getIsReport() != 0){
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(1);
|
||||
|
||||
}
|
||||
return taskDispatchDetailDO;
|
||||
}
|
||||
@ -753,7 +764,7 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
||||
}
|
||||
}
|
||||
if (taskDispatchDetailDO.getDispatchType().equals("PRODUCTION")){
|
||||
if (taskDispatchDO.getDispatchType().equals("PRODUCTION")){
|
||||
pgMasterService.insertPgList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getBomDetailId(),taskDispatchDetailDO.getProcedureId());
|
||||
}
|
||||
// if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && isBomDetailProductionOver){
|
||||
|
@ -44,7 +44,7 @@ spring:
|
||||
datasource:
|
||||
master:
|
||||
name: mes-heli
|
||||
url: jdbc:mysql://localhost:3306/mes-heli?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&socketTimeout=30000&connectTimeout=30000
|
||||
url: jdbc:mysql://218.75.46.166:3306/mes-heli?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&socketTimeout=30000&connectTimeout=30000
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: 'heli,12#$'
|
||||
|
@ -7,6 +7,7 @@ spring:
|
||||
profiles:
|
||||
active: local
|
||||
|
||||
|
||||
main:
|
||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||
|
||||
|
@ -81,12 +81,12 @@
|
||||
<el-table-column fixed="right" label="2D截止日期" align="center" prop="twoDimDate" :formatter="dateFormatter2" min-width="140" />
|
||||
<el-table-column fixed="right" label="完成情况" align="center" prop="progress" min-width="120">
|
||||
<template #default="scope">
|
||||
{{!scope.row.progress ? '' : (parseFloat(scope.row.progress) + '%')}}
|
||||
{{getDetailMsg(scope.row)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="最新进度" align="center" prop="progress" min-width="120">
|
||||
<template #default="scope">
|
||||
{{scope.row.isOver ? '已完成':'实施中'}}
|
||||
{{scope.row.isOverProcess == 1 ? '已完成':'实施中'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" align="center" min-width="160">
|
||||
@ -184,7 +184,29 @@ const openDetail = (type: string, id?: number) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const getDetailMsg = (row) =>{
|
||||
if(row.isOverProcess){
|
||||
//完结的,按计划完成了还是没按计划完成
|
||||
if(row.twoDimDate != null && row.lastDate != null ){
|
||||
const start = new Date(row.twoDimDate).getTime();
|
||||
const end = new Date(row.lastDate).getTime();
|
||||
const diffTime = Math.abs(end - start);
|
||||
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
if(row.lastDate > row.twoDimDate){
|
||||
return '延后' + day +'天';
|
||||
}else if (row.lastDate < row.twoDimDate){
|
||||
return '提前' + day +'天';
|
||||
}else{
|
||||
return '按时完成'
|
||||
}
|
||||
}else{
|
||||
return '实施中';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user