Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom
This commit is contained in:
commit
ae989f0b51
|
|
@ -171,7 +171,7 @@ public class OptionalEbomApi extends BaseApi {
|
|||
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")
|
||||
@ApiOperation("物料分页数据")
|
||||
public ResultVO<IPage<OptionalMbomMaterialVO>> getMaterialParentList(@RequestBody OptionalMbomMaterialListQuery query) {
|
||||
|
||||
|
||||
query.setCreatedBy(SessionUtil.getUserCode());
|
||||
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.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.Param;
|
||||
|
||||
|
|
@ -19,9 +20,9 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
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.time.LocalDateTime;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -102,13 +103,26 @@ public class OptionalEbomConfigEntity implements Serializable {
|
|||
*/
|
||||
@TableField(value = "created_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createdTime;
|
||||
private String createdTime;
|
||||
|
||||
public String getCreatedTime(){
|
||||
|
||||
return DateUtil.now();
|
||||
|
||||
}
|
||||
/**
|
||||
* 变更时间
|
||||
*/
|
||||
@TableField(value = "updated_time")
|
||||
@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")
|
||||
@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.time.LocalDateTime;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -108,11 +109,21 @@ public class OptionalEbomImportChildEntity implements Serializable {
|
|||
*/
|
||||
@TableField(value = "created_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createdTime;
|
||||
private String createdTime;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@TableField(value = "updated_time")
|
||||
@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.time.LocalDateTime;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -58,7 +59,10 @@ public class OptionalEbomImportEntity implements Serializable {
|
|||
*/
|
||||
@TableField(value = "created_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createdTime;
|
||||
private String createdTime;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否删除(0 :否 1:是)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ package com.nflg.product.bomnew.pojo.entity;
|
|||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
|
@ -77,13 +79,23 @@ public class OptionalEbomMainEntity implements Serializable {
|
|||
*/
|
||||
@TableField(value = "created_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createdTime;
|
||||
private String createdTime;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 变更时间
|
||||
*/
|
||||
@TableField(value = "updated_time")
|
||||
@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 查询显示 空全部")
|
||||
private Integer enable;
|
||||
|
||||
private Integer isDel;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,4 +35,8 @@ public class OptionalMbomMaterialListQuery extends BasePageQuery implements S
|
|||
@ApiModelProperty(value = "图号")
|
||||
private String drawingNo;
|
||||
|
||||
|
||||
private String createdBy;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,29 +3,49 @@ package com.nflg.product.bomnew.pojo.vo;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel("ebom 配置状态关系")
|
||||
@Accessors(chain = true)
|
||||
public class OptionalEbomConfigRVO implements Serializable {
|
||||
/**主键*/ @ApiModelProperty(value = "主键")
|
||||
public class OptionalEbomConfigRVO implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long rowId;
|
||||
/**父级*/ @ApiModelProperty(value = "父级")
|
||||
/**
|
||||
* 父级
|
||||
*/
|
||||
@ApiModelProperty(value = "父级")
|
||||
private Long parentRowId;
|
||||
/**选配id*/ @ApiModelProperty(value = "选配id")
|
||||
/**
|
||||
* 选配id
|
||||
*/
|
||||
@ApiModelProperty(value = "选配id")
|
||||
private Long optionRowId;
|
||||
/**选择状态(0 否 1是)*/ @ApiModelProperty(value = "选择状态(0 否 1是)")
|
||||
/**
|
||||
* 选择状态(0 否 1是)
|
||||
*/
|
||||
@ApiModelProperty(value = "选择状态(0 否 1是)")
|
||||
private Integer chooseStatus;
|
||||
/**创建时间*/ @ApiModelProperty(value = "创建时间")
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createdTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,14 +44,20 @@ public class MaterialService {
|
|||
MaterialMainDTO materialMainDTO = new MaterialMainDTO();
|
||||
materialMainDTO.setMaterialName(materialName);
|
||||
materialMainDTO.setDrawingNo(drawingNo);
|
||||
materialMainDTO.setMaterialDesc(StrUtil.join(" ", StrUtil.isNotBlank(drawingNo)?drawingNo:"" , StrUtil.isNotBlank(materialName)?materialName:"" ));
|
||||
|
||||
if(StrUtil.isEmpty(drawingNo)){
|
||||
materialMainDTO.setMaterialDesc(materialName);
|
||||
}else {
|
||||
materialMainDTO.setMaterialDesc(StrUtil.join(" ", StrUtil.isNotBlank(drawingNo) ? drawingNo : "", StrUtil.isNotBlank(materialName) ? materialName : ""));
|
||||
|
||||
}
|
||||
materialMainDTO.setMaterialCategoryCode(materialCategoryCode);
|
||||
materialMainDTO.setOpEnum(1);
|
||||
materialMainDTO.setRowId(IdWorker.getId());
|
||||
|
||||
// materialMainDTO.setApplyDeptName(SessionUtil.getDepartName());
|
||||
String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySW5mbyI6IntcImRlcGFydE5hbWVcIjpcIuS_oeaBr-a1geeoi-S4reW_gy9JVOaUr-aMgVwiLFwiZGVwYXJ0Um93SWRcIjoxNTg1MTk2OTc4NDEzNjk0OTc4LFwiZnVsbERlcHROYW1lXCI6XCJPVT1JVOaUr-aMgSxPVT3kv6Hmga_mtYHnqIvkuK3lv4MsT1U956aP5bu65Y2X5pa56Lev6Z2i5py65qKw5pyJ6ZmQ5YWs5Y-4LERDPW5mbGdcIixcInF1ZXJ5RGF0YVwiOjMsXCJyZWFsTmFtZVwiOlwi6YOR5Yab5qaVXCIsXCJyb3dJZFwiOjE1ODUxNjQ2NjgzMzU0Mzk4ODEsXCJ1c2VyQ29kZVwiOlwiUUhJMTcwNjIxMDBcIixcInVzZXJOYW1lXCI6XCJRSEkxNzA2MjEwMFwifSIsImV4cCI6MTcwMjE0ODg1MCwianRpIjoiMzE3MDkxZGYtOTc2MS00ZTUxLWI2NzctOWNjZTE0MTkwOTFlIn0.yqaTXcch4hnegN1Z4G4q0hWtJ5cspp_I-uoIar3su8s";
|
||||
// String token=SessionUtil.getSessionKey();
|
||||
// String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySW5mbyI6IntcImRlcGFydE5hbWVcIjpcIuemj-W7uuWNl-aWuei3r-mdouacuuaisOaciemZkOWFrOWPuFwiLFwiZGVwYXJ0Um93SWRcIjoxNTg1MTk1Njk0ODcyNzg0ODk3LFwiZnVsbERlcHROYW1lXCI6XCJPVT3npo_lu7rljZfmlrnot6_pnaLmnLrmorDmnInpmZDlhazlj7gsREM9bmZsZ1wiLFwicXVlcnlEYXRhXCI6MixcInJlYWxOYW1lXCI6XCJhZG1pblwiLFwicm93SWRcIjoxNTQ3NTEyOTc4MDE2OTE5NTUzLFwidXNlckNvZGVcIjpcImFkbWluXCIsXCJ1c2VyTmFtZVwiOlwiYWRtaW5cIn0iLCJleHAiOjE3MDIxNTQ4MjksImp0aSI6IjQ1YjFlYThlLWJjZjgtNDhlZi05M2M3LTg2ZGQwNjZiM2UzYSJ9.vxOgvTYgFqM3FPAY8fwWtULPeF10wiCWzLOxuoPLvbE";
|
||||
String token=SessionUtil.getSessionKey();
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.product.bomnew.service;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.pojo.dto.OptionalEbomConfigDTO;
|
||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigREntity;
|
||||
import com.nflg.product.bomnew.pojo.vo.OptionalEbomConfigRVO;
|
||||
import com.nflg.product.bomnew.service.OptionalEbomConfigRService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -33,7 +36,7 @@ public class OptionalEbomConfigRService extends ServiceImpl<OptionalEbomConfigRM
|
|||
}, rList);
|
||||
materialAttrEntityList.forEach(item -> {
|
||||
item.setParentRowId(parentRowId);
|
||||
item.setCreatedTime(new Date());
|
||||
item.setCreatedTime(DateUtil.now());
|
||||
});
|
||||
|
||||
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;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
|
|
@ -33,6 +34,7 @@ import javax.annotation.Resource;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 选配方案清单(OptionalEbomConfig)表服务实现类
|
||||
|
|
@ -86,7 +88,6 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
|||
if (optionalEbomMainVO == null || StrUtil.isEmpty(optionalEbomMainVO.getDeviceNo())) {
|
||||
throw new NflgBusinessException(STATE.SystemErr, "查询设备数据不存在");
|
||||
}
|
||||
|
||||
OptionalEbomConfigEntity optionalEbomConfigEntity = new OptionalEbomConfigEntity();
|
||||
optionalEbomConfigEntity.setParentRowId(dto.getRowId());
|
||||
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
||||
|
|
@ -95,7 +96,7 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
|||
optionalEbomConfigEntity.setDeviceNo(optionalEbomMainVO.getDeviceNo());
|
||||
optionalEbomConfigEntity.setDeviceName(optionalEbomMainVO.getDeviceName());
|
||||
optionalEbomConfigEntity.setDeptName(SessionUtil.getDepartName());
|
||||
optionalEbomConfigEntity.setCreatedTime(new Date());
|
||||
// optionalEbomConfigEntity.setCreatedTime(new Date());
|
||||
optionalEbomConfigEntity.setParentRowId(dto.getRowId());
|
||||
optionalEbomConfigEntity.setUpdatedTime(optionalEbomConfigEntity.getCreatedTime());
|
||||
|
||||
|
|
@ -110,10 +111,8 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
|
|||
OptionalEbomConfigVO optionalEbomConfigVO = Convert.convert(new TypeReference<OptionalEbomConfigVO>() {
|
||||
}, optionalEbomConfigEntity);
|
||||
|
||||
|
||||
return optionalEbomConfigVO;
|
||||
|
||||
|
||||
}
|
||||
|
||||
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.setRowId(dto.getRowId());
|
||||
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
||||
optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||
// optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||
this.updateById(optionalEbomConfigEntity);
|
||||
|
||||
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.date.DateUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.query.OptionalEbomImportChildQuery;
|
||||
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 nflg.product.common.constant.STATE;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -37,7 +40,7 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
|
||||
|
||||
@Resource
|
||||
private OptionalEbomImportService optionalEbomImportService;
|
||||
private OptionalEbomImportService optionalEbomImportService;
|
||||
|
||||
public List<OptionalEbomImportChildVO> getByRootRowIdList(Long rootRowId) {
|
||||
return getBaseMapper().getByRootRowIdList(rootRowId);
|
||||
|
|
@ -48,7 +51,6 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加选配数据
|
||||
*
|
||||
|
|
@ -58,48 +60,95 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
public Boolean insertOption(OptionalEbomImportChildAddDTO dto) throws NflgBusinessException {
|
||||
|
||||
//选配检查parentId是否存在
|
||||
if ( Objects.equals(dto.getPartType(), OptionalBomConstant.PartTypeEnum.PART_TYPE_RADIO.getValue())){
|
||||
if (Objects.equals(dto.getPartType(), OptionalBomConstant.PartTypeEnum.PART_TYPE_RADIO.getValue())) {
|
||||
|
||||
OptionalEbomImportEntity optionalEbomImportEntity =optionalEbomImportService.getById(dto.getParentRowId());
|
||||
if(optionalEbomImportEntity==null){
|
||||
throw new NflgBusinessException(STATE.BusinessError,"添加数据的选项id未找到");
|
||||
OptionalEbomImportEntity optionalEbomImportEntity = optionalEbomImportService.getById(dto.getParentRowId());
|
||||
if (optionalEbomImportEntity == null) {
|
||||
throw new NflgBusinessException(STATE.BusinessError, "添加数据的选项id未找到");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String nos = dto.getDrawingNo();
|
||||
//先统一后分割
|
||||
String[] array = nos.replace(";", ";").split(";");
|
||||
List<String> listNo = Arrays.stream(array).collect(Collectors.toList());
|
||||
|
||||
List<BaseMaterialVO> materialListVo = SpringUtil.getBean(MaterialMainService.class).initMaterialForAnyNo(listNo);
|
||||
if(CollectionUtil.isEmpty(materialListVo)){
|
||||
throw new NflgBusinessException(STATE.BusinessError,"未查询到图号/物料相关数据");
|
||||
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(";");
|
||||
List<String> listNo = Arrays.stream(array).collect(Collectors.toList());
|
||||
List<BaseMaterialVO> materialListVo = SpringUtil.getBean(MaterialMainService.class).initMaterialForAnyNo(listNo);
|
||||
if (CollectionUtil.isEmpty(materialListVo)) {
|
||||
throw new NflgBusinessException(STATE.BusinessError, "未查询到图号/物料相关数据");
|
||||
}
|
||||
optionList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||
}, materialListVo);
|
||||
}
|
||||
List<OptionalEbomImportChildEntity> optionList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||
}, materialListVo);
|
||||
|
||||
optionList.forEach(item -> {
|
||||
if (CollectionUtil.isNotEmpty(optionList)) {
|
||||
optionList.forEach(item -> {
|
||||
|
||||
item.setSource(OptionalBomConstant.SourceTypeEnum.SOURCE_INPUT.getValue());
|
||||
item.setCreatedBy(SessionUtil.getUserCode());
|
||||
item.setRootRowId(dto.getRootRowId());
|
||||
item.setParentRowId(dto.getParentRowId());
|
||||
item.setPartType(dto.getPartType());
|
||||
item.setRemak(dto.getRemak());
|
||||
item.setCreatedTime(new Date());
|
||||
item.setUpdatedTime(new Date());
|
||||
item.setSource(OptionalBomConstant.SourceTypeEnum.SOURCE_INPUT.getValue());
|
||||
item.setRootRowId(dto.getRootRowId());
|
||||
item.setParentRowId(dto.getParentRowId());
|
||||
item.setPartType(dto.getPartType());
|
||||
item.setRemak(dto.getRemak());
|
||||
|
||||
});
|
||||
return this.saveOrUpdateBatch(optionList);
|
||||
insertOptionAction(item );
|
||||
});
|
||||
|
||||
}
|
||||
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) {
|
||||
|
||||
OptionalEbomImportChildEntity entity = Convert.convert(OptionalEbomImportChildEntity.class, vo);
|
||||
entity.setUpdatedTime(new Date());
|
||||
// entity.setUpdatedTime(new Date());
|
||||
return this.updateById(entity);
|
||||
|
||||
}
|
||||
|
|
@ -121,9 +170,89 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
}
|
||||
|
||||
public Boolean deleteByRowId(List<Long> longIds) {
|
||||
|
||||
String rowIds = longIds.stream().map(Object::toString)
|
||||
.collect(Collectors.joining(","));
|
||||
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;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.mapper.master.OptionalEbomImportMapper;
|
||||
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.vo.OptionalEbomImportVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -31,7 +33,7 @@ public class OptionalEbomImportService extends ServiceImpl<OptionalEbomImportMap
|
|||
for (OptionalEbomImportEntity entity :
|
||||
list) {
|
||||
entity.setRowId(null);
|
||||
entity.setCreatedTime(DateUtil.parse(DateUtil.now()));
|
||||
// entity.setCreatedTime(DateUtil.parse(DateUtil.now()));
|
||||
entity.setIsDel(0);
|
||||
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;
|
||||
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
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.pojo.dto.OptionalEbomMainDTO;
|
||||
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.query.OptionalEbomMainListQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.OptionalEbomMainQuery;
|
||||
|
|
@ -20,6 +26,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -31,9 +38,9 @@ public class OptionalEbomMainService extends ServiceImpl<OptionalEbomMainMapper,
|
|||
|
||||
|
||||
@Resource
|
||||
private OptionalEbomImportChildService optionalEbomImportChildService;
|
||||
private OptionalEbomImportChildService optionalEbomImportChildService;
|
||||
@Resource
|
||||
private OptionalEbomImportService optionalEbomImportService;
|
||||
private OptionalEbomImportService optionalEbomImportService;
|
||||
|
||||
|
||||
public IPage<OptionalEbomMainVO> getListPage(OptionalEbomMainListQuery query) {
|
||||
|
|
@ -46,9 +53,9 @@ public class OptionalEbomMainService extends ServiceImpl<OptionalEbomMainMapper,
|
|||
public Boolean updateRowById(OptionalEbomMainDTO dto) {
|
||||
OptionalEbomMainEntity entity = new OptionalEbomMainEntity();
|
||||
BeanUtils.copyProperties(dto, entity);
|
||||
return this.updateById(entity);
|
||||
// int rows = this.getBaseMapper().updateRow(entity);
|
||||
// return rows > 0;
|
||||
return this.updateById(entity);
|
||||
// int rows = this.getBaseMapper().updateRow(entity);
|
||||
// return rows > 0;
|
||||
}
|
||||
|
||||
public boolean insertBatch(List<OptionalEbomMainEntity> list) {
|
||||
|
|
@ -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)
|
||||
public Boolean deleteByRowIds(OptionalEbomMainDelDTO dto) {
|
||||
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;
|
||||
|
|
@ -76,7 +132,7 @@ public class OptionalEbomMainService extends ServiceImpl<OptionalEbomMainMapper,
|
|||
public OptionalEbomMainVO getByRowId(Long id) {
|
||||
OptionalEbomMainEntity entity = this.getBaseMapper().selectById(id);
|
||||
OptionalEbomMainVO vo = new OptionalEbomMainVO();
|
||||
if(entity!=null) {
|
||||
if (entity != null) {
|
||||
BeanUtils.copyProperties(entity, vo);
|
||||
}
|
||||
return vo;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.nflg.product.bomnew.service.aggreg;
|
|||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
|
@ -138,7 +139,7 @@ public class AggregOptionConfigService {
|
|||
/**
|
||||
* 编辑配件
|
||||
*
|
||||
* @param rowId
|
||||
|
||||
* @return
|
||||
*/
|
||||
public OptionalEbomConfigAggregVO ebomEditTree(OptionalEbomImportChildQuery query) {
|
||||
|
|
@ -163,18 +164,18 @@ public class AggregOptionConfigService {
|
|||
|
||||
OptionalEbomMainEntity optionalEbomMainEntity = Convert.convert(new TypeReference<OptionalEbomMainEntity>() {
|
||||
}, dto.getDeviceInfo());
|
||||
optionalEbomMainEntity.setUpdatedTime(new Date());
|
||||
optionalEbomMainEntity.setUpdatedTime(DateUtil.now());
|
||||
Boolean row= optionalEbomMainService.updateById(optionalEbomMainEntity);
|
||||
|
||||
if(CollectionUtil.isNotEmpty(dto.getOptions())){
|
||||
List<OptionalEbomImportChildEntity> optionalEbomImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||
}, dto.getOptions());
|
||||
|
||||
if (CollectionUtil.isNotEmpty(optionalEbomImportChildEntityList)) {
|
||||
optionalEbomImportChildEntityList.forEach(item -> {
|
||||
item.setUpdatedTime(new Date());
|
||||
});
|
||||
}
|
||||
// if (CollectionUtil.isNotEmpty(optionalEbomImportChildEntityList)) {
|
||||
// optionalEbomImportChildEntityList.forEach(item -> {
|
||||
// item.setUpdatedTime(new Date());
|
||||
// });
|
||||
// }
|
||||
return optionalEbomImportChildService.updateBatchById(optionalEbomImportChildEntityList);
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +218,7 @@ public class AggregOptionConfigService {
|
|||
OptionalEbomConfigEntity optionalEbomConfigEntity =new OptionalEbomConfigEntity();
|
||||
optionalEbomConfigEntity.setRowId(dto.getRowId());
|
||||
optionalEbomConfigEntity.setRemark(dto.getRemark());
|
||||
optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||
// optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||
optionalEbomConfigService.updateById(optionalEbomConfigEntity);
|
||||
|
||||
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.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
|
@ -128,7 +129,15 @@ public class OptionalExcelService {
|
|||
for (; row < list.size(); 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)) {
|
||||
String finalName = name;
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
name = rowField.getCellFirst();
|
||||
if((row!=list.size()-1)) {
|
||||
name = rowField.getCellFirst();
|
||||
}
|
||||
|
||||
} else {
|
||||
classList.add(rowField);
|
||||
}
|
||||
}
|
||||
|
||||
//最后一项处理
|
||||
|
||||
|
||||
|
||||
|
||||
return optionalEbomInportExcelDTO;
|
||||
|
||||
}
|
||||
|
|
@ -182,9 +198,9 @@ public class OptionalExcelService {
|
|||
//构建测试数据 无物料号 用图号代替
|
||||
for (OptionalEbomImportChildDTO childDTO : listChild) {
|
||||
if (!childDTO.getTag() && StringUtils.isEmpty(childDTO.getMaterialNo())) {
|
||||
// childDTO.setMaterialNo(childDTO.getDrawingNo());
|
||||
childDTO.setError(childDTO.getError()|OptionalBomConstant.ExcelErrorTagEnum.MATERIA_NO_UNKOWN.getValue());
|
||||
item1.setError(true);
|
||||
// childDTO.setMaterialNo(childDTO.getDrawingNo());
|
||||
childDTO.setError(childDTO.getError() | OptionalBomConstant.ExcelErrorTagEnum.MATERIA_NO_UNKOWN.getValue());
|
||||
item1.setError(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -196,37 +212,33 @@ public class OptionalExcelService {
|
|||
}
|
||||
|
||||
//检查是否满足条件 除了‘无’ ,物料号不能为空
|
||||
String hintMsg=isValiData(optionalEbomInportExcelDTO.getOptionInfo());
|
||||
if( StrUtil.isNotEmpty(hintMsg)){
|
||||
throw new NflgBusinessException(STATE.Error,hintMsg);
|
||||
String hintMsg = isValiData(optionalEbomInportExcelDTO.getOptionInfo());
|
||||
if (StrUtil.isNotEmpty(hintMsg)) {
|
||||
throw new NflgBusinessException(STATE.Error, hintMsg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//保存db
|
||||
return batchExcelToRepertory(optionalEbomInportExcelDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private String isValiData(List<OptionalEbomImportDTO> excelList) {
|
||||
|
||||
StringBuffer title=new StringBuffer();
|
||||
excelList.forEach(item->{
|
||||
StringBuffer title = new StringBuffer();
|
||||
excelList.forEach(item -> {
|
||||
List<OptionalEbomImportDTO> listParent = item.getChild();
|
||||
for (OptionalEbomImportDTO item1 :listParent){
|
||||
if(item1.isError()){
|
||||
for (OptionalEbomImportDTO item1 : listParent) {
|
||||
if (item1.isError()) {
|
||||
|
||||
List<OptionalEbomImportChildDTO > listChild = item1.getChild();
|
||||
for(OptionalEbomImportChildDTO item2:listChild){
|
||||
if(item2.getError()== OptionalBomConstant.ExcelErrorTagEnum.REPEAT.getValue()){
|
||||
title.append(String.format("第%d行 %s\n",item2.getLineNo(),OptionalBomConstant.ExcelErrorTagEnum.REPEAT.getDescription()));
|
||||
}else if(item2.getError()== OptionalBomConstant.ExcelErrorTagEnum.MATERIA_NO_UNKOWN.getValue()){
|
||||
title.append(String.format("第%d行 %s\n",item2.getLineNo(),OptionalBomConstant.ExcelErrorTagEnum.MATERIA_NO_UNKOWN.getDescription()));
|
||||
}else if(item2.getError()== OptionalBomConstant.ExcelErrorTagEnum.ALL.getValue() ){
|
||||
title.append(String.format("第%d行 %s\n",item2.getLineNo(),OptionalBomConstant.ExcelErrorTagEnum.ALL.getDescription()));
|
||||
List<OptionalEbomImportChildDTO> listChild = item1.getChild();
|
||||
for (OptionalEbomImportChildDTO item2 : listChild) {
|
||||
if (item2.getError() == OptionalBomConstant.ExcelErrorTagEnum.REPEAT.getValue()) {
|
||||
title.append(String.format("第%d行 %s\n", item2.getLineNo(), OptionalBomConstant.ExcelErrorTagEnum.REPEAT.getDescription()));
|
||||
} else if (item2.getError() == OptionalBomConstant.ExcelErrorTagEnum.MATERIA_NO_UNKOWN.getValue()) {
|
||||
title.append(String.format("第%d行 %s\n", item2.getLineNo(), OptionalBomConstant.ExcelErrorTagEnum.MATERIA_NO_UNKOWN.getDescription()));
|
||||
} else if (item2.getError() == OptionalBomConstant.ExcelErrorTagEnum.ALL.getValue()) {
|
||||
title.append(String.format("第%d行 %s\n", item2.getLineNo(), OptionalBomConstant.ExcelErrorTagEnum.ALL.getDescription()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -240,14 +252,6 @@ public class OptionalExcelService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchExcelToRepertory(OptionalEbomImportExcelDTO ebomImportExcelDTO) {
|
||||
|
||||
|
|
@ -259,92 +263,134 @@ public class OptionalExcelService {
|
|||
queryWrapper.lambda().eq(OptionalEbomMainEntity::getDeviceNo, optionalEbomMainEntity.getDeviceNo());
|
||||
|
||||
OptionalEbomMainEntity queryDevice = optionalEbomMainService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(queryDevice)) {
|
||||
throw new NflgBusinessException(STATE.Error, String.format("已存在设备数据%s", optionalEbomMainEntity.getDeviceNo()));
|
||||
}
|
||||
// if (ObjectUtil.isNotEmpty(queryDevice)) {
|
||||
// throw new NflgBusinessException(STATE.Error, String.format("已存在设备数据%s", optionalEbomMainEntity.getDeviceNo()));
|
||||
// }
|
||||
|
||||
if (queryDevice == null) {
|
||||
optionalEbomMainEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
optionalEbomMainEntity.setRealName(SessionUtil.getRealName());
|
||||
optionalEbomMainEntity.setDeptName(SessionUtil.getDepartName());
|
||||
|
||||
optionalEbomMainEntity.setCreatedTime(DateUtil.now());
|
||||
optionalEbomMainEntity.setDeptRowId(SessionUtil.getPartRowId());
|
||||
optionalEbomMainService.save(optionalEbomMainEntity);
|
||||
|
||||
|
||||
optionalEbomMainEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
optionalEbomMainEntity.setRealName(SessionUtil.getRealName());
|
||||
optionalEbomMainEntity.setDeptName(SessionUtil.getDepartName());
|
||||
optionalEbomMainEntity.setCreatedTime(new Date());
|
||||
optionalEbomMainEntity.setUpdatedTime(new Date());
|
||||
optionalEbomMainEntity.setDeptRowId(SessionUtil.getPartRowId());
|
||||
boolean row0 = optionalEbomMainService.save(optionalEbomMainEntity);
|
||||
if (!row0) {
|
||||
}else{
|
||||
optionalEbomMainEntity=queryDevice;
|
||||
|
||||
}
|
||||
|
||||
if (optionalEbomMainEntity == null || optionalEbomMainEntity.getRowId() == null) {
|
||||
throw new NflgBusinessException(STATE.Error, "保存设备数据失败");
|
||||
}
|
||||
|
||||
|
||||
List<OptionalEbomImportDTO> parentOptionList = ebomImportExcelDTO.getOptionInfo();
|
||||
|
||||
//保存选项
|
||||
for (OptionalEbomImportDTO parentOption : parentOptionList) {
|
||||
|
||||
|
||||
OptionalEbomImportEntity parentOptionEntity = Convert.convert(new TypeReference<OptionalEbomImportEntity>() {
|
||||
}, parentOption);
|
||||
parentOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||
parentOptionEntity.setCreatedTime(new Date());
|
||||
parentOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
QueryWrapper<OptionalEbomImportEntity> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.lambda().eq(OptionalEbomImportEntity::getRootRowId, optionalEbomMainEntity.getRowId());
|
||||
queryWrapper1.lambda().eq(OptionalEbomImportEntity::getOptionDrawingNo, parentOption.getOptionDrawingNo());
|
||||
|
||||
|
||||
boolean row1;
|
||||
try {
|
||||
row1 = optionalEbomImportService.save(parentOptionEntity);
|
||||
if (!row1) {
|
||||
throw new Exception ("");
|
||||
OptionalEbomImportEntity parentOptionEntity = optionalEbomImportService.getOne(queryWrapper1);
|
||||
if (parentOptionEntity == null) {
|
||||
parentOptionEntity = Convert.convert(new TypeReference<OptionalEbomImportEntity>() {
|
||||
}, parentOption);
|
||||
parentOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||
parentOptionEntity.setCreatedTime(DateUtil.now());
|
||||
parentOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
optionalEbomImportService.save(parentOptionEntity);
|
||||
}
|
||||
|
||||
if (parentOptionEntity == null || parentOptionEntity.getRowId() == null) {
|
||||
throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
||||
}
|
||||
|
||||
// if (!row1) {
|
||||
// throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
||||
// }
|
||||
//子选项
|
||||
List<OptionalEbomImportDTO> childOptionList = parentOption.getChild();
|
||||
|
||||
for (OptionalEbomImportDTO childOption : childOptionList) {
|
||||
OptionalEbomImportEntity childOptionEntity = Convert.convert(new TypeReference<OptionalEbomImportEntity>() {
|
||||
}, childOption);
|
||||
childOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
childOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||
childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
||||
childOptionEntity.setCreatedTime(new Date());
|
||||
|
||||
boolean row2 ;
|
||||
try {
|
||||
row2= optionalEbomImportService.save(childOptionEntity);
|
||||
if (!row2) {
|
||||
throw new Exception ("");
|
||||
}
|
||||
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);
|
||||
childOptionEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
childOptionEntity.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||
childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
||||
|
||||
childOptionEntity.setCreatedTime(DateUtil.now());
|
||||
optionalEbomImportService.save(childOptionEntity);
|
||||
}else{
|
||||
childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
||||
|
||||
optionalEbomImportService.updateById(childOptionEntity);
|
||||
}
|
||||
|
||||
|
||||
if (childOptionEntity == null || childOptionEntity.getRowId() == null) {
|
||||
|
||||
}catch (Exception e){
|
||||
throw new NflgBusinessException(STATE.Error, "保存选项数据失败");
|
||||
}
|
||||
|
||||
List<OptionalEbomImportChildDTO> optionImportChildDtoList = childOption.getChild();
|
||||
|
||||
List<OptionalEbomImportChildDTO> optionImportChildDtoList = childOption.getChild();
|
||||
List<OptionalEbomImportChildEntity> optionImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||
}, optionImportChildDtoList);
|
||||
optionImportChildEntityList.forEach(item -> {
|
||||
item.setParentRowId(childOptionEntity.getRowId());
|
||||
item.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||
item.setCreatedBy(SessionUtil.getUserCode());
|
||||
item.setCreatedTime(new Date());
|
||||
item.setUpdatedTime(new Date());
|
||||
|
||||
});
|
||||
try {
|
||||
boolean row3 = optionalEbomImportChildService.saveOrUpdateBatch(optionImportChildEntityList);
|
||||
if (!row3) {
|
||||
throw new Exception ("");
|
||||
|
||||
if (CollectionUtil.isNotEmpty(optionImportChildEntityList)) {
|
||||
for (OptionalEbomImportChildEntity item :
|
||||
optionImportChildEntityList) {
|
||||
|
||||
|
||||
item.setSource(OptionalBomConstant.SourceTypeEnum.SOURCE_EXCEL.getValue());
|
||||
|
||||
item.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||
item.setParentRowId(childOptionEntity.getRowId());
|
||||
|
||||
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);
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
}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.setRowId(optionalEbomPublishAddDTO.getRowId());
|
||||
optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||
// optionalEbomConfigEntity.setUpdatedTime(new Date());
|
||||
optionalEbomConfigEntity.setEditStatus(OptionalBomConstant.PublishEnum.PUBLISH.getValue());
|
||||
optionalEbomConfigService.updateById(optionalEbomConfigEntity);
|
||||
}
|
||||
|
|
@ -140,7 +140,7 @@ public class PublishMaterialService {
|
|||
sendPack.setMaterialNo("");//申请物料号
|
||||
|
||||
try {
|
||||
String data = materialService.addMaterialPublish("", sendPack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
String data = materialService.addMaterial("", sendPack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
|
||||
if (resultVO == null) {
|
||||
throw new NflgBusinessException(STATE.Error, "机型发货物料编码申请失败,联系管理员," + data);
|
||||
|
|
@ -171,7 +171,7 @@ public class PublishMaterialService {
|
|||
|
||||
|
||||
try {
|
||||
String data = materialService.addMaterialPublish("", makePack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
String data = materialService.addMaterial("", makePack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
|
||||
if (resultVO == null) {
|
||||
throw new NflgBusinessException(STATE.Error, "机型制作物料编码申请失败,联系管理员," + data);
|
||||
|
|
@ -240,7 +240,7 @@ public class PublishMaterialService {
|
|||
material.setMaterialNo("");//申请物料号
|
||||
|
||||
try {
|
||||
String data = materialService.addMaterialPublish(material.getDrawingNo(), material.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.MACHINE.getCategory());
|
||||
String data = materialService.addMaterial(material.getDrawingNo(), material.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.MACHINE.getCategory());
|
||||
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
|
||||
if (resultVO == null) {
|
||||
throw new NflgBusinessException(STATE.Error, "机械部分物料编码申请失败,联系管理员," + data);
|
||||
|
|
@ -330,7 +330,7 @@ public class PublishMaterialService {
|
|||
|
||||
|
||||
try {
|
||||
String data = materialService.addMaterialPublish("", makePack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
String data = materialService.addMaterial("", makePack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
|
||||
if (resultVO == null) {
|
||||
throw new NflgBusinessException(STATE.Error, "电控制作物料编码申请失败,联系管理员," + data);
|
||||
|
|
@ -360,7 +360,7 @@ public class PublishMaterialService {
|
|||
sendPack.setRootRowId(rootRowId);
|
||||
sendPack.setMaterialNo("");//申请物料号
|
||||
try {
|
||||
String data = materialService.addMaterialPublish("", sendPack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
String data = materialService.addMaterial("", sendPack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
|
||||
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
|
||||
if (resultVO == null) {
|
||||
throw new NflgBusinessException(STATE.Error, "电控发货物料编码申请失败,联系管理员," + data);
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
<result property="realName" column="real_name" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="VARCHAR"/>
|
||||
<result property="updatedTime" column="updated_time" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<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
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
</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} ]]>
|
||||
</if>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<result property="parentRowId" column="parent_row_id" jdbcType="INTEGER"/>
|
||||
<result property="optionRowId" column="option_row_id" 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>
|
||||
<sql id="Base_Column_List" >
|
||||
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 from t_optional_ebom_config_r where parent_row_id = #{parentRowId}
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
<result property="remak" column="remak" jdbcType="VARCHAR"/>
|
||||
<result property="source" column="source" jdbcType="INTEGER"/>
|
||||
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="VARCHAR"/>
|
||||
<result property="updatedTime" column="updated_time" jdbcType="VARCHAR"/>
|
||||
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
|
@ -36,9 +36,8 @@ row_id,parent_row_id,root_row_id,material_no,material_name,material_desc,drawing
|
|||
select
|
||||
<include refid="Base_Column_List" />
|
||||
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">
|
||||
and is_enable=${query.enable}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<result property="optionName" column="option_name" 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="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
|
|
|
|||
|
|
@ -28,25 +28,22 @@
|
|||
<where>
|
||||
is_del =0
|
||||
|
||||
|
||||
<if test="query.deviceName != null and query.deviceName != ''">
|
||||
and( device_name like concat('%', '${query.deviceName}', '%') or device_no like concat('%', '${query.deviceName}', '%') )
|
||||
</if>
|
||||
|
||||
|
||||
<if test="query.deptRowId != null">
|
||||
<if test="query.deptRowId != null and query.deptRowId != 0">
|
||||
and dept_row_id = #{query.deptRowId}
|
||||
</if>
|
||||
<if test="query.deptName != null and query.deptName != ''">
|
||||
and dept_name like concat('%', '${query.deptName}', '%')
|
||||
</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}]]>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
<if test="query.realName != null and query.realName != ''">
|
||||
and real_name like concat('%', '${query.realName}', '%')
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -60,17 +60,18 @@ row_id,parent_row_id,level_row_id,material_no,material_name,material_desc,drawin
|
|||
|
||||
<where>
|
||||
t1.parent_row_id is null
|
||||
and t1.created_by=#{query.createdBy}
|
||||
|
||||
<if test="query.materialNo != null and query.materialNo != ''">
|
||||
and t1.material_no like concat('%', '${query.materialNo}', '%')
|
||||
</if>
|
||||
|
||||
|
||||
<if test="query.drawingNo != null">
|
||||
<if test="query.drawingNo != null and query.drawingNo != '' ">
|
||||
and t1.drawing_no like concat('%', '${query.drawingNo}', '%')
|
||||
</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}]]>
|
||||
</if>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class MaterialServiceTest {
|
|||
public void addMaterialPublish() {
|
||||
try {
|
||||
|
||||
String data = materialService.addMaterialPublish("", "好家伙名称2222234324(制作)", "201101");
|
||||
String data = materialService.addMaterial("", "2好家伙1111(制作)", "201101");
|
||||
System.out.println(data);
|
||||
ResultVO<String> r = JSON.parseObject(data, new TypeReference<ResultVO<String>>(){});
|
||||
System.out.println(r);
|
||||
|
|
|
|||
Loading…
Reference in New Issue