Commit 9b95f5c6 by sunxiwang

修改部门回调通知数据入库出错问题

1 parent 16e15799
...@@ -76,8 +76,16 @@ public class WeEventChangeContactImpl implements WeCallBackEventFactory { ...@@ -76,8 +76,16 @@ public class WeEventChangeContactImpl implements WeCallBackEventFactory {
protected void createParty(WxCpXmlMessageVO message) { protected void createParty(WxCpXmlMessageVO message) {
try { try {
WeDepartment weDepartment = new WeDepartment(); WeDepartment weDepartment = new WeDepartment();
BeanUtils.copyPropertiesASM(message, weDepartment); if (message.getId() !=null){
weDepartmentService.insertWeDepartment(weDepartment); weDepartment.setId(message.getId());
}
if (message.getName() !=null){
weDepartment.setName(message.getName());
}
if (message.getParentId() !=null){
weDepartment.setParentId(Long.valueOf(message.getParentId()));
}
weDepartmentService.save(weDepartment);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error(e.getMessage()); log.error(e.getMessage());
...@@ -88,8 +96,7 @@ public class WeEventChangeContactImpl implements WeCallBackEventFactory { ...@@ -88,8 +96,7 @@ public class WeEventChangeContactImpl implements WeCallBackEventFactory {
protected void deleteParty(WxCpXmlMessageVO message) { protected void deleteParty(WxCpXmlMessageVO message) {
try { try {
if (message.getId() != null) { if (message.getId() != null) {
String[] idArr = message.getId().toString().split(""); weDepartmentService.removeById(message.getId());
weDepartmentService.deleteWeDepartmentByIds(idArr);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -101,8 +108,16 @@ public class WeEventChangeContactImpl implements WeCallBackEventFactory { ...@@ -101,8 +108,16 @@ public class WeEventChangeContactImpl implements WeCallBackEventFactory {
protected void updateParty(WxCpXmlMessageVO message) { protected void updateParty(WxCpXmlMessageVO message) {
try { try {
WeDepartment weDepartment = new WeDepartment(); WeDepartment weDepartment = new WeDepartment();
BeanUtils.copyPropertiesASM(message, weDepartment); if (message.getId() !=null){
weDepartmentService.updateWeDepartment(weDepartment); weDepartment.setId(message.getId());
}
if (message.getName() !=null){
weDepartment.setName(message.getName());
}
if (message.getParentId() !=null){
weDepartment.setParentId(Long.valueOf(message.getParentId()));
}
weDepartmentService.saveOrUpdate(weDepartment);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error(e.getMessage()); log.error(e.getMessage());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!