Compare commits
4 Commits
ff5d5e357b
...
3af8d9d687
Author | SHA1 | Date |
---|---|---|
|
3af8d9d687 | |
|
493f5fbe33 | |
|
480e5a3729 | |
|
0e22b4b29b |
|
@ -30,5 +30,13 @@ public interface IZjMaterielSynchronizationEventDao extends IBaseDao<ZjMaterielS
|
||||||
List<ZjMaterielSynchronizationEventEntity> getmeiji(ZjMaterielSynchronizationEventEntity zjMaterielSynchronizationEventEntity);
|
List<ZjMaterielSynchronizationEventEntity> getmeiji(ZjMaterielSynchronizationEventEntity zjMaterielSynchronizationEventEntity);
|
||||||
|
|
||||||
List<ZjMaterielSynchronizationEventEntity> getuser(ZjMaterielSynchronizationEventEntity user);
|
List<ZjMaterielSynchronizationEventEntity> getuser(ZjMaterielSynchronizationEventEntity user);
|
||||||
|
|
||||||
|
List<InventoryEntity> queryInventory(ZjMaterielSynchronizationEventEntity querywl);
|
||||||
|
|
||||||
|
Integer queryKh(ZjMaterielSynchronizationEventEntity querywl);
|
||||||
|
|
||||||
|
Integer queryXM(ZjMaterielSynchronizationEventEntity querywl);
|
||||||
|
|
||||||
|
List<ZjMaterielSynchronizationEventEntity> getUser(ZjMaterielSynchronizationEventEntity user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,5 +54,30 @@ public class ZjMaterielSynchronizationEventDaoImpl extends MybatisGenericDao<ZjM
|
||||||
public List<ZjMaterielSynchronizationEventEntity> getuser(ZjMaterielSynchronizationEventEntity entity) {
|
public List<ZjMaterielSynchronizationEventEntity> getuser(ZjMaterielSynchronizationEventEntity entity) {
|
||||||
return (List<ZjMaterielSynchronizationEventEntity>) super.selectList(getSqlIdPrifx() + "getuser",entity);
|
return (List<ZjMaterielSynchronizationEventEntity>) super.selectList(getSqlIdPrifx() + "getuser",entity);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
public List<ZjMaterielSynchronizationEventEntity> getUser(ZjMaterielSynchronizationEventEntity entity) {
|
||||||
|
return (List<ZjMaterielSynchronizationEventEntity>) super.selectList(getSqlIdPrifx() + "getUser",entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
public List<InventoryEntity> queryInventory(ZjMaterielSynchronizationEventEntity entity) {
|
||||||
|
return (List<InventoryEntity>) super.selectList(getSqlIdPrifx() + "queryInventory",entity);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
public Integer queryKh(ZjMaterielSynchronizationEventEntity entity) {
|
||||||
|
return super.getCount(getSqlIdPrifx() + "queryKh",entity);
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
public Integer queryXM(ZjMaterielSynchronizationEventEntity entity) {
|
||||||
|
return super.getCount(getSqlIdPrifx() + "queryXM",entity);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,24 @@ public class ZjMaterielSynchronizationEventEntity extends BaseEntity {
|
||||||
private String field0049;//认证信息
|
private String field0049;//认证信息
|
||||||
private String field0049code;//认证信息
|
private String field0049code;//认证信息
|
||||||
private String querycode;//
|
private String querycode;//
|
||||||
|
private String affairId;//
|
||||||
|
private String userName;//
|
||||||
|
|
||||||
|
public String getAffairId() {
|
||||||
|
return affairId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAffairId(String affairId) {
|
||||||
|
this.affairId = affairId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
public String getQuerycode() {
|
public String getQuerycode() {
|
||||||
return querycode;
|
return querycode;
|
||||||
|
|
|
@ -13,8 +13,24 @@
|
||||||
ORDER BY field0018code,field0043,field0007
|
ORDER BY field0018code,field0043,field0007
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryKh" resultType="java.lang.Integer"
|
||||||
|
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventDto">
|
||||||
|
select
|
||||||
|
count(*)
|
||||||
|
from Customer
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="field0034code != null and field0034code != ''"> and cCusDefine7 = #{field0034code} </if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
<select id="queryXM" resultType="java.lang.Integer"
|
||||||
|
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventDto">
|
||||||
|
select
|
||||||
|
count(*)
|
||||||
|
from fitemss97
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="field0039 != null and field0039 != ''"> and citemcode = #{field0039} </if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
<select id="queryInventoryEntity" resultType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity"
|
<select id="queryInventoryEntity" resultType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity"
|
||||||
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventDto">
|
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventDto">
|
||||||
select
|
select
|
||||||
|
@ -29,7 +45,15 @@
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryInventory" resultType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity"
|
||||||
|
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventDto">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from Inventory
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="field0045 != null and field0045 != ''"> and cInvAddCode = #{field0045} </if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
<select id="queryMaxLsh" resultType="java.lang.String"
|
<select id="queryMaxLsh" resultType="java.lang.String"
|
||||||
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity">
|
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity">
|
||||||
SELECT max(cInvCode) from Inventory
|
SELECT max(cInvCode) from Inventory
|
||||||
|
@ -64,6 +88,7 @@
|
||||||
'3731163912961082997', -- field0018
|
'3731163912961082997', -- field0018
|
||||||
'612018623748066455', -- field0019
|
'612018623748066455', -- field0019
|
||||||
'-5893688452217157155', -- field0020
|
'-5893688452217157155', -- field0020
|
||||||
|
'-5893688452217157155', -- field0020
|
||||||
'-8682849565428789486', -- field0033
|
'-8682849565428789486', -- field0033
|
||||||
'3282520586982344070', -- field0034
|
'3282520586982344070', -- field0034
|
||||||
'1314047672872420014', -- field0040
|
'1314047672872420014', -- field0040
|
||||||
|
@ -81,5 +106,15 @@
|
||||||
from v_user_view_all
|
from v_user_view_all
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getUser" resultType="com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity"
|
||||||
|
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity">
|
||||||
|
|
||||||
|
SELECT name as userName from v_user_view_all where staffID in (
|
||||||
|
SELECT MEMBER_ID from CTP_AFFAIR WHERE id = #{affairId}
|
||||||
|
)
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -77,6 +79,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
JSONObject reqJson = new JSONObject();
|
JSONObject reqJson = new JSONObject();
|
||||||
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
||||||
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
||||||
|
String affairId = jsonStr.getString("affairId");
|
||||||
String formAppId = jsonStr.getString("formAppId");
|
String formAppId = jsonStr.getString("formAppId");
|
||||||
String eventType = jsonStr.getString("eventType");
|
String eventType = jsonStr.getString("eventType");
|
||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
|
@ -121,7 +124,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
}
|
}
|
||||||
//组装数据,保存数据
|
//组装数据,保存数据
|
||||||
try {
|
try {
|
||||||
saveMaterielToU8(list1,inventoryEntities1);
|
saveMaterielToU8(list1,inventoryEntities1,affairId);
|
||||||
//回写U8生成的编码
|
//回写U8生成的编码
|
||||||
updateOaCode(list1);
|
updateOaCode(list1);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
@ -342,7 +345,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
* @param list
|
* @param list
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
private void saveMaterielToU8(List<ZjMaterielSynchronizationEventEntity> list,List<InventoryEntity> inventoryEntities) throws Exception {
|
private void saveMaterielToU8(List<ZjMaterielSynchronizationEventEntity> list,List<InventoryEntity> inventoryEntities,String affairId) throws Exception {
|
||||||
Map<String,String> lsh = new HashMap<>();//当前流水号
|
Map<String,String> lsh = new HashMap<>();//当前流水号
|
||||||
List<InventoryEntity> savedata = new ArrayList<>();
|
List<InventoryEntity> savedata = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -563,6 +566,28 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
wlcode.append(entity.getField0043code());
|
wlcode.append(entity.getField0043code());
|
||||||
wlcode.append(formattedNum);
|
wlcode.append(formattedNum);
|
||||||
wlcode.append("1");
|
wlcode.append("1");
|
||||||
|
}else if(entity.getField0043code().startsWith("T")){
|
||||||
|
//未填写物料(T 草清单)
|
||||||
|
//货品分类(区分是”草清单”通过分类首位 T)
|
||||||
|
//当前分类最大流水号(编码第 2-11 是顺序号)
|
||||||
|
//整体逻辑 T物料分类 0000000001流水
|
||||||
|
if(lsh.get(entity.getField0043code()) != null){
|
||||||
|
maxnum = lsh.get(entity.getField0043code());
|
||||||
|
}
|
||||||
|
if(maxnum == null){
|
||||||
|
entity.setDataSourceCode(zju8);
|
||||||
|
entity.setQuerycode(entity.getField0043code());
|
||||||
|
String num = zjMaterielSynchronizationEventDao.queryMaxLsh(entity);
|
||||||
|
num = num.substring(entity.getField0043code().length(),entity.getField0043code().length()+10);
|
||||||
|
maxnum = num;
|
||||||
|
}
|
||||||
|
String formattedNum = null;
|
||||||
|
|
||||||
|
formattedNum = String.format("%010d", Integer.valueOf(maxnum)+1);
|
||||||
|
maxnum = String.valueOf(Integer.valueOf(maxnum)+1);
|
||||||
|
lsh.put(entity.getField0043code(),maxnum);
|
||||||
|
wlcode.append(entity.getField0043code());
|
||||||
|
wlcode.append(formattedNum);
|
||||||
}
|
}
|
||||||
}else if("修改".equals(entity.getField0018code()) || "增加替代".equals(entity.getField0018code()) || "升级".equals(entity.getField0018code())){
|
}else if("修改".equals(entity.getField0018code()) || "增加替代".equals(entity.getField0018code()) || "升级".equals(entity.getField0018code())){
|
||||||
wlcode.append(entity.getField0005());
|
wlcode.append(entity.getField0005());
|
||||||
|
@ -588,7 +613,15 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
inventorySubEntity.setcInvSubCode(entity.getField0005());
|
inventorySubEntity.setcInvSubCode(entity.getField0005());
|
||||||
inventorySubEntity = iInventorySubService.getInvSub(inventorySubEntity);
|
inventorySubEntity = iInventorySubService.getInvSub(inventorySubEntity);
|
||||||
inventorySubEntity.setDataSourceCode(zju8);
|
inventorySubEntity.setDataSourceCode(zju8);
|
||||||
|
// 变更日期 变更人
|
||||||
|
inventoryEntity.setdModifyDate(new Date());//变更日期
|
||||||
|
ZjMaterielSynchronizationEventEntity user = new ZjMaterielSynchronizationEventEntity();
|
||||||
|
user.setDataSourceCode(zjoa);
|
||||||
|
user.setAffairId(affairId);
|
||||||
|
List<ZjMaterielSynchronizationEventEntity> usersa = zjMaterielSynchronizationEventDao.getUser(user);
|
||||||
|
if(usersa != null && usersa.size() > 0){
|
||||||
|
inventoryEntity.setcModifyPerson(usersa.get(0).getUserName());//变更人
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
for (int i1 = 0; i1 < inventoryEntities.size(); i1++) {
|
for (int i1 = 0; i1 < inventoryEntities.size(); i1++) {
|
||||||
if(inventoryEntities.get(i1).getcInvCode().equals(entity.getField0043code())){
|
if(inventoryEntities.get(i1).getcInvCode().equals(entity.getField0043code())){
|
||||||
|
@ -604,6 +637,19 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
inventorySubEntity.setcInvSubCode(entity.getField0043code());
|
inventorySubEntity.setcInvSubCode(entity.getField0043code());
|
||||||
inventorySubEntity = iInventorySubService.getInvSub(inventorySubEntity);
|
inventorySubEntity = iInventorySubService.getInvSub(inventorySubEntity);
|
||||||
inventorySubEntity.setDataSourceCode(zju8);
|
inventorySubEntity.setDataSourceCode(zju8);
|
||||||
|
// 建档日期 启用日期 建档人
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
inventorySubEntity.setdInvCreateDatetime(sdf.format(new Date()));//建档日期
|
||||||
|
inventoryEntity.setdSDate(new Date());//启用日期
|
||||||
|
|
||||||
|
ZjMaterielSynchronizationEventEntity user = new ZjMaterielSynchronizationEventEntity();
|
||||||
|
user.setDataSourceCode(zjoa);
|
||||||
|
user.setAffairId(affairId);
|
||||||
|
List<ZjMaterielSynchronizationEventEntity> usersa = zjMaterielSynchronizationEventDao.getUser(user);
|
||||||
|
if(usersa != null && usersa.size() > 0){
|
||||||
|
inventoryEntity.setcCreatePerson(usersa.get(0).getUserName());//建档人
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
inventoryExtEntity.setcInvCode(wlcode.toString());
|
inventoryExtEntity.setcInvCode(wlcode.toString());
|
||||||
|
@ -742,22 +788,33 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
if(subStrfz.equals("9")){
|
if(subStrfz.equals("9")){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码的封装分类,编码对应不应该填写9");
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码的封装分类,编码对应不应该填写9");
|
||||||
}
|
}
|
||||||
String subStr = entity.getField0005().substring(9, 11);
|
String subStr = entity.getField0005().substring(10, 11);
|
||||||
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
// mw = 00 pp =000或空
|
||||||
if("000".equals(entity.getField0008code())){
|
//mw != 00 pp !=000或!空
|
||||||
if(!subStr.equals("00")){
|
if(subStr.equals("0")){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为000,编码对应应该填写00");
|
if(entity.getField0008code() != null && !"000".equals(entity.getField0008code())){
|
||||||
}
|
str.append("序号为"+entity.getField0004()+"明细行的编码和品牌不一致");
|
||||||
}else {
|
|
||||||
if(!subStr.equals("01")){
|
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌存在,编码对应应该填写01");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if(!subStr.equals("00")){
|
if(entity.getField0008code() == null || "000".equals(entity.getField0008code())){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为空,应该填写00");
|
str.append("序号为"+entity.getField0004()+"明细行的编码和品牌不一致");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
||||||
|
// if("000".equals(entity.getField0008code())){
|
||||||
|
// if(!subStr.equals("00")){
|
||||||
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为000,编码对应应该填写00");
|
||||||
|
// }
|
||||||
|
// }else {
|
||||||
|
// if(!subStr.equals("01")){
|
||||||
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌存在,编码对应应该填写01");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}else {
|
||||||
|
// if(!subStr.equals("00")){
|
||||||
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为空,应该填写00");
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}else if(entity.getField0043code().startsWith("1") || entity.getField0043code().startsWith("4") || entity.getField0043code().startsWith("5")){
|
}else if(entity.getField0043code().startsWith("1") || entity.getField0043code().startsWith("4") || entity.getField0043code().startsWith("5")){
|
||||||
//货品分类(区分是否是原材料通过分类首位1,4,5)
|
//货品分类(区分是否是原材料通过分类首位1,4,5)
|
||||||
//封装分类(贴片 9 , 其他 0 )
|
//封装分类(贴片 9 , 其他 0 )
|
||||||
|
@ -779,32 +836,44 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码的封装分类不是贴片,编码对应应该填写0");
|
str.append("序号为"+entity.getField0004()+"明细行的物料编码的封装分类不是贴片,编码对应应该填写0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String subStr = entity.getField0005().substring(9, 11);
|
String subStr = entity.getField0005().substring(10, 11);
|
||||||
if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
// mw = 00 pp =000或空
|
||||||
if("000".equals(entity.getField0008code())){
|
//mw != 00 pp !=000或!空
|
||||||
if(!subStr.equals("00")){
|
if(subStr.equals("0")){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为000,编码对应应该填写00");
|
if(entity.getField0008code() != null && !"000".equals(entity.getField0008code())){
|
||||||
}
|
str.append("序号为"+entity.getField0004()+"明细行的编码和品牌不一致");
|
||||||
}else {
|
|
||||||
if(!subStr.equals("01")){
|
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌存在,编码对应应该填写01");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if(!subStr.equals("00")){
|
if(entity.getField0008code() == null || "000".equals(entity.getField0008code())){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为空,应该填写00");
|
str.append("序号为"+entity.getField0004()+"明细行的编码和品牌不一致");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(entity.getField0008code() != null && !"".equals(entity.getField0008code())){
|
||||||
|
// if("000".equals(entity.getField0008code())){
|
||||||
|
// if(!subStr.equals("00")){
|
||||||
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌为000,编码对应应该填写00");
|
||||||
|
// }
|
||||||
|
// }else {
|
||||||
|
// if(!subStr.equals("01")){
|
||||||
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码品牌存在,编码对应应该填写01");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}else {
|
||||||
|
// if(!subStr.equals("00")){
|
||||||
|
// str.append("序号为"+entity.getField0004()+"明细行的编码和品牌不一致");
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}else if(entity.getField0043code().startsWith("6") || entity.getField0043code().startsWith("7") || entity.getField0043code().startsWith("8") || entity.getField0043code().startsWith("9")){
|
}else if(entity.getField0043code().startsWith("6") || entity.getField0043code().startsWith("7") || entity.getField0043code().startsWith("8") || entity.getField0043code().startsWith("9")){
|
||||||
//货品分类(区分是否是”产品”通过分类首位6,7,8,9)
|
//货品分类(区分是否是”产品”通过分类首位6,7,8,9)
|
||||||
//当前分类最大流水号(编码第6-9是顺序号)
|
//当前分类最大流水号(编码第6-9是顺序号)
|
||||||
//最后2位默认11
|
//最后2位默认11
|
||||||
//整体逻辑 62100物料分类 0001流水 11默认
|
//整体逻辑 62100物料分类 0001流水 11默认
|
||||||
//例:62100 0001 11
|
//例:62100 0001 11
|
||||||
String subStr = entity.getField0005().substring(9, 11);
|
//String subStr = entity.getField0005().substring(9, 11);
|
||||||
if(!subStr.equals("11")){
|
//if(!subStr.equals("11")){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码,末尾编码应该填写11");
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码,末尾编码应该填写11");
|
||||||
}
|
//}
|
||||||
|
|
||||||
}else if(entity.getField0043code().startsWith("A")){
|
}else if(entity.getField0043code().startsWith("A")){
|
||||||
//货品分类(区分是”软件”通过分类首位A)
|
//货品分类(区分是”软件”通过分类首位A)
|
||||||
|
@ -812,23 +881,67 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
//最后1位默认1
|
//最后1位默认1
|
||||||
//整体逻辑 A0110物料分类 00001流水 1默认
|
//整体逻辑 A0110物料分类 00001流水 1默认
|
||||||
//例:A0110 00001 1
|
//例:A0110 00001 1
|
||||||
String subStr = entity.getField0005().substring(10, 11);
|
//String subStr = entity.getField0005().substring(10, 11);
|
||||||
if(!subStr.equals("1")){
|
//if(!subStr.equals("1")){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码,末尾编码应该填写1");
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码,末尾编码应该填写1");
|
||||||
}
|
//}
|
||||||
|
}else if(entity.getField0043code().startsWith("T")){
|
||||||
|
//货品分类(区分是”软件”通过分类首位A)
|
||||||
|
//当前分类最大流水号(编码第6-10是顺序号)
|
||||||
|
//最后1位默认1
|
||||||
|
//整体逻辑 A0110物料分类 00001流水 1默认
|
||||||
|
//例:A0110 00001 1
|
||||||
|
//String subStr = entity.getField0005().substring(10, 11);
|
||||||
|
//if(!subStr.equals("1")){
|
||||||
|
// str.append("序号为"+entity.getField0004()+"明细行的物料编码,末尾编码应该填写1");
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if(flag){
|
if("新增".equals(entity.getField0018code())){
|
||||||
// if(entity.getField0045() == null || "".equals(entity.getField0045())){
|
if(entity.getField0005() != null && !"".equals(entity.getField0005())){
|
||||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的货品代码为空");
|
str.append("序号为"+entity.getField0004()+"明细行的申请原因与实际不符。");
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
if("修改".equals(entity.getField0018code())) {
|
||||||
|
if(entity.getField0045() == null || "".equals(entity.getField0045())){
|
||||||
|
//str.append("序号为"+entity.getField0004()+"明细行的货品代码为空");
|
||||||
|
}else {
|
||||||
|
ZjMaterielSynchronizationEventEntity querywl = new ZjMaterielSynchronizationEventEntity();
|
||||||
|
querywl.setDataSourceCode(zju8);
|
||||||
|
querywl.setField0045(entity.getField0045());
|
||||||
|
List<InventoryEntity> inventoryEntities1 = zjMaterielSynchronizationEventDao.queryInventory(querywl);
|
||||||
|
if(inventoryEntities1 == null || inventoryEntities1.size() == 0){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的货品代码不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(entity.getField0045() != null && !"".equals(entity.getField0045())){//货品代码不为空时
|
||||||
|
ZjMaterielSynchronizationEventEntity querywl = new ZjMaterielSynchronizationEventEntity();
|
||||||
|
querywl.setDataSourceCode(zju8);
|
||||||
|
querywl.setField0045(entity.getField0045());
|
||||||
|
List<InventoryEntity> inventoryEntities1 = zjMaterielSynchronizationEventDao.queryInventory(querywl);
|
||||||
|
if(inventoryEntities1 != null && inventoryEntities1.size() > 0){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的货品代码已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//if(flag){
|
//if(flag){
|
||||||
// if(entity.getField0008code() == null || "".equals(entity.getField0008code())){
|
// if(entity.getField0008code() == null || "".equals(entity.getField0008code())){
|
||||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的品牌为空");
|
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的品牌为空");
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
if(entity.getField0034code() != null && !"".equals(entity.getField0034code())){//客户名
|
||||||
|
ZjMaterielSynchronizationEventEntity querywl = new ZjMaterielSynchronizationEventEntity();
|
||||||
|
querywl.setDataSourceCode(zju8);
|
||||||
|
querywl.setField0034code(entity.getField0034code());
|
||||||
|
Integer counts = zjMaterielSynchronizationEventDao.queryKh(querywl);
|
||||||
|
if(counts == null || counts == 0){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的客户名不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//if(flag){
|
//if(flag){
|
||||||
// if(entity.getField0034code() == null || "".equals(entity.getField0034code())){
|
// if(entity.getField0034code() == null || "".equals(entity.getField0034code())){
|
||||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的客户名为空");
|
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的客户名为空");
|
||||||
|
@ -839,11 +952,16 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的优选等级为空");
|
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的优选等级为空");
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
//if(flag){
|
// 开发号
|
||||||
// if(entity.getField0039() == null || "".equals(entity.getField0039())){
|
if(entity.getField0039() != null && !"".equals(entity.getField0039())){//开发号
|
||||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的开发号为空");
|
ZjMaterielSynchronizationEventEntity querywl = new ZjMaterielSynchronizationEventEntity();
|
||||||
// }
|
querywl.setDataSourceCode(zju8);
|
||||||
//}
|
querywl.setField0039(entity.getField0039());
|
||||||
|
Integer counts = zjMaterielSynchronizationEventDao.queryXM(querywl);
|
||||||
|
if(counts == null || counts == 0){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的开发号不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
//if(flag){
|
//if(flag){
|
||||||
// if(entity.getField0042code() == null || "".equals(entity.getField0042code())){
|
// if(entity.getField0042code() == null || "".equals(entity.getField0042code())){
|
||||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料属性为空");
|
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料属性为空");
|
||||||
|
@ -858,7 +976,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
if(entity.getField0005() != null && !"".equals(entity.getField0005())
|
if(entity.getField0005() != null && !"".equals(entity.getField0005())
|
||||||
&& entity.getField0045() != null && !"".equals(entity.getField0045())){
|
&& entity.getField0045() != null && !"".equals(entity.getField0045())){
|
||||||
if(!entity.getField0005().equals(entity.getField0045())){
|
if(!entity.getField0005().equals(entity.getField0045())){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的物料编码和货品代码不一致。");
|
//str.append("序号为"+entity.getField0004()+"明细行的物料编码和货品代码不一致。");
|
||||||
|
|
||||||
//return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料编码和货品代码不一致");
|
//return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料编码和货品代码不一致");
|
||||||
}
|
}
|
||||||
|
@ -967,18 +1085,17 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
str.append(entity.getField0005()+"在U8中不存在,请检查货品编号"+"。");
|
str.append(entity.getField0005()+"在U8中不存在,请检查货品编号"+"。");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if("增加替代".equals(entity.getField0018code()) || "升级".equals(entity.getField0018code())){
|
}else if("增加替代".equals(entity.getField0018code()) || "升级".equals(entity.getField0018code())){
|
||||||
//查询u8物料
|
//查询u8物料
|
||||||
InventoryEntity queryCz = new InventoryEntity();
|
InventoryEntity queryCz = new InventoryEntity();
|
||||||
queryCz.setDataSourceCode(zju8);
|
queryCz.setDataSourceCode(zju8);
|
||||||
queryCz.setcInvCode(entity.getField0005());
|
queryCz.setcInvCode(entity.getField0005());
|
||||||
List<InventoryEntity> queryCzList = inventoryDao.query(queryCz);
|
List<InventoryEntity> queryCzList = inventoryDao.query(queryCz);
|
||||||
if(queryCzList != null && queryCzList.size() > 0 ){
|
if(queryCzList != null && queryCzList.size() > 0 ){
|
||||||
|
//return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行修改的物料编码在U8中不存在");
|
||||||
str.append(entity.getField0005()+"在U8中已存在,请检查货品编号"+"。");
|
str.append(entity.getField0005()+"在U8中已存在,请检查货品编号"+"。");
|
||||||
|
|
||||||
}
|
}
|
||||||
}else {//新增/增加替代/升级
|
}else {//新增
|
||||||
xzCount++;
|
xzCount++;
|
||||||
if(entity.getField0043code().startsWith("A")
|
if(entity.getField0043code().startsWith("A")
|
||||||
|| entity.getField0043code().startsWith("6")
|
|| entity.getField0043code().startsWith("6")
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue