|
|
|
@ -52,31 +52,29 @@ public class HighTySalesmanServiceImpl implements HighTySalesmanService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void addSalesman(HighTySalesman tySalesman) { |
|
|
|
|
try { |
|
|
|
|
if (secUserService.findByPhone(tySalesman.getSalesmanPhone()) != null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已存在,请更换"); |
|
|
|
|
} |
|
|
|
|
editTySalesman(tySalesman); |
|
|
|
|
|
|
|
|
|
SecUser secUser = new SecUser(); |
|
|
|
|
secUser.setUserName(tySalesman.getSalesmanName()); |
|
|
|
|
secUser.setLoginName(tySalesman.getSalesmanPhone()); |
|
|
|
|
secUser.setPassword(MD5Util.encode("123456".getBytes())); |
|
|
|
|
secUser.setAdminFlag(1); |
|
|
|
|
secUser.setStatus(1); |
|
|
|
|
secUser.setRoleId(8L); |
|
|
|
|
secUser.setObjectType(UserObjectTypeEnum.type7.getType()); |
|
|
|
|
secUser.setObjectId(tySalesman.getId()); |
|
|
|
|
secUser.setCreateTime(new Date()); |
|
|
|
|
secUser.setUpdateTime(new Date()); |
|
|
|
|
secUserService.addUser(secUser); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW) |
|
|
|
|
public void addSalesman(HighTySalesman tySalesman) throws Exception { |
|
|
|
|
if (secUserService.findByLoginName(tySalesman.getSalesmanPhone()) != null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "在系统中此联系电话已存在,请更换"); |
|
|
|
|
} |
|
|
|
|
editTySalesman(tySalesman); |
|
|
|
|
|
|
|
|
|
SecUser secUser = new SecUser(); |
|
|
|
|
secUser.setUserName(tySalesman.getSalesmanName()); |
|
|
|
|
secUser.setLoginName(tySalesman.getSalesmanPhone()); |
|
|
|
|
secUser.setPassword(MD5Util.encode("123456".getBytes())); |
|
|
|
|
secUser.setAdminFlag(1); |
|
|
|
|
secUser.setStatus(1); |
|
|
|
|
secUser.setRoleId(8L); |
|
|
|
|
secUser.setObjectType(UserObjectTypeEnum.type7.getType()); |
|
|
|
|
secUser.setObjectId(tySalesman.getId()); |
|
|
|
|
secUser.setCreateTime(new Date()); |
|
|
|
|
secUser.setUpdateTime(new Date()); |
|
|
|
|
secUserService.addUser(secUser); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW) |
|
|
|
|
public void updateSalesman(HighTySalesman tySalesman) { |
|
|
|
|
// 查询账户
|
|
|
|
|
SecUser account = secUserService.getMainAccount(UserObjectTypeEnum.type7.getType(), tySalesman.getId()); |
|
|
|
|