物料对称修改
This commit is contained in:
parent
493f5fbe33
commit
3af8d9d687
|
@ -34,5 +34,9 @@ public interface IZjMaterielSynchronizationEventDao extends IBaseDao<ZjMaterielS
|
||||||
List<InventoryEntity> queryInventory(ZjMaterielSynchronizationEventEntity querywl);
|
List<InventoryEntity> queryInventory(ZjMaterielSynchronizationEventEntity querywl);
|
||||||
|
|
||||||
Integer queryKh(ZjMaterielSynchronizationEventEntity querywl);
|
Integer queryKh(ZjMaterielSynchronizationEventEntity querywl);
|
||||||
|
|
||||||
|
Integer queryXM(ZjMaterielSynchronizationEventEntity querywl);
|
||||||
|
|
||||||
|
List<ZjMaterielSynchronizationEventEntity> getUser(ZjMaterielSynchronizationEventEntity user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,11 @@ 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
|
@Override
|
||||||
@DS("#entity.dataSourceCode")
|
@DS("#entity.dataSourceCode")
|
||||||
|
@ -68,5 +73,11 @@ public class ZjMaterielSynchronizationEventDaoImpl extends MybatisGenericDao<ZjM
|
||||||
return super.getCount(getSqlIdPrifx() + "queryKh",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;
|
||||||
|
|
|
@ -19,10 +19,18 @@
|
||||||
count(*)
|
count(*)
|
||||||
from Customer
|
from Customer
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="field0034code != null and field0034code != ''"> and cCusAbbName = #{field0034code} </if>
|
<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>
|
</trim>
|
||||||
</select>
|
</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
|
||||||
|
@ -80,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
|
||||||
|
@ -97,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<>();
|
||||||
|
|
||||||
|
@ -610,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())){
|
||||||
|
@ -626,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());
|
||||||
|
@ -874,9 +898,14 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if("新增".equals(entity.getField0018code())){
|
||||||
|
if(entity.getField0005() != null && !"".equals(entity.getField0005())){
|
||||||
|
str.append("序号为"+entity.getField0004()+"明细行的申请原因与实际不符。");
|
||||||
|
}
|
||||||
|
}
|
||||||
if("修改".equals(entity.getField0018code())) {
|
if("修改".equals(entity.getField0018code())) {
|
||||||
if(entity.getField0045() == null || "".equals(entity.getField0045())){
|
if(entity.getField0045() == null || "".equals(entity.getField0045())){
|
||||||
str.append("序号为"+entity.getField0004()+"明细行的货品代码为空");
|
//str.append("序号为"+entity.getField0004()+"明细行的货品代码为空");
|
||||||
}else {
|
}else {
|
||||||
ZjMaterielSynchronizationEventEntity querywl = new ZjMaterielSynchronizationEventEntity();
|
ZjMaterielSynchronizationEventEntity querywl = new ZjMaterielSynchronizationEventEntity();
|
||||||
querywl.setDataSourceCode(zju8);
|
querywl.setDataSourceCode(zju8);
|
||||||
|
@ -923,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()+"明细行的物料属性为空");
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue