|
@@ -907,10 +907,14 @@ public class AnalysisDiyCustomerComponent {
|
|
|
if (assRelcustomerinfoList != null && assRelcustomerinfoList.size() > 0) {
|
|
|
assRelcustomerinfoService.deleteAssRelcustomerinfoByUserId(user.getUserId().toString(), customerCode);
|
|
|
}
|
|
|
- if (user.getSysUserExt().getOrgCode() != null && !customerCode.equals(userOld.getSysUserExt().getOrgCode())) {
|
|
|
+ if (user.getSysUserExt().getOrgCode() != null && (!customerCode.equals(userOld.getSysUserExt().getOrgCode()) || !customerCode.equals(userOld.getSysUserExt().getCustomerCode()) )) {
|
|
|
AssRelcustomerinfo info = new AssRelcustomerinfo();
|
|
|
info.setUserId(userOld.getUserId().toString());
|
|
|
- info.setMainkunnr(userOld.getSysUserExt().getOrgCode());
|
|
|
+ if(!customerCode.equals(userOld.getSysUserExt().getOrgCode())){
|
|
|
+ info.setMainkunnr(userOld.getSysUserExt().getOrgCode());
|
|
|
+ }else{
|
|
|
+ info.setMainkunnr(userOld.getSysUserExt().getCustomerCode());
|
|
|
+ }
|
|
|
if (cusMap.containsKey(info.getMainkunnr())) {
|
|
|
Customers c = cusMap.get(info.getMainkunnr());
|
|
|
info.setMainname1(c.getChainsName());
|