Merge branch 'feature/DM/nflg-bom-transition' of http://192.168.0.40:3000/root/nflg_project into feature/DM/nflg-bom-transition
This commit is contained in:
commit
488cbe2ab4
|
|
@ -171,7 +171,8 @@ public class OriginalBomApi extends BaseApi {
|
|||
});
|
||||
|
||||
//跟新EBom 根节点
|
||||
ebomParentService.getBaseMapper().updateRootState();
|
||||
// ebomParentService.getBaseMapper().updateRootState();
|
||||
ebomParentService.updateRootState();
|
||||
ebomParentService.getBaseMapper().updateRootForWaitReview();
|
||||
|
||||
return ResultVO.success(result);
|
||||
|
|
|
|||
|
|
@ -55,10 +55,17 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
|
||||
List<BomNewEbomParentVO> getChildForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList,@Param("bomRowIds") Collection<Long> bomRowIds , @Param("createdBy") String createdBy );
|
||||
|
||||
@Deprecated
|
||||
void updateRootState();
|
||||
void updateRootState1();
|
||||
void updateRootState2();
|
||||
void updateRootState3();
|
||||
|
||||
@Deprecated
|
||||
void delBatch(@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void delBatch1(@Param("rowIds") List<Long> rowIds);
|
||||
void delBatch2(@Param("rowIds") List<Long> rowIds);
|
||||
void updateStateBatchByRowIdsParent(@Param("status") Integer status, String userName, @Param("list") List<Long> list);
|
||||
|
||||
void updateStateBatchByRowIdsChild( @Param("list") List<Long> list);
|
||||
|
|
|
|||
|
|
@ -51,8 +51,11 @@ public interface BomNewMbomParentMapper extends BaseMapper<BomNewMbomParentEntit
|
|||
/**
|
||||
* 将MBOM迁移到历史表
|
||||
*/
|
||||
@Deprecated
|
||||
void insertMBomIntoHistory(@Param("rowId") Long rowId);
|
||||
|
||||
void insertMBomIntoHistoryParent(@Param("rowId") Long rowId);
|
||||
|
||||
void insertMBomIntoHistoryChild(@Param("rowId") Long rowId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,13 +33,22 @@ public interface BomNewOriginalChildMapper extends BaseMapper<BomNewOriginalChil
|
|||
* @param drawingNos
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
void delOriginalFormalBom(@Param("drawingNos") List<String> drawingNos);
|
||||
|
||||
void delOriginalFormalBomChild(@Param("drawingNos") List<String> drawingNos);
|
||||
|
||||
void delOriginalFormalBomParent(@Param("drawingNos") List<String> drawingNos);
|
||||
|
||||
/**
|
||||
* 原始BOM-同步到正式表
|
||||
* @param rowIds
|
||||
*/
|
||||
@Deprecated
|
||||
void syncOriginalBomToFormal(@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void syncOriginalBomToFormalParent(@Param("rowIds") List<Long> rowIds);
|
||||
void syncOriginalBomToFormalChild(@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void deleteChildByParentRowIds(@Param("parentRowIds") List<Long> parentRowIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,25 @@ public interface BomNewOriginalParentMapper extends BaseMapper<BomNewOriginalPar
|
|||
|
||||
List<BomOriginalListVO> getParentChildBatch(@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
@Deprecated
|
||||
void delBatch(@Param("rowIds") List<Long> rowIds);
|
||||
void delBatchParent(@Param("rowIds") List<Long> rowIds);
|
||||
void delBatchChild(@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
@Deprecated
|
||||
void updateBomState(@Param("editStatus") Integer editStatus, @Param("status") Integer status ,@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void updateBomStateParent(@Param("editStatus") Integer editStatus, @Param("status") Integer status ,@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void updateBomStateChild(@Param("editStatus") Integer editStatus, @Param("status") Integer status ,@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
|
||||
@Deprecated
|
||||
void updateRevertBom( @Param("status") Integer status ,@Param("editStatus") Integer editStatus ,@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void updateRevertBomParent( @Param("status") Integer status ,@Param("editStatus") Integer editStatus ,@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void updateRevertBomChild( @Param("status") Integer status ,@Param("editStatus") Integer editStatus ,@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -65,8 +65,12 @@ public interface BomNewPbomParentMapper extends BaseMapper<BomNewPbomParentEntit
|
|||
|
||||
void insertPBomChildToFormal(@Param("bomRowIds") List<Long> bomRowIds);
|
||||
|
||||
@Deprecated
|
||||
void delPBom(@Param("bomRowIds") List<Long> bomRowIds);
|
||||
|
||||
void delPBomParent(@Param("bomRowIds") List<Long> bomRowIds);
|
||||
void delPBomChild(@Param("bomRowIds") List<Long> bomRowIds);
|
||||
|
||||
|
||||
List<BomNewPbomParentEntity> getLatestParents(Set<String> materialNos, String facCode);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class BomNewEbomChildService extends ServiceImpl<BomNewEbomChildMapper, B
|
|||
|
||||
public CompletableFuture<Void> updateEBomMaterialUse(Collection<String> materialNos) {
|
||||
return CompletableFuture.runAsync(() -> {
|
||||
baseMapper.updateEBomMaterialUse(materialNos);
|
||||
// baseMapper.updateEBomMaterialUse(materialNos);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1004,7 +1004,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
if(CollUtil.isNotEmpty(delEBomParents)){
|
||||
List<Long> delParentBom = delEBomParents.stream().filter(u -> u.getBomRowId() > 0).map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(delParentBom)){
|
||||
this.getBaseMapper().delBatch(delParentBom);
|
||||
// this.getBaseMapper().delBatch(delParentBom);
|
||||
this.delBatch(delParentBom);
|
||||
// ebomChildService.getBaseMapper().delBomChild(delParentBom);
|
||||
}
|
||||
}
|
||||
|
|
@ -1060,6 +1061,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
}
|
||||
|
||||
public void delBatch(List<Long> rowIds){
|
||||
this.getBaseMapper().delBatch1(rowIds);
|
||||
this.getBaseMapper().delBatch2(rowIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* EBOM 正式版转PBom
|
||||
* @param paramDto
|
||||
|
|
@ -1360,7 +1366,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
//计算树的层级数
|
||||
// CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
this.getBaseMapper().updateRootState();
|
||||
this.updateRootState();
|
||||
ebomChildService.updateEBomMaterialUse(materialNos);
|
||||
//this.compucteLevelNum();
|
||||
|
||||
|
|
@ -1370,6 +1376,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
// });
|
||||
}
|
||||
|
||||
public void updateRootState(){
|
||||
this.getBaseMapper().updateRootState1();
|
||||
this.getBaseMapper().updateRootState2();
|
||||
this.getBaseMapper().updateRootState3();
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultVO<Boolean> createBomImport(BomNewEbomImportDTO dto, InputStream inputStream) throws IOException, ExecutionException, InterruptedException {
|
||||
|
|
@ -1999,7 +2011,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
.map(BomNewEbomParentVO::getRowId).collect(Collectors.toList());
|
||||
|
||||
if (CollUtil.isNotEmpty(parentList)) {
|
||||
this.getBaseMapper().delBatch(parentList);
|
||||
// this.getBaseMapper().delBatch(parentList);
|
||||
this.delBatch(parentList);
|
||||
}
|
||||
|
||||
// QueryWrapper<BomNewEbomParentEntity> parentWrapper=new QueryWrapper<>();
|
||||
|
|
@ -2256,7 +2269,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
//手动创建
|
||||
List<BomNewEbomChildEntity> s2List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_EXCE.getValue(), u.getSource())
|
||||
|| Objects.equals(EBomSourceEnum.FROM_MDM.getValue(), u.getSource())).collect(Collectors.toList());
|
||||
|| Objects.equals(EBomSourceEnum.FROM_MDM.getValue(), u.getSource())
|
||||
|| Objects.equals(EBomSourceEnum.FROM_CHANGE.getValue(), u.getSource())
|
||||
|
||||
).collect(Collectors.toList());
|
||||
|
||||
//工艺岗可以删自己的和设计岗(手动、excel),
|
||||
// 设计自己删除自己
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public class BomNewEbomUpgradeChangeService extends ServiceImpl<BomNewEbomUpgrad
|
|||
//删除旧版PBOM移动到历史表中
|
||||
if (CollUtil.isNotEmpty(updateImpact.getOldPBomList())) {
|
||||
List<Long> oldPbomRowIds = updateImpact.getOldPBomList().stream().map(u -> u.getRowId()).collect(Collectors.toList());
|
||||
pbomParentService.getBaseMapper().delPBom(oldPbomRowIds);
|
||||
pbomParentService.delPBom(oldPbomRowIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.nflg.product.bomnew.service.domain.MBom.IndexListTree;
|
|||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
|
@ -322,4 +323,10 @@ public class BomNewMbomParentService extends ServiceImpl<BomNewMbomParentMapper,
|
|||
.set(BomNewMbomParentEntity::getStatus, sapState.getValue())
|
||||
.update();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void insertMBomIntoHistory(Long rowId){
|
||||
this.getBaseMapper().insertMBomIntoHistoryParent(rowId);
|
||||
this.getBaseMapper().insertMBomIntoHistoryChild(rowId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import com.nflg.product.bomnew.mapper.master.BomNewOriginalChildMapper;
|
|||
import com.nflg.product.bomnew.pojo.entity.BomNewOriginalChildEntity;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -17,4 +20,18 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class BomNewOriginalChildService extends ServiceImpl<BomNewOriginalChildMapper, BomNewOriginalChildEntity> {
|
||||
|
||||
|
||||
public void delOriginalFormalBom(List<String> drawingNos){
|
||||
this.getBaseMapper().delOriginalFormalBomChild(drawingNos);
|
||||
this.getBaseMapper().delOriginalFormalBomParent(drawingNos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步正式
|
||||
*/
|
||||
@Transactional
|
||||
public void syncOriginalBomToFormal(List<Long> rowIds){
|
||||
this.getBaseMapper().syncOriginalBomToFormalParent(rowIds);
|
||||
this.getBaseMapper().syncOriginalBomToFormalChild(rowIds);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
return;
|
||||
}
|
||||
|
||||
this.getBaseMapper().updateRevertBom(OriginalStatusEnum.UN_CONVERT.getValue(),
|
||||
this.updateRevertBom(OriginalStatusEnum.UN_CONVERT.getValue(),
|
||||
OriginalEditStatusEnum.HANDLER_CREATED.getValue(),
|
||||
sourceIds);
|
||||
|
||||
|
|
@ -563,6 +563,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
*
|
||||
* @param bomRowId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean del(Long bomRowId) throws ExecutionException, InterruptedException {
|
||||
|
||||
BomNewOriginalParentEntity parentEntity = this.getBaseMapper().selectById(bomRowId);
|
||||
|
|
@ -578,7 +579,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
}
|
||||
delParentRowId.add(bomRowId);
|
||||
if (CollUtil.isNotEmpty(delParentRowId)) {
|
||||
this.getBaseMapper().delBatch(delParentRowId);
|
||||
this.delBatch(delParentRowId);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -655,7 +656,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
}
|
||||
//将原始BOM及子级转为已处理
|
||||
if (CollUtil.isNotEmpty(convert.getHasHandlerParentIds())) {
|
||||
this.getBaseMapper().updateBomState(OriginalEditStatusEnum.HANDLER_FINISHED.getValue(), OriginalStatusEnum.OVER_CONVERT.getValue(), convert.getHasHandlerParentIds());
|
||||
this.updateBomState(OriginalEditStatusEnum.HANDLER_FINISHED.getValue(), OriginalStatusEnum.OVER_CONVERT.getValue(), convert.getHasHandlerParentIds());
|
||||
//原始BOM-同步到历史表
|
||||
CompletableFuture.runAsync(() -> {
|
||||
syncToFormal(convert.getHasHandlerParentIds());
|
||||
|
|
@ -735,9 +736,9 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
|
||||
if (CollUtil.isNotEmpty(drawingNos)) {
|
||||
//删除正式版中已有图号的BOM
|
||||
originalChildService.getBaseMapper().delOriginalFormalBom(drawingNos);
|
||||
originalChildService.delOriginalFormalBom(drawingNos);
|
||||
//同步新的BOM版本
|
||||
originalChildService.getBaseMapper().syncOriginalBomToFormal(parentRowIds);
|
||||
originalChildService.syncOriginalBomToFormal(parentRowIds);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -869,4 +870,20 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
private void resetBomExist(Long rowId) {
|
||||
this.getBaseMapper().resetBomExist(rowId);
|
||||
}
|
||||
|
||||
public void delBatch(List<Long> rowIds){
|
||||
this.getBaseMapper().delBatchParent(rowIds);
|
||||
this.getBaseMapper().delBatchChild(rowIds);
|
||||
}
|
||||
|
||||
public void updateRevertBom(Integer status ,Integer editStatus,List<Long> rowIds){
|
||||
this.getBaseMapper().updateRevertBomParent(status,editStatus,rowIds);
|
||||
this.getBaseMapper().updateRevertBomChild(status,editStatus,rowIds);
|
||||
}
|
||||
|
||||
public void updateBomState(Integer editStatus,Integer status ,List<Long> rowIds){
|
||||
this.getBaseMapper().updateBomStateParent(editStatus,status,rowIds);
|
||||
this.getBaseMapper().updateBomStateChild(editStatus,status,rowIds);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@ public class BomNewOriginalParentV2Service extends ServiceImpl<BomNewOriginalPar
|
|||
@Qualifier("syncOriginalBomToFormalPool")
|
||||
ThreadPoolTaskExecutor syncOriginalBomToFormalPool;
|
||||
|
||||
@Resource
|
||||
BomNewOriginalParentService originalParentService;
|
||||
|
||||
/**
|
||||
* 检查物料编码在主数据中是否存在
|
||||
*
|
||||
|
|
@ -289,7 +292,7 @@ public class BomNewOriginalParentV2Service extends ServiceImpl<BomNewOriginalPar
|
|||
}
|
||||
//将原始BOM及子级转为已处理
|
||||
if (CollUtil.isNotEmpty(convert.getHasHandlerParentIds())) {
|
||||
this.getBaseMapper().updateBomState(OriginalEditStatusEnum.HANDLER_FINISHED.getValue(), OriginalStatusEnum.OVER_CONVERT.getValue(), convert.getHasHandlerParentIds());
|
||||
originalParentService.updateBomState(OriginalEditStatusEnum.HANDLER_FINISHED.getValue(), OriginalStatusEnum.OVER_CONVERT.getValue(), convert.getHasHandlerParentIds());
|
||||
//原始BOM-同步到历史表
|
||||
CompletableFuture.runAsync(() -> {
|
||||
syncToFormal(convert.getHasHandlerParentIds());
|
||||
|
|
@ -308,9 +311,9 @@ public class BomNewOriginalParentV2Service extends ServiceImpl<BomNewOriginalPar
|
|||
|
||||
if (CollUtil.isNotEmpty(drawingNos)) {
|
||||
//删除正式版中已有图号的BOM
|
||||
originalChildService.getBaseMapper().delOriginalFormalBom(drawingNos);
|
||||
originalChildService.delOriginalFormalBom(drawingNos);
|
||||
//同步新的BOM版本
|
||||
originalChildService.getBaseMapper().syncOriginalBomToFormal(parentRowIds);
|
||||
originalChildService.syncOriginalBomToFormal(parentRowIds);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1268,7 +1268,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
if(CollUtil.isNotEmpty(toParents)) {
|
||||
List<Long> oldPBomRowIds = toParents.stream().map(u -> u.getRowId()).collect(Collectors.toList());
|
||||
//转移后删除
|
||||
this.getBaseMapper().delPBom(oldPBomRowIds);
|
||||
this.delPBom(oldPBomRowIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1799,4 +1799,9 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
buildNoticeNumDetailList(noticeNumRowId, noticeNumDetailEntityList, noticeNumDetailEntity2List, newestP, lastP);
|
||||
}
|
||||
}
|
||||
|
||||
public void delPBom(List<Long> bomRowIds){
|
||||
this.getBaseMapper().delPBomParent(bomRowIds);
|
||||
this.getBaseMapper().delPBomChild(bomRowIds);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ public class ConvertToMBomBase {
|
|||
if (Objects.nonNull(oldParent)) {
|
||||
if (SapStatusEnum.PUB_SUCCESS.equalsValue(oldParent.getStatus())) {
|
||||
//将数据迁移到历史表
|
||||
SpringUtil.getBean(BomNewMbomParentService.class).getBaseMapper().insertMBomIntoHistory(oldParent.getRowId());
|
||||
|
||||
// SpringUtil.getBean(BomNewMbomParentService.class).getBaseMapper().insertMBomIntoHistory(oldParent.getRowId());
|
||||
SpringUtil.getBean(BomNewMbomParentService.class).insertMBomIntoHistory(oldParent.getRowId());
|
||||
mBomParent.setCurrentVersion(VersionUtil.getMBomNextVersion(oldParent.getCurrentVersion()));
|
||||
|
||||
SpringUtil.getBean(BomNewMbomDetailService.class).getBaseMapper().deleteByMap(ImmutableMap.of("bom_row_id", oldParent.getRowId()));
|
||||
|
|
|
|||
|
|
@ -256,6 +256,37 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="updateRootState1">
|
||||
update t_bom_new_ebom_parent
|
||||
set root_is=0,
|
||||
user_root_is=0
|
||||
where last_version_is = 1
|
||||
AND `status` < 4
|
||||
</update>
|
||||
<update id="updateRootState2">
|
||||
update t_bom_new_ebom_parent a left join (
|
||||
select b.row_id, b.material_no,a.`status` from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id
|
||||
and a.`status` < 4
|
||||
) b
|
||||
on a.material_no=b.material_no
|
||||
set a.root_is=1,
|
||||
a.user_root_is=1
|
||||
where a.`status` < 4 and b.row_id is null and a.last_version_is=1
|
||||
</update>
|
||||
<update id="updateRootState3">
|
||||
update t_bom_new_ebom_parent a left join (
|
||||
select b.row_id, b.material_no,a.`status` , a.created_by from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id
|
||||
and a.`status` < 4
|
||||
) b
|
||||
on a.material_no=b.material_no and a.created_by=b.created_by
|
||||
set a.user_root_is=1
|
||||
where a.`status`
|
||||
< 4
|
||||
and b.row_id is null
|
||||
and a.last_version_is = 1
|
||||
AND a.virtual_package_is = 0;
|
||||
</update>
|
||||
|
||||
<update id="updateRootState">
|
||||
update t_bom_new_ebom_parent
|
||||
set root_is=0,
|
||||
|
|
@ -298,6 +329,18 @@
|
|||
where a.`status` in (1, 3) and last_version_is=1 and b.row_id is null;
|
||||
</update>
|
||||
|
||||
<delete id="delBatch1">
|
||||
delete from t_bom_new_ebom_parent where row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="delBatch2">
|
||||
delete from t_bom_new_ebom_child where parent_row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delBatch">
|
||||
delete from t_bom_new_ebom_parent where row_id in
|
||||
|
|
|
|||
|
|
@ -185,8 +185,17 @@
|
|||
|
||||
]]>
|
||||
</select>
|
||||
<insert id="insertMBomIntoHistoryParent">
|
||||
INSERT INTO `nflg`.`t_bom_new_mbom_parent_history` (`row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`)
|
||||
select `row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time` from t_bom_new_mbom_parent where row_id=#{rowId}
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insertMBomIntoHistoryChild">
|
||||
INSERT INTO `nflg`.`t_bom_new_mbom_detail_history` (`row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type`)
|
||||
|
||||
select `row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type` from t_bom_new_mbom_detail where bom_row_id=#{rowId}
|
||||
</insert>
|
||||
<!--将MBOM迁移到历史表-->
|
||||
<insert id="insertMBomIntoHistory">
|
||||
INSERT INTO `nflg`.`t_bom_new_mbom_parent_history` (`row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,23 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="delOriginalFormalBomChild">
|
||||
delete from t_bom_new_original_child_formal where parent_row_id in
|
||||
( select row_id from t_bom_new_original_parent_formal where drawing_no in
|
||||
<foreach collection="drawingNos" item="drawingNo" open="(" separator="," close=")">
|
||||
#{drawingNo}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
|
||||
<delete id="delOriginalFormalBomParent">
|
||||
delete from t_bom_new_original_parent_formal where drawing_no in
|
||||
<foreach collection="drawingNos" item="drawingNo" open="(" separator="," close=")">
|
||||
#{drawingNo}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
|
||||
<!--删除-正式表中已有的BOM-->
|
||||
<delete id="delOriginalFormalBom">
|
||||
delete from t_bom_new_original_child_formal where parent_row_id in
|
||||
|
|
@ -68,6 +85,25 @@
|
|||
</foreach>
|
||||
);
|
||||
</delete>
|
||||
<insert id="syncOriginalBomToFormalParent">
|
||||
INSERT INTO `nflg`.`t_bom_new_original_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`)
|
||||
|
||||
select `row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`
|
||||
from t_bom_new_original_parent where row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="syncOriginalBomToFormalChild">
|
||||
INSERT INTO `t_bom_new_original_child_formal` (`row_id`, `parent_row_id`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `unit_weight`, `num`, `total_weight`, `remark`, `created_time`, `created_by`, `edit_status`, `status`, `material_texture`, `should_bom_exist`, `bom_version_row_id`)
|
||||
select `row_id`, `parent_row_id`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `unit_weight`, `num`, `total_weight`, `remark`, `created_time`, `created_by`, `edit_status`, `status`, `material_texture`, `should_bom_exist`, `bom_version_row_id`
|
||||
from t_bom_new_original_child
|
||||
where parent_row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--原始BOM-同步到正式表-->
|
||||
<insert id="syncOriginalBomToFormal">
|
||||
|
|
|
|||
|
|
@ -101,6 +101,18 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="delBatchParent">
|
||||
delete from t_bom_new_original_parent where row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="delBatchChild">
|
||||
delete from t_bom_new_original_child where parent_row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="delBatch">
|
||||
delete from t_bom_new_original_parent where row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
|
|
@ -112,6 +124,21 @@
|
|||
</foreach>;
|
||||
</delete>
|
||||
|
||||
<update id="updateRevertBomParent">
|
||||
update t_bom_new_original_parent set status = #{status},edit_status=#{editStatus} where
|
||||
row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateRevertBomChild">
|
||||
update t_bom_new_original_child set status = #{status},edit_status=#{editStatus} where
|
||||
parent_row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateRevertBom">
|
||||
update t_bom_new_original_parent set status = #{status},edit_status=#{editStatus} where
|
||||
row_id in
|
||||
|
|
@ -126,7 +153,22 @@
|
|||
</foreach>;
|
||||
</update>
|
||||
|
||||
<update id="updateBomStateParent">
|
||||
update t_bom_new_original_parent set status = #{status},edit_status=#{editStatus}, convert_to_ebom_time=now()
|
||||
where
|
||||
row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateBomStateChild">
|
||||
update t_bom_new_original_child set status = #{status} ,edit_status=#{editStatus} where
|
||||
parent_row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
<update id="updateBomState">
|
||||
update t_bom_new_original_parent set status = #{status},edit_status=#{editStatus}, convert_to_ebom_time=now()
|
||||
where
|
||||
|
|
|
|||
|
|
@ -344,6 +344,19 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="delPBomParent">
|
||||
delete from t_bom_new_pbom_parent where row_id in
|
||||
<foreach collection="bomRowIds" item="item" open="(" separator="," close=");">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="delPBomChild">
|
||||
delete from t_bom_new_pbom_child where parent_row_id in
|
||||
<foreach collection="bomRowIds" item="item" open="(" separator="," close=");">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delPBom">
|
||||
delete from t_bom_new_pbom_parent where row_id in
|
||||
<foreach collection="bomRowIds" item="item" open="(" separator="," close=");">
|
||||
|
|
|
|||
Loading…
Reference in New Issue