bug修改
This commit is contained in:
parent
7f52eeb7d7
commit
4619cd3843
|
|
@ -171,7 +171,7 @@ public class OptionalEbomApi extends BaseApi {
|
||||||
return ResultVO.error(STATE.ParamErr, "选择待删除数据");
|
return ResultVO.error(STATE.ParamErr, "选择待删除数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResultVO.success(this.optionalEbomImportChildService.deleteByRowId(rowIds));
|
return ResultVO.success(this.optionalEbomImportChildService.deleteBiz(rowIds));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,9 @@ public class OptionalMbomApi extends BaseApi {
|
||||||
@PostMapping("getMaterialParentList")
|
@PostMapping("getMaterialParentList")
|
||||||
@ApiOperation("物料分页数据")
|
@ApiOperation("物料分页数据")
|
||||||
public ResultVO<IPage<OptionalMbomMaterialVO>> getMaterialParentList(@RequestBody OptionalMbomMaterialListQuery query) {
|
public ResultVO<IPage<OptionalMbomMaterialVO>> getMaterialParentList(@RequestBody OptionalMbomMaterialListQuery query) {
|
||||||
|
|
||||||
|
|
||||||
|
query.setCreatedBy(SessionUtil.getUserCode());
|
||||||
return ResultVO.success(this.optionalMbomMaterialService.getListPage(query));
|
return ResultVO.success(this.optionalMbomMaterialService.getListPage(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ package com.nflg.product.bomnew.mapper.master;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigREntity;
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigREntity;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.OptionalEbomConfigRVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -21,7 +22,7 @@ import java.util.List;
|
||||||
public interface OptionalEbomConfigRMapper extends BaseMapper<OptionalEbomConfigREntity> {
|
public interface OptionalEbomConfigRMapper extends BaseMapper<OptionalEbomConfigREntity> {
|
||||||
|
|
||||||
|
|
||||||
|
public List<OptionalEbomConfigRVO> countPublishList(@Param("optionRowIds")String optionRowIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ package com.nflg.product.bomnew.pojo.entity;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
@ -102,13 +103,26 @@ public class OptionalEbomConfigEntity implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time")
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createdTime;
|
private String createdTime;
|
||||||
|
|
||||||
|
public String getCreatedTime(){
|
||||||
|
|
||||||
|
return DateUtil.now();
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 变更时间
|
* 变更时间
|
||||||
*/
|
*/
|
||||||
@TableField(value = "updated_time")
|
@TableField(value = "updated_time")
|
||||||
@ApiModelProperty(value = "变更时间")
|
@ApiModelProperty(value = "变更时间")
|
||||||
private Date updatedTime;
|
private String updatedTime;
|
||||||
|
|
||||||
|
|
||||||
|
public String getUpdatedTime(){
|
||||||
|
|
||||||
|
return DateUtil.now();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ public class OptionalEbomConfigREntity implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time")
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createdTime;
|
private String createdTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ package com.nflg.product.bomnew.pojo.entity;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
@ -108,11 +109,21 @@ public class OptionalEbomImportChildEntity implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time")
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createdTime;
|
private String createdTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@TableField(value = "updated_time")
|
@TableField(value = "updated_time")
|
||||||
@ApiModelProperty(value = "更新时间")
|
@ApiModelProperty(value = "更新时间")
|
||||||
private Date updatedTime;
|
private String updatedTime;
|
||||||
|
|
||||||
|
public String getUpdatedTime(){
|
||||||
|
|
||||||
|
return DateUtil.now();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ package com.nflg.product.bomnew.pojo.entity;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
@ -58,7 +59,10 @@ public class OptionalEbomImportEntity implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time")
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createdTime;
|
private String createdTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除(0 :否 1:是)
|
* 是否删除(0 :否 1:是)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ package com.nflg.product.bomnew.pojo.entity;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
|
@ -77,13 +79,23 @@ public class OptionalEbomMainEntity implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time")
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createdTime;
|
private String createdTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变更时间
|
* 变更时间
|
||||||
*/
|
*/
|
||||||
@TableField(value = "updated_time")
|
@TableField(value = "updated_time")
|
||||||
@ApiModelProperty(value = "变更时间")
|
@ApiModelProperty(value = "变更时间")
|
||||||
private Date updatedTime;
|
private String updatedTime;
|
||||||
|
|
||||||
|
public String getUpdatedTime(){
|
||||||
|
|
||||||
|
return DateUtil.now();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改人编码
|
* 更改人编码
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ public class OptionalEbomImportChildQuery implements Serializable {
|
||||||
@ApiModelProperty(value = "0查询隐藏 1 查询显示 空全部")
|
@ApiModelProperty(value = "0查询隐藏 1 查询显示 空全部")
|
||||||
private Integer enable;
|
private Integer enable;
|
||||||
|
|
||||||
|
private Integer isDel;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,4 +35,8 @@ public class OptionalMbomMaterialListQuery extends BasePageQuery implements S
|
||||||
@ApiModelProperty(value = "图号")
|
@ApiModelProperty(value = "图号")
|
||||||
private String drawingNo;
|
private String drawingNo;
|
||||||
|
|
||||||
|
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,29 +3,49 @@ package com.nflg.product.bomnew.pojo.vo;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("ebom 配置状态关系")
|
@ApiModel("ebom 配置状态关系")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class OptionalEbomConfigRVO implements Serializable {
|
public class OptionalEbomConfigRVO implements Serializable {
|
||||||
/**主键*/ @ApiModelProperty(value = "主键")
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
private Long rowId;
|
private Long rowId;
|
||||||
/**父级*/ @ApiModelProperty(value = "父级")
|
/**
|
||||||
|
* 父级
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "父级")
|
||||||
private Long parentRowId;
|
private Long parentRowId;
|
||||||
/**选配id*/ @ApiModelProperty(value = "选配id")
|
/**
|
||||||
|
* 选配id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "选配id")
|
||||||
private Long optionRowId;
|
private Long optionRowId;
|
||||||
/**选择状态(0 否 1是)*/ @ApiModelProperty(value = "选择状态(0 否 1是)")
|
/**
|
||||||
|
* 选择状态(0 否 1是)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "选择状态(0 否 1是)")
|
||||||
private Integer chooseStatus;
|
private Integer chooseStatus;
|
||||||
/**创建时间*/ @ApiModelProperty(value = "创建时间")
|
/**
|
||||||
private Date createdTime;
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private String createdTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.product.bomnew.service;
|
package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.TypeReference;
|
import cn.hutool.core.lang.TypeReference;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
@ -8,7 +9,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nflg.product.bomnew.mapper.master.OptionalEbomConfigRMapper;
|
import com.nflg.product.bomnew.mapper.master.OptionalEbomConfigRMapper;
|
||||||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomConfigDTO;
|
import com.nflg.product.bomnew.pojo.dto.OptionalEbomConfigDTO;
|
||||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigREntity;
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigREntity;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.OptionalEbomConfigRVO;
|
||||||
import com.nflg.product.bomnew.service.OptionalEbomConfigRService;
|
import com.nflg.product.bomnew.service.OptionalEbomConfigRService;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -33,7 +36,7 @@ public class OptionalEbomConfigRService extends ServiceImpl<OptionalEbomConfigRM
|
||||||
}, rList);
|
}, rList);
|
||||||
materialAttrEntityList.forEach(item -> {
|
materialAttrEntityList.forEach(item -> {
|
||||||
item.setParentRowId(parentRowId);
|
item.setParentRowId(parentRowId);
|
||||||
item.setCreatedTime(new Date());
|
item.setCreatedTime(DateUtil.now());
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.saveOrUpdateBatch(materialAttrEntityList);
|
return this.saveOrUpdateBatch(materialAttrEntityList);
|
||||||
|
|
@ -41,7 +44,9 @@ public class OptionalEbomConfigRService extends ServiceImpl<OptionalEbomConfigRM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<OptionalEbomConfigRVO> countPublish(String optionRowIds){
|
||||||
|
return this.baseMapper.countPublishList(optionRowIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.nflg.product.bomnew.service;
|
package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.TypeReference;
|
import cn.hutool.core.lang.TypeReference;
|
||||||
|
|
@ -33,6 +34,7 @@ import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选配方案清单(OptionalEbomConfig)表服务实现类
|
* 选配方案清单(OptionalEbomConfig)表服务实现类
|
||||||
|
|
@ -86,7 +88,6 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
||||||
if (optionalEbomMainVO == null || StrUtil.isEmpty(optionalEbomMainVO.getDeviceNo())) {
|
if (optionalEbomMainVO == null || StrUtil.isEmpty(optionalEbomMainVO.getDeviceNo())) {
|
||||||
throw new NflgBusinessException(STATE.SystemErr, "查询设备数据不存在");
|
throw new NflgBusinessException(STATE.SystemErr, "查询设备数据不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionalEbomConfigEntity optionalEbomConfigEntity = new OptionalEbomConfigEntity();
|
OptionalEbomConfigEntity optionalEbomConfigEntity = new OptionalEbomConfigEntity();
|
||||||
optionalEbomConfigEntity.setParentRowId(dto.getRowId());
|
optionalEbomConfigEntity.setParentRowId(dto.getRowId());
|
||||||
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
||||||
|
|
@ -95,7 +96,7 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
||||||
optionalEbomConfigEntity.setDeviceNo(optionalEbomMainVO.getDeviceNo());
|
optionalEbomConfigEntity.setDeviceNo(optionalEbomMainVO.getDeviceNo());
|
||||||
optionalEbomConfigEntity.setDeviceName(optionalEbomMainVO.getDeviceName());
|
optionalEbomConfigEntity.setDeviceName(optionalEbomMainVO.getDeviceName());
|
||||||
optionalEbomConfigEntity.setDeptName(SessionUtil.getDepartName());
|
optionalEbomConfigEntity.setDeptName(SessionUtil.getDepartName());
|
||||||
optionalEbomConfigEntity.setCreatedTime(new Date());
|
// optionalEbomConfigEntity.setCreatedTime(new Date());
|
||||||
optionalEbomConfigEntity.setParentRowId(dto.getRowId());
|
optionalEbomConfigEntity.setParentRowId(dto.getRowId());
|
||||||
optionalEbomConfigEntity.setUpdatedTime(optionalEbomConfigEntity.getCreatedTime());
|
optionalEbomConfigEntity.setUpdatedTime(optionalEbomConfigEntity.getCreatedTime());
|
||||||
|
|
||||||
|
|
@ -110,10 +111,8 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
||||||
OptionalEbomConfigVO optionalEbomConfigVO = Convert.convert(new TypeReference<OptionalEbomConfigVO>() {
|
OptionalEbomConfigVO optionalEbomConfigVO = Convert.convert(new TypeReference<OptionalEbomConfigVO>() {
|
||||||
}, optionalEbomConfigEntity);
|
}, optionalEbomConfigEntity);
|
||||||
|
|
||||||
|
|
||||||
return optionalEbomConfigVO;
|
return optionalEbomConfigVO;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean insertConfigRelation(Long rowId,List<OptionalEbomConfigDTO.OptionInfoDTO> rList){
|
public Boolean insertConfigRelation(Long rowId,List<OptionalEbomConfigDTO.OptionInfoDTO> rList){
|
||||||
|
|
@ -144,6 +143,36 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 级联删除
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Boolean deleteByIds(List<Long> rowIds){
|
||||||
|
|
||||||
|
QueryWrapper<OptionalEbomConfigEntity> wrapper=new QueryWrapper();
|
||||||
|
wrapper.lambda().in(OptionalEbomConfigEntity::getRowId,rowIds);
|
||||||
|
wrapper.lambda().eq(OptionalEbomConfigEntity::getEditStatus,OptionalBomConstant.PublishEnum.TMP.getValue());
|
||||||
|
|
||||||
|
List<OptionalEbomConfigEntity> list=this.list(wrapper);
|
||||||
|
|
||||||
|
List<Long> ids=list.stream().map(OptionalEbomConfigEntity::getRowId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Boolean result= this.removeByIds(ids);
|
||||||
|
if(result) {
|
||||||
|
QueryWrapper<OptionalEbomConfigREntity> wrapperR = new QueryWrapper();
|
||||||
|
wrapperR.lambda().in(OptionalEbomConfigREntity::getParentRowId, ids);
|
||||||
|
|
||||||
|
optionalEbomConfigRService.remove(wrapperR);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑暂存数据
|
* 编辑暂存数据
|
||||||
*
|
*
|
||||||
|
|
@ -157,7 +186,7 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
||||||
OptionalEbomConfigEntity optionalEbomConfigEntity = new OptionalEbomConfigEntity();
|
OptionalEbomConfigEntity optionalEbomConfigEntity = new OptionalEbomConfigEntity();
|
||||||
optionalEbomConfigEntity.setRowId(dto.getRowId());
|
optionalEbomConfigEntity.setRowId(dto.getRowId());
|
||||||
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
||||||
optionalEbomConfigEntity.setUpdatedTime(new Date());
|
// optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||||
this.updateById(optionalEbomConfigEntity);
|
this.updateById(optionalEbomConfigEntity);
|
||||||
|
|
||||||
return optionalEbomConfigRService.insertConfigRelation(dto.getRowId(), dto.getOptions());
|
return optionalEbomConfigRService.insertConfigRelation(dto.getRowId(), dto.getOptions());
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.TypeReference;
|
import cn.hutool.core.lang.TypeReference;
|
||||||
|
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.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -19,6 +21,7 @@ import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportChildEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportEntity;
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportEntity;
|
||||||
import com.nflg.product.bomnew.pojo.query.OptionalEbomImportChildQuery;
|
import com.nflg.product.bomnew.pojo.query.OptionalEbomImportChildQuery;
|
||||||
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.OptionalEbomConfigRVO;
|
||||||
import com.nflg.product.bomnew.pojo.vo.OptionalEbomImportChildVO;
|
import com.nflg.product.bomnew.pojo.vo.OptionalEbomImportChildVO;
|
||||||
import nflg.product.common.constant.STATE;
|
import nflg.product.common.constant.STATE;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
@ -48,7 +51,6 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加选配数据
|
* 添加选配数据
|
||||||
*
|
*
|
||||||
|
|
@ -68,38 +70,85 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
||||||
}
|
}
|
||||||
|
|
||||||
String nos = dto.getDrawingNo();
|
String nos = dto.getDrawingNo();
|
||||||
|
|
||||||
|
List<OptionalEbomImportChildEntity> optionList = null;
|
||||||
|
if (StrUtil.equals(nos, "无")) {
|
||||||
|
optionList = new ArrayList<>();
|
||||||
|
OptionalEbomImportChildEntity entity = new OptionalEbomImportChildEntity();
|
||||||
|
entity.setMaterialName(nos);
|
||||||
|
entity.setMaterialDesc(nos);
|
||||||
|
} else {
|
||||||
//先统一后分割
|
//先统一后分割
|
||||||
String[] array = nos.replace(";", ";").split(";");
|
String[] array = nos.replace(";", ";").split(";");
|
||||||
List<String> listNo = Arrays.stream(array).collect(Collectors.toList());
|
List<String> listNo = Arrays.stream(array).collect(Collectors.toList());
|
||||||
|
|
||||||
List<BaseMaterialVO> materialListVo = SpringUtil.getBean(MaterialMainService.class).initMaterialForAnyNo(listNo);
|
List<BaseMaterialVO> materialListVo = SpringUtil.getBean(MaterialMainService.class).initMaterialForAnyNo(listNo);
|
||||||
if (CollectionUtil.isEmpty(materialListVo)) {
|
if (CollectionUtil.isEmpty(materialListVo)) {
|
||||||
throw new NflgBusinessException(STATE.BusinessError, "未查询到图号/物料相关数据");
|
throw new NflgBusinessException(STATE.BusinessError, "未查询到图号/物料相关数据");
|
||||||
}
|
}
|
||||||
List<OptionalEbomImportChildEntity> optionList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
optionList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||||
}, materialListVo);
|
}, materialListVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(optionList)) {
|
||||||
optionList.forEach(item -> {
|
optionList.forEach(item -> {
|
||||||
|
|
||||||
item.setSource(OptionalBomConstant.SourceTypeEnum.SOURCE_INPUT.getValue());
|
item.setSource(OptionalBomConstant.SourceTypeEnum.SOURCE_INPUT.getValue());
|
||||||
item.setCreatedBy(SessionUtil.getUserCode());
|
|
||||||
item.setRootRowId(dto.getRootRowId());
|
item.setRootRowId(dto.getRootRowId());
|
||||||
item.setParentRowId(dto.getParentRowId());
|
item.setParentRowId(dto.getParentRowId());
|
||||||
item.setPartType(dto.getPartType());
|
item.setPartType(dto.getPartType());
|
||||||
item.setRemak(dto.getRemak());
|
item.setRemak(dto.getRemak());
|
||||||
item.setCreatedTime(new Date());
|
|
||||||
item.setUpdatedTime(new Date());
|
|
||||||
|
|
||||||
|
insertOptionAction(item );
|
||||||
});
|
});
|
||||||
return this.saveOrUpdateBatch(optionList);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void insertOptionAction(OptionalEbomImportChildEntity item){
|
||||||
|
QueryWrapper<OptionalEbomImportChildEntity> queryWrapper3 = new QueryWrapper<>();
|
||||||
|
// 同一个机型下不可以存在相同的物料信息(物料编号),如果是“无”的情况,需同一个机型+同一个选项来做唯一判断
|
||||||
|
if (StrUtil.isEmpty(item.getMaterialNo()) && item.getMaterialName().equals("无")) {
|
||||||
|
queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getRootRowId, item.getRootRowId());
|
||||||
|
queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getParentRowId, item.getParentRowId());
|
||||||
|
queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getMaterialName, "无");
|
||||||
|
queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getIsDel, 0);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getRootRowId, item.getRootRowId());
|
||||||
|
queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getMaterialNo, item.getMaterialNo());
|
||||||
|
queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getIsDel, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionalEbomImportChildEntity childEntity = getOne(queryWrapper3);
|
||||||
|
item.setCreatedBy(SessionUtil.getUserCode());
|
||||||
|
if (childEntity == null) {
|
||||||
|
|
||||||
|
item.setCreatedTime(DateUtil.now());
|
||||||
|
// item.setUpdatedTime(new Date());
|
||||||
|
save(item);
|
||||||
|
} else {
|
||||||
|
item.setRowId(childEntity.getRowId());
|
||||||
|
|
||||||
|
|
||||||
|
this.getBaseMapper().updateById(item);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Boolean openCloseStatus(OptionalEbomImportChildVO vo) {
|
public Boolean openCloseStatus(OptionalEbomImportChildVO vo) {
|
||||||
|
|
||||||
OptionalEbomImportChildEntity entity = Convert.convert(OptionalEbomImportChildEntity.class, vo);
|
OptionalEbomImportChildEntity entity = Convert.convert(OptionalEbomImportChildEntity.class, vo);
|
||||||
entity.setUpdatedTime(new Date());
|
// entity.setUpdatedTime(new Date());
|
||||||
return this.updateById(entity);
|
return this.updateById(entity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -121,9 +170,89 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean deleteByRowId(List<Long> longIds) {
|
public Boolean deleteByRowId(List<Long> longIds) {
|
||||||
|
|
||||||
String rowIds = longIds.stream().map(Object::toString)
|
String rowIds = longIds.stream().map(Object::toString)
|
||||||
.collect(Collectors.joining(","));
|
.collect(Collectors.joining(","));
|
||||||
return getBaseMapper().deleteByRowId(rowIds) > 0;
|
return getBaseMapper().deleteByRowId(rowIds) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相同部分更改isDel标记
|
||||||
|
* 不同部分没有发布数据则删除
|
||||||
|
* @param longIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Boolean deleteBiz(List<Long> longIds) {
|
||||||
|
List<Long> intersectionList=new ArrayList<>(); //交, 更新
|
||||||
|
List<Long> subList=new ArrayList<>(); //差, 删除
|
||||||
|
if(CollectionUtil.isNotEmpty(longIds)) {
|
||||||
|
|
||||||
|
String rowIds = longIds.stream().map(Object::toString)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
List<OptionalEbomConfigRVO> list= SpringUtil.getBean(OptionalEbomConfigRService.class).countPublish(rowIds);
|
||||||
|
List<Long> optionIdList=list.stream().map(OptionalEbomConfigRVO::getOptionRowId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//交集 相同
|
||||||
|
List<Long> intersectionList2= CollectionUtil.intersection(longIds, optionIdList).stream().collect(Collectors.toList());
|
||||||
|
//差 第一个list 不同部分
|
||||||
|
List<Long> subList2= CollectionUtil.subtract(longIds, optionIdList).stream().collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isNotEmpty(intersectionList2)){
|
||||||
|
intersectionList.addAll(intersectionList2);
|
||||||
|
}
|
||||||
|
if(CollectionUtil.isNotEmpty(subList2)){
|
||||||
|
subList.addAll(subList2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(intersectionList)) {
|
||||||
|
updateDelStatusByRowId(intersectionList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(subList)) {
|
||||||
|
|
||||||
|
deleteByRowId(subList);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// String rowIds = longIds.stream().map(Object::toString)
|
||||||
|
// .collect(Collectors.joining(","));
|
||||||
|
// return getBaseMapper().deleteByRowId(rowIds) > 0;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean updateDelStatusByRowId(List<Long> rowIds) {
|
||||||
|
QueryWrapper<OptionalEbomImportChildEntity> queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.lambda().in(OptionalEbomImportChildEntity::getRowId, rowIds);
|
||||||
|
OptionalEbomImportChildEntity entity = new OptionalEbomImportChildEntity();
|
||||||
|
entity.setIsDel(1);
|
||||||
|
|
||||||
|
return this.update(entity, queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean deleteByRootId(List<Long> rootRowId) {
|
||||||
|
QueryWrapper<OptionalEbomImportChildEntity> queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.lambda().in(OptionalEbomImportChildEntity::getRootRowId, rootRowId);
|
||||||
|
return this.remove(queryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean updateDelStatusByRootId(List<Long> rootRowId) {
|
||||||
|
QueryWrapper<OptionalEbomImportChildEntity> queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.lambda().in(OptionalEbomImportChildEntity::getRootRowId, rootRowId);
|
||||||
|
OptionalEbomImportChildEntity entity = new OptionalEbomImportChildEntity();
|
||||||
|
entity.setIsDel(1);
|
||||||
|
|
||||||
|
return this.update(entity, queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
package com.nflg.product.bomnew.service;
|
package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.bomnew.mapper.master.OptionalEbomImportMapper;
|
import com.nflg.product.bomnew.mapper.master.OptionalEbomImportMapper;
|
||||||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomMainDelDTO;
|
import com.nflg.product.bomnew.pojo.dto.OptionalEbomMainDelDTO;
|
||||||
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigREntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportEntity;
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportEntity;
|
||||||
import com.nflg.product.bomnew.pojo.vo.OptionalEbomImportVO;
|
import com.nflg.product.bomnew.pojo.vo.OptionalEbomImportVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
@ -31,7 +33,7 @@ public class OptionalEbomImportService extends ServiceImpl<OptionalEbomImportMap
|
||||||
for (OptionalEbomImportEntity entity :
|
for (OptionalEbomImportEntity entity :
|
||||||
list) {
|
list) {
|
||||||
entity.setRowId(null);
|
entity.setRowId(null);
|
||||||
entity.setCreatedTime(DateUtil.parse(DateUtil.now()));
|
// entity.setCreatedTime(DateUtil.parse(DateUtil.now()));
|
||||||
entity.setIsDel(0);
|
entity.setIsDel(0);
|
||||||
entity.setCreatedBy(SessionUtil.getUserCode());
|
entity.setCreatedBy(SessionUtil.getUserCode());
|
||||||
}
|
}
|
||||||
|
|
@ -52,5 +54,23 @@ public class OptionalEbomImportService extends ServiceImpl<OptionalEbomImportMap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean deleteByRootId(List<Long> rootRowId){
|
||||||
|
QueryWrapper<OptionalEbomImportEntity> queryWrapper=new QueryWrapper();
|
||||||
|
queryWrapper.lambda().in(OptionalEbomImportEntity::getRootRowId, rootRowId);
|
||||||
|
return this.remove(queryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean updateDelStatusByRooId(List<Long> rootRowId){
|
||||||
|
QueryWrapper<OptionalEbomImportEntity> queryWrapper=new QueryWrapper();
|
||||||
|
queryWrapper.lambda().in(OptionalEbomImportEntity::getRootRowId, rootRowId);
|
||||||
|
OptionalEbomImportEntity entity=new OptionalEbomImportEntity();
|
||||||
|
entity.setIsDel(1);
|
||||||
|
|
||||||
|
return this.update(entity,queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,19 @@
|
||||||
package com.nflg.product.bomnew.service;
|
package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import com.nflg.product.base.core.vo.PageVO;
|
import com.nflg.product.base.core.vo.PageVO;
|
||||||
|
import com.nflg.product.bomnew.constant.OptionalBomConstant;
|
||||||
import com.nflg.product.bomnew.mapper.master.OptionalEbomMainMapper;
|
import com.nflg.product.bomnew.mapper.master.OptionalEbomMainMapper;
|
||||||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomMainDTO;
|
import com.nflg.product.bomnew.pojo.dto.OptionalEbomMainDTO;
|
||||||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomMainDelDTO;
|
import com.nflg.product.bomnew.pojo.dto.OptionalEbomMainDelDTO;
|
||||||
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigEntity;
|
||||||
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomMainEntity;
|
import com.nflg.product.bomnew.pojo.entity.OptionalEbomMainEntity;
|
||||||
import com.nflg.product.bomnew.pojo.query.OptionalEbomMainListQuery;
|
import com.nflg.product.bomnew.pojo.query.OptionalEbomMainListQuery;
|
||||||
import com.nflg.product.bomnew.pojo.query.OptionalEbomMainQuery;
|
import com.nflg.product.bomnew.pojo.query.OptionalEbomMainQuery;
|
||||||
|
|
@ -20,6 +26,7 @@ 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.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -57,16 +64,65 @@ public class OptionalEbomMainService extends ServiceImpl<OptionalEbomMainMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Boolean deleteByRowIds(List<Long> longList) {
|
||||||
|
|
||||||
|
String rowIds = longList.stream().map(Object::toString)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
int rows = this.getBaseMapper().deleteByRowIds(rowIds);
|
||||||
|
return rows > 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除机型
|
||||||
|
* 1.如果没有已发布的就全删 (机型 选项 暂存),存在发布的 只删掉机型,选项并打删除标签
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteByRowIds(OptionalEbomMainDelDTO dto) {
|
public Boolean deleteByRowIds(OptionalEbomMainDelDTO dto) {
|
||||||
List<Long> longList = dto.getRowIdList();
|
List<Long> longList = dto.getRowIdList();
|
||||||
String rowIds = longList.stream().map(Object::toString)
|
|
||||||
.collect(Collectors.joining(","));
|
|
||||||
int rows = this.getBaseMapper().deleteByRowIds(rowIds);
|
|
||||||
|
|
||||||
Boolean parentStatus= optionalEbomImportService.deleteByRootId(dto);
|
List<Long> delList = new ArrayList<>();
|
||||||
|
List<Long> updateList = new ArrayList<>();
|
||||||
|
List<Long> delTmpList = new ArrayList<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(longList)) {
|
||||||
|
for (Long rowId : longList) {
|
||||||
|
QueryWrapper<OptionalEbomConfigEntity> queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.lambda().eq(OptionalEbomConfigEntity::getParentRowId, rowId);
|
||||||
|
//找出暂存表里 已发布 和暂存数据
|
||||||
|
List<OptionalEbomConfigEntity> configList = SpringUtil.getBean(OptionalEbomConfigService.class).list(queryWrapper);
|
||||||
|
List<OptionalEbomConfigEntity> publishList = configList.stream().filter(item -> item.getEditStatus().equals(OptionalBomConstant.PublishEnum.PUBLISH.getValue())).collect(Collectors.toList());
|
||||||
|
List<OptionalEbomConfigEntity> tmpList = configList.stream().filter(item -> item.getEditStatus().equals(OptionalBomConstant.PublishEnum.TMP.getValue())).collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(publishList)) {
|
||||||
|
updateList.add(rowId);
|
||||||
|
} else {
|
||||||
|
delList.add(rowId);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(tmpList)) {
|
||||||
|
delTmpList.addAll(tmpList.stream().map(OptionalEbomConfigEntity::getRowId).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
optionalEbomImportChildService.deleteByRootId(dto);
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(delList)) {
|
||||||
|
optionalEbomImportService.deleteByRootId(delList);
|
||||||
|
optionalEbomImportChildService.deleteByRootId(delList);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(updateList)) {
|
||||||
|
optionalEbomImportService.updateDelStatusByRooId(updateList);
|
||||||
|
optionalEbomImportChildService.updateDelStatusByRootId(updateList);
|
||||||
|
}
|
||||||
|
//操作删除或更新
|
||||||
|
deleteByRowIds(dto.getRowIdList());
|
||||||
|
if (CollectionUtil.isNotEmpty(delTmpList)) {
|
||||||
|
SpringUtil.getBean(OptionalEbomConfigService.class).deleteByIds(delTmpList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nflg.product.bomnew.service.aggreg;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.TypeReference;
|
import cn.hutool.core.lang.TypeReference;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
@ -138,7 +139,7 @@ public class AggregOptionConfigService {
|
||||||
/**
|
/**
|
||||||
* 编辑配件
|
* 编辑配件
|
||||||
*
|
*
|
||||||
* @param rowId
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public OptionalEbomConfigAggregVO ebomEditTree(OptionalEbomImportChildQuery query) {
|
public OptionalEbomConfigAggregVO ebomEditTree(OptionalEbomImportChildQuery query) {
|
||||||
|
|
@ -163,18 +164,18 @@ public class AggregOptionConfigService {
|
||||||
|
|
||||||
OptionalEbomMainEntity optionalEbomMainEntity = Convert.convert(new TypeReference<OptionalEbomMainEntity>() {
|
OptionalEbomMainEntity optionalEbomMainEntity = Convert.convert(new TypeReference<OptionalEbomMainEntity>() {
|
||||||
}, dto.getDeviceInfo());
|
}, dto.getDeviceInfo());
|
||||||
optionalEbomMainEntity.setUpdatedTime(new Date());
|
optionalEbomMainEntity.setUpdatedTime(DateUtil.now());
|
||||||
Boolean row= optionalEbomMainService.updateById(optionalEbomMainEntity);
|
Boolean row= optionalEbomMainService.updateById(optionalEbomMainEntity);
|
||||||
|
|
||||||
if(CollectionUtil.isNotEmpty(dto.getOptions())){
|
if(CollectionUtil.isNotEmpty(dto.getOptions())){
|
||||||
List<OptionalEbomImportChildEntity> optionalEbomImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
List<OptionalEbomImportChildEntity> optionalEbomImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||||
}, dto.getOptions());
|
}, dto.getOptions());
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(optionalEbomImportChildEntityList)) {
|
// if (CollectionUtil.isNotEmpty(optionalEbomImportChildEntityList)) {
|
||||||
optionalEbomImportChildEntityList.forEach(item -> {
|
// optionalEbomImportChildEntityList.forEach(item -> {
|
||||||
item.setUpdatedTime(new Date());
|
// item.setUpdatedTime(new Date());
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
return optionalEbomImportChildService.updateBatchById(optionalEbomImportChildEntityList);
|
return optionalEbomImportChildService.updateBatchById(optionalEbomImportChildEntityList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -217,7 +218,7 @@ public class AggregOptionConfigService {
|
||||||
OptionalEbomConfigEntity optionalEbomConfigEntity =new OptionalEbomConfigEntity();
|
OptionalEbomConfigEntity optionalEbomConfigEntity =new OptionalEbomConfigEntity();
|
||||||
optionalEbomConfigEntity.setRowId(dto.getRowId());
|
optionalEbomConfigEntity.setRowId(dto.getRowId());
|
||||||
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
||||||
optionalEbomConfigEntity.setUpdatedTime(new Date());
|
// optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||||
optionalEbomConfigService.updateById(optionalEbomConfigEntity);
|
optionalEbomConfigService.updateById(optionalEbomConfigEntity);
|
||||||
|
|
||||||
if(entity.getEditStatus()==OptionalBomConstant.PublishEnum.TMP.getValue()) {
|
if(entity.getEditStatus()==OptionalBomConstant.PublishEnum.TMP.getValue()) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.nflg.product.bomnew.service.aggreg;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.TypeReference;
|
import cn.hutool.core.lang.TypeReference;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
@ -128,7 +129,15 @@ public class OptionalExcelService {
|
||||||
for (; row < list.size(); row++) {
|
for (; row < list.size(); row++) {
|
||||||
ImportExcelField rowField = list.get(row);
|
ImportExcelField rowField = list.get(row);
|
||||||
//相同列为根
|
//相同列为根
|
||||||
if (rowField.getCellFirst().trim().equals(rowField.getCellSecond().trim()) && rowField.getCellSecond().trim().equals(rowField.getCellThird().trim())) {
|
if ((row==list.size()-1)||(rowField.getCellFirst().trim().equals(rowField.getCellSecond().trim())
|
||||||
|
&& rowField.getCellSecond().trim().equals(rowField.getCellThird().trim()))) {
|
||||||
|
|
||||||
|
|
||||||
|
if((row==list.size()-1)){
|
||||||
|
classList.add(rowField);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(classList)) {
|
if (CollectionUtil.isNotEmpty(classList)) {
|
||||||
String finalName = name;
|
String finalName = name;
|
||||||
Map<String, Map<String, List<ImportExcelField>>> group1 = classList.parallelStream().collect(Collectors.groupingBy(ImportExcelField::getCellFirst, Collectors.groupingBy(ImportExcelField::getCellSecond)));
|
Map<String, Map<String, List<ImportExcelField>>> group1 = classList.parallelStream().collect(Collectors.groupingBy(ImportExcelField::getCellFirst, Collectors.groupingBy(ImportExcelField::getCellSecond)));
|
||||||
|
|
@ -147,13 +156,20 @@ public class OptionalExcelService {
|
||||||
classList.clear();
|
classList.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if((row!=list.size()-1)) {
|
||||||
name = rowField.getCellFirst();
|
name = rowField.getCellFirst();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
classList.add(rowField);
|
classList.add(rowField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//最后一项处理
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return optionalEbomInportExcelDTO;
|
return optionalEbomInportExcelDTO;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -202,15 +218,11 @@ public class OptionalExcelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//保存db
|
//保存db
|
||||||
return batchExcelToRepertory(optionalEbomInportExcelDTO);
|
return batchExcelToRepertory(optionalEbomInportExcelDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String isValiData(List<OptionalEbomImportDTO> excelList) {
|
private String isValiData(List<OptionalEbomImportDTO> excelList) {
|
||||||
|
|
||||||
StringBuffer title = new StringBuffer();
|
StringBuffer title = new StringBuffer();
|
||||||
|
|
@ -240,14 +252,6 @@ public class OptionalExcelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean batchExcelToRepertory(OptionalEbomImportExcelDTO ebomImportExcelDTO) {
|
public Boolean batchExcelToRepertory(OptionalEbomImportExcelDTO ebomImportExcelDTO) {
|
||||||
|
|
||||||
|
|
@ -259,92 +263,134 @@ public class OptionalExcelService {
|
||||||
queryWrapper.lambda().eq(OptionalEbomMainEntity::getDeviceNo, optionalEbomMainEntity.getDeviceNo());
|
queryWrapper.lambda().eq(OptionalEbomMainEntity::getDeviceNo, optionalEbomMainEntity.getDeviceNo());
|
||||||
|
|
||||||
OptionalEbomMainEntity queryDevice = optionalEbomMainService.getOne(queryWrapper);
|
OptionalEbomMainEntity queryDevice = optionalEbomMainService.getOne(queryWrapper);
|
||||||
if (ObjectUtil.isNotEmpty(queryDevice)) {
|
// if (ObjectUtil.isNotEmpty(queryDevice)) {
|
||||||
throw new NflgBusinessException(STATE.Error, String.format("已存在设备数据%s", optionalEbomMainEntity.getDeviceNo()));
|
// throw new NflgBusinessException(STATE.Error, String.format("已存在设备数据%s", optionalEbomMainEntity.getDeviceNo()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
if (queryDevice == null) {
|
||||||
optionalEbomMainEntity.setCreatedBy(SessionUtil.getUserCode());
|
optionalEbomMainEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||||
optionalEbomMainEntity.setRealName(SessionUtil.getRealName());
|
optionalEbomMainEntity.setRealName(SessionUtil.getRealName());
|
||||||
optionalEbomMainEntity.setDeptName(SessionUtil.getDepartName());
|
optionalEbomMainEntity.setDeptName(SessionUtil.getDepartName());
|
||||||
optionalEbomMainEntity.setCreatedTime(new Date());
|
|
||||||
optionalEbomMainEntity.setUpdatedTime(new Date());
|
optionalEbomMainEntity.setCreatedTime(DateUtil.now());
|
||||||
optionalEbomMainEntity.setDeptRowId(SessionUtil.getPartRowId());
|
optionalEbomMainEntity.setDeptRowId(SessionUtil.getPartRowId());
|
||||||
boolean row0 = optionalEbomMainService.save(optionalEbomMainEntity);
|
optionalEbomMainService.save(optionalEbomMainEntity);
|
||||||
if (!row0) {
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
optionalEbomMainEntity=queryDevice;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optionalEbomMainEntity == null || optionalEbomMainEntity.getRowId() == null) {
|
||||||
throw new NflgBusinessException(STATE.Error, "保存设备数据失败");
|
throw new NflgBusinessException(STATE.Error, "保存设备数据失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
List<OptionalEbomImportDTO> parentOptionList = ebomImportExcelDTO.getOptionInfo();
|
List<OptionalEbomImportDTO> parentOptionList = ebomImportExcelDTO.getOptionInfo();
|
||||||
|
|
||||||
//保存选项
|
//保存选项
|
||||||
for (OptionalEbomImportDTO parentOption : parentOptionList) {
|
for (OptionalEbomImportDTO parentOption : parentOptionList) {
|
||||||
|
|
||||||
|
|
||||||
OptionalEbomImportEntity parentOptionEntity = Convert.convert(new TypeReference<OptionalEbomImportEntity>() {
|
QueryWrapper<OptionalEbomImportEntity> queryWrapper1 = new QueryWrapper<>();
|
||||||
|
queryWrapper1.lambda().eq(OptionalEbomImportEntity::getRootRowId, optionalEbomMainEntity.getRowId());
|
||||||
|
queryWrapper1.lambda().eq(OptionalEbomImportEntity::getOptionDrawingNo, parentOption.getOptionDrawingNo());
|
||||||
|
|
||||||
|
OptionalEbomImportEntity parentOptionEntity = optionalEbomImportService.getOne(queryWrapper1);
|
||||||
|
if (parentOptionEntity == null) {
|
||||||
|
parentOptionEntity = Convert.convert(new TypeReference<OptionalEbomImportEntity>() {
|
||||||
}, parentOption);
|
}, parentOption);
|
||||||
parentOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
parentOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||||
parentOptionEntity.setCreatedTime(new Date());
|
parentOptionEntity.setCreatedTime(DateUtil.now());
|
||||||
parentOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
parentOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||||
|
optionalEbomImportService.save(parentOptionEntity);
|
||||||
|
|
||||||
boolean row1;
|
|
||||||
try {
|
|
||||||
row1 = optionalEbomImportService.save(parentOptionEntity);
|
|
||||||
if (!row1) {
|
|
||||||
throw new Exception ("");
|
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
|
||||||
|
if (parentOptionEntity == null || parentOptionEntity.getRowId() == null) {
|
||||||
throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!row1) {
|
|
||||||
// throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
|
||||||
// }
|
|
||||||
//子选项
|
|
||||||
List<OptionalEbomImportDTO> childOptionList = parentOption.getChild();
|
List<OptionalEbomImportDTO> childOptionList = parentOption.getChild();
|
||||||
|
|
||||||
for (OptionalEbomImportDTO childOption : childOptionList) {
|
for (OptionalEbomImportDTO childOption : childOptionList) {
|
||||||
OptionalEbomImportEntity childOptionEntity = Convert.convert(new TypeReference<OptionalEbomImportEntity>() {
|
|
||||||
|
QueryWrapper<OptionalEbomImportEntity> queryWrapper2 = new QueryWrapper<>();
|
||||||
|
queryWrapper2.lambda().eq(OptionalEbomImportEntity::getRootRowId, optionalEbomMainEntity.getRowId());
|
||||||
|
queryWrapper2.lambda().eq(OptionalEbomImportEntity::getOptionDrawingNo, childOption.getOptionDrawingNo());
|
||||||
|
|
||||||
|
OptionalEbomImportEntity childOptionEntity = optionalEbomImportService.getOne(queryWrapper2);
|
||||||
|
if (childOptionEntity == null) {
|
||||||
|
childOptionEntity = Convert.convert(new TypeReference<OptionalEbomImportEntity>() {
|
||||||
}, childOption);
|
}, childOption);
|
||||||
childOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
childOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||||
childOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
childOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||||
childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
||||||
childOptionEntity.setCreatedTime(new Date());
|
|
||||||
|
|
||||||
boolean row2 ;
|
childOptionEntity.setCreatedTime(DateUtil.now());
|
||||||
try {
|
optionalEbomImportService.save(childOptionEntity);
|
||||||
row2= optionalEbomImportService.save(childOptionEntity);
|
}else{
|
||||||
if (!row2) {
|
childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
||||||
throw new Exception ("");
|
|
||||||
|
optionalEbomImportService.updateById(childOptionEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch (Exception e){
|
|
||||||
|
if (childOptionEntity == null || childOptionEntity.getRowId() == null) {
|
||||||
|
|
||||||
throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<OptionalEbomImportChildDTO> optionImportChildDtoList = childOption.getChild();
|
|
||||||
|
|
||||||
|
List<OptionalEbomImportChildDTO> optionImportChildDtoList = childOption.getChild();
|
||||||
List<OptionalEbomImportChildEntity> optionImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
List<OptionalEbomImportChildEntity> optionImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||||
}, optionImportChildDtoList);
|
}, optionImportChildDtoList);
|
||||||
optionImportChildEntityList.forEach(item -> {
|
|
||||||
item.setParentRowId(childOptionEntity.getRowId());
|
|
||||||
|
if (CollectionUtil.isNotEmpty(optionImportChildEntityList)) {
|
||||||
|
for (OptionalEbomImportChildEntity item :
|
||||||
|
optionImportChildEntityList) {
|
||||||
|
|
||||||
|
|
||||||
|
item.setSource(OptionalBomConstant.SourceTypeEnum.SOURCE_EXCEL.getValue());
|
||||||
|
|
||||||
item.setRootRowId(optionalEbomMainEntity.getRowId());
|
item.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||||
item.setCreatedBy(SessionUtil.getUserCode());
|
item.setParentRowId(childOptionEntity.getRowId());
|
||||||
item.setCreatedTime(new Date());
|
|
||||||
item.setUpdatedTime(new Date());
|
optionalEbomImportChildService.insertOptionAction(item);
|
||||||
|
|
||||||
|
// QueryWrapper<OptionalEbomImportChildEntity> queryWrapper3 = new QueryWrapper<>();
|
||||||
|
// // 同一个机型下不可以存在相同的物料信息(物料编号),如果是“无”的情况,需同一个机型+同一个选项来做唯一判断
|
||||||
|
// if (StrUtil.isEmpty(item.getMaterialNo()) && item.getMaterialName().equals("无")) {
|
||||||
|
//
|
||||||
|
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getRootRowId, optionalEbomMainEntity.getRowId());
|
||||||
|
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getParentRowId, childOptionEntity.getParentRowId());
|
||||||
|
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getIsDel, 0);
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getRootRowId, optionalEbomMainEntity.getRowId());
|
||||||
|
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getMaterialNo, item.getMaterialNo());
|
||||||
|
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getIsDel, 0);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// OptionalEbomImportChildEntity childEntity = optionalEbomImportChildService.getOne(queryWrapper3);
|
||||||
|
// if (childEntity == null) {
|
||||||
|
// item.setParentRowId(childOptionEntity.getRowId());
|
||||||
|
// item.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||||
|
// item.setCreatedBy(SessionUtil.getUserCode());
|
||||||
|
// // item.setCreatedTime(new Date());
|
||||||
|
// // item.setUpdatedTime(new Date());
|
||||||
|
// optionalEbomImportChildService.save(item);
|
||||||
|
// } else {
|
||||||
|
// item.setRowId(childEntity.getRowId());
|
||||||
|
// optionalEbomImportChildService.updateById(item);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
});
|
|
||||||
try {
|
|
||||||
boolean row3 = optionalEbomImportChildService.saveOrUpdateBatch(optionImportChildEntityList);
|
|
||||||
if (!row3) {
|
|
||||||
throw new Exception ("");
|
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
|
||||||
throw new NflgBusinessException(STATE.Error, "保存选配数据失败"+e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -354,8 +400,6 @@ public class OptionalExcelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ public class PublishMaterialService {
|
||||||
//物料数据保存更改状态
|
//物料数据保存更改状态
|
||||||
OptionalEbomConfigEntity optionalEbomConfigEntity = new OptionalEbomConfigEntity();
|
OptionalEbomConfigEntity optionalEbomConfigEntity = new OptionalEbomConfigEntity();
|
||||||
optionalEbomConfigEntity.setRowId(optionalEbomPublishAddDTO.getRowId());
|
optionalEbomConfigEntity.setRowId(optionalEbomPublishAddDTO.getRowId());
|
||||||
optionalEbomConfigEntity.setUpdatedTime(new Date());
|
// optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||||
optionalEbomConfigEntity.setEditStatus(OptionalBomConstant.PublishEnum.PUBLISH.getValue());
|
optionalEbomConfigEntity.setEditStatus(OptionalBomConstant.PublishEnum.PUBLISH.getValue());
|
||||||
optionalEbomConfigService.updateById(optionalEbomConfigEntity);
|
optionalEbomConfigService.updateById(optionalEbomConfigEntity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
|
|
||||||
<result property="realName" column="real_name" jdbcType="VARCHAR"/>
|
<result property="realName" column="real_name" jdbcType="VARCHAR"/>
|
||||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
<result property="createdTime" column="created_time" jdbcType="VARCHAR"/>
|
||||||
<result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
|
<result property="updatedTime" column="updated_time" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List" >
|
<sql id="Base_Column_List" >
|
||||||
row_id,config_no,parent_row_id,device_no,device_name,edit_status,upload_sap_status,remark,dept_name,real_name,created_by,created_time,updated_time
|
row_id,config_no,parent_row_id,device_no,device_name,edit_status,upload_sap_status,remark,dept_name,real_name,created_by,created_time,updated_time
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
<if test="query.startDate!= null and query.endDate != null">
|
<if test="query.startDate!= null and query.startDate!= '' and query.endDate != null and query.endDate!= '' ">
|
||||||
<![CDATA[and created_time >= #{query.startDate} and created_time < #{query.endDate} ]]>
|
<![CDATA[and created_time >= #{query.startDate} and created_time < #{query.endDate} ]]>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<result property="parentRowId" column="parent_row_id" jdbcType="INTEGER"/>
|
<result property="parentRowId" column="parent_row_id" jdbcType="INTEGER"/>
|
||||||
<result property="optionRowId" column="option_row_id" jdbcType="INTEGER"/>
|
<result property="optionRowId" column="option_row_id" jdbcType="INTEGER"/>
|
||||||
<result property="chooseStatus" column="choose_status" jdbcType="INTEGER"/>
|
<result property="chooseStatus" column="choose_status" jdbcType="INTEGER"/>
|
||||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
<result property="createdTime" column="created_time" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List" >
|
<sql id="Base_Column_List" >
|
||||||
row_id,parent_row_id,option_row_id,choose_status,created_time
|
row_id,parent_row_id,option_row_id,choose_status,created_time
|
||||||
|
|
@ -15,8 +15,12 @@ row_id,parent_row_id,option_row_id,choose_status,created_time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--是否存在已发布数据-->
|
||||||
|
<select id="countPublishList" resultType="com.nflg.product.bomnew.pojo.vo.OptionalEbomConfigRVO" >
|
||||||
|
SELECT t1.* from t_optional_ebom_config_r as t1 LEFT JOIN t_optional_ebom_config as t2 on t1.parent_row_id=t2.row_id
|
||||||
|
WHERE t1.option_row_id in (${optionRowIds}) and t2.edit_status=1
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<!--通过主键修改数据-->
|
<!--通过主键修改数据-->
|
||||||
|
|
@ -44,6 +48,7 @@ row_id,parent_row_id,option_row_id,choose_status,created_time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<delete id="deleteByParentRowId">
|
<delete id="deleteByParentRowId">
|
||||||
delete from t_optional_ebom_config_r where parent_row_id = #{parentRowId}
|
delete from t_optional_ebom_config_r where parent_row_id = #{parentRowId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
@ -54,4 +59,7 @@ row_id,parent_row_id,option_row_id,choose_status,created_time
|
||||||
delete from t_optional_ebom_config_r where row_id = #{rowId}
|
delete from t_optional_ebom_config_r where row_id = #{rowId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
<result property="remak" column="remak" jdbcType="VARCHAR"/>
|
<result property="remak" column="remak" jdbcType="VARCHAR"/>
|
||||||
<result property="source" column="source" jdbcType="INTEGER"/>
|
<result property="source" column="source" jdbcType="INTEGER"/>
|
||||||
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
||||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
<result property="createdTime" column="created_time" jdbcType="VARCHAR"/>
|
||||||
<result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
|
<result property="updatedTime" column="updated_time" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
@ -36,9 +36,8 @@ row_id,parent_row_id,root_row_id,material_no,material_name,material_desc,drawing
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from t_optional_ebom_import_child
|
from t_optional_ebom_import_child
|
||||||
where root_row_id = #{query.rootRowId}
|
where
|
||||||
|
is_del=0 and root_row_id = #{query.rootRowId}
|
||||||
|
|
||||||
|
|
||||||
<if test="query.enable != null">
|
<if test="query.enable != null">
|
||||||
and is_enable=${query.enable}
|
and is_enable=${query.enable}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<result property="optionName" column="option_name" jdbcType="VARCHAR"/>
|
<result property="optionName" column="option_name" jdbcType="VARCHAR"/>
|
||||||
<result property="optionDrawingNo" column="option_drawing_no" jdbcType="VARCHAR"/>
|
<result property="optionDrawingNo" column="option_drawing_no" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
<result property="createdTime" column="created_time" jdbcType="VARCHAR"/>
|
||||||
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
||||||
|
|
||||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||||
|
|
|
||||||
|
|
@ -28,25 +28,22 @@
|
||||||
<where>
|
<where>
|
||||||
is_del =0
|
is_del =0
|
||||||
|
|
||||||
|
|
||||||
<if test="query.deviceName != null and query.deviceName != ''">
|
<if test="query.deviceName != null and query.deviceName != ''">
|
||||||
and( device_name like concat('%', '${query.deviceName}', '%') or device_no like concat('%', '${query.deviceName}', '%') )
|
and( device_name like concat('%', '${query.deviceName}', '%') or device_no like concat('%', '${query.deviceName}', '%') )
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
<if test="query.deptRowId != null">
|
<if test="query.deptRowId != null and query.deptRowId != 0">
|
||||||
and dept_row_id = #{query.deptRowId}
|
and dept_row_id = #{query.deptRowId}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.deptName != null and query.deptName != ''">
|
<if test="query.deptName != null and query.deptName != ''">
|
||||||
and dept_name like concat('%', '${query.deptName}', '%')
|
and dept_name like concat('%', '${query.deptName}', '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="query.startDate != null and query.endDate != null">
|
<if test="query.startDate != null and query.startDate != '' and query.endDate != null and query.endDate != ''">
|
||||||
<![CDATA[ and created_time >= #{query.startDate} and created_time < #{query.endDate}]]>
|
<![CDATA[ and created_time >= #{query.startDate} and created_time < #{query.endDate}]]>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<if test="query.realName != null and query.realName != ''">
|
<if test="query.realName != null and query.realName != ''">
|
||||||
and real_name like concat('%', '${query.realName}', '%')
|
and real_name like concat('%', '${query.realName}', '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -60,17 +60,18 @@ row_id,parent_row_id,level_row_id,material_no,material_name,material_desc,drawin
|
||||||
|
|
||||||
<where>
|
<where>
|
||||||
t1.parent_row_id is null
|
t1.parent_row_id is null
|
||||||
|
and t1.created_by=#{query.createdBy}
|
||||||
|
|
||||||
<if test="query.materialNo != null and query.materialNo != ''">
|
<if test="query.materialNo != null and query.materialNo != ''">
|
||||||
and t1.material_no like concat('%', '${query.materialNo}', '%')
|
and t1.material_no like concat('%', '${query.materialNo}', '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
<if test="query.drawingNo != null">
|
<if test="query.drawingNo != null and query.drawingNo != '' ">
|
||||||
and t1.drawing_no like concat('%', '${query.drawingNo}', '%')
|
and t1.drawing_no like concat('%', '${query.drawingNo}', '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="query.startDate != null and query.endDate != null">
|
<if test="query.startDate != null and query.startDate != '' and query.endDate != null and query.endDate != null">
|
||||||
<![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}]]>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue