This commit is contained in:
parent
39ccfb251b
commit
3cd755b283
|
|
@ -162,7 +162,7 @@ public class MBomApi extends BaseApi {
|
||||||
@PostMapping("applyBack")
|
@PostMapping("applyBack")
|
||||||
@ApiOperation("申请退回")
|
@ApiOperation("申请退回")
|
||||||
public ResultVO<Boolean> applyBack(@RequestBody BomNewMbomApplyBackMaterialDTO dto){
|
public ResultVO<Boolean> applyBack(@RequestBody BomNewMbomApplyBackMaterialDTO dto){
|
||||||
VUtils.isTure(CollectionUtil.isEmpty(dto.getRowIds())).throwMessage("选择申请退回数据");
|
VUtils.isTure(CollectionUtil.isEmpty(dto.getRowIds())).throwMessage("选择行数据操作");
|
||||||
bomNewMbomBackMaterialService.applyBack(dto);
|
bomNewMbomBackMaterialService.applyBack(dto);
|
||||||
return ResultVO.success(true);
|
return ResultVO.success(true);
|
||||||
}
|
}
|
||||||
|
|
@ -171,16 +171,28 @@ public class MBomApi extends BaseApi {
|
||||||
@ApiOperation("申请驳回")
|
@ApiOperation("申请驳回")
|
||||||
public ResultVO<Boolean> rejectBack(@RequestBody List<Long> rowIds){
|
public ResultVO<Boolean> rejectBack(@RequestBody List<Long> rowIds){
|
||||||
|
|
||||||
VUtils.isTure(CollectionUtil.isEmpty(rowIds)).throwMessage("选择驳回的数据");
|
VUtils.isTure(CollectionUtil.isEmpty(rowIds)).throwMessage("选择行数据操作");
|
||||||
bomNewMbomBackMaterialService.rejectBack(rowIds);
|
bomNewMbomBackMaterialService.rejectBack(rowIds);
|
||||||
return ResultVO.success(true);
|
return ResultVO.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("deleteBack")
|
||||||
|
@ApiOperation("删除申请")
|
||||||
|
public ResultVO<Boolean> deleteBack(@RequestBody List<Long> rowIds){
|
||||||
|
|
||||||
|
VUtils.isTure(CollectionUtil.isEmpty(rowIds)).throwMessage("选择行数据操作");
|
||||||
|
bomNewMbomBackMaterialService.rejectBack(rowIds);
|
||||||
|
return ResultVO.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("confirmBack")
|
@PostMapping("confirmBack")
|
||||||
@ApiOperation("确认退回")
|
@ApiOperation("确认退回")
|
||||||
public ResultVO<Boolean> confirmBack(@RequestBody List<Long> rowIds){
|
public ResultVO<Boolean> confirmBack(@RequestBody List<Long> rowIds){
|
||||||
|
|
||||||
VUtils.isTure(CollectionUtil.isEmpty(rowIds)).throwMessage("选择确认的数据");
|
VUtils.isTure(CollectionUtil.isEmpty(rowIds)).throwMessage("选择行数据操作");
|
||||||
bomNewMbomBackMaterialService.confirmBack(rowIds);
|
bomNewMbomBackMaterialService.confirmBack(rowIds);
|
||||||
return ResultVO.success(true);
|
return ResultVO.success(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,4 +45,22 @@ public class MBomConstantEnum {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum MaterialBackStatusEnum implements ValueEnum<Integer> {
|
||||||
|
//状态 0-待处理 1-待退回 2-已退
|
||||||
|
APPLY_0(0, "待处理"),
|
||||||
|
DEAL_1 (1, "待退回"),
|
||||||
|
REJECT_2 (2, "已退"),
|
||||||
|
;
|
||||||
|
private final Integer value;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ import lombok.Getter;
|
||||||
@Getter
|
@Getter
|
||||||
public enum VirtualPackageTypeEnum implements ValueEnum<Integer>{
|
public enum VirtualPackageTypeEnum implements ValueEnum<Integer>{
|
||||||
//1-发货包 2-制作包 4-直发包 8-发货前装配包
|
//1-发货包 2-制作包 4-直发包 8-发货前装配包
|
||||||
|
|
||||||
|
UN_VIRTUAL_PACKAGE(1,"非虚拟包","" ,"", ""),
|
||||||
DELIVERY_PACKAGE(1,"发货包","发货" ,"201101", ""),
|
DELIVERY_PACKAGE(1,"发货包","发货" ,"201101", ""),
|
||||||
MAKING_PACKAGE(2,"制作包","制作","201101",""),
|
MAKING_PACKAGE(2,"制作包","制作","201101",""),
|
||||||
DIRECT_DELIVERY_PACKAGE(4,"直发包","直发","201101","F"),
|
DIRECT_DELIVERY_PACKAGE(4,"直发包","直发","201101","F"),
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,7 @@ public interface BomNewMbomBackMaterialMapper extends BaseMapper<BomNewMbomBackM
|
||||||
Page<BomNewMbomBackMaterialVO> getListPage(Page<BomNewMbomBackMaterialVO> page, @Param("query") BomNewMbomBackMaterialQuery query );
|
Page<BomNewMbomBackMaterialVO> getListPage(Page<BomNewMbomBackMaterialVO> page, @Param("query") BomNewMbomBackMaterialQuery query );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,11 @@ import org.apache.ibatis.annotations.Param;
|
||||||
public interface BomNewMbomDetailMapper extends BaseMapper<BomNewMbomDetailEntity> {
|
public interface BomNewMbomDetailMapper extends BaseMapper<BomNewMbomDetailEntity> {
|
||||||
|
|
||||||
BomNewMbomMiddleVO getDetailById(@Param("rowId") Long rowId );
|
BomNewMbomMiddleVO getDetailById(@Param("rowId") Long rowId );
|
||||||
|
|
||||||
|
|
||||||
|
String getGroupRowId(@Param("rowId") Long rowId);
|
||||||
|
|
||||||
|
|
||||||
|
void updateBackStatus(@Param("rowIds") String rowIds,@Param("materialBackStatus") Integer materialBackStatus);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.nflg.product.bomnew.pojo.entity;
|
package com.nflg.product.bomnew.pojo.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
@ -99,10 +100,100 @@ public class BomNewMbomBackMaterialEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private LocalDateTime createdTime;
|
private LocalDateTime createdTime;
|
||||||
|
|
||||||
|
@TableField(value = "created_time")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@TableField(value = "reason_msg")
|
@TableField(value = "reason_msg")
|
||||||
@ApiModelProperty(value = "退回原因")
|
@ApiModelProperty(value = "退回原因")
|
||||||
private String reasonMsg;
|
private String reasonMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图号
|
||||||
|
*/
|
||||||
|
@TableField(value = "drawing_no")
|
||||||
|
@ApiModelProperty(value = "图号")
|
||||||
|
private String drawingNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "material_no")
|
||||||
|
@ApiModelProperty(value = "物料编码")
|
||||||
|
private String materialNo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "material_name")
|
||||||
|
@ApiModelProperty(value = "物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料描述
|
||||||
|
*/
|
||||||
|
@TableField(value = "material_desc")
|
||||||
|
@ApiModelProperty(value = "物料描述")
|
||||||
|
private String materialDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材质,材料
|
||||||
|
*/
|
||||||
|
@TableField(value = "material_texture")
|
||||||
|
@ApiModelProperty(value = "材质,材料")
|
||||||
|
private String materialTexture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@TableField(value = "material_unit")
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String materialUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单重
|
||||||
|
*/
|
||||||
|
@TableField(value = "unit_weight")
|
||||||
|
@ApiModelProperty(value = "单重")
|
||||||
|
private BigDecimal unitWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总重
|
||||||
|
*/
|
||||||
|
@TableField(value = "total_weight")
|
||||||
|
@ApiModelProperty(value = "总重")
|
||||||
|
private BigDecimal totalWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "num")
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
private BigDecimal num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类别
|
||||||
|
*/
|
||||||
|
@TableField(value = "project_type")
|
||||||
|
@ApiModelProperty(value = "项目类别")
|
||||||
|
private String projectType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
@TableField(value = "order_no")
|
||||||
|
@ApiModelProperty(value = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@TableField(value = "group_row_id")
|
||||||
|
@ApiModelProperty(value = "子级包含自己rowid")
|
||||||
|
private String groupRowId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -35414988190486329L;
|
private static final long serialVersionUID = -35414988190486329L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,19 @@ public class BomNewMbomDetailEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
private LocalDateTime modifyTime;
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*退回状态
|
||||||
|
*/
|
||||||
|
@TableField(value = "material_back_status")
|
||||||
|
@ApiModelProperty(value = "状态 0-待处理 1-待退回 2-已退")
|
||||||
|
private Integer materialBackStatus;
|
||||||
|
/**
|
||||||
|
* 0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包
|
||||||
|
*/
|
||||||
|
@TableField(value = "virtual_part_type")
|
||||||
|
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||||
|
private Integer virtualPartType;
|
||||||
|
|
||||||
private static final long serialVersionUID = -78419386224657732L;
|
private static final long serialVersionUID = -78419386224657732L;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,25 @@ import java.time.LocalDate;
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-BomNewMbomBackMaterialEntityVO")
|
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-BomNewMbomBackMaterialEntityVO")
|
||||||
public class BomNewMbomBackMaterialVO extends BomNewMbomMiddleVO {
|
public class BomNewMbomBackMaterialVO extends BaseMaterialVO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键行ID-雪花
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "主键行ID-雪花")
|
||||||
|
private Long rowId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* bom版本行ID,和mbom_parent表row_id关联
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "bom版本行ID,和mbom_parent表row_id关联")
|
||||||
|
private Long bomRowId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "bom版本行ID,和mbom_parent表row_id关联")
|
||||||
|
private Long detailRowId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退回人名称
|
* 退回人名称
|
||||||
|
|
@ -31,6 +45,8 @@ public class BomNewMbomBackMaterialVO extends BomNewMbomMiddleVO {
|
||||||
@ApiModelProperty(value = "退回人名称")
|
@ApiModelProperty(value = "退回人名称")
|
||||||
private String backUserName;
|
private String backUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源行ID(PBOM中parent的行ID)")
|
||||||
|
private Long sourceRowId;
|
||||||
/**
|
/**
|
||||||
* 退回人工号
|
* 退回人工号
|
||||||
*/
|
*/
|
||||||
|
|
@ -66,6 +82,26 @@ public class BomNewMbomBackMaterialVO extends BomNewMbomMiddleVO {
|
||||||
private String reasonMsg;
|
private String reasonMsg;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态 0-待处理 1-已处理 2- 驳回")
|
||||||
|
private Integer backStatus=0;
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createdTime;
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.product.bomnew.pojo.vo;
|
package com.nflg.product.bomnew.pojo.vo;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.nflg.product.bomnew.constant.FactoryCodeEnum;
|
import com.nflg.product.bomnew.constant.FactoryCodeEnum;
|
||||||
import com.nflg.product.bomnew.util.EnumUtils;
|
import com.nflg.product.bomnew.util.EnumUtils;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
|
@ -237,8 +238,24 @@ public class BomNewMbomMiddleVO extends BaseMaterialVO implements Serializable {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态 0-待处理 1-已处理 2- 驳回")
|
// @ApiModelProperty(value = "状态 0-待处理 1-已处理 2- 驳回")
|
||||||
private Integer backStatus=0;
|
// private Integer backStatus=0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*退回状态
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态 0-待处理 1-待退回 2-已退")
|
||||||
|
private Integer materialBackStatus;
|
||||||
|
/**
|
||||||
|
* 0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||||
|
private Integer virtualPartType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private List<BomNewMbomMiddleVO> childNodes = Collections.emptyList();
|
private List<BomNewMbomMiddleVO> childNodes = Collections.emptyList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.lang.TypeReference;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
@ -11,6 +13,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
import com.nflg.product.bomnew.constant.MBomConstantEnum;
|
import com.nflg.product.bomnew.constant.MBomConstantEnum;
|
||||||
|
import com.nflg.product.bomnew.constant.ProjectTypeInputTypeEnum;
|
||||||
|
import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum;
|
||||||
import com.nflg.product.bomnew.mapper.master.BomNewMbomBackMaterialMapper;
|
import com.nflg.product.bomnew.mapper.master.BomNewMbomBackMaterialMapper;
|
||||||
import com.nflg.product.bomnew.pojo.dto.BomNewMbomApplyBackMaterialDTO;
|
import com.nflg.product.bomnew.pojo.dto.BomNewMbomApplyBackMaterialDTO;
|
||||||
import com.nflg.product.bomnew.pojo.dto.BomNewMbomBackMaterialDTO;
|
import com.nflg.product.bomnew.pojo.dto.BomNewMbomBackMaterialDTO;
|
||||||
|
|
@ -20,6 +24,9 @@ import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomNewMbomBackMaterialQuery;
|
import com.nflg.product.bomnew.pojo.query.BomNewMbomBackMaterialQuery;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
|
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
|
||||||
import com.nflg.product.bomnew.pojo.vo.BomNewMbomBackMaterialVO;
|
import com.nflg.product.bomnew.pojo.vo.BomNewMbomBackMaterialVO;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.BomNewMbomParentVO;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.OptionalMbomMaterialListVO;
|
||||||
import nflg.product.common.constant.STATE;
|
import nflg.product.common.constant.STATE;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -52,90 +59,243 @@ public class BomNewMbomBackMaterialService extends ServiceImpl<BomNewMbomBackMat
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void checkBackStatus( List<BomNewMbomBackMaterialEntity> backList){
|
||||||
|
if(CollectionUtil.isEmpty(backList)){
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError,"未查询到数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BomNewMbomBackMaterialEntity entity:
|
||||||
|
backList) {
|
||||||
|
if(Objects.equals(entity.getBackStatus(), MBomConstantEnum.MBomBackStatusEnum.REJECT_2.getValue())){
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError,StrUtil.format("{}物料已驳回禁止操作",entity.getMaterialNo()));
|
||||||
|
}
|
||||||
|
if(Objects.equals(entity.getBackStatus(), MBomConstantEnum.MBomBackStatusEnum.DEAL_1.getValue())){
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError,StrUtil.format("{}物料已处理退回禁止操作",entity.getMaterialNo()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteBack(List<Long> rowIds ){
|
||||||
|
|
||||||
|
QueryWrapper<BomNewMbomBackMaterialEntity> queryWrapper=new QueryWrapper<>();
|
||||||
|
queryWrapper.lambda().in(BomNewMbomBackMaterialEntity::getRowId,rowIds);
|
||||||
|
List<BomNewMbomBackMaterialEntity> backList=getBaseMapper().selectList(queryWrapper);
|
||||||
|
checkBackStatus(backList);
|
||||||
|
|
||||||
|
for (BomNewMbomBackMaterialEntity entity:
|
||||||
|
backList) {
|
||||||
|
if(!entity.getBackUserCode().equals(SessionUtil.getUserCode())){
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError,StrUtil.format("{}物料由申请人才能删除",entity.getMaterialNo()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BomNewMbomBackMaterialEntity entity:
|
||||||
|
backList) {
|
||||||
|
|
||||||
|
this.removeById(entity.getRowId());
|
||||||
|
|
||||||
|
SpringUtil.getBean(BomNewMbomDetailService.class).getBaseMapper().updateBackStatus(entity.getGroupRowId(),
|
||||||
|
MBomConstantEnum.MaterialBackStatusEnum.APPLY_0.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驳回
|
* 驳回
|
||||||
* @param rowIds
|
* @param rowIds
|
||||||
*/
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void rejectBack(List<Long> rowIds ){
|
public void rejectBack(List<Long> rowIds ){
|
||||||
|
|
||||||
QueryWrapper<BomNewMbomBackMaterialEntity> queryWrapper=new QueryWrapper<>();
|
QueryWrapper<BomNewMbomBackMaterialEntity> queryWrapper=new QueryWrapper<>();
|
||||||
queryWrapper.lambda().in(BomNewMbomBackMaterialEntity::getRowId,rowIds);
|
queryWrapper.lambda().in(BomNewMbomBackMaterialEntity::getRowId,rowIds);
|
||||||
queryWrapper.lambda().eq(BomNewMbomBackMaterialEntity::getBackStatus, MBomConstantEnum.MBomBackStatusEnum.REJECT_2.getValue());
|
// queryWrapper.lambda().eq(BomNewMbomBackMaterialEntity::getBackStatus, MBomConstantEnum.MBomBackStatusEnum.REJECT_2.getValue());
|
||||||
|
|
||||||
List<BomNewMbomBackMaterialEntity> backList=getBaseMapper().selectList(queryWrapper);
|
List<BomNewMbomBackMaterialEntity> backList=getBaseMapper().selectList(queryWrapper);
|
||||||
if(CollectionUtil.isNotEmpty(backList)){
|
|
||||||
throw new NflgBusinessException(STATE.BusinessError,"选择数据存在已驳回不能重复驳回");
|
|
||||||
}
|
|
||||||
|
|
||||||
List<BomNewMbomBackMaterialEntity> updateList=new ArrayList<>();
|
|
||||||
rowIds.forEach(id->{
|
checkBackStatus(backList);
|
||||||
|
|
||||||
|
|
||||||
|
//修改物料退回
|
||||||
|
for ( BomNewMbomBackMaterialEntity entity:
|
||||||
|
backList) {
|
||||||
BomNewMbomBackMaterialEntity bean=new BomNewMbomBackMaterialEntity();
|
BomNewMbomBackMaterialEntity bean=new BomNewMbomBackMaterialEntity();
|
||||||
bean.setRowId(id);
|
bean.setRowId(entity.getRowId());
|
||||||
bean.setBackStatus(MBomConstantEnum.MBomBackStatusEnum.REJECT_2.getValue());
|
bean.setBackStatus(MBomConstantEnum.MBomBackStatusEnum.REJECT_2.getValue());
|
||||||
bean.setConfirmTime(LocalDateTime.now());
|
bean.setConfirmTime(LocalDateTime.now());
|
||||||
|
bean.setModifyTime(LocalDateTime.now());
|
||||||
bean.setConfirmUserCode(SessionUtil.getUserCode());
|
bean.setConfirmUserCode(SessionUtil.getUserCode());
|
||||||
bean.setConfirmUserName(SessionUtil.getUserName());
|
bean.setConfirmUserName(SessionUtil.getUserName());
|
||||||
updateList.add(bean);
|
this.updateById(entity);
|
||||||
});
|
|
||||||
if(CollectionUtil.isNotEmpty(updateList)){
|
SpringUtil.getBean(BomNewMbomDetailService.class).getBaseMapper().updateBackStatus(entity.getGroupRowId(),
|
||||||
this.updateBatchById(updateList);
|
MBomConstantEnum.MaterialBackStatusEnum.APPLY_0.getValue());
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退回
|
* 申请退回
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void applyBack(BomNewMbomApplyBackMaterialDTO dto ){
|
public void applyBack(BomNewMbomApplyBackMaterialDTO dto ){
|
||||||
List<BomNewMbomBackMaterialDTO> rowIds=dto.getRowIds();
|
List<BomNewMbomBackMaterialDTO> rowIds=dto.getRowIds();
|
||||||
|
|
||||||
|
|
||||||
|
dto.getRowIds().forEach(item->{
|
||||||
|
if(Objects.equals(item.getRowId(),item.getBomRowId())){
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError,"不能选择顶层数据退回");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//是否存在退回
|
//是否存在退回
|
||||||
List<Long> backRowId=rowIds.stream().map(BomNewMbomBackMaterialDTO::getRowId).collect(Collectors.toList());
|
List<Long> backRowId=rowIds.stream().map(BomNewMbomBackMaterialDTO::getRowId).collect(Collectors.toList());
|
||||||
QueryWrapper<BomNewMbomBackMaterialEntity> queryWrapper=new QueryWrapper<>();
|
QueryWrapper<BomNewMbomBackMaterialEntity> queryWrapper=new QueryWrapper<>();
|
||||||
queryWrapper.lambda().in(BomNewMbomBackMaterialEntity::getDetailRowId,backRowId);
|
queryWrapper.lambda().in(BomNewMbomBackMaterialEntity::getDetailRowId,backRowId);
|
||||||
|
|
||||||
List<BomNewMbomBackMaterialEntity> backList=getBaseMapper().selectList(queryWrapper);
|
List<BomNewMbomBackMaterialEntity> backList=getBaseMapper().selectList(queryWrapper);
|
||||||
if(CollectionUtil.isNotEmpty(backList)){
|
checkBackStatus(backList);
|
||||||
throw new NflgBusinessException(STATE.BusinessError,"选择数据已申请退回");
|
|
||||||
}
|
|
||||||
|
|
||||||
dto.getRowIds().forEach(item->{
|
|
||||||
|
|
||||||
if(Objects.equals(item.getRowId(),item.getBomRowId())){
|
|
||||||
throw new NflgBusinessException(STATE.BusinessError,"不能选择顶层数据退回");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//虚拟包不能退
|
||||||
QueryWrapper<BomNewMbomDetailEntity> queryWrapper2=new QueryWrapper<>();
|
QueryWrapper<BomNewMbomDetailEntity> queryWrapper2=new QueryWrapper<>();
|
||||||
queryWrapper2.lambda().in(BomNewMbomDetailEntity::getRowId,backRowId);
|
queryWrapper2.lambda().in(BomNewMbomDetailEntity::getRowId,backRowId);
|
||||||
List<BomNewMbomDetailEntity> list= SpringUtil.getBean(BomNewMbomDetailService.class).list(queryWrapper2);
|
List<BomNewMbomDetailEntity> detailEntityList = SpringUtil.getBean(BomNewMbomDetailService.class).list(queryWrapper2);
|
||||||
|
List<BomNewMbomDetailEntity> checkVirtualPartList= detailEntityList.stream().filter(item->Objects.nonNull(item.getVirtualPartType())&&item.getVirtualPartType().intValue()>0).collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isNotEmpty(checkVirtualPartList)){
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError,"虚拟包数据不能进行退回");
|
||||||
|
}
|
||||||
|
|
||||||
if(CollectionUtil.isNotEmpty(list)){
|
//订单号
|
||||||
|
String orderNo;
|
||||||
|
if(CollectionUtil.isNotEmpty(detailEntityList)){
|
||||||
|
BomNewMbomParentEntity bomNewMbomParentEntity=
|
||||||
|
|
||||||
|
SpringUtil.getBean(BomNewMbomParentService .class).getById(detailEntityList.get(0).getBomRowId());
|
||||||
|
|
||||||
|
orderNo=bomNewMbomParentEntity.getOrderNo();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
orderNo = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<BomNewMbomBackMaterialEntity> backMaterialEntityList=Convert.convert(new TypeReference<List<BomNewMbomBackMaterialEntity>>() {
|
||||||
|
},detailEntityList);
|
||||||
|
|
||||||
|
//1.物料的项目类型是Q时,此时这个物料的下级(递归处理)要全部进行退回
|
||||||
|
//2. 不为Q时 首先向上递归,所有父级物料(到虚拟包为止),然后向下递归,所有子级物料
|
||||||
|
|
||||||
|
if(CollectionUtil.isNotEmpty(backMaterialEntityList)){
|
||||||
List<BomNewMbomBackMaterialEntity> saveBackList=new ArrayList<>();
|
List<BomNewMbomBackMaterialEntity> saveBackList=new ArrayList<>();
|
||||||
list.forEach(item->{
|
|
||||||
BomNewMbomBackMaterialEntity beanBack=new BomNewMbomBackMaterialEntity();
|
for (BomNewMbomBackMaterialEntity item:
|
||||||
beanBack.setBomRowId(item.getBomRowId());
|
backMaterialEntityList) {
|
||||||
beanBack.setDetailRowId(item.getRowId());
|
|
||||||
beanBack.setSourceRowId(item.getSourceRowId());
|
|
||||||
beanBack.setBackStatus(MBomConstantEnum.MBomBackStatusEnum.APPLY_0.getValue());
|
item.setBackUserName(SessionUtil.getRealName());
|
||||||
beanBack.setBackUserName(SessionUtil.getRealName());
|
item.setBackUserCode(SessionUtil.getUserCode());
|
||||||
beanBack.setBackUserCode(SessionUtil.getUserCode());
|
item.setCreatedTime(LocalDateTime.now());
|
||||||
beanBack.setCreatedTime(LocalDateTime.now());
|
item.setModifyTime(LocalDateTime.now());
|
||||||
beanBack.setReasonMsg(dto.getReasonMsg());
|
item.setReasonMsg(dto.getReasonMsg());
|
||||||
|
item.setOrderNo(orderNo);
|
||||||
|
item.setBackStatus(MBomConstantEnum.MBomBackStatusEnum.APPLY_0.getValue());
|
||||||
|
if(item.getProjectType().equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue())){
|
||||||
|
item.setGroupRowId(SpringUtil.getBean(BomNewMbomDetailService.class).getGroupRowId(item.getDetailRowId()));
|
||||||
|
}else{
|
||||||
|
item.setGroupRowId(SpringUtil.getBean(BomNewMbomDetailService.class).getGroupRowId(findRootRowId(item.getDetailRowId())));
|
||||||
|
}
|
||||||
saveBackList.add(beanBack);
|
saveBackList.add(beanBack);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.saveBatch(saveBackList);
|
this.saveBatch(saveBackList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向上递归到根
|
||||||
|
* 从根向下查找最近一个非虚拟包作为起始节点返回,然后起始节点向下递归
|
||||||
|
* @param rowId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Long findRootRowId(Long rowId){
|
||||||
|
|
||||||
|
List<BomNewMbomMiddleVO> childList = SpringUtil.getBean(BomNewMbomParentService.class).getBaseMapper()
|
||||||
|
.searchList(rowId);
|
||||||
|
|
||||||
|
|
||||||
|
BomNewMbomMiddleVO root=listToTree(childList);
|
||||||
|
for (;root!=null;) {
|
||||||
|
|
||||||
|
if(root.getVirtualPartType()!=null&&
|
||||||
|
root.getVirtualPartType().intValue()== VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue()){
|
||||||
|
return root.getRowId();
|
||||||
|
}
|
||||||
|
if(CollectionUtil.isNotEmpty(root.getChildNodes())){
|
||||||
|
root= root.getChildNodes().get(0);
|
||||||
|
}else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError,"非Q向上递归未查询到节点");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private BomNewMbomMiddleVO listToTree(List<BomNewMbomMiddleVO> childs) {
|
||||||
|
|
||||||
|
if(CollectionUtil.isEmpty(childs)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Map<Long, List<BomNewMbomMiddleVO>> groupMap = childs.stream().collect(Collectors.groupingBy(BomNewMbomMiddleVO::getParentRowId));
|
||||||
|
childs.forEach(child -> {
|
||||||
|
child.setChildNodes(groupMap.get(child.getRowId()));
|
||||||
|
});
|
||||||
|
//筛选出根
|
||||||
|
List<BomNewMbomMiddleVO> collect = childs.stream().filter(item -> Objects.isNull(item.getParentRowId()) || item.getParentRowId().longValue()==0).collect(Collectors.toList());
|
||||||
|
return collect.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认退回
|
* 确认退回
|
||||||
* @param rowIds
|
* @param rowIds
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,9 @@ public class BomNewMbomDetailService extends ServiceImpl<BomNewMbomDetailMapper,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getGroupRowId(Long rowId){
|
||||||
|
return this.getBaseMapper().getGroupRowId(rowId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<BomNewMbomMiddleVO> superSaterialList(Long rowId) {
|
public List<BomNewMbomMiddleVO> superSaterialList(Long rowId) {
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,8 @@ public class OptionalMbomMaterialService extends ServiceImpl<OptionalMbomMateria
|
||||||
item.setRootRowId(parentRow.getRootRowId());
|
item.setRootRowId(parentRow.getRootRowId());
|
||||||
if(Objects.isNull(item.getRowId()) || item.getRowId().longValue() == 0){
|
if(Objects.isNull(item.getRowId()) || item.getRowId().longValue() == 0){
|
||||||
item.setCreatedTime(DateUtil.now());
|
item.setCreatedTime(DateUtil.now());
|
||||||
|
}else{
|
||||||
|
item.setCreatedTime(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
item.setCreatedBy(SessionUtil.getUserCode());
|
item.setCreatedBy(SessionUtil.getUserCode());
|
||||||
|
|
|
||||||
|
|
@ -3,64 +3,66 @@
|
||||||
<mapper namespace="com.nflg.product.bomnew.mapper.master.BomNewMbomBackMaterialMapper">
|
<mapper namespace="com.nflg.product.bomnew.mapper.master.BomNewMbomBackMaterialMapper">
|
||||||
|
|
||||||
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.BomNewMbomBackMaterialEntity">
|
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.BomNewMbomBackMaterialEntity">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
<!--@Table t_bom_new_mbom_back_material -->
|
<!--@Table t_bom_new_mbom_back_material -->
|
||||||
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
|
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
|
||||||
<result column="detail_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
<result column="detail_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
||||||
|
|
||||||
|
|
||||||
<result column="bom_row_id" property="bomRowId" jdbcType="BIGINT"/>
|
<result column="bom_row_id" property="bomRowId" jdbcType="BIGINT"/>
|
||||||
|
|
||||||
|
|
||||||
<result column="detail_row_id" property="detailRowId" jdbcType="BIGINT"/>
|
<result column="detail_row_id" property="detailRowId" jdbcType="BIGINT"/>
|
||||||
<result column="back_user_name" property="backUserName" jdbcType="VARCHAR"/>
|
<result column="back_user_name" property="backUserName" jdbcType="VARCHAR"/>
|
||||||
<result column="back_user_code" property="backUserCode" jdbcType="VARCHAR"/>
|
<result column="back_user_code" property="backUserCode" jdbcType="VARCHAR"/>
|
||||||
<result column="back_status" property="backStatus" jdbcType="INTEGER"/>
|
<result column="back_status" property="backStatus" jdbcType="INTEGER"/>
|
||||||
<result column="confirm_user_code" property="confirmUserCode" jdbcType="VARCHAR"/>
|
<result column="confirm_user_code" property="confirmUserCode" jdbcType="VARCHAR"/>
|
||||||
<result column="confirm_user_name" property="confirmUserName" jdbcType="VARCHAR"/>
|
<result column="confirm_user_name" property="confirmUserName" jdbcType="VARCHAR"/>
|
||||||
<result column="confirm_time" property="confirmTime" jdbcType="TIMESTAMP"/>
|
<result column="confirm_time" property="confirmTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="reason_msg" property="reasonMsg" jdbcType="VARCHAR"/>
|
|
||||||
|
|
||||||
</resultMap>
|
<result column="modify_time" property="modifTime" jdbcType="TIMESTAMP"/>
|
||||||
|
<result column="reason_msg" property="reasonMsg" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result column="drawing_no" property="drawingNo" jdbcType="VARCHAR"/>
|
||||||
|
<result column="project_type" property="projectType" jdbcType="VARCHAR"/>
|
||||||
|
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
||||||
|
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
|
||||||
|
<result column="material_texture" property="materialTexture" jdbcType="VARCHAR"/>
|
||||||
|
<result column="material_unit" property="materialUnit" jdbcType="VARCHAR"/>
|
||||||
|
<result column="unit_weight" property="unitWeight" jdbcType="DECIMAL"/>
|
||||||
|
<result column="total_weight" property="totalWeight" jdbcType="DECIMAL"/>
|
||||||
|
<result column="num" property="num" jdbcType="DECIMAL"/>
|
||||||
|
<result column="order_no" property="orderNo" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result column="group_row_id" property="groupRowId" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
row_id, source_id, back_user_name, back_user_code, status, confirm_user_code, confirm_user_name, confirm_time, created_time </sql>
|
row_id, source_id, back_user_name, back_user_code, status, confirm_user_code, confirm_user_name, confirm_time,
|
||||||
|
created_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
<select id="getListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomBackMaterialVO">
|
<select id="getListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomBackMaterialVO">
|
||||||
select t1.*, t2.drawing_no,
|
select t1.*
|
||||||
t2.fac_code,
|
|
||||||
t2.material_no,
|
|
||||||
t2.material_name,
|
|
||||||
t2.material_desc,
|
|
||||||
t2.material_texture,
|
|
||||||
t2.material_unit,
|
|
||||||
t2.unit_weight,
|
|
||||||
t2.total_weight,
|
|
||||||
t2.num,
|
|
||||||
t2.project_type,
|
|
||||||
t2.super_material_status,
|
|
||||||
t2.virtual_part_is,
|
|
||||||
t2.remark,
|
|
||||||
t3.order_no
|
|
||||||
from t_bom_new_mbom_back_material as t1
|
from t_bom_new_mbom_back_material as t1
|
||||||
left join t_bom_new_mbom_detail t2
|
|
||||||
on t1.detail_row_id=t2.row_id
|
|
||||||
left join t_bom_new_mbom_parent t3
|
|
||||||
on t1.bom_row_id=t3.row_id
|
|
||||||
|
|
||||||
|
|
||||||
<where>
|
<where>
|
||||||
<if test="query.drawingNo!=null and query.drawingNo!=''">
|
<if test="query.drawingNo!=null and query.drawingNo!=''">
|
||||||
and t2.drawing_no=#{query.drawingNo}
|
and t1.drawing_no=#{query.drawingNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.materialNo!=null and query.materialNo!=''">
|
<if test="query.materialNo!=null and query.materialNo!=''">
|
||||||
and t2.material_no=#{query.materialNo}
|
and t1.material_no=#{query.materialNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.orderNo!=null and query.orderNo!=''">
|
<if test="query.orderNo!=null and query.orderNo!=''">
|
||||||
and t3.order_no=#{query.orderNo}
|
and t1.order_no=#{query.orderNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.startDate!=null and query.startDate!='' and query.endDate!=null and query.endDate!=''">
|
<if test="query.startDate!=null and query.startDate!='' and query.endDate!=null and query.endDate!=''">
|
||||||
<![CDATA[ and t1.created_time >= #{query.startDate} and t1.created_time <=#{query.endDate}]]>
|
<![CDATA[ and t1.created_time >= #{query.startDate} and t1.created_time <=#{query.endDate}]]>
|
||||||
|
|
@ -78,4 +80,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -3,45 +3,85 @@
|
||||||
<mapper namespace="com.nflg.product.bomnew.mapper.master.BomNewMbomDetailMapper">
|
<mapper namespace="com.nflg.product.bomnew.mapper.master.BomNewMbomDetailMapper">
|
||||||
|
|
||||||
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.BomNewMbomDetailEntity">
|
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.BomNewMbomDetailEntity">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
<!--@Table t_bom_new_mbom_detail -->
|
<!--@Table t_bom_new_mbom_detail -->
|
||||||
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
|
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
|
||||||
<result column="bom_row_id" property="bomRowId" jdbcType="BIGINT"/>
|
<result column="bom_row_id" property="bomRowId" jdbcType="BIGINT"/>
|
||||||
<result column="parent_row_id" property="parentRowId" jdbcType="BIGINT"/>
|
<result column="parent_row_id" property="parentRowId" jdbcType="BIGINT"/>
|
||||||
<result column="drawing_no" property="drawingNo" jdbcType="VARCHAR"/>
|
<result column="drawing_no" property="drawingNo" jdbcType="VARCHAR"/>
|
||||||
<result column="fac_code" property="facCode" jdbcType="VARCHAR"/>
|
<result column="fac_code" property="facCode" jdbcType="VARCHAR"/>
|
||||||
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
|
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
|
||||||
<result column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
|
<result column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
|
||||||
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
||||||
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
|
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
|
||||||
<result column="material_texture" property="materialTexture" jdbcType="VARCHAR"/>
|
<result column="material_texture" property="materialTexture" jdbcType="VARCHAR"/>
|
||||||
<result column="material_unit" property="materialUnit" jdbcType="VARCHAR"/>
|
<result column="material_unit" property="materialUnit" jdbcType="VARCHAR"/>
|
||||||
<result column="unit_weight" property="unitWeight" jdbcType="DECIMAL"/>
|
<result column="unit_weight" property="unitWeight" jdbcType="DECIMAL"/>
|
||||||
<result column="total_weight" property="totalWeight" jdbcType="DECIMAL"/>
|
<result column="total_weight" property="totalWeight" jdbcType="DECIMAL"/>
|
||||||
<result column="num" property="num" jdbcType="DECIMAL"/>
|
<result column="num" property="num" jdbcType="DECIMAL"/>
|
||||||
<result column="project_type" property="projectType" jdbcType="VARCHAR"/>
|
<result column="project_type" property="projectType" jdbcType="VARCHAR"/>
|
||||||
<result column="super_material_status" property="superMaterialStatus" jdbcType="INTEGER"/>
|
<result column="super_material_status" property="superMaterialStatus" jdbcType="INTEGER"/>
|
||||||
<result column="virtual_part_is" property="virtualPartIs" jdbcType="INTEGER"/>
|
<result column="virtual_part_is" property="virtualPartIs" jdbcType="INTEGER"/>
|
||||||
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
||||||
<result column="devise_user_code" property="deviseUserCode" jdbcType="VARCHAR"/>
|
<result column="devise_user_code" property="deviseUserCode" jdbcType="VARCHAR"/>
|
||||||
<result column="devise_name" property="deviseName" jdbcType="VARCHAR"/>
|
<result column="devise_name" property="deviseName" jdbcType="VARCHAR"/>
|
||||||
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
|
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
|
||||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||||
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
|
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
|
||||||
<result column="level_num" property="levelNum" jdbcType="INTEGER"/>
|
<result column="level_num" property="levelNum" jdbcType="INTEGER"/>
|
||||||
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
|
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
|
||||||
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
|
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
|
||||||
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
||||||
</resultMap>
|
<result column="material_back_status" property="materialBackStatus" jdbcType="INTEGER"/>
|
||||||
|
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
row_id, bom_row_id, parent_row_id, drawing_no, fac_code, material_no, 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 </sql>
|
row_id, bom_row_id, parent_row_id, drawing_no, fac_code, material_no, 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
|
||||||
|
</sql>
|
||||||
<select id="getDetailById" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
<select id="getDetailById" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||||
select t1.*
|
select t1.*
|
||||||
from t_bom_new_mbom_detail as t1
|
from t_bom_new_mbom_detail as t1
|
||||||
where t1.row_id = #{rowId}
|
where t1.row_id = #{rowId}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--向下递归查找-->
|
||||||
|
<select id="getGroupRowId" resultType="java.lang.String">
|
||||||
|
|
||||||
|
SELECT GROUP_CONCAT(d.row_id) ids
|
||||||
|
FROM (SELECT @ids AS _ids,
|
||||||
|
(SELECT @ids := GROUP_CONCAT( row_id )
|
||||||
|
FROM t_bom_new_mbom_detail
|
||||||
|
WHERE FIND_IN_SET( parent_row_id, @ids )) AS cids FROM
|
||||||
|
t_bom_new_mbom_detail,
|
||||||
|
( SELECT @ids := ( SELECT pu.row_id FROM t_bom_new_mbom_detail pu WHERE pu.row_id = ${rowId}) ) b
|
||||||
|
WHERE
|
||||||
|
@ids IS NOT NULL
|
||||||
|
) dd
|
||||||
|
, t_bom_new_mbom_detail d
|
||||||
|
WHERE
|
||||||
|
FIND_IN_SET( d.row_id
|
||||||
|
, dd._ids );
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateBackStatus" >
|
||||||
|
UPDATE t_bom_new_mbom_detail SET material_back_status=#{materialBackStatus},modify_time=now()
|
||||||
|
|
||||||
|
WHERE row_id in ${rowIds}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@
|
||||||
<!--向上递归查找-->
|
<!--向上递归查找-->
|
||||||
<select id="searchList" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
<select id="searchList" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
select T1.*, IFNULL(T2.back_status, 0) as back_status
|
select T1.*
|
||||||
from (SELECT t2.*, (SELECT count(1) from t_bom_new_mbom_detail where parent_row_id = t2.row_id) as bom_exist
|
from (SELECT t2.*, (SELECT count(1) from t_bom_new_mbom_detail where parent_row_id = t2.row_id) as bom_exist
|
||||||
FROM (SELECT @r AS _row_id,
|
FROM (SELECT @r AS _row_id,
|
||||||
(SELECT @r := parent_row_id
|
(SELECT @r := parent_row_id
|
||||||
|
|
@ -174,8 +174,7 @@
|
||||||
JOIN t_bom_new_mbom_detail t2
|
JOIN t_bom_new_mbom_detail t2
|
||||||
ON t1._row_id = t2.row_id
|
ON t1._row_id = t2.row_id
|
||||||
)as T1
|
)as T1
|
||||||
left join t_bom_new_mbom_back_material as T2
|
|
||||||
on T1.row_id=T2.detail_row_id
|
|
||||||
]]>
|
]]>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue