问题修复

This commit is contained in:
BF-202309241046\Administrator 2023-12-10 11:51:10 +08:00
parent f7bb3dc50f
commit 47672c0f50
7 changed files with 64 additions and 56 deletions

View File

@ -105,11 +105,6 @@ public class OptionalEbomConfigEntity implements Serializable {
@ApiModelProperty(value = "创建时间")
private String createdTime;
public String getCreatedTime(){
return DateUtil.now();
}
/**
* 变更时间
*/

View File

@ -42,7 +42,7 @@ public class OptionalMbomCompareEntity implements Serializable {
*/
@TableField(value = "created_time")
@ApiModelProperty(value = "创建时间")
private Date createdTime;
private String createdTime;
/**
* 物料编码
*/

View File

@ -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;
@ -78,7 +79,9 @@ public class OptionalMbomMaterialEntity implements Serializable {
*/
@TableField(value = "created_time")
@ApiModelProperty(value = "创建时间")
private Date createdTime;
private String createdTime;
/**
* 操作人编码
*/

View File

@ -45,9 +45,9 @@ public class MaterialService {
materialMainDTO.setMaterialName(materialName);
materialMainDTO.setDrawingNo(drawingNo);
if(StrUtil.isEmpty(drawingNo)){
if (StrUtil.isEmpty(drawingNo)) {
materialMainDTO.setMaterialDesc(materialName);
}else {
} else {
materialMainDTO.setMaterialDesc(StrUtil.join(" ", StrUtil.isNotBlank(drawingNo) ? drawingNo : "", StrUtil.isNotBlank(materialName) ? materialName : ""));
}
@ -55,19 +55,28 @@ public class MaterialService {
materialMainDTO.setOpEnum(1);
materialMainDTO.setRowId(IdWorker.getId());
// materialMainDTO.setApplyDeptName(SessionUtil.getDepartName());
// String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySW5mbyI6IntcImRlcGFydE5hbWVcIjpcIuemj-W7uuWNl-aWuei3r-mdouacuuaisOaciemZkOWFrOWPuFwiLFwiZGVwYXJ0Um93SWRcIjoxNTg1MTk1Njk0ODcyNzg0ODk3LFwiZnVsbERlcHROYW1lXCI6XCJPVT3npo_lu7rljZfmlrnot6_pnaLmnLrmorDmnInpmZDlhazlj7gsREM9bmZsZ1wiLFwicXVlcnlEYXRhXCI6MixcInJlYWxOYW1lXCI6XCJhZG1pblwiLFwicm93SWRcIjoxNTQ3NTEyOTc4MDE2OTE5NTUzLFwidXNlckNvZGVcIjpcImFkbWluXCIsXCJ1c2VyTmFtZVwiOlwiYWRtaW5cIn0iLCJleHAiOjE3MDIxNTQ4MjksImp0aSI6IjQ1YjFlYThlLWJjZjgtNDhlZi05M2M3LTg2ZGQwNjZiM2UzYSJ9.vxOgvTYgFqM3FPAY8fwWtULPeF10wiCWzLOxuoPLvbE";
String token=SessionUtil.getSessionKey();
// materialMainDTO.setApplyDeptName(SessionUtil.getDepartName());
//测试用 生成编码
// try {
// Thread.sleep(100);
// }catch (Exception e){
//
// }
// String s=DateUtil.format(DateUtil.date(), "yyyyMMddHHmmssSSS");
HttpUtils httpUtils = new HttpUtils();
// String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySW5mbyI6IntcImRlcGFydE5hbWVcIjpcIuemj-W7uuWNl-aWuei3r-mdouacuuaisOaciemZkOWFrOWPuFwiLFwiZGVwYXJ0Um93SWRcIjoxNTg1MTk1Njk0ODcyNzg0ODk3LFwiZnVsbERlcHROYW1lXCI6XCJPVT3npo_lu7rljZfmlrnot6_pnaLmnLrmorDmnInpmZDlhazlj7gsREM9bmZsZ1wiLFwicXVlcnlEYXRhXCI6MixcInJlYWxOYW1lXCI6XCJhZG1pblwiLFwicm93SWRcIjoxNTQ3NTEyOTc4MDE2OTE5NTUzLFwidXNlckNvZGVcIjpcImFkbWluXCIsXCJ1c2VyTmFtZVwiOlwiYWRtaW5cIn0iLCJleHAiOjE3MDIxNTQ4MjksImp0aSI6IjQ1YjFlYThlLWJjZjgtNDhlZi05M2M3LTg2ZGQwNjZiM2UzYSJ9.vxOgvTYgFqM3FPAY8fwWtULPeF10wiCWzLOxuoPLvbE";
String token = SessionUtil.getSessionKey();
String s = httpUtils.doPost(NacosConfig.getNacosConfig().getAddMaterialUrl(), JSON.toJSONString(materialMainDTO), token);
String s = httpUtils.doPost(NacosConfig.getNacosConfig().getAddMaterialUrl(),JSON.toJSONString(materialMainDTO),token);
AddMaterialResultDTO result= JSON.parseObject(s,AddMaterialResultDTO.class);
if(STATE.Success.getState().equals(result.getState()) ){
return result.getData().toString();
AddMaterialResultDTO result = JSON.parseObject(s, AddMaterialResultDTO.class);
if (STATE.Success.getState().equals(result.getState())) {
return result.getData().toString();
}
VUtils.isTure(true).throwMessage("申请物料失败"+result.getMsg());
VUtils.isTure(true).throwMessage("申请物料失败" + result.getMsg());
return s;
}
@ -82,9 +91,9 @@ public class MaterialService {
// materialMainDTO.setRowId(IdWorker.getId());
materialMainDTO.setApplyDeptName(SessionUtil.getDepartName());
// materialMainDTO.setApplyDeptName("福建南方路面机械有限公司");
// String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySW5mbyI6IntcImRlcGFydE5hbWVcIjpcIuemj-W7uuWNl-aWuei3r-mdouacuuaisOaciemZkOWFrOWPuFwiLFwiZGVwYXJ0Um93SWRcIjoxNTg1MTk1Njk0ODcyNzg0ODk3LFwiZnVsbERlcHROYW1lXCI6XCJPVT3npo_lu7rljZfmlrnot6_pnaLmnLrmorDmnInpmZDlhazlj7gsREM9bmZsZ1wiLFwicXVlcnlEYXRhXCI6MixcInJlYWxOYW1lXCI6XCJhZG1pblwiLFwicm93SWRcIjoxNTQ3NTEyOTc4MDE2OTE5NTUzLFwidXNlckNvZGVcIjpcImFkbWluXCIsXCJ1c2VyTmFtZVwiOlwiYWRtaW5cIn0iLCJleHAiOjE3MDIwNTI1MzEsImp0aSI6Ijc5NmU2MjZhLWJjYzUtNDY3ZS1iNjFjLWRmOGViNGY0MDYyOSJ9.iq2dyYKpGd7Z60Mmm9ef59CF1YrkG9KLaTGr9CrGsHI";
// String token = SessionUtil.getSessionKey();
// materialMainDTO.setApplyDeptName("福建南方路面机械有限公司");
// String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySW5mbyI6IntcImRlcGFydE5hbWVcIjpcIuemj-W7uuWNl-aWuei3r-mdouacuuaisOaciemZkOWFrOWPuFwiLFwiZGVwYXJ0Um93SWRcIjoxNTg1MTk1Njk0ODcyNzg0ODk3LFwiZnVsbERlcHROYW1lXCI6XCJPVT3npo_lu7rljZfmlrnot6_pnaLmnLrmorDmnInpmZDlhazlj7gsREM9bmZsZ1wiLFwicXVlcnlEYXRhXCI6MixcInJlYWxOYW1lXCI6XCJhZG1pblwiLFwicm93SWRcIjoxNTQ3NTEyOTc4MDE2OTE5NTUzLFwidXNlckNvZGVcIjpcImFkbWluXCIsXCJ1c2VyTmFtZVwiOlwiYWRtaW5cIn0iLCJleHAiOjE3MDIwNTI1MzEsImp0aSI6Ijc5NmU2MjZhLWJjYzUtNDY3ZS1iNjFjLWRmOGViNGY0MDYyOSJ9.iq2dyYKpGd7Z60Mmm9ef59CF1YrkG9KLaTGr9CrGsHI";
// String token = SessionUtil.getSessionKey();
// String token=SessionUtil.getSessionKey();
// HttpUtils httpUtils = new HttpUtils();
@ -93,10 +102,8 @@ public class MaterialService {
// return s;
ResultVO<String> r= ResultVO.success(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmssSSS"));
return JSON.toJSONString(r);
ResultVO<String> r = ResultVO.success(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmssSSS"));
return JSON.toJSONString(r);
}

View File

@ -96,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(DateUtil.now());
optionalEbomConfigEntity.setParentRowId(dto.getRowId());
optionalEbomConfigEntity.setUpdatedTime(optionalEbomConfigEntity.getCreatedTime());

View File

@ -77,6 +77,7 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
OptionalEbomImportChildEntity entity = new OptionalEbomImportChildEntity();
entity.setMaterialName(nos);
entity.setMaterialDesc(nos);
optionList.add(entity);
} else {
//先统一后分割
String[] array = nos.replace("", ";").split(";");
@ -102,7 +103,7 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
});
}
return false;
return true;
}

View File

@ -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.StrUtil;
import cn.hutool.crypto.digest.MD5;
@ -133,7 +134,7 @@ public class PublishMaterialService {
String sendMaterialName = goodsDesc.concat("(发货)");
sendPack.setRowId(IdWorker.getId());
sendPack.setCreatedBy(SessionUtil.getUserCode());
sendPack.setCreatedTime(new Date());
sendPack.setCreatedTime(DateUtil.now());
sendPack.setMaterialName(sendMaterialName);
sendPack.setMaterialDesc(sendMaterialName);
sendPack.setRootRowId(rootRowId);
@ -150,7 +151,7 @@ public class PublishMaterialService {
// }
sendPack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "机型发货物料编码申请失败," + e.getMessage());
throw new NflgBusinessException(STATE.Error, "机型发货," + e.getMessage());
}
if (StrUtil.isEmpty(sendPack.getMaterialNo())) {
@ -162,11 +163,12 @@ public class PublishMaterialService {
String makeMaterialName = goodsDesc.concat("(制作)");
makePack.setRowId(IdWorker.getId());
makePack.setCreatedBy(SessionUtil.getUserCode());
makePack.setCreatedTime(new Date());
makePack.setMaterialName(makeMaterialName);
makePack.setMaterialDesc(makeMaterialName);
makePack.setParentRowId(sendPack.getRowId()); //父级
makePack.setRootRowId(rootRowId);
makePack.setCreatedTime(DateUtil.now());
makePack.setMaterialNo("");//申请物料号
@ -181,7 +183,7 @@ public class PublishMaterialService {
// }
makePack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "机型制作物料编码申请失败," + e.getMessage());
throw new NflgBusinessException(STATE.Error, "机型制作," + e.getMessage());
}
@ -223,7 +225,7 @@ public class PublishMaterialService {
String signMd5 = MD5.create().digestHex(result);
QueryWrapper<OptionalMbomCompareEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(OptionalMbomCompareEntity::getSignMd5, signMd5);
OptionalMbomCompareEntity optionalMbomCompareEntity=null ;//= optionalMbomCompareService.getOne(queryWrapper);
OptionalMbomCompareEntity optionalMbomCompareEntity= optionalMbomCompareService.getOne(queryWrapper);
OptionalMbomMaterialEntity material;
if (optionalMbomCompareEntity == null) {
material = new OptionalMbomMaterialEntity();
@ -234,7 +236,7 @@ public class PublishMaterialService {
material.setParentRowId(parentId);
material.setRootRowId(rootRowId);
material.setCreatedBy(SessionUtil.getUserCode());
material.setCreatedTime(new Date());
material.setCreatedTime(DateUtil.now());
material.setMaterialName(desc);
material.setMaterialDesc(desc);
material.setMaterialNo("");//申请物料号
@ -250,25 +252,25 @@ public class PublishMaterialService {
// }
material.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "机械部分物料编码申请失败," + e.getMessage());
throw new NflgBusinessException(STATE.Error, "机械部分," + e.getMessage());
}
// try {
// //数据不存在保存
// if (StrUtil.isNotEmpty(material.getMaterialNo())) {
// optionalMbomCompareEntity = Convert.convert(new TypeReference<OptionalMbomCompareEntity>() {
// }, material);
// optionalMbomCompareEntity.setParentRowId(rootRowId);
// optionalMbomCompareEntity.setSignMd5(signMd5);
// optionalMbomCompareEntity.setCreatedTime(new Date());
// optionalMbomCompareEntity.setChildRowIds(result);
// optionalMbomCompareService.save(optionalMbomCompareEntity);
// }
//
// } catch (Exception e) {
// e.printStackTrace();
// }
try {
//数据不存在保存
if (StrUtil.isNotEmpty(material.getMaterialNo())) {
optionalMbomCompareEntity = Convert.convert(new TypeReference<OptionalMbomCompareEntity>() {
}, material);
optionalMbomCompareEntity.setParentRowId(rootRowId);
optionalMbomCompareEntity.setSignMd5(signMd5);
optionalMbomCompareEntity.setCreatedTime(DateUtil.now());
optionalMbomCompareEntity.setChildRowIds(result);
optionalMbomCompareService.save(optionalMbomCompareEntity);
}
} catch (Exception e) {
e.printStackTrace();
}
} else { //同物料号
material = Convert.convert(new TypeReference<OptionalMbomMaterialEntity>() {
@ -277,7 +279,7 @@ public class PublishMaterialService {
material.setParentRowId(parentId);
material.setRootRowId(rootRowId);
material.setCreatedBy(SessionUtil.getUserCode());
material.setCreatedTime(new Date());
material.setCreatedTime(DateUtil.now());
}
if (StrUtil.isEmpty(material.getMaterialNo())) {
@ -289,7 +291,7 @@ public class PublishMaterialService {
List<OptionalMbomMaterialEntity> optionConvertList = Convert.toList(OptionalMbomMaterialEntity.class, optionList);
optionConvertList.forEach(item -> {
item.setCreatedBy(SessionUtil.getUserCode());
item.setCreatedTime(new Date());
item.setCreatedTime(DateUtil.now());
item.setRootRowId(rootRowId);
item.setParentRowId(material.getRowId());
materialList.add(item);
@ -322,7 +324,7 @@ public class PublishMaterialService {
makePack.setRowId(IdWorker.getId());
makePack.setParentRowId(parentId);
makePack.setCreatedBy(SessionUtil.getUserCode());
makePack.setCreatedTime(new Date());
makePack.setCreatedTime(DateUtil.now());
makePack.setMaterialName(makeMaterialName);
makePack.setMaterialDesc(makeMaterialName);
makePack.setRootRowId(rootRowId);
@ -340,7 +342,7 @@ public class PublishMaterialService {
// }
makePack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "电控制作物料编码申请失败," + e.getMessage());
throw new NflgBusinessException(STATE.Error, "电控制作," + e.getMessage());
}
@ -354,7 +356,7 @@ public class PublishMaterialService {
sendPack.setRowId(IdWorker.getId());
sendPack.setParentRowId(makePack.getRowId());
sendPack.setCreatedBy(SessionUtil.getUserCode());
sendPack.setCreatedTime(new Date());
sendPack.setCreatedTime(DateUtil.now());
sendPack.setMaterialName(sendMaterialName);
sendPack.setMaterialDesc(sendMaterialName);
sendPack.setRootRowId(rootRowId);
@ -370,7 +372,7 @@ public class PublishMaterialService {
// }
sendPack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "电控发货物料编码申请失败," + e.getMessage());
throw new NflgBusinessException(STATE.Error, "电控发货,"+e.getMessage());
}
if (StrUtil.isEmpty(sendPack.getMaterialNo())) {