申请物料及BUG修复
This commit is contained in:
parent
d137c92473
commit
eaeee81dff
|
|
@ -122,7 +122,7 @@ public class OriginalBomApi extends BaseApi {
|
|||
@GetMapping("getOriginalBomExcelTemplate")
|
||||
@ApiOperation("原始BOM导入模板下载")
|
||||
public void getAttrGroupExcelTemplate(HttpServletResponse response) throws IOException {
|
||||
EecExcelUtil.setResponseExcelHeader(response, "OriginalBomTemplate");
|
||||
EecExcelUtil.setResponseExcelHeader(response, "原始BOM导入模版");
|
||||
new Workbook("物料导入", "").addSheet(new ListSheet<>("sheet1", ImmutableList.of(new BomNewOriginalExcelDTO()))).writeTo(response.getOutputStream());
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
package com.nflg.product.bomnew.pojo.dto;
|
||||
|
||||
import com.nflg.product.material.pojo.entity.MaterialFilesEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.naming.ldap.PagedResultsControl;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
|
|
|||
|
|
@ -173,6 +173,10 @@ public class BomOriginalListVO extends BaseMaterialVO {
|
|||
private String identityNo;
|
||||
|
||||
|
||||
@ApiModelProperty("是否删除 0-否 1-是")
|
||||
private Integer delIs=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -96,12 +96,18 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
* @return
|
||||
*/
|
||||
public Boolean saveBom(OriginalSaveBomDTO bom) {
|
||||
List<BomNewOriginalChildEntity> childEntities = Convert.toList(BomNewOriginalChildEntity.class, bom.getBomList());
|
||||
|
||||
List<BomOriginalListVO> saveEnts = bom.getBomList().stream().filter(u -> u.getDelIs().equals(0)).collect(Collectors.toList());
|
||||
List<BomNewOriginalChildEntity> childEntities = Convert.toList(BomNewOriginalChildEntity.class, saveEnts);
|
||||
// originalChildService.getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id",bom.getParentRowId()));
|
||||
childEntities.forEach(u -> {
|
||||
u.setParentRowId(bom.getParentRowId());
|
||||
});
|
||||
|
||||
if (CollUtil.isNotEmpty(childEntities)) {
|
||||
//删除行
|
||||
List<Long> delRowIds = bom.getBomList().stream().filter(u -> u.getDelIs().equals(1)).map(u -> u.getRowId()).collect(Collectors.toList());
|
||||
originalChildService.getBaseMapper().deleteBatchIds(delRowIds);
|
||||
originalChildService.saveOrUpdateBatch(childEntities);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ public abstract class BaseConvert {
|
|||
parentEntity.setStatus(OriginalStatusEnum.UN_CONVERT.getValue());
|
||||
parentEntity.setEditStatus(OriginalEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
parentEntity.setDeptRowId(SessionUtil.getPartRowId());
|
||||
parentEntity.setDeptName(SessionUtil.getFullDeptName());
|
||||
parentEntity.setDeptName(SessionUtil.getSecondFullDeptName());
|
||||
|
||||
parentEntity.setSource(originalSourceEnum.getValue());
|
||||
parentEntity.setCreatedBy(material.getCreatedBy());
|
||||
parentEntity.setCreatedTime(LocalDateTime.now());
|
||||
|
|
@ -144,7 +145,7 @@ public abstract class BaseConvert {
|
|||
|
||||
childEntity.setRowId(IdWorker.getId());
|
||||
childEntity.setParentRowId(parent.getRowId());
|
||||
childEntity.setOrderNumber(material.getOrderNo().toString());
|
||||
childEntity.setOrderNumber(StrUtil.padPre( material.getOrderNo().toString(), 3, '0'));
|
||||
childEntity.setDrawingNo(material.getChartNo());
|
||||
childEntity.setMaterialNo(material.getMaterialNo());
|
||||
childEntity.setMaterialName(material.getMaterialName());
|
||||
|
|
@ -167,7 +168,7 @@ public abstract class BaseConvert {
|
|||
|
||||
|
||||
childEntity.setParentRowId(parent.getRowId());
|
||||
childEntity.setOrderNumber("1");
|
||||
childEntity.setOrderNumber("001");
|
||||
childEntity.setDrawingNo(material.getDrawingNo());
|
||||
childEntity.setMaterialNo(material.getMaterialNo());
|
||||
childEntity.setMaterialName(material.getMaterialName());
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
from t_bom_new_original_parent
|
||||
where (root_is =1 or ( user_root_is=1 and created_by=#{userCode}) )
|
||||
<include refid="whr"/>
|
||||
order by user_root_is desc
|
||||
order by user_root_is desc , created_time desc
|
||||
</select>
|
||||
|
||||
<!--获取原始bom列表-->
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package com.nflg.product.base.core.conmon.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.product.base.core.api.BaseApi;
|
||||
import nflg.product.common.dto.LoginUserInfoDTO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @decription
|
||||
|
|
@ -71,6 +71,19 @@ public class SessionUtil {
|
|||
return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getFullDeptName).orElse(null);
|
||||
}
|
||||
|
||||
//获取2级部门以下
|
||||
public static String getSecondFullDeptName() {
|
||||
String depName = Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getFullDeptName).orElse("");
|
||||
|
||||
depName= StrUtil.replace(depName,"OU=","").replace("福建南方路面机械有限公司,DC=nflg","");
|
||||
List<String> depts = new ArrayList<>(Arrays.asList(StrUtil.split(depName, ",")));
|
||||
depts.remove("");
|
||||
Collections.reverse(depts );
|
||||
return StrUtil.join("/",depts);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static String getLanguage() {
|
||||
return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getLanguage).orElse(null);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue