财报数据推送
This commit is contained in:
parent
82efd2a363
commit
d785e49f84
|
@ -215,50 +215,50 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
user.setId(object.getString("field0032"));
|
||||
List<ZjMaterielSynchronizationEventEntity> entities = zjMaterielSynchronizationEventDao.getuser(user);
|
||||
if(entities != null && entities.size() > 0){
|
||||
zjMaterielSynchronizationEventEntity.setField0032code(entities.get(0).getAccName());//负责人. 选人 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0032code(entities.get(0).getAccName());//负责人. 选人
|
||||
}
|
||||
}
|
||||
if(object.getString("field0033") != null ){
|
||||
zjMaterielSynchronizationEventEntity.setField0033(object.getString("field0033"));//产品阶段
|
||||
zjMaterielSynchronizationEventEntity.setField0033code(mj.get(object.getString("field0033")));//产品阶段 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0033code(mj.get(object.getString("field0033")));//产品阶段
|
||||
}
|
||||
|
||||
if(object.getString("field0034") != null ){
|
||||
zjMaterielSynchronizationEventEntity.setField0034(object.getString("field0034"));//客户名
|
||||
zjMaterielSynchronizationEventEntity.setField0034code(object.getString("field0034"));//客户名 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0034code(mj.get(object.getString("field0034")));//客户名
|
||||
}
|
||||
if(object.getString("field0035") != null ){
|
||||
|
||||
zjMaterielSynchronizationEventEntity.setField0035(object.getString("field0035"));//是否带入档案
|
||||
zjMaterielSynchronizationEventEntity.setField0035code(mj.get(object.getString("field0035")));//是否带入档案 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0035code(mj.get(object.getString("field0035")));//是否带入档案
|
||||
}
|
||||
if(object.getString("field0049") != null ){
|
||||
zjMaterielSynchronizationEventEntity.setField0049(object.getString("field0049"));//
|
||||
zjMaterielSynchronizationEventEntity.setField0049code(mj.get(object.getString("field0049")));// todo
|
||||
zjMaterielSynchronizationEventEntity.setField0049code(mj.get(object.getString("field0049")));//
|
||||
}
|
||||
|
||||
zjMaterielSynchronizationEventEntity.setField0039(object.getString("field0039"));//开发号
|
||||
if(object.getString("field0040") != null ){
|
||||
zjMaterielSynchronizationEventEntity.setField0040(object.getString("field0040"));//仓库名称
|
||||
zjMaterielSynchronizationEventEntity.setField0040code(getSubstringBeforeDash(mj.get(object.getString("field0040"))));//仓库名称 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0040code(getSubstringBeforeDash(mj.get(object.getString("field0040"))));//仓库名称
|
||||
}
|
||||
if(object.getString("field0042") != null ){
|
||||
zjMaterielSynchronizationEventEntity.setField0042(object.getString("field0042"));//物料属性
|
||||
zjMaterielSynchronizationEventEntity.setField0042code(mj.get(object.getString("field0042")));//物料属性 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0042code(mj.get(object.getString("field0042")));//物料属性
|
||||
}
|
||||
|
||||
|
||||
zjMaterielSynchronizationEventEntity.setField0043(object.getString("field0043"));//物料中类编码
|
||||
zjMaterielSynchronizationEventEntity.setField0043code(getSubstringBeforeDash(object.getString("field0043")));//物料中类编码 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0043code(getSubstringBeforeDash(object.getString("field0043")));//物料中类编码
|
||||
zjMaterielSynchronizationEventEntity.setField0044(object.getString("field0044"));//物料一级分类
|
||||
zjMaterielSynchronizationEventEntity.setField0045(object.getString("field0045"));//物料一级分类
|
||||
if(object.getString("field0047") != null ){
|
||||
zjMaterielSynchronizationEventEntity.setField0047(object.getString("field0047"));//物料类别
|
||||
zjMaterielSynchronizationEventEntity.setField0047code(mj.get(object.getString("field0047")));//物料类别 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0047code(mj.get(object.getString("field0047")));//物料类别
|
||||
}
|
||||
if(object.getString("field0048") != null ){
|
||||
zjMaterielSynchronizationEventEntity.setField0048(object.getString("field0048"));//计量单位
|
||||
zjMaterielSynchronizationEventEntity.setField0048code(mj.get(object.getString("field0048")));//计量单位 todo
|
||||
zjMaterielSynchronizationEventEntity.setField0048code(mj.get(object.getString("field0048")));//计量单位
|
||||
}
|
||||
zjMaterielSynchronizationEventEntity.setAccName("UFDATA_997_2021.dbo.");
|
||||
zjMaterielSynchronizationEventEntity.setCaccId("997");
|
||||
|
@ -275,9 +275,35 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
Map<String, String> map = new HashMap<>();
|
||||
if(entities != null && entities.size() > 0){
|
||||
for (int i = 0; i < entities.size(); i++) {
|
||||
if(entities.get(i).getId().equals("4344562897656367384")){
|
||||
map.put(entities.get(i).getId(),"不合格");
|
||||
|
||||
}else if(entities.get(i).getId().equals("-2370628075712397249")){
|
||||
map.put(entities.get(i).getId(),"优选1级");
|
||||
|
||||
}else if(entities.get(i).getId().equals("6388260843022600446")){
|
||||
map.put(entities.get(i).getId(),"优选2级");
|
||||
|
||||
}else if(entities.get(i).getId().equals("407604312497538138")){
|
||||
map.put(entities.get(i).getId(),"优选3级");
|
||||
|
||||
}else if(entities.get(i).getId().equals("1992327618862992707")){
|
||||
map.put(entities.get(i).getId(),"合格");
|
||||
|
||||
}else if(entities.get(i).getId().equals("5555752418635433040")){
|
||||
map.put(entities.get(i).getId(),"B机插类");
|
||||
|
||||
}else if(entities.get(i).getId().equals("-8754053652716436337")){
|
||||
map.put(entities.get(i).getId(),"C手插类");
|
||||
|
||||
}else if(entities.get(i).getId().equals("-3057298014166890271")){
|
||||
map.put(entities.get(i).getId(),"A贴片类");
|
||||
|
||||
}else {
|
||||
map.put(entities.get(i).getId(),entities.get(i).getAccName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -358,7 +384,12 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
lsh.put(entity.getField0043code(),maxnum);
|
||||
wlcode.append(entity.getField0043code()).append(formattedNum);
|
||||
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
||||
if("000".equals(entity.getField0008code())){
|
||||
wlcode.append("00");
|
||||
|
||||
}else {
|
||||
wlcode.append("01");
|
||||
}
|
||||
}else {
|
||||
wlcode.append("00");
|
||||
}
|
||||
|
@ -387,7 +418,12 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
}
|
||||
wlcode.append(formattedNum);
|
||||
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
||||
if("000".equals(entity.getField0008code())){
|
||||
wlcode.append("00");
|
||||
|
||||
}else {
|
||||
wlcode.append("01");
|
||||
}
|
||||
}else {
|
||||
wlcode.append("00");
|
||||
}
|
||||
|
@ -492,10 +528,12 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
inventoryEntity.setcInvDefine7(entity.getField0042code());// 物料属性 OEM
|
||||
if(entity.getField0022code() != null && "是".equals(entity.getField0022code())){
|
||||
inventoryEntity.setbProxyForeign("1");// 是否委外
|
||||
inventoryEntity.setbPurchase("1");// 计划属性
|
||||
inventoryEntity.setbBomMain("1");// 计划属性
|
||||
inventoryEntity.setiPlanDefault(2);// 计划属性
|
||||
}else {
|
||||
inventoryEntity.setbProxyForeign("0");// 是否委外
|
||||
inventoryEntity.setbPurchase("0");// 计划属性
|
||||
inventoryEntity.setbBomMain("0");// 计划属性
|
||||
//inventoryEntity.setbPurchase("0");// 计划属性
|
||||
}
|
||||
inventoryExtEntity.setCidefine7(entity.getField0049code());// 认证信息
|
||||
inventoryExtEntity.setCidefine6(entity.getField0034code());// 客户名
|
||||
|
@ -544,10 +582,8 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
private JsonResultEntity checkData(List<ZjMaterielSynchronizationEventEntity> list, boolean flag,List<InventoryEntity> inventoryEntities) {
|
||||
// 定义正则表达式,匹配全角符号
|
||||
String regex = "[\uFF00-\uFFEF&&[^~Φφμ/±%^Ω≥≤#]]";
|
||||
// 编译正则表达式
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
StringBuffer str = new StringBuffer();
|
||||
|
||||
Integer num = 0;
|
||||
Integer num1 = 0;
|
||||
/*
|
||||
|
@ -563,10 +599,12 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
for (int i = 0; i < list.size(); i++) {
|
||||
ZjMaterielSynchronizationEventEntity entity = list.get(i);
|
||||
if(entity.getField0004() == null || "".equals(entity.getField0004())){
|
||||
|
||||
return BaseResult.getFailureMessageEntity("序号为空");
|
||||
}
|
||||
if(entity.getField0043code() == null || "".equals(entity.getField0043code())){
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料中类为空");
|
||||
str.append("序号为"+entity.getField0004()+"明细行的物料中类为空。");
|
||||
//return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料中类为空");
|
||||
}else {
|
||||
//判断存货分类里面如果有6或7,有一个必须有另一个
|
||||
if(entity.getField0043code().startsWith("6")){
|
||||
|
@ -581,7 +619,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
//}
|
||||
if("修改".equals(entity.getField0018code())){
|
||||
if(entity.getField0005() == null || "".equals(entity.getField0005())){
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的货品编码为空");
|
||||
str.append("序号为"+entity.getField0004()+"明细行的货品编码为空。");
|
||||
}
|
||||
}
|
||||
//if(flag){
|
||||
|
@ -623,7 +661,9 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
if(entity.getField0005() != null && !"".equals(entity.getField0005())
|
||||
&& entity.getField0045() != null && !"".equals(entity.getField0045())){
|
||||
if(!entity.getField0005().equals(entity.getField0045())){
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料编码和货品代码不一致");
|
||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码和货品代码不一致。");
|
||||
|
||||
//return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料编码和货品代码不一致");
|
||||
}
|
||||
}
|
||||
//规格型号正则校验(不允许全角符号)
|
||||
|
@ -646,7 +686,8 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
}
|
||||
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的规格型号包含全角符号:"+msg);
|
||||
str.append("序号为"+entity.getField0004()+"明细行的规格型号包含全角符号:"+msg+"。");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -658,12 +699,13 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
//判断存货分类里面如果有6或7,有一个必须有另一个
|
||||
if(num > 0){
|
||||
if(num1 == 0){
|
||||
return BaseResult.getFailureMessageEntity("存货分类存在6,不存在7");
|
||||
str.append("存货分类存在6,不存在7"+"。");
|
||||
|
||||
}
|
||||
}
|
||||
if(num1 > 0){
|
||||
if(num == 0){
|
||||
return BaseResult.getFailureMessageEntity("存货分类存在7,不存在6");
|
||||
str.append("存货分类存在7,不存在6"+"。");
|
||||
}
|
||||
}
|
||||
//查询u8物料
|
||||
|
@ -673,7 +715,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
List<InventoryEntity> inventoryEntities1 = zjMaterielSynchronizationEventDao.queryInventoryEntity(querywl);
|
||||
inventoryEntities.addAll(inventoryEntities1);
|
||||
if(inventoryEntities == null || inventoryEntities.size() == 0){
|
||||
return BaseResult.getFailureMessageEntity("物料分类在U8中不存在");
|
||||
str.append("物料分类在U8中不存在"+"。");
|
||||
}
|
||||
//发起、保存判断物料分类是否在U8中存在
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
@ -686,7 +728,8 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
}
|
||||
}
|
||||
if(!flags){
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料分类在U8中不存在");
|
||||
str.append("序号为"+entity.getField0004()+"明细行的物料分类在U8中不存在"+"。");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -709,7 +752,8 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
List<InventoryEntity> queryCzList = inventoryDao.query(queryCz);
|
||||
if(queryCzList == null || queryCzList.size() == 0 ){
|
||||
//return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行修改的物料编码在U8中不存在");
|
||||
return BaseResult.getFailureMessageEntity(entity.getField0005()+"在U8中不存在,请检查货品编号");
|
||||
str.append(entity.getField0005()+"在U8中不存在,请检查货品编号"+"。");
|
||||
|
||||
}
|
||||
|
||||
}else if("增加替代".equals(entity.getField0018code()) || "升级".equals(entity.getField0018code())){
|
||||
|
@ -719,11 +763,12 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
queryCz.setcInvCode(entity.getField0005());
|
||||
List<InventoryEntity> queryCzList = inventoryDao.query(queryCz);
|
||||
if(queryCzList != null && queryCzList.size() > 0 ){
|
||||
return BaseResult.getFailureMessageEntity(entity.getField0005()+"在U8中已存在,请检查货品编号");
|
||||
str.append(entity.getField0005()+"在U8中已存在,请检查货品编号"+"。");
|
||||
|
||||
}
|
||||
}else {//新增/增加替代/升级
|
||||
xzCount++;
|
||||
if(entity.getField0043code().startsWith("a")
|
||||
if(entity.getField0043code().startsWith("A")
|
||||
|| entity.getField0043code().startsWith("6")
|
||||
|| entity.getField0043code().startsWith("7")
|
||||
|| entity.getField0043code().startsWith("8")
|
||||
|
@ -735,7 +780,8 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
queryCz.setcInvStd(entity.getField0007());//规格型号
|
||||
List<InventoryEntity> queryCzList = inventoryDao.query(queryCz);
|
||||
if(queryCzList != null && queryCzList.size() > 0 ){
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行"+entity.getField0018code()+"的存货分类和规格型号已存在");
|
||||
str.append("序号为"+entity.getField0004()+"明细行"+entity.getField0018code()+"的存货分类和规格型号已存在"+"。");
|
||||
|
||||
}
|
||||
js.add(entity.getField0043code()+entity.getField0007());
|
||||
}else if(entity.getField0043code().startsWith("1")
|
||||
|
@ -747,20 +793,26 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
queryCz.setcInvStd(entity.getField0007());//规格型号
|
||||
List<InventoryEntity> queryCzList = inventoryDao.query(queryCz);
|
||||
if(queryCzList != null && queryCzList.size() > 0 ){
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行"+entity.getField0018code()+"的规格型号已存在");
|
||||
str.append("序号为"+entity.getField0004()+"明细行"+entity.getField0018code()+"的规格型号已存在"+"。");
|
||||
|
||||
}
|
||||
js.add(entity.getField0007());
|
||||
}else {
|
||||
return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行"+entity.getField0018code()+"的物料中类不正确");
|
||||
str.append("序号为"+entity.getField0004()+"明细行"+entity.getField0018code()+"的物料中类不正确"+"。");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(js.size() != xzCount ){
|
||||
return BaseResult.getFailureMessageEntity("新增/增加替代/升级的明细行存货分类和规格型号或者规格型号存在重复");
|
||||
str.append("新增/增加替代/升级的明细行存货分类和规格型号或者规格型号存在重复"+"。");
|
||||
}
|
||||
}
|
||||
if(str != null && str.toString() != null && !"".equals(str.toString())){
|
||||
return BaseResult.getFailureMessageEntity("校验失败:"+str.toString());
|
||||
}else {
|
||||
return BaseResult.getSuccessMessageEntity("校验成功");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue