feat: 电气专用bom功能
This commit is contained in:
parent
2154ac2599
commit
acbd76a8bf
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.product.bomnew.api.user;
|
package com.nflg.product.bomnew.api.user;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.mzt.logapi.context.LogRecordContext;
|
import com.mzt.logapi.context.LogRecordContext;
|
||||||
import com.mzt.logapi.starter.annotation.LogRecord;
|
import com.mzt.logapi.starter.annotation.LogRecord;
|
||||||
import com.nflg.product.base.core.api.BaseApi;
|
import com.nflg.product.base.core.api.BaseApi;
|
||||||
|
|
@ -17,8 +18,11 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import nflg.product.common.vo.ResultVO;
|
import nflg.product.common.vo.ResultVO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.ttzero.excel.entity.ListSheet;
|
||||||
|
import org.ttzero.excel.entity.Workbook;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -39,6 +43,20 @@ public class DQBomApi extends BaseApi {
|
||||||
@Resource
|
@Resource
|
||||||
DQBomService dQBomService;
|
DQBomService dQBomService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板下载
|
||||||
|
* @param response
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
@GetMapping("getExcelTemplate")
|
||||||
|
@ApiOperation("模板下载")
|
||||||
|
public void getExcelTemplate(HttpServletResponse response) throws IOException {
|
||||||
|
EecExcelUtil.setResponseExcelHeader(response, "电气专用bom导入模版");
|
||||||
|
new Workbook("物料导入模板")
|
||||||
|
.addSheet(new ListSheet<>("sheet1", ImmutableList.of(new DQbomExcelVO())))
|
||||||
|
.writeTo(response.getOutputStream());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入
|
* 导入
|
||||||
* @param file 导入的excel文件
|
* @param file 导入的excel文件
|
||||||
|
|
@ -177,10 +195,15 @@ public class DQBomApi extends BaseApi {
|
||||||
return ResultVO.error("暂未实现");
|
return ResultVO.error("暂未实现");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("convertToSAP")
|
/**
|
||||||
@ApiOperation("导入SAP")
|
* 导入到SAP
|
||||||
public ResultVO convertToSAP(@Valid @RequestBody @NotNull Long rootBomRowId) {
|
* @param rootBomRowId 顶级bom的rowId
|
||||||
//TODO 导入SAP
|
* @return
|
||||||
return ResultVO.error("暂未实现");
|
*/
|
||||||
|
@PostMapping("importToSAP")
|
||||||
|
@ApiOperation("导入到SAP")
|
||||||
|
public ResultVO importToSAP(@Valid @RequestBody @NotNull Long rootBomRowId) {
|
||||||
|
dQBomService.importToSAP(rootBomRowId);
|
||||||
|
return ResultVO.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomPageQuery;
|
import com.nflg.product.bomnew.pojo.query.BomNewDQbomPageQuery;
|
||||||
import com.nflg.product.bomnew.pojo.vo.BomNewDQbomVO;
|
import com.nflg.product.bomnew.pojo.vo.BomNewDQbomVO;
|
||||||
import com.nflg.product.bomnew.pojo.vo.DQbomExcelVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -21,7 +20,7 @@ public interface BomNewDQbomParentMapper extends BaseMapper<BomNewDQbomParentEnt
|
||||||
|
|
||||||
void resetBomExist(Long rowId);
|
void resetBomExist(Long rowId);
|
||||||
|
|
||||||
DQbomExcelVO getRootBomByRowId(Long rootBomRowId);
|
BomNewDQbomVO getRootBomByRowId(Long rootBomRowId);
|
||||||
|
|
||||||
List<DQbomExcelVO> getChildren(Long bomRowId);
|
List<BomNewDQbomVO> getChildren(Long bomRowId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,13 @@ public class BomNewDQbomParentEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "主键-雪花")
|
@ApiModelProperty(value = "主键-雪花")
|
||||||
private Long rowId;
|
private Long rowId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 层次
|
||||||
|
*/
|
||||||
|
@TableField(value = "level")
|
||||||
|
@ApiModelProperty(value = "层次")
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图号
|
* 图号
|
||||||
*/
|
*/
|
||||||
|
|
@ -176,4 +183,18 @@ public class BomNewDQbomParentEntity implements Serializable {
|
||||||
@TableField(value = "modify_time")
|
@TableField(value = "modify_time")
|
||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
private LocalDateTime modifyTime;
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入SAP状态,1-未导入;3-已导入
|
||||||
|
*/
|
||||||
|
@TableField(value = "sap_state")
|
||||||
|
@ApiModelProperty(value = "导入SAP状态,1-未导入;3-已导入")
|
||||||
|
private Integer sapState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入SAP时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "sap_time")
|
||||||
|
@ApiModelProperty(value = "导入SAP时间")
|
||||||
|
private LocalDateTime sapTime;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.nflg.product.bomnew.pojo.query;
|
package com.nflg.product.bomnew.pojo.query;
|
||||||
|
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
|
||||||
import com.nflg.product.bomnew.pojo.vo.BomNewDQbomSaveVO;
|
import com.nflg.product.bomnew.pojo.vo.BomNewDQbomSaveVO;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
@ -25,7 +24,7 @@ public class BomNewDQbomSaveQuery implements Serializable {
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "父级")
|
@ApiModelProperty(value = "父级")
|
||||||
@NotNull
|
@NotNull
|
||||||
private BomNewDQbomParentEntity parent;
|
private BomNewDQbomSaveVO parent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子级数据
|
* 子级数据
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
package com.nflg.product.bomnew.pojo.vo;
|
package com.nflg.product.bomnew.pojo.vo;
|
||||||
|
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -16,12 +15,8 @@ import java.io.Serializable;
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-vo-BomNewDQbomSaveVO")
|
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-vo-BomNewDQbomSaveVO")
|
||||||
public class BomNewDQbomSaveVO extends BomNewDQbomChildEntity implements Serializable {
|
public class BomNewDQbomSaveVO extends BomNewDQbomParentEntity implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty("物料BOM版本ID")
|
@ApiModelProperty("物料BOM关系rowId")
|
||||||
private Long bomRowId = 0L;
|
private Long bomChildRowId;
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@ApiModelProperty("物料bom行ID")
|
|
||||||
private Long childBomRowId;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,4 +46,9 @@ public class BomNewDQbomVO extends BomNewDQbomChildEntity implements Serializabl
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "物料状态")
|
@ApiModelProperty(value = "物料状态")
|
||||||
private Integer systemMaterialState;
|
private Integer systemMaterialState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级物料编码
|
||||||
|
*/
|
||||||
|
private String parentMaterialNo;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,20 @@
|
||||||
package com.nflg.product.bomnew.service;
|
package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.bomnew.constant.DQBomStatusEnum;
|
import com.nflg.product.bomnew.constant.*;
|
||||||
import com.nflg.product.bomnew.constant.EbomEditStatusEnum;
|
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
|
||||||
import com.nflg.product.bomnew.constant.UserJobEnum;
|
import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1DTO;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomPageQuery;
|
import com.nflg.product.bomnew.pojo.query.BomNewDQbomPageQuery;
|
||||||
|
|
@ -21,12 +26,15 @@ import com.nflg.product.bomnew.pojo.vo.DQbomExcelVO;
|
||||||
import com.nflg.product.bomnew.util.BomUtil;
|
import com.nflg.product.bomnew.util.BomUtil;
|
||||||
import com.nflg.product.bomnew.util.VUtils;
|
import com.nflg.product.bomnew.util.VUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import nflg.product.common.constant.STATE;
|
||||||
|
import nflg.product.common.vo.ResultVO;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -92,11 +100,11 @@ public class DQBomService {
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(BomNewDQbomSaveQuery query) {
|
public void save(BomNewDQbomSaveQuery query) {
|
||||||
BomNewDQbomParentEntity parent = query.getParent();
|
BomNewDQbomParentEntity parent = new BomNewDQbomParentEntity();
|
||||||
|
BeanUtil.copyProperties(query.getParent(), parent);
|
||||||
BomNewDQbomChildEntity child;
|
BomNewDQbomChildEntity child;
|
||||||
|
|
||||||
List<BomNewDQbomParentEntity> liParents = new ArrayList<>();
|
List<BomNewDQbomParentEntity> liParents = new ArrayList<>();
|
||||||
List<BomNewDQbomChildEntity> liChildren = new ArrayList<>();
|
|
||||||
|
|
||||||
if (Objects.isNull(parent.getRowId())) {
|
if (Objects.isNull(parent.getRowId())) {
|
||||||
//新增父级节点
|
//新增父级节点
|
||||||
|
|
@ -108,6 +116,7 @@ public class DQBomService {
|
||||||
VUtils.isTure(CollUtil.isEmpty(query.getChildren())).throwMessage("新添加的bom必须有子级");
|
VUtils.isTure(CollUtil.isEmpty(query.getChildren())).throwMessage("新添加的bom必须有子级");
|
||||||
|
|
||||||
parent.setRowId(IdWorker.getId());
|
parent.setRowId(IdWorker.getId());
|
||||||
|
parent.setLevel(1);
|
||||||
parent.setBomExist(1);
|
parent.setBomExist(1);
|
||||||
parent.setCreatedBy(SessionUtil.getUserCode());
|
parent.setCreatedBy(SessionUtil.getUserCode());
|
||||||
parent.setStatus(DQBomStatusEnum.WAIT_CONVERT.getValue());
|
parent.setStatus(DQBomStatusEnum.WAIT_CONVERT.getValue());
|
||||||
|
|
@ -133,7 +142,7 @@ public class DQBomService {
|
||||||
parent.setBomExist(1);
|
parent.setBomExist(1);
|
||||||
parent.setModifyTime(LocalDateTime.now());
|
parent.setModifyTime(LocalDateTime.now());
|
||||||
|
|
||||||
child =
|
child = dQBomChildService.getById(query.getParent().getBomChildRowId());
|
||||||
}
|
}
|
||||||
//处理child
|
//处理child
|
||||||
List<BomNewDQbomChildEntity> children = Convert.toList(BomNewDQbomChildEntity.class, query.getChildren());
|
List<BomNewDQbomChildEntity> children = Convert.toList(BomNewDQbomChildEntity.class, query.getChildren());
|
||||||
|
|
@ -148,8 +157,7 @@ public class DQBomService {
|
||||||
c.setCreatedBy(SessionUtil.getUserCode());
|
c.setCreatedBy(SessionUtil.getUserCode());
|
||||||
c.setCreatedName(SessionUtil.getRealName());
|
c.setCreatedName(SessionUtil.getRealName());
|
||||||
}
|
}
|
||||||
liChildren.addAll(children);
|
dQBomChildService.saveBatch(children);
|
||||||
dQBomChildService.saveBatch(liChildren);
|
|
||||||
//处理parent
|
//处理parent
|
||||||
List<BomNewDQbomParentEntity> parents = Convert.toList(BomNewDQbomParentEntity.class, query.getChildren());
|
List<BomNewDQbomParentEntity> parents = Convert.toList(BomNewDQbomParentEntity.class, query.getChildren());
|
||||||
List<String> materialNos = dQBomParentService.lambdaQuery()
|
List<String> materialNos = dQBomParentService.lambdaQuery()
|
||||||
|
|
@ -217,13 +225,56 @@ public class DQBomService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DQbomExcelVO> exportBom(Long rootBomRowId) {
|
public List<DQbomExcelVO> exportBom(Long rootBomRowId) {
|
||||||
DQbomExcelVO root = dQBomParentService.getBaseMapper().getRootBomByRowId(rootBomRowId);
|
return Convert.toList(DQbomExcelVO.class, getAll(rootBomRowId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<BomNewDQbomVO> getAll(Long rootBomRowId) {
|
||||||
|
BomNewDQbomVO root = dQBomParentService.getBaseMapper().getRootBomByRowId(rootBomRowId);
|
||||||
VUtils.isTure(Objects.isNull(root)).throwMessage("数据不存在");
|
VUtils.isTure(Objects.isNull(root)).throwMessage("数据不存在");
|
||||||
|
|
||||||
List<DQbomExcelVO> datas = new ArrayList<>();
|
List<BomNewDQbomVO> datas = new ArrayList<>();
|
||||||
datas.add(root);
|
datas.add(root);
|
||||||
List<DQbomExcelVO> children = dQBomParentService.getBaseMapper().getChildren(rootBomRowId);
|
getChildren(datas, root);
|
||||||
|
|
||||||
return datas;
|
return datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getChildren(List<BomNewDQbomVO> datas, BomNewDQbomVO parent) {
|
||||||
|
if (parent.getBomRowId() == 0) return;
|
||||||
|
List<BomNewDQbomVO> cc = dQBomParentService.getBaseMapper().getChildren(parent.getBomRowId());
|
||||||
|
if (CollUtil.isNotEmpty(cc)) {
|
||||||
|
cc.forEach(c -> {
|
||||||
|
c.setParentMaterialNo(parent.getMaterialNo());
|
||||||
|
datas.add(c);
|
||||||
|
getChildren(datas, c);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void importToSAP(Long rootBomRowId) {
|
||||||
|
List<BomNewDQbomVO> datas = getAll(rootBomRowId);
|
||||||
|
ImportSapParamDTO sapDto = new ImportSapParamDTO();
|
||||||
|
sapDto.setZID(RandomUtil.randomNumbers(5));
|
||||||
|
sapDto.setI_WERKS(FactoryCodeEnum.FACTORY_1010.getValue());
|
||||||
|
sapDto.setI_STLAN("2");
|
||||||
|
String dateYMD = DateUtil.format(new Date(), "yyyyMMdd");
|
||||||
|
datas.forEach(d -> {
|
||||||
|
T1DTO t1 = new T1DTO();
|
||||||
|
t1.setID(RandomUtil.randomNumbers(5));
|
||||||
|
t1.setMATNR(d.getParentMaterialNo());
|
||||||
|
t1.setIDNRK(d.getMaterialNo());
|
||||||
|
t1.setMEINS(d.getMaterialUnit());
|
||||||
|
t1.setMENGE("1");
|
||||||
|
t1.setPOSTP(d.getProjectType());
|
||||||
|
t1.setDATUM(dateYMD);
|
||||||
|
sapDto.getT1().add(t1);
|
||||||
|
});
|
||||||
|
ResultVO<Boolean> resultVO = SpringUtil.getBean(SapOpUtilService.class).importToSapV2(sapDto, null);
|
||||||
|
if (resultVO.getState().equals(STATE.Success.getState())) {
|
||||||
|
BomNewDQbomParentEntity parentEntity = new BomNewDQbomParentEntity();
|
||||||
|
parentEntity.setRowId(rootBomRowId);
|
||||||
|
parentEntity.setSapState(MBomConstantEnum.MBomStatusEnum.PUB_SAP.getValue());
|
||||||
|
parentEntity.setSapTime(LocalDateTimeUtil.now());
|
||||||
|
dQBomParentService.updateById(parentEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,8 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
ebom.setExpireEndTime(LocalDateTime.now());
|
ebom.setExpireEndTime(LocalDateTime.now());
|
||||||
this.eBomParentResult.add(ebom);
|
this.eBomParentResult.add(ebom);
|
||||||
}
|
}
|
||||||
|
eBomParent.setRootIs(parentEnt.getRootIs());
|
||||||
|
eBomParent.setUserRootIs(parentEnt.getUserRootIs());
|
||||||
this.eBomParentResult.add(eBomParent);
|
this.eBomParentResult.add(eBomParent);
|
||||||
|
|
||||||
return eBomParent.getRowId();
|
return eBomParent.getRowId();
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@
|
||||||
<result column="level" jdbcType="INTEGER" property="level"/>
|
<result column="level" jdbcType="INTEGER" property="level"/>
|
||||||
<result column="edit_status" jdbcType="INTEGER" property="editStatus"/>
|
<result column="edit_status" jdbcType="INTEGER" property="editStatus"/>
|
||||||
<result column="expire_end_time" jdbcType="TIMESTAMP" property="expireEndTime"/>
|
<result column="expire_end_time" jdbcType="TIMESTAMP" property="expireEndTime"/>
|
||||||
|
<result column="sap_state" jdbcType="INTEGER" property="sapState"/>
|
||||||
|
<result column="sap_time" jdbcType="TIMESTAMP" property="sapTime"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<!--分页获取数据-->
|
<!--分页获取数据-->
|
||||||
<select id="getPageList" resultType="com.nflg.product.bomnew.pojo.vo.BomNewDQbomVO">
|
<select id="getPageList" resultType="com.nflg.product.bomnew.pojo.vo.BomNewDQbomVO">
|
||||||
|
|
@ -67,25 +69,26 @@
|
||||||
WHERE p.row_id = #{rowId};
|
WHERE p.row_id = #{rowId};
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRootBomByRowId" resultType="com.nflg.product.bomnew.pojo.vo.DQbomExcelVO">
|
<select id="getRootBomByRowId" resultType="com.nflg.product.bomnew.pojo.vo.BomNewDQbomVO">
|
||||||
SELECT p.level,
|
SELECT level,
|
||||||
p.material_no,
|
material_no,
|
||||||
p.drawing_no,
|
drawing_no,
|
||||||
p.material_name,
|
material_name,
|
||||||
p.material_texture,
|
material_texture,
|
||||||
c.num,
|
num,
|
||||||
p.material_unit,
|
material_unit,
|
||||||
c.project_type,
|
project_type,
|
||||||
p.current_version,
|
current_version,
|
||||||
p.unit_weight,
|
unit_weight,
|
||||||
c.remark
|
remark
|
||||||
FROM t_bom_new_dqbom_child c
|
FROM t_bom_new_dqbom_parent
|
||||||
JOIN t_bom_new_dqbom_parent p ON c.material_no = p.material_no AND c.parent_row_id = 0
|
WHERE row_id = #{rootBomRowId}
|
||||||
WHERE p.row_id = #{rootBomRowId}
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getChildren" resultType="com.nflg.product.bomnew.pojo.vo.DQbomExcelVO">
|
<select id="getChildren" resultType="com.nflg.product.bomnew.pojo.vo.BomNewDQbomVO">
|
||||||
SELECT c.level,
|
SELECT ifnull(p.row_id, 0) AS bomRowId,
|
||||||
|
c.row_id,
|
||||||
|
c.level,
|
||||||
c.material_no,
|
c.material_no,
|
||||||
c.drawing_no,
|
c.drawing_no,
|
||||||
c.material_name,
|
c.material_name,
|
||||||
|
|
@ -97,7 +100,8 @@
|
||||||
ifnull(p.unit_weight, c.unit_weight) unit_weight,
|
ifnull(p.unit_weight, c.unit_weight) unit_weight,
|
||||||
c.remark
|
c.remark
|
||||||
FROM t_bom_new_dqbom_child c
|
FROM t_bom_new_dqbom_child c
|
||||||
LEFT JOIN t_bom_new_dqbom_parent p ON c.material_no = p.material_no AND c.parent_row_id = 0
|
LEFT JOIN t_bom_new_dqbom_parent p ON c.material_no = p.material_no AND p.last_version_is = 1
|
||||||
WHERE p.row_id = #{rootBomRowId}
|
WHERE c.parent_row_id = #{rootBomRowId}
|
||||||
|
order by c.level
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue