Compare commits
5 Commits
1b6e51944d
...
11525c412f
Author | SHA1 | Date | |
---|---|---|---|
|
11525c412f | ||
|
1ce0541c3e | ||
|
beb5441696 | ||
|
43d07558f0 | ||
|
2c24ccd3cb |
@ -8,7 +8,6 @@
|
||||
<version>0.0.1-RELEASE</version>
|
||||
<name>Yo Agent</name>
|
||||
<description>Yo Agent</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
|
@ -27,7 +27,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/agent/api/v1/agent-case")
|
||||
public class AgentCaseController
|
||||
extends BaseQueryController<Integer,
|
||||
extends BaseQueryController<
|
||||
BaseListCtrlrReq,
|
||||
AgentCaseCtrlrResp,
|
||||
AgentCaseServResp> {
|
||||
|
@ -51,11 +51,11 @@ public class CallController implements SessionAbility {
|
||||
@Autowired
|
||||
private ChannelService channelService;
|
||||
@Autowired
|
||||
private PhoneBlacklistMapper phoneBlacklistMapper;
|
||||
private PhoneBlacklistMapper phoneBlacklistDal;
|
||||
@Autowired
|
||||
private PhoneWhitelistMapper phoneWhitelistMapper;
|
||||
private PhoneWhitelistMapper phoneWhitelistDal;
|
||||
@Autowired
|
||||
private CallDetailRecordMapper callDetailRecordMapper;
|
||||
private CallDetailRecordMapper callDetailRecordDal;
|
||||
@Autowired
|
||||
private LockService lockService;
|
||||
@Value("${yo.agent.account-idle-lock.timeout:4000}")
|
||||
@ -114,14 +114,14 @@ public class CallController implements SessionAbility {
|
||||
agentCase.getPhone());
|
||||
// 黑名单
|
||||
AssertUtils.state(
|
||||
!phoneBlacklistMapper.exists(
|
||||
!phoneBlacklistDal.exists(
|
||||
new Search(PhoneBlacklist.TENANT_ID, tenantId)
|
||||
.eq(PhoneBlacklist.PHONE, calledNumber)
|
||||
.eq(PhoneBlacklist.ACTIVE, true)),
|
||||
ErrorCode.DIAL_BLACKLIST);
|
||||
|
||||
// 白名单
|
||||
if (phoneWhitelistMapper.exists(
|
||||
if (phoneWhitelistDal.exists(
|
||||
new Search(PhoneWhitelist.TENANT_ID, tenantId)
|
||||
.eq(PhoneWhitelist.PHONE, calledNumber)
|
||||
.eq(PhoneWhitelist.ACTIVE, true))) {
|
||||
@ -130,7 +130,7 @@ public class CallController implements SessionAbility {
|
||||
}
|
||||
|
||||
// 灰名单
|
||||
if (callDetailRecordMapper.calledNumberValidOfGreylist(tenantId, calledNumber)) {
|
||||
if (callDetailRecordDal.calledNumberValidOfGreylist(tenantId, calledNumber)) {
|
||||
doDial(caseId, account, calledNumber);
|
||||
return;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/agent/api/v1/case-contact-record")
|
||||
public class CaseContactRecordController
|
||||
extends BaseCrudController<Integer,
|
||||
extends BaseCrudController<
|
||||
CaseContactRecordCtrlrResp,
|
||||
CaseContactRecordServResp,
|
||||
CaseContactRecordListCtlrReq,
|
||||
|
@ -8,7 +8,6 @@
|
||||
<version>0.0.1-RELEASE</version>
|
||||
<name>Yo CMS</name>
|
||||
<description>Yo CMS</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
@ -62,8 +61,8 @@
|
||||
<artifactId>tigon-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.chyxion.tigon</groupId>
|
||||
<artifactId>tigon-service-support</artifactId>
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
<artifactId>yo-base-service</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
@ -73,10 +72,6 @@
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
<artifactId>yo-web-auth</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.chyxion.tigon</groupId>
|
||||
<artifactId>tigon-web-controller</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
<artifactId>yo-fsagent-api</artifactId>
|
||||
|
@ -13,7 +13,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
* @date Oct 26, 2019 15:56:08
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(scanBasePackages = "com.pudonghot.yo")
|
||||
@ImportResource("classpath*:spring/spring-*.xml")
|
||||
public class YoCMS implements WebMvcConfigurer {
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
|
||||
import javax.servlet.RequestDispatcher;
|
||||
|
||||
import lombok.val;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import me.chyxion.tigon.web.JsonViewModel;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -28,8 +30,8 @@ public class ErrorController implements org.springframework.boot.web.servlet.err
|
||||
final Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
|
||||
|
||||
if (status != null) {
|
||||
final Integer code = Integer.valueOf(status.toString());
|
||||
final HttpStatus httpStatus = HttpStatus.valueOf(code);
|
||||
val code = Integer.valueOf(status.toString());
|
||||
val httpStatus = HttpStatus.valueOf(code);
|
||||
|
||||
return new JsonViewModel(null)
|
||||
.setError(httpStatus.getReasonPhrase())
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.agent;
|
||||
|
||||
import lombok.val;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
@ -12,8 +13,8 @@ import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.dal.agent.model.AgentGroup;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||
import com.pudonghot.yo.cms.service.QueueService;
|
||||
import com.pudonghot.yo.cms.service.AgentGroupService;
|
||||
import com.pudonghot.yo.cms.service.queue.QueueService;
|
||||
import com.pudonghot.yo.cms.service.agent.AgentGroupService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAgent;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAgent;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
@ -46,8 +47,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/agent")
|
||||
public class AgentController
|
||||
extends BaseCrudController<Integer,
|
||||
Agent,
|
||||
extends BaseCrudController<Agent,
|
||||
FormList,
|
||||
CreateFormAgent,
|
||||
UpdateFormAgent> implements SessionAbility {
|
||||
@ -71,11 +71,15 @@ public class AgentController
|
||||
@Override
|
||||
protected void after(final ArgQuery<?> arg) {
|
||||
super.after(arg);
|
||||
final ViewModel<?> model = arg.getResult();
|
||||
val model = arg.getResult();
|
||||
// TODO attrs
|
||||
|
||||
/*
|
||||
final Integer tenantId = getTenantId();
|
||||
model.setAttr("groupsList", agentGroupService.list(
|
||||
new Search(AgentGroup.TENANT_ID, tenantId)));
|
||||
model.setAttr("queuesList", queueService.list(
|
||||
new Search(Queue.TENANT_ID, tenantId)));
|
||||
*/
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.agent;
|
||||
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
@ -13,7 +13,7 @@ import com.pudonghot.yo.basic.model.enumeration.PrivacyLevelEnum;
|
||||
import com.pudonghot.yo.dal.trunk.model.TrunkStrategy;
|
||||
import com.pudonghot.yo.webauth.annotation.TenantResource;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import com.pudonghot.yo.cms.service.TrunkStrategyService;
|
||||
import com.pudonghot.yo.cms.service.trunk.TrunkStrategyService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAgentGroup;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -38,8 +38,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/agent-group")
|
||||
public class AgentGroupController
|
||||
extends BaseCrudController<Integer,
|
||||
AgentGroup,
|
||||
extends BaseCrudController<AgentGroup,
|
||||
FormList,
|
||||
CreateFormAgentGroup,
|
||||
UpdateFormAgentGroup> implements SessionAbility {
|
||||
@ -62,10 +61,13 @@ public class AgentGroupController
|
||||
@Override
|
||||
protected void after(final ArgQuery<?> arg) {
|
||||
super.after(arg);
|
||||
// TODO attrs
|
||||
/*
|
||||
arg.getResult().attr("trunkStrategiesList",
|
||||
trunkStrategyService.list(
|
||||
new Search(TrunkStrategy.TENANT_ID, getTenantId())));
|
||||
arg.getResult().attr("privacyLevelsList", PrivacyLevelEnum.values());
|
||||
*/
|
||||
}
|
||||
|
||||
@RequestMapping("/privacyLevelsList")
|
@ -1,7 +1,8 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.agent;
|
||||
|
||||
import com.pudonghot.yo.basic.model.enumeration.AgentStatusStateEnum;
|
||||
import com.pudonghot.yo.basic.model.enumeration.AgentStatusStatusEnum;
|
||||
import me.chyxion.tigon.form.FU0;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
@ -28,7 +29,6 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/agent-status")
|
||||
public class AgentStatusController
|
||||
extends BaseQueryController<Integer,
|
||||
AgentStatus,
|
||||
FormList> {
|
||||
extends BaseQueryController<AgentStatus,
|
||||
FormList, AgentStatus, FU0<Integer>> {
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.agentcase;
|
||||
|
||||
import com.pudonghot.yo.dal.agent.model.Agent;
|
||||
import com.pudonghot.yo.dal.agentcase.model.AgentCase;
|
||||
@ -10,7 +10,7 @@ import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import me.chyxion.tigon.web.controller.ArgQuery;
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.cms.service.AgentService;
|
||||
import com.pudonghot.yo.cms.service.agent.AgentService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import com.pudonghot.yo.webauth.annotation.TenantResource;
|
||||
@ -36,8 +36,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/agent-case")
|
||||
public class AgentCaseController
|
||||
extends BaseCrudController<Integer,
|
||||
AgentCase,
|
||||
extends BaseCrudController<AgentCase,
|
||||
FormList,
|
||||
FormCreateAgentCase,
|
||||
FormUpdateAgentCase>
|
||||
@ -67,9 +66,12 @@ public class AgentCaseController
|
||||
super.after(arg);
|
||||
|
||||
val model = arg.getResult();
|
||||
// TODO attrs
|
||||
/*
|
||||
model.setAttr("agentList", agentService.list(
|
||||
new Search(Agent.TENANT_ID, getTenantId())
|
||||
.eq(Agent.ACTIVE, true)));
|
||||
model.setAttr("statusList", AgentCaseStatusEnum.values());
|
||||
*/
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.agentcase;
|
||||
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@ -15,8 +15,7 @@ import com.pudonghot.yo.cms.form.update.FormUpdateCaseContactRecord;
|
||||
@Controller
|
||||
@RequestMapping("/cms/api/case-contact-record")
|
||||
public class CaseContactRecordController
|
||||
extends BaseCrudController<Integer,
|
||||
CaseContactRecord,
|
||||
extends BaseCrudController<CaseContactRecord,
|
||||
FormList,
|
||||
FormCreateCaseContactRecord,
|
||||
FormUpdateCaseContactRecord> {
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.auth;
|
||||
|
||||
import lombok.val;
|
||||
import javax.validation.constraints.NotBlank;
|
@ -1,15 +1,16 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.auth;
|
||||
|
||||
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthPermission;
|
||||
import lombok.val;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import me.chyxion.tigon.web.controller.ArgQuery;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.cms.service.AuthRoleService;
|
||||
import com.pudonghot.yo.cms.service.auth.AuthRoleService;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthPermission;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -33,8 +34,7 @@ filterCols = {
|
||||
@Taggable
|
||||
@RequestMapping("/cms/api/auth-permission")
|
||||
public class AuthPermissionController
|
||||
extends BaseCrudController<Integer,
|
||||
AuthPermission,
|
||||
extends BaseCrudController<AuthPermission,
|
||||
FormList,
|
||||
CreateFormAuthPermission,
|
||||
UpdateFormAuthPermission>
|
||||
@ -58,8 +58,8 @@ public class AuthPermissionController
|
||||
@Override
|
||||
protected void after(final ArgQuery<?> arg) {
|
||||
super.after(arg);
|
||||
|
||||
final ViewModel<?> model = arg.getResult();
|
||||
model.setAttr("rolesList", authRoleService.list(null));
|
||||
val model = arg.getResult();
|
||||
// TODO attrs
|
||||
// model.setAttr("rolesList", authRoleService.list(null));
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.auth;
|
||||
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthRole;
|
||||
@ -28,8 +28,7 @@ filterCols = {
|
||||
@Taggable
|
||||
@RequestMapping("/cms/api/auth-role")
|
||||
public class AuthRoleController
|
||||
extends BaseCrudController<Integer,
|
||||
AuthRole,
|
||||
extends BaseCrudController<AuthRole,
|
||||
FormList,
|
||||
CreateFormAuthRole,
|
||||
UpdateFormAuthRole>
|
@ -1,7 +1,8 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.auth;
|
||||
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthUser;
|
||||
import lombok.val;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import me.chyxion.tigon.web.controller.ArgQuery;
|
||||
@ -10,8 +11,8 @@ import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthUser;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||
import com.pudonghot.yo.cms.service.TenantService;
|
||||
import com.pudonghot.yo.cms.service.AuthRoleService;
|
||||
import com.pudonghot.yo.cms.service.tenant.TenantService;
|
||||
import com.pudonghot.yo.cms.service.auth.AuthRoleService;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -37,8 +38,7 @@ filterCols = {
|
||||
@Taggable
|
||||
@RequestMapping("/cms/api/auth-user")
|
||||
public class AuthUserController
|
||||
extends BaseCrudController<Integer,
|
||||
AuthUser,
|
||||
extends BaseCrudController<AuthUser,
|
||||
FormList,
|
||||
CreateFormAuthUser,
|
||||
UpdateFormAuthUser>
|
||||
@ -66,8 +66,9 @@ public class AuthUserController
|
||||
protected void after(final ArgQuery<?> arg) {
|
||||
super.after(arg);
|
||||
|
||||
final ViewModel<?> model = arg.getResult();
|
||||
model.setAttr("rolesList", authRoleService.list(null));
|
||||
model.setAttr("tenantsList", tenantService.list(null));
|
||||
val model = arg.getResult();
|
||||
// TODO attrs
|
||||
// model.setAttr("rolesList", authRoleService.list(null));
|
||||
// model.setAttr("tenantsList", tenantService.list(null));
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.callinglist;
|
||||
|
||||
import com.pudonghot.yo.cms.service.callinglist.model.CallingListBO;
|
||||
import lombok.val;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
@ -17,10 +18,10 @@ import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.dal.callinglist.model.CallingList;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.cms.service.CampaignService;
|
||||
import com.pudonghot.yo.cms.service.campaign.CampaignService;
|
||||
import com.pudonghot.yo.webauth.annotation.TenantResource;
|
||||
import com.pudonghot.yo.cms.service.CallingListService;
|
||||
import com.pudonghot.yo.dal.dbobject.CallingListSummary;
|
||||
import com.pudonghot.yo.cms.service.callinglist.CallingListService;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallingListSummary;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -28,8 +29,8 @@ import com.pudonghot.yo.cms.form.update.UpdateFormCallingList;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormCallingList;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.cms.service.CallingListPreparedService;
|
||||
import com.pudonghot.yo.cms.service.CallingListHistoricalService;
|
||||
import com.pudonghot.yo.cms.service.callinglist.CallingListPreparedService;
|
||||
import com.pudonghot.yo.cms.service.callinglist.CallingListHistoricalService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
@ -48,8 +49,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/calling-list")
|
||||
public class CallingListController
|
||||
extends BaseCrudController<Integer,
|
||||
CallingList,
|
||||
extends BaseCrudController<CallingListBO,
|
||||
FormList,
|
||||
CreateFormCallingList,
|
||||
UpdateFormCallingList> implements SessionAbility {
|
||||
@ -73,8 +73,9 @@ public class CallingListController
|
||||
);
|
||||
}
|
||||
val vm = arg.getResult();
|
||||
vm.setAttr("campaignList", campaignService.list(new Search(Campaign.ACTIVE, true)));
|
||||
vm.setAttr("callingListStatus", status());
|
||||
// TODO
|
||||
// vm.setAttr("campaignList", campaignService.list(new Search(Campaign.ACTIVE, true)));
|
||||
// vm.setAttr("callingListStatus", status());
|
||||
}
|
||||
|
||||
@RequestMapping("/status")
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.campaign;
|
||||
|
||||
import lombok.val;
|
||||
import java.util.Arrays;
|
||||
@ -12,9 +12,9 @@ import com.pudonghot.yo.basic.model.DailyTime;
|
||||
import com.pudonghot.yo.dal.campaign.model.Campaign;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import me.chyxion.tigon.web.controller.ArgQuery;
|
||||
import com.pudonghot.yo.cms.service.TagService;
|
||||
import com.pudonghot.yo.cms.service.tag.TagService;
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import com.pudonghot.yo.cms.service.QueueService;
|
||||
import com.pudonghot.yo.cms.service.queue.QueueService;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@ -22,7 +22,7 @@ import com.pudonghot.yo.dal.trunk.model.TrunkStrategy;
|
||||
import com.pudonghot.yo.service.CampaignService;
|
||||
import com.pudonghot.yo.webauth.annotation.TenantResource;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import com.pudonghot.yo.cms.service.TrunkStrategyService;
|
||||
import com.pudonghot.yo.cms.service.trunk.TrunkStrategyService;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormCampaign;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormCampaign;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -55,8 +55,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/campaign")
|
||||
public class CampaignController
|
||||
extends BaseCrudController<Integer,
|
||||
Campaign,
|
||||
extends BaseCrudController<Campaign,
|
||||
FormList,
|
||||
CreateFormCampaign,
|
||||
UpdateFormCampaign> implements SessionAbility {
|
||||
@ -88,7 +87,7 @@ public class CampaignController
|
||||
final ArgQuery<ViewModel<Campaign>> argQuery = new ArgQuery<>();
|
||||
argQuery.setController(getClass());
|
||||
argQuery.setType(ArgQuery.Type.FIND);
|
||||
final Campaign campaign = new Campaign();
|
||||
val campaign = new Campaign();
|
||||
campaign.setType(CampaignTypeEnum.AGENT);
|
||||
campaign.setTargetType(CampaignTargetTypeEnum.QUEUE);
|
||||
campaign.setNumOfChannels(32);
|
||||
@ -131,9 +130,10 @@ public class CampaignController
|
||||
@Override
|
||||
protected void after(final ArgQuery<?> arg) {
|
||||
super.after(arg);
|
||||
final ViewModel<?> result = arg.getResult();
|
||||
|
||||
final Integer tenantId = getTenantId();
|
||||
val result = arg.getResult();
|
||||
val tenantId = getTenantId();
|
||||
// TODO attrs
|
||||
/*
|
||||
result.attr("tagsList", tagService.list(
|
||||
new Search(Tag.TENANT_ID, tenantId)));
|
||||
result.attr("trunkStrategiesList",
|
||||
@ -148,5 +148,6 @@ public class CampaignController
|
||||
Arrays.asList(CampaignTargetTypeEnum.QUEUE));
|
||||
result.attr("optimizationMethodsList",
|
||||
Arrays.asList(CampaignOptimizationMethodEnum.AGENT_BUSY_FACTOR));
|
||||
*/
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.cdr;
|
||||
|
||||
import com.pudonghot.yo.basic.model.enumeration.CallTypeEnum;
|
||||
import com.pudonghot.yo.basic.model.enumeration.DialTypeEnum;
|
||||
@ -9,6 +9,8 @@ import java.util.HashMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import me.chyxion.tigon.form.FU0;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -21,18 +23,18 @@ import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.basic.model.enumeration.PrivacyLevelEnum;
|
||||
import com.pudonghot.yo.dal.cdr.mapper.CallRecordingMapper;
|
||||
import com.pudonghot.yo.dal.cdr.model.CallDetailRecord;
|
||||
import com.pudonghot.yo.dal.dbobject.CallDetailReport;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallDetailReport;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import com.pudonghot.yo.cms.form.FormListCallDetailRecord;
|
||||
import me.chyxion.tigon.web.controller.BaseQueryController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.pudonghot.yo.cms.service.CallDetailRecordService;
|
||||
import com.pudonghot.yo.cms.service.cdr.CallDetailRecordService;
|
||||
import com.pudonghot.yo.tool.util.NumberPrivacyUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import static com.pudonghot.yo.dal.cdr.model.CallDetailRecord.*;
|
||||
import com.pudonghot.yo.cms.form.FormCallDetailRecordAccountReport;
|
||||
import com.pudonghot.yo.dal.request.ReqCallDetailRecordAccountReport;
|
||||
import com.pudonghot.yo.dal.cdr.request.ReqCallDetailRecordAccountReport;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
@ -48,11 +50,11 @@ filterCols = {
|
||||
})
|
||||
@RequestMapping("/cms/api/call-detail-record")
|
||||
public class CallDetailRecordController
|
||||
extends BaseQueryController<Integer, CallDetailRecord, FormListCallDetailRecord>
|
||||
extends BaseQueryController<CallDetailRecord, FormListCallDetailRecord, CallDetailRecord, FU0<Integer>>
|
||||
implements SessionAbility {
|
||||
|
||||
@Autowired
|
||||
private CallRecordingMapper callRecordingMapper;
|
||||
private CallRecordingMapper callRecordingDal;
|
||||
@Value("${yo.cms.recording-server.base-path}")
|
||||
private String fileServerBasePath;
|
||||
private final Map<String, String> HANGUP_CAUSES = new HashMap<>(32);
|
||||
@ -155,7 +157,7 @@ public class CallDetailRecordController
|
||||
}
|
||||
|
||||
if (record.getAnswerStamp() != null) {
|
||||
val recording = callRecordingMapper.find(
|
||||
val recording = callRecordingDal.find(
|
||||
new Search(CONN_ID,
|
||||
vm.getData().getConnId()));
|
||||
if (recording != null) {
|
@ -1,11 +1,12 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.gateway;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import com.pudonghot.yo.dal.model.Gateway;
|
||||
import com.pudonghot.yo.dal.gateway.model.Gateway;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.fsagent.api.FsEslService;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormGateway;
|
||||
@ -29,12 +30,12 @@ filterCols = {
|
||||
})
|
||||
@RequestMapping("/cms/api/gateway")
|
||||
public class GatewayController
|
||||
extends BaseCrudController<Integer,
|
||||
Gateway,
|
||||
extends BaseCrudController<Gateway,
|
||||
FormList,
|
||||
CreateFormGateway,
|
||||
UpdateFormGateway> {
|
||||
@Autowired
|
||||
|
||||
@DubboReference
|
||||
private FsEslService fsEslService;
|
||||
|
||||
@PostMapping("/reload-mod-sofia")
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.ivr;
|
||||
|
||||
import com.pudonghot.yo.dal.ivr.model.IvrEntry;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
@ -25,8 +25,7 @@ filterCols = {
|
||||
})
|
||||
@RequestMapping("/cms/api/ivr-entry")
|
||||
public class IvrEntryController
|
||||
extends BaseCrudController<Integer,
|
||||
IvrEntry,
|
||||
extends BaseCrudController<IvrEntry,
|
||||
FormListIvrEntry,
|
||||
CreateFormIvrEntry,
|
||||
UpdateFormIvrEntry> {
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.ivr;
|
||||
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import com.pudonghot.yo.dal.ivr.model.IvrMenu;
|
||||
@ -26,8 +26,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/ivr-menu")
|
||||
public class IvrMenuController
|
||||
extends BaseCrudController<Integer,
|
||||
IvrMenu,
|
||||
extends BaseCrudController<IvrMenu,
|
||||
FormList,
|
||||
CreateFormIvrMenu,
|
||||
UpdateFormIvrMenu> {
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.misc;
|
||||
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAreaCode;
|
||||
@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.dal.model.AreaCode;
|
||||
import com.pudonghot.yo.dal.misc.model.AreaCode;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
@ -33,8 +33,7 @@ filterCols = {
|
||||
@TenantResource(searchAttr = true)
|
||||
@RequestMapping("/cms/api/area-code")
|
||||
public class AreaCodeController
|
||||
extends BaseCrudController<Integer,
|
||||
AreaCode,
|
||||
extends BaseCrudController<AreaCode,
|
||||
FormList,
|
||||
CreateFormAreaCode,
|
||||
UpdateFormAreaCode>
|
@ -1,11 +1,11 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.misc;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormSequence;
|
||||
import com.pudonghot.yo.webauth.annotation.TenantResource;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.dal.model.Sequence;
|
||||
import com.pudonghot.yo.dal.misc.model.Sequence;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -26,8 +26,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/sequence")
|
||||
public class SequenceController
|
||||
extends BaseCrudController<Integer,
|
||||
Sequence,
|
||||
extends BaseCrudController<Sequence,
|
||||
FormList,
|
||||
CreateFormSequence,
|
||||
UpdateFormSequence> {
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.misc;
|
||||
|
||||
import java.io.File;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
@ -26,8 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@Controller
|
||||
@RequestMapping("/cms/api/sound")
|
||||
public class SoundController
|
||||
extends BaseCrudController<Integer,
|
||||
Sound,
|
||||
extends BaseCrudController<Sound,
|
||||
FormList,
|
||||
FormCreateSound,
|
||||
FormUpdateSound> {
|
||||
@ -58,7 +57,8 @@ public class SoundController
|
||||
super.after(arg);
|
||||
|
||||
if (arg.getType() == ArgQuery.Type.LIST) {
|
||||
arg.getResult().attr("basePath", basePath);
|
||||
// TODO attrs
|
||||
// arg.getResult().attr("basePath", basePath);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.misc;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTelecomVendor;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
import com.pudonghot.yo.dal.model.TelecomVendor;
|
||||
import com.pudonghot.yo.dal.misc.model.TelecomVendor;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormTelecomVendor;
|
||||
@ -24,8 +24,7 @@ filterCols = {
|
||||
})
|
||||
@RequestMapping("/cms/api/telecom-vendor")
|
||||
public class TelecomVendorController
|
||||
extends BaseCrudController<Integer,
|
||||
TelecomVendor,
|
||||
extends BaseCrudController<TelecomVendor,
|
||||
FormList,
|
||||
CreateFormTelecomVendor,
|
||||
UpdateFormTelecomVendor> {
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.phone;
|
||||
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import com.pudonghot.yo.dal.phone.model.PhoneAlias;
|
||||
@ -27,8 +27,7 @@ filterCols = {
|
||||
@Controller
|
||||
@RequestMapping("/cms/api/phone-alias")
|
||||
public class PhoneAliasController
|
||||
extends BaseCrudController<Integer,
|
||||
PhoneAlias,
|
||||
extends BaseCrudController<PhoneAlias,
|
||||
FormList,
|
||||
FormCreatePhoneAlias,
|
||||
FormUpdatePhoneAlias> {
|
@ -1,5 +1,6 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.phone;
|
||||
|
||||
import com.pudonghot.yo.cms.service.phone.model.PhoneBlacklistBO;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.dal.phone.model.PhoneBlacklist;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -13,7 +14,7 @@ import com.pudonghot.yo.cms.form.update.FormUpdatePhoneBlacklist;
|
||||
@Controller
|
||||
@RequestMapping("/cms/api/phone-blacklist")
|
||||
public class PhoneBlacklistController
|
||||
extends PhoneListController<PhoneBlacklist,
|
||||
extends PhoneListController<PhoneBlacklistBO,
|
||||
FormCreatePhoneBlacklist,
|
||||
FormUpdatePhoneBlacklist> {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.phone;
|
||||
|
||||
import com.pudonghot.yo.cms.service.phone.model.PhoneGreylistBO;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.dal.phone.model.PhoneGreylist;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -14,7 +15,7 @@ import com.pudonghot.yo.cms.form.update.FormUpdatePhoneGreylist;
|
||||
@RequestMapping("/cms/api/phone-greylist")
|
||||
public class PhoneGreylistController
|
||||
extends PhoneListController<
|
||||
PhoneGreylist,
|
||||
PhoneGreylistBO,
|
||||
FormCreatePhoneGreylist,
|
||||
FormUpdatePhoneGreylist> {
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.phone;
|
||||
|
||||
import com.pudonghot.yo.cms.service.phone.model.PhoneListBO;
|
||||
import lombok.val;
|
||||
import java.util.List;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
@ -10,7 +11,7 @@ import com.pudonghot.yo.dal.phone.model.PhoneList;
|
||||
import me.chyxion.tigon.web.controller.ArgQuery;
|
||||
import com.pudonghot.yo.cms.form.UpdateFormBase;
|
||||
import com.pudonghot.yo.basic.model.enumeration.PrivacyLevelEnum;
|
||||
import com.pudonghot.yo.cms.service.PhoneListService;
|
||||
import com.pudonghot.yo.cms.service.phone.PhoneListService;
|
||||
import com.pudonghot.yo.webauth.annotation.TenantResource;
|
||||
import me.chyxion.tigon.web.controller.BaseCrudController;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -27,11 +28,10 @@ import com.pudonghot.yo.tool.util.NumberPrivacyUtils;
|
||||
PhoneList.NOTE
|
||||
})
|
||||
@TenantResource
|
||||
public class PhoneListController<M extends PhoneList,
|
||||
public class PhoneListController<M extends PhoneListBO,
|
||||
FC extends FormCreatePhoneList,
|
||||
FU extends UpdateFormBase>
|
||||
extends BaseCrudController<Integer,
|
||||
M, FormList, FC, FU> {
|
||||
extends BaseCrudController<M, FormList, FC, FU> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@ -42,16 +42,16 @@ public class PhoneListController<M extends PhoneList,
|
||||
val type = arg.getType();
|
||||
|
||||
if (type == ArgQuery.Type.FIND) {
|
||||
val data = (PhoneList) arg.getResult().getData();
|
||||
data.setPhone(NumberPrivacyUtils.mask(data.getPhone(),
|
||||
PrivacyLevelEnum.ABSOLUTE));
|
||||
// val data = (PhoneList) arg.getResult().getData();
|
||||
// data.setPhone(NumberPrivacyUtils.mask(data.getPhone(),
|
||||
// PrivacyLevelEnum.ABSOLUTE));
|
||||
}
|
||||
else if (type == ArgQuery.Type.LIST) {
|
||||
for (val vm : (List<ViewModel<PhoneList>>) arg.getResult().getData()) {
|
||||
val data = vm.getData();
|
||||
data.setPhone(NumberPrivacyUtils.mask(data.getPhone(),
|
||||
PrivacyLevelEnum.ABSOLUTE));
|
||||
}
|
||||
// for (val vm : (List<ViewModel<PhoneList>>) arg.getResult().getData()) {
|
||||
// val data = vm.getData();
|
||||
// data.setPhone(NumberPrivacyUtils.mask(data.getPhone(),
|
||||
// PrivacyLevelEnum.ABSOLUTE));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.phone;
|
||||
|
||||
import com.pudonghot.yo.cms.service.phone.model.PhoneWhitelistBO;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.dal.phone.model.PhoneWhitelist;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreatePhoneWhitelist;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdatePhoneWhitelist;
|
||||
@ -13,7 +13,7 @@ import com.pudonghot.yo.cms.form.update.FormUpdatePhoneWhitelist;
|
||||
@Controller
|
||||
@RequestMapping("/cms/api/phone-whitelist")
|
||||
public class PhoneWhitelistController
|
||||
extends PhoneListController<PhoneWhitelist,
|
||||
FormCreatePhoneWhitelist,
|
||||
FormUpdatePhoneWhitelist> {
|
||||
extends PhoneListController<PhoneWhitelistBO,
|
||||
FormCreatePhoneWhitelist,
|
||||
FormUpdatePhoneWhitelist> {
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.queue;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormQueue;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
@ -26,8 +26,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/queue")
|
||||
public class QueueController
|
||||
extends BaseCrudController<Integer,
|
||||
Queue,
|
||||
extends BaseCrudController<Queue,
|
||||
FormList,
|
||||
CreateFormQueue,
|
||||
UpdateFormQueue> {
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.tag;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@ -32,8 +32,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/tag")
|
||||
public class TagController
|
||||
extends BaseCrudController<Integer,
|
||||
Tag,
|
||||
extends BaseCrudController<Tag,
|
||||
FormList,
|
||||
CreateFormTag,
|
||||
UpdateFormTag>
|
@ -1,9 +1,9 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.tag;
|
||||
|
||||
import lombok.val;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import com.pudonghot.yo.cms.service.TagService;
|
||||
import com.pudonghot.yo.cms.service.tag.TagService;
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import com.pudonghot.yo.dal.tag.model.ObjectTag;
|
||||
import me.chyxion.tigon.web.controller.ArgQuery;
|
||||
@ -57,8 +57,9 @@ public class TaggableQueryHook implements BaseQueryControllerHook, SessionAbilit
|
||||
log.debug("Query after: @Taggable found, add tenant [{}] tags.", tenantId);
|
||||
val result = arg.getResult();
|
||||
if (result != null) {
|
||||
result.setAttr("tagsList", tagService.list(
|
||||
new Search(ObjectTag.TENANT_ID, tenantId)));
|
||||
// TODO attrs
|
||||
// result.setAttr("tagsList", tagService.list(
|
||||
// new Search(ObjectTag.TENANT_ID, tenantId)));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.tenant;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTenant;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import com.pudonghot.yo.dal.model.Tenant;
|
||||
import com.pudonghot.yo.dal.tenant.model.Tenant;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import me.chyxion.tigon.web.annotation.FilterCol;
|
||||
@ -24,5 +24,5 @@ filterCols = {
|
||||
@FilterCol(param = Tenant.ACTIVE, type = boolean.class)
|
||||
})
|
||||
@RequestMapping("/cms/api/tenant")
|
||||
public class TenantController extends BaseCrudController<Integer, Tenant, FormList, CreateFormTenant, UpdateFormTenant> {
|
||||
public class TenantController extends BaseCrudController<Tenant, FormList, CreateFormTenant, UpdateFormTenant> {
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.trunk;
|
||||
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTrunkAttr;
|
||||
@ -27,8 +27,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/trunk-attr")
|
||||
public class TrunkAttrController
|
||||
extends BaseCrudController<Integer,
|
||||
TrunkAttr,
|
||||
extends BaseCrudController<TrunkAttr,
|
||||
FormList,
|
||||
CreateFormTrunkAttr,
|
||||
UpdateFormTrunkAttr>
|
@ -1,7 +1,14 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.trunk;
|
||||
|
||||
import com.pudonghot.yo.cms.service.agent.AgentGroupService;
|
||||
import com.pudonghot.yo.cms.service.agent.AgentService;
|
||||
import com.pudonghot.yo.cms.service.gateway.GatewayService;
|
||||
import com.pudonghot.yo.cms.service.misc.AreaCodeService;
|
||||
import com.pudonghot.yo.cms.service.misc.TelecomVendorService;
|
||||
import com.pudonghot.yo.cms.service.queue.QueueService;
|
||||
import com.pudonghot.yo.cms.service.trunk.TrunkAttrService;
|
||||
import com.pudonghot.yo.cms.service.trunk.TrunkStrategyService;
|
||||
import lombok.val;
|
||||
import com.pudonghot.yo.cms.service.*;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
@ -49,8 +56,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/trunk")
|
||||
public class TrunkController
|
||||
extends BaseCrudController<Integer,
|
||||
Trunk,
|
||||
extends BaseCrudController<Trunk,
|
||||
FormList,
|
||||
CreateFormTrunk,
|
||||
UpdateFormTrunk>
|
||||
@ -114,6 +120,8 @@ public class TrunkController
|
||||
super.after(arg);
|
||||
|
||||
val model = arg.getResult();
|
||||
// TODO add attrs
|
||||
/*
|
||||
model.setAttr("gatewaysList", gatewayService.list(null));
|
||||
model.setAttr("telecomVendorsList", telecomVendorService.list(null));
|
||||
val tenantId = getTenantId();
|
||||
@ -133,5 +141,6 @@ public class TrunkController
|
||||
if (arg.getType() == ArgQuery.Type.LIST) {
|
||||
model.setAttr("areaCodes", areaCodeService.list(null));
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.trunk;
|
||||
|
||||
import com.pudonghot.yo.cms.form.UpdateFormBase;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTrunkProhibitedAreaCode;
|
||||
@ -25,8 +25,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/trunk-prohibited-area-code")
|
||||
public class TrunkProhibitedAreaCodeController
|
||||
extends BaseCrudController<Integer,
|
||||
TrunkProhibitedAreaCode,
|
||||
extends BaseCrudController<TrunkProhibitedAreaCode,
|
||||
FormList,
|
||||
CreateFormTrunkProhibitedAreaCode,
|
||||
UpdateFormBase> {
|
@ -1,5 +1,6 @@
|
||||
package com.pudonghot.yo.cms.controller;
|
||||
package com.pudonghot.yo.cms.controller.trunk;
|
||||
|
||||
import lombok.val;
|
||||
import me.chyxion.tigon.form.FormList;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import me.chyxion.tigon.web.annotation.ListApi;
|
||||
@ -29,8 +30,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/trunk-strategy")
|
||||
public class TrunkStrategyController
|
||||
extends BaseCrudController<Integer,
|
||||
TrunkStrategy,
|
||||
extends BaseCrudController<TrunkStrategy,
|
||||
FormList,
|
||||
CreateFormTrunkStrategy,
|
||||
UpdateFormTrunkStrategy> {
|
||||
@ -41,8 +41,9 @@ public class TrunkStrategyController
|
||||
@Override
|
||||
protected void after(final ArgQuery<?> arg) {
|
||||
super.after(arg);
|
||||
final ViewModel<?> model = arg.getResult();
|
||||
model.setAttr("strategiesList", TrunkStrategy.Strategy.values());
|
||||
val model = arg.getResult();
|
||||
// TODO attrs
|
||||
// model.setAttr("strategiesList", TrunkStrategy.Strategy.values());
|
||||
}
|
||||
|
||||
@RequestMapping("/strategies")
|
@ -7,8 +7,8 @@ import com.pudonghot.yo.cms.annotation.Taggable;
|
||||
import com.pudonghot.yo.cms.controller2.request.create.AgentCreateCtrlrReq;
|
||||
import com.pudonghot.yo.cms.controller2.request.update.AgentUpdateCtrlrReq;
|
||||
import com.pudonghot.yo.cms.controller2.response.AgentCtrlrResp;
|
||||
import com.pudonghot.yo.cms.service.AgentGroupService;
|
||||
import com.pudonghot.yo.cms.service.QueueService;
|
||||
import com.pudonghot.yo.cms.service.agent.AgentGroupService;
|
||||
import com.pudonghot.yo.cms.service.queue.QueueService;
|
||||
import com.pudonghot.yo.dal.agent.model.Agent;
|
||||
import com.pudonghot.yo.service.response.AgentServResp;
|
||||
import com.pudonghot.yo.webauth.SessionAbility;
|
||||
@ -45,7 +45,7 @@ filterCols = {
|
||||
@TenantResource
|
||||
@RequestMapping("/cms/api/v2/agent")
|
||||
public class AgentController2
|
||||
extends BaseCrudController<Integer,
|
||||
extends BaseCrudController<
|
||||
AgentCtrlrResp,
|
||||
AgentServResp,
|
||||
BaseListCtrlrReq,
|
||||
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.agentcase.model.AgentCase;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreateAgentCase;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdateAgentCase;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 14, 2021 23:20:22
|
||||
*/
|
||||
public interface AgentCaseService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
AgentCase,
|
||||
FormCreateAgentCase,
|
||||
FormUpdateAgentCase> {
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.agent.model.AgentStatus;
|
||||
import me.chyxion.tigon.service.BaseQueryService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Jul 09, 2020 16:53:30
|
||||
*/
|
||||
public interface AgentStatusService
|
||||
extends BaseQueryService<Integer, AgentStatus> {
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.dbobject.CallDetailReport;
|
||||
import com.pudonghot.yo.dal.request.ReqCallDetailRecordAccountReport;
|
||||
import me.chyxion.tigon.service.BaseQueryService;
|
||||
import com.pudonghot.yo.dal.cdr.model.CallDetailRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 21, 2020 21:10:19
|
||||
*/
|
||||
public interface CallDetailRecordService extends BaseQueryService<Integer, CallDetailRecord> {
|
||||
|
||||
/**
|
||||
* account report
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
List<CallDetailReport> accountReport(ReqCallDetailRecordAccountReport form);
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import java.util.List;
|
||||
import me.chyxion.tigon.service.BaseCrudService;
|
||||
import com.pudonghot.yo.dal.callinglist.model.CallingListHistorical;
|
||||
import com.pudonghot.yo.dal.dbobject.CallingListHistoricalSummary;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 26, 2020 21:41:42
|
||||
*/
|
||||
public interface CallingListHistoricalService
|
||||
extends BaseCrudService<Integer,
|
||||
CallingListHistorical> {
|
||||
|
||||
/**
|
||||
* Calling list historical summary
|
||||
*
|
||||
* @param campaignId campaign id
|
||||
* @return calling list prepared summary
|
||||
*/
|
||||
List<CallingListHistoricalSummary> summary(Integer campaignId);
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import java.util.List;
|
||||
import me.chyxion.tigon.service.BaseCrudService;
|
||||
import com.pudonghot.yo.dal.callinglist.model.CallingListPrepared;
|
||||
import com.pudonghot.yo.dal.dbobject.CallingListPreparedSummary;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 20, 2020 14:42:24
|
||||
*/
|
||||
public interface CallingListPreparedService
|
||||
extends BaseCrudService<Integer, CallingListPrepared> {
|
||||
|
||||
/**
|
||||
* Calling list prepared summary
|
||||
*
|
||||
* @param campaignId campaign id
|
||||
* @return calling list prepared summary
|
||||
*/
|
||||
List<CallingListPreparedSummary> summary(Integer campaignId);
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormCampaign;
|
||||
import com.pudonghot.yo.dal.campaign.model.Campaign;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormCampaign;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Jan 02, 2020 16:44:02
|
||||
*/
|
||||
public interface CampaignService
|
||||
extends TaggableService<Campaign,
|
||||
CreateFormCampaign,
|
||||
UpdateFormCampaign> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.agentcase.model.CaseContactRecord;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreateCaseContactRecord;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdateCaseContactRecord;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 16, 2021 00:20:09
|
||||
*/
|
||||
public interface CaseContactRecordService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
CaseContactRecord,
|
||||
FormCreateCaseContactRecord,
|
||||
FormUpdateCaseContactRecord> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormGateway;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormGateway;
|
||||
import com.pudonghot.yo.dal.model.Gateway;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 02, 2019 09:58:50
|
||||
*/
|
||||
public interface GatewayService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
Gateway,
|
||||
CreateFormGateway,
|
||||
UpdateFormGateway> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.ivr.model.IvrEntry;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormIvrEntry;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormIvrEntry;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Aug 15, 2020 18:42:50
|
||||
*/
|
||||
public interface IvrEntryService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
IvrEntry,
|
||||
CreateFormIvrEntry,
|
||||
UpdateFormIvrEntry> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.ivr.model.IvrMenu;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormIvrMenu;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormIvrMenu;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Aug 15, 2020 18:42:35
|
||||
*/
|
||||
public interface IvrMenuService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
IvrMenu,
|
||||
CreateFormIvrMenu,
|
||||
UpdateFormIvrMenu> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.phone.model.PhoneAlias;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreatePhoneAlias;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdatePhoneAlias;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Feb 27, 2021 00:39:15
|
||||
*/
|
||||
public interface PhoneAliasService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
PhoneAlias,
|
||||
FormCreatePhoneAlias,
|
||||
FormUpdatePhoneAlias> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormQueue;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormQueue;
|
||||
import com.pudonghot.yo.dal.queue.model.Queue;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 16, 2019 12:46:17
|
||||
*/
|
||||
public interface QueueService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
Queue,
|
||||
CreateFormQueue,
|
||||
UpdateFormQueue> {
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.ivr.model.Sound;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreateSound;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdateSound;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Aug 16, 2020 12:58:27
|
||||
*/
|
||||
public interface SoundService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
Sound,
|
||||
FormCreateSound,
|
||||
FormUpdateSound> {
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTag;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormTag;
|
||||
import com.pudonghot.yo.dal.tag.model.Tag;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 14, 2019 12:03:19
|
||||
*/
|
||||
public interface TagService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
Tag,
|
||||
CreateFormTag,
|
||||
UpdateFormTag> {
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.webauth.form.SessionForm;
|
||||
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||
import me.chyxion.tigon.form.FormCreateApi;
|
||||
import me.chyxion.tigon.form.FormUpdateApi;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.dal.model.TaggableDbEntity;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 16, 2019 10:06:43
|
||||
*/
|
||||
public interface TaggableService<Model extends TaggableDbEntity,
|
||||
FormCreate extends FormCreateApi & SessionForm & TaggableForm,
|
||||
FormUpdate extends FormUpdateApi<Integer> & SessionForm & TaggableForm>
|
||||
extends BaseCrudByFormService<Integer, Model, FormCreate, FormUpdate> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTelecomVendor;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormTelecomVendor;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.dal.model.TelecomVendor;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 01, 2019 22:48:10
|
||||
*/
|
||||
public interface TelecomVendorService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
TelecomVendor,
|
||||
CreateFormTelecomVendor,
|
||||
UpdateFormTelecomVendor> {
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.dal.model.Tenant;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormTenant;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTenant;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 26, 2019 15:59:44
|
||||
*/
|
||||
public interface TenantService extends BaseCrudByFormService<Integer, Tenant, CreateFormTenant, UpdateFormTenant> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTrunkAttr;
|
||||
import com.pudonghot.yo.dal.trunk.model.TrunkAttr;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormTrunkAttr;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Jan 17, 2020 15:24:50
|
||||
*/
|
||||
public interface TrunkAttrService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
TrunkAttr,
|
||||
CreateFormTrunkAttr,
|
||||
UpdateFormTrunkAttr> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.UpdateFormBase;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTrunkProhibitedAreaCode;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.dal.trunk.model.TrunkProhibitedAreaCode;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 30, 2019 19:00:39
|
||||
*/
|
||||
public interface TrunkProhibitedAreaCodeService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
TrunkProhibitedAreaCode,
|
||||
CreateFormTrunkProhibitedAreaCode,
|
||||
UpdateFormBase> {
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTrunk;
|
||||
import com.pudonghot.yo.dal.trunk.model.Trunk;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormTrunk;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 02, 2019 12:28:36
|
||||
*/
|
||||
public interface TrunkService
|
||||
extends TaggableService<Trunk,
|
||||
CreateFormTrunk,
|
||||
UpdateFormTrunk> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormTrunkStrategy;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormTrunkStrategy;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.dal.trunk.model.TrunkStrategy;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 30, 2019 19:00:39
|
||||
*/
|
||||
public interface TrunkStrategyService
|
||||
extends BaseCrudByFormService<Integer,
|
||||
TrunkStrategy,
|
||||
CreateFormTrunkStrategy,
|
||||
UpdateFormTrunkStrategy> {
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
package com.pudonghot.yo.cms.service.agent;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAgentGroup;
|
||||
import com.pudonghot.yo.cms.service.agent.model.AgentGroupBO;
|
||||
import com.pudonghot.yo.cms.service.tag.TaggableService;
|
||||
import com.pudonghot.yo.dal.agent.model.AgentGroup;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAgentGroup;
|
||||
|
||||
@ -9,7 +11,7 @@ import com.pudonghot.yo.cms.form.update.UpdateFormAgentGroup;
|
||||
* @date Nov 16, 2019 11:29:12
|
||||
*/
|
||||
public interface AgentGroupService
|
||||
extends TaggableService<AgentGroup,
|
||||
CreateFormAgentGroup,
|
||||
UpdateFormAgentGroup> {
|
||||
extends TaggableService<AgentGroupBO,
|
||||
CreateFormAgentGroup,
|
||||
UpdateFormAgentGroup> {
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
package com.pudonghot.yo.cms.service.agent;
|
||||
|
||||
import com.pudonghot.yo.cms.service.agent.model.AgentBO;
|
||||
import com.pudonghot.yo.cms.service.tag.TaggableService;
|
||||
import com.pudonghot.yo.dal.agent.model.Agent;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAgent;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAgent;
|
||||
@ -9,7 +11,7 @@ import com.pudonghot.yo.cms.form.create.CreateFormAgent;
|
||||
* @date Nov 02, 2019 12:52:34
|
||||
*/
|
||||
public interface AgentService
|
||||
extends TaggableService<Agent,
|
||||
CreateFormAgent,
|
||||
UpdateFormAgent> {
|
||||
extends TaggableService<AgentBO,
|
||||
CreateFormAgent,
|
||||
UpdateFormAgent> {
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.agent.impl;
|
||||
|
||||
import com.pudonghot.yo.cms.service.agent.model.AgentGroupBO;
|
||||
import com.pudonghot.yo.cms.service.tag.impl.TaggableServiceImpl;
|
||||
import lombok.val;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
@ -10,17 +12,17 @@ import me.chyxion.tigon.model.ViewModel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.pudonghot.yo.webauth.form.SessionForm;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentGroupMapper;
|
||||
import com.pudonghot.yo.dal.agent.AgentGroupDal;
|
||||
import com.pudonghot.yo.dal.agent.model.AgentGroup;
|
||||
import com.pudonghot.yo.cms.service.SequenceService;
|
||||
import com.pudonghot.yo.cms.service.AgentGroupService;
|
||||
import com.pudonghot.yo.cms.service.misc.SequenceService;
|
||||
import com.pudonghot.yo.cms.service.agent.AgentGroupService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAgentGroup;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentGroupTrunkStrategyMapper;
|
||||
import com.pudonghot.yo.dal.agent.AgentGroupTrunkStrategyDal;
|
||||
import com.pudonghot.yo.dal.agent.model.AgentGroupTrunkStrategy;
|
||||
import com.pudonghot.yo.dal.agent.model.AgentGroupCampaignWeight;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAgentGroup;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentGroupCampaignWeightMapper;
|
||||
import com.pudonghot.yo.dal.agent.AgentGroupCampaignWeightDal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -31,10 +33,11 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AgentGroupServiceImpl
|
||||
extends TaggableServiceImpl<AgentGroup,
|
||||
CreateFormAgentGroup,
|
||||
UpdateFormAgentGroup,
|
||||
AgentGroupMapper>
|
||||
extends TaggableServiceImpl<AgentGroupBO,
|
||||
CreateFormAgentGroup,
|
||||
UpdateFormAgentGroup,
|
||||
AgentGroup,
|
||||
AgentGroupDal>
|
||||
implements AgentGroupService {
|
||||
|
||||
@Value("${yo.cms.agent-group.seq-name:AGENT_GROUP}")
|
||||
@ -44,18 +47,18 @@ public class AgentGroupServiceImpl
|
||||
@Autowired
|
||||
private SequenceService seqService;
|
||||
@Autowired
|
||||
private AgentGroupTrunkStrategyMapper agentGroupTrunkStrategyMapper;
|
||||
private AgentGroupTrunkStrategyDal agentGroupTrunkStrategyDal;
|
||||
@Autowired
|
||||
private AgentGroupCampaignWeightMapper agentGroupCampaignWeightMapper;
|
||||
private AgentGroupCampaignWeightDal agentGroupCampaignWeightDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<AgentGroup> create(final CreateFormAgentGroup form) {
|
||||
public AgentGroupBO create(final CreateFormAgentGroup form) {
|
||||
val vm = super.create(form);
|
||||
|
||||
val agentGroup = vm.getData();
|
||||
val agentGroup = vm;
|
||||
val strategies = form.getTrunkStrategies();
|
||||
if (strategies != null) {
|
||||
for (val strategy : strategies) {
|
||||
@ -70,12 +73,12 @@ public class AgentGroupServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<AgentGroup> update(final UpdateFormAgentGroup form) {
|
||||
public AgentGroupBO update(final UpdateFormAgentGroup form) {
|
||||
val vm = super.update(form);
|
||||
val agentGroup = vm.getData();
|
||||
val agentGroup = vm;
|
||||
val agentGroupId = agentGroup.getId();
|
||||
|
||||
val strategiesExisted = agentGroupTrunkStrategyMapper.list(
|
||||
val strategiesExisted = agentGroupTrunkStrategyDal.list(
|
||||
new Search(AgentGroupTrunkStrategy.AGENT_GROUP_ID,
|
||||
agentGroupId)).stream()
|
||||
.map(AgentGroupTrunkStrategy::getTrunkStrategyId)
|
||||
@ -89,7 +92,7 @@ public class AgentGroupServiceImpl
|
||||
}
|
||||
|
||||
if (!strategiesDiff.getRight().isEmpty()) {
|
||||
agentGroupTrunkStrategyMapper.delete(
|
||||
agentGroupTrunkStrategyDal.delete(
|
||||
new Search(AgentGroupTrunkStrategy.AGENT_GROUP_ID, agentGroupId)
|
||||
.in(AgentGroupTrunkStrategy.TRUNK_STRATEGY_ID,
|
||||
strategiesDiff.getRight()));
|
||||
@ -116,14 +119,14 @@ public class AgentGroupServiceImpl
|
||||
@Override
|
||||
@Transactional(transactionManager = "transactionManager", rollbackFor = Exception.class)
|
||||
public int delete(final Integer id) {
|
||||
agentGroupCampaignWeightMapper.delete(
|
||||
agentGroupCampaignWeightDal.delete(
|
||||
new Search(AgentGroupCampaignWeight.GROUP_ID, id));
|
||||
return super.delete(id);
|
||||
}
|
||||
|
||||
|
||||
protected void insertTrunkStrategy(
|
||||
final AgentGroup agentGroup,
|
||||
final AgentGroupBO agentGroup,
|
||||
final Integer strategyId,
|
||||
final SessionForm form) {
|
||||
|
||||
@ -135,27 +138,27 @@ public class AgentGroupServiceImpl
|
||||
model.setCreatedBy(form.getAuthAccount());
|
||||
|
||||
log.info("Insert agent group trunk strategy [{}].", model);
|
||||
agentGroupTrunkStrategyMapper.insert(model);
|
||||
agentGroupTrunkStrategyDal.insert(model);
|
||||
}
|
||||
|
||||
protected void insertCampaignWeight(
|
||||
final SessionForm form,
|
||||
final AgentGroup agentGroup) {
|
||||
final AgentGroupBO agentGroup) {
|
||||
|
||||
val groupId = agentGroup.getId();
|
||||
|
||||
val campaignWeight = agentGroup.getCampaignWeight();
|
||||
val search = new Search(AgentGroupCampaignWeight.GROUP_ID, groupId);
|
||||
val existedWeight = agentGroupCampaignWeightMapper.count(search);
|
||||
val existedWeight = agentGroupCampaignWeightDal.count(search);
|
||||
|
||||
if (campaignWeight > existedWeight) {
|
||||
agentGroupCampaignWeightMapper.insert(
|
||||
agentGroupCampaignWeightDal.insert(
|
||||
genNewCampaignWeights(
|
||||
campaignWeight - existedWeight,
|
||||
groupId, form.getAuthAccount()));
|
||||
}
|
||||
else if (campaignWeight < existedWeight) {
|
||||
agentGroupCampaignWeightMapper.delete(
|
||||
agentGroupCampaignWeightDal.delete(
|
||||
search.limit(existedWeight - campaignWeight));
|
||||
}
|
||||
}
|
@ -1,25 +1,23 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.agent.impl;
|
||||
|
||||
import java.util.Set;
|
||||
import com.pudonghot.yo.cms.service.agent.model.AgentBO;
|
||||
import com.pudonghot.yo.cms.service.tag.impl.TaggableServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.val;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import org.springframework.util.Assert;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import com.pudonghot.yo.dal.agent.model.Agent;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentMapper;
|
||||
import com.pudonghot.yo.dal.agent.AgentDal;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.pudonghot.yo.webauth.form.SessionForm;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentGroupMapper;
|
||||
import com.pudonghot.yo.dal.queue.mapper.QueueAgentMapper;
|
||||
import com.pudonghot.yo.dal.agent.model.AgentGroup;
|
||||
import com.pudonghot.yo.dal.agent.AgentGroupDal;
|
||||
import com.pudonghot.yo.dal.queue.QueueAgentDal;
|
||||
import com.pudonghot.yo.dal.queue.model.QueueAgent;
|
||||
import com.pudonghot.yo.cms.service.AgentService;
|
||||
import com.pudonghot.yo.cms.service.agent.AgentService;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import com.pudonghot.yo.cms.service.SequenceService;
|
||||
import com.pudonghot.yo.cms.service.misc.SequenceService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAgent;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAgent;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@ -32,10 +30,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AgentServiceImpl
|
||||
extends TaggableServiceImpl<Agent,
|
||||
CreateFormAgent,
|
||||
UpdateFormAgent,
|
||||
AgentMapper>
|
||||
extends TaggableServiceImpl<AgentBO,
|
||||
CreateFormAgent,
|
||||
UpdateFormAgent,
|
||||
Agent,
|
||||
AgentDal>
|
||||
implements AgentService {
|
||||
|
||||
@Value("${yo.cms.agent.seq-name:AGENT}")
|
||||
@ -45,18 +44,19 @@ public class AgentServiceImpl
|
||||
@Autowired
|
||||
private SequenceService seqService;
|
||||
@Autowired
|
||||
private AgentGroupMapper agentGroupMapper;
|
||||
private AgentGroupDal agentGroupDal;
|
||||
@Autowired
|
||||
private QueueAgentMapper queueAgentMapper;
|
||||
private QueueAgentDal queueAgentDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<Agent> create(final CreateFormAgent form) {
|
||||
final ViewModel<Agent> vm = super.create(form);
|
||||
final Agent agent = vm.getData();
|
||||
final Integer[] queues = form.getQueues();
|
||||
public AgentBO create(final CreateFormAgent form) {
|
||||
val vm = super.create(form);
|
||||
val agent = vm;
|
||||
val queues = form.getQueues();
|
||||
|
||||
if (queues != null) {
|
||||
for (final Integer queue : queues) {
|
||||
insertQueueAgent(agent, queue, form);
|
||||
@ -69,18 +69,18 @@ public class AgentServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<Agent> update(final UpdateFormAgent form) {
|
||||
final ViewModel<Agent> vm = super.update(form);
|
||||
final Agent agent = vm.getData();
|
||||
public AgentBO update(final UpdateFormAgent form) {
|
||||
val vm = super.update(form);
|
||||
val agent = vm;
|
||||
|
||||
final Integer agentId = agent.getId();
|
||||
val agentId = agent.getId();
|
||||
|
||||
final Set<Integer> queuesExisted = queueAgentMapper.list(
|
||||
val queuesExisted = queueAgentDal.list(
|
||||
new Search(QueueAgent.AGENT_ID, agentId)).stream()
|
||||
.map(QueueAgent::getQueueId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
final Pair<Set<Integer>, Set<Integer>> queuesDiff =
|
||||
val queuesDiff =
|
||||
diff(queuesExisted, form.getQueues());
|
||||
|
||||
for (final Integer queueId : queuesDiff.getLeft()) {
|
||||
@ -88,7 +88,7 @@ public class AgentServiceImpl
|
||||
}
|
||||
|
||||
if (!queuesDiff.getRight().isEmpty()) {
|
||||
queueAgentMapper.delete(
|
||||
queueAgentDal.delete(
|
||||
new Search(QueueAgent.AGENT_ID, agentId)
|
||||
.in(QueueAgent.QUEUE_ID, queuesDiff.getRight()));
|
||||
}
|
||||
@ -102,11 +102,12 @@ public class AgentServiceImpl
|
||||
@Override
|
||||
protected void validate(final CreateFormAgent form) {
|
||||
super.validate(form);
|
||||
final Integer groupId = form.getGroupId();
|
||||
final AgentGroup agentGroup = agentGroupMapper.find(groupId);
|
||||
val groupId = form.getGroupId();
|
||||
val agentGroup = agentGroupDal.find(groupId);
|
||||
|
||||
Assert.state(agentGroup != null, () -> "No agent group [" + groupId + "] found");
|
||||
Assert.state(agentGroup.getActive(), () -> "Agent group [" + groupId + "] is inactive");
|
||||
Assert.state(!mapper.exists(
|
||||
Assert.state(!dal.exists(
|
||||
new Search(Agent.TENANT_ID, form.getTenantId())
|
||||
.eq(Agent.ACCOUNT, form.getAccount())),
|
||||
() -> "Agent [" + form.getAccount() + "] existed");
|
||||
@ -141,7 +142,7 @@ public class AgentServiceImpl
|
||||
}
|
||||
}
|
||||
|
||||
protected void insertQueueAgent(final Agent agent,
|
||||
protected void insertQueueAgent(final AgentBO agent,
|
||||
final Integer queueId,
|
||||
final SessionForm form) {
|
||||
|
||||
@ -152,6 +153,6 @@ public class AgentServiceImpl
|
||||
arg.setAccount(agent.getAccount());
|
||||
arg.setAgent(agent.getAgent());
|
||||
arg.setCreatedBy(form.getAuthAccount());
|
||||
queueAgentMapper.insert(arg);
|
||||
queueAgentDal.insert(arg);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.pudonghot.yo.cms.service.agent.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import com.pudonghot.yo.cms.service.model.TaggableServModel;
|
||||
import com.pudonghot.yo.basic.model.enumeration.AgentTypeEnum;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 26, 2019 15:35:23
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AgentBO extends TaggableServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private String tenantCode;
|
||||
private Integer groupId;
|
||||
private AgentTypeEnum type;
|
||||
private Boolean webrtc;
|
||||
private String name;
|
||||
private String account;
|
||||
private String agent;
|
||||
|
||||
private String password;
|
||||
private Integer wrapUpTime;
|
||||
private Boolean trunkDialAllowed;
|
||||
private String queues;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.pudonghot.yo.cms.service.agent.model;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.TaggableServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import com.pudonghot.yo.basic.model.enumeration.PrivacyLevelEnum;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 16, 2019 11:24:43
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AgentGroupBO extends TaggableServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private String tenantCode;
|
||||
private String name;
|
||||
private PrivacyLevelEnum privacyLevel;
|
||||
private String identifier;
|
||||
private Integer campaignWeight;
|
||||
private String trunkStrategies;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.pudonghot.yo.cms.service.agent.model;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 16, 2019 11:24:43
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AgentGroupCampaignWeightBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer groupId;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.pudonghot.yo.cms.service.agent.model;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 16, 2019 11:24:43
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AgentGroupTrunkStrategyBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private String tenantCode;
|
||||
private Integer agentGroupId;
|
||||
private Integer trunkStrategyId;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.pudonghot.yo.cms.service.agent.model;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import com.pudonghot.yo.basic.model.enumeration.AgentStatusStateEnum;
|
||||
import com.pudonghot.yo.basic.model.enumeration.AgentStatusStatusEnum;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 09, 2020 16:11:08
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AgentStatusBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
|
||||
private Integer agentId;
|
||||
private String account;
|
||||
private String agent;
|
||||
private boolean registered;
|
||||
private AgentStatusStatusEnum status;
|
||||
private AgentStatusStateEnum state;
|
||||
private Date acwTime;
|
||||
private Date operationTime;
|
||||
private String eventKey;
|
||||
private String lockKey;
|
||||
private String checkRegKey;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.pudonghot.yo.cms.service.agentcase;
|
||||
|
||||
import me.chyxion.tigon.service.BaseService1;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreateAgentCase;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdateAgentCase;
|
||||
import com.pudonghot.yo.cms.service.agentcase.model.AgentCaseBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 14, 2021 23:20:22
|
||||
*/
|
||||
public interface AgentCaseService
|
||||
extends BaseService1<AgentCaseBO,
|
||||
FormCreateAgentCase,
|
||||
FormUpdateAgentCase> {
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.pudonghot.yo.cms.service.agentcase;
|
||||
|
||||
import me.chyxion.tigon.service.BaseService1;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreateCaseContactRecord;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdateCaseContactRecord;
|
||||
import com.pudonghot.yo.cms.service.agentcase.model.CaseContactRecordBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 16, 2021 00:20:09
|
||||
*/
|
||||
public interface CaseContactRecordService
|
||||
extends BaseService1<CaseContactRecordBO,
|
||||
FormCreateCaseContactRecord,
|
||||
FormUpdateCaseContactRecord> {
|
||||
}
|
@ -1,20 +1,21 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.agentcase.impl;
|
||||
|
||||
import com.pudonghot.yo.cms.service.agentcase.model.AgentCaseBO;
|
||||
import lombok.val;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import org.springframework.util.Assert;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentMapper;
|
||||
import com.pudonghot.yo.dal.agent.AgentDal;
|
||||
import com.pudonghot.yo.dal.agent.model.Agent;
|
||||
import me.chyxion.tigon.kit.sequence.IdSequence;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.agentcase.model.AgentCase;
|
||||
import com.pudonghot.yo.dal.agentcase.mapper.AgentCaseMapper;
|
||||
import com.pudonghot.yo.cms.service.AgentCaseService;
|
||||
import com.pudonghot.yo.dal.agentcase.AgentCaseDal;
|
||||
import com.pudonghot.yo.cms.service.agentcase.AgentCaseService;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreateAgentCase;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdateAgentCase;
|
||||
import com.pudonghot.yo.basic.model.enumeration.AgentCaseStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import me.chyxion.tigon.service.support.BaseCrudByFormServiceSupport;
|
||||
import me.chyxion.tigon.service.support.BaseService1Support;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
@ -22,14 +23,14 @@ import me.chyxion.tigon.service.support.BaseCrudByFormServiceSupport;
|
||||
*/
|
||||
@Service
|
||||
public class AgentCaseServiceImpl
|
||||
extends BaseCrudByFormServiceSupport<Integer,
|
||||
AgentCase,
|
||||
FormCreateAgentCase,
|
||||
FormUpdateAgentCase,
|
||||
AgentCaseMapper>
|
||||
extends BaseService1Support<AgentCaseBO,
|
||||
FormCreateAgentCase,
|
||||
FormUpdateAgentCase,
|
||||
AgentCase,
|
||||
AgentCaseDal>
|
||||
implements AgentCaseService {
|
||||
@Autowired
|
||||
private AgentMapper agentMapper;
|
||||
private AgentDal agentDal;
|
||||
@Autowired
|
||||
private IdSequence idSeq;
|
||||
|
||||
@ -40,7 +41,7 @@ public class AgentCaseServiceImpl
|
||||
protected void beforeCreate(final FormCreateAgentCase form, final AgentCase agentCase) {
|
||||
super.beforeCreate(form, agentCase);
|
||||
val agentId = form.getAgentId();
|
||||
val agent = agentMapper.find(new Search(agentId)
|
||||
val agent = agentDal.find(new Search(agentId)
|
||||
.eq(Agent.TENANT_ID, form.getTenantId())
|
||||
.eq(Agent.ACTIVE, true));
|
||||
Assert.state(agent != null,
|
@ -0,0 +1,24 @@
|
||||
package com.pudonghot.yo.cms.service.agentcase.impl;
|
||||
|
||||
import com.pudonghot.yo.cms.service.agentcase.model.CaseContactRecordBO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.agentcase.model.CaseContactRecord;
|
||||
import com.pudonghot.yo.dal.agentcase.CaseContactRecordDal;
|
||||
import com.pudonghot.yo.cms.service.agentcase.CaseContactRecordService;
|
||||
import com.pudonghot.yo.cms.form.create.FormCreateCaseContactRecord;
|
||||
import com.pudonghot.yo.cms.form.update.FormUpdateCaseContactRecord;
|
||||
import me.chyxion.tigon.service.support.BaseService1Support;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 16, 2021 00:20:09
|
||||
*/
|
||||
@Service
|
||||
public class CaseContactRecordServiceImpl
|
||||
extends BaseService1Support<CaseContactRecordBO,
|
||||
FormCreateCaseContactRecord,
|
||||
FormUpdateCaseContactRecord,
|
||||
CaseContactRecord,
|
||||
CaseContactRecordDal>
|
||||
implements CaseContactRecordService {
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.pudonghot.yo.cms.service.agentcase.model;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import com.pudonghot.yo.basic.model.enumeration.AgentCaseStatusEnum;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 14, 2021 23:20:22
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AgentCaseBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private Integer agentId;
|
||||
private String account;
|
||||
private String caseKey;
|
||||
private String name;
|
||||
private String phone;
|
||||
private AgentCaseStatusEnum status;
|
||||
|
||||
private Date lastContactTime;
|
||||
private Date nextContactTime;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.pudonghot.yo.cms.service.agentcase.model;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import com.pudonghot.yo.basic.model.enumeration.CaseContactRecordStatusEnum;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 16, 2021 00:20:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class CaseContactRecordBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private Integer agentId;
|
||||
private String account;
|
||||
private Integer caseId;
|
||||
private String connId;
|
||||
private Date contactTime;
|
||||
private CaseContactRecordStatusEnum status;
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.pudonghot.yo.cms.service.agentcase.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Mar 09, 2020 16:11:08
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class WorkRecordBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private Integer agentId;
|
||||
private String account;
|
||||
private String connId;
|
||||
private String takePhone;
|
||||
private Date callStartTime;
|
||||
private Date callEndTime;
|
||||
|
||||
/**
|
||||
* hangup type,
|
||||
* 01 -> Agent hangup
|
||||
* 02 -> Customer hangup
|
||||
*/
|
||||
private String hangupType;
|
||||
private PackType packType;
|
||||
private String packRemark;
|
||||
|
||||
public enum PackType {
|
||||
/**
|
||||
* business success
|
||||
*/
|
||||
Y,
|
||||
/**
|
||||
* business fail
|
||||
*/
|
||||
N;
|
||||
}
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
package com.pudonghot.yo.cms.service.auth;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthPermission;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAuthPermission;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthPermission;
|
||||
|
||||
import com.pudonghot.yo.cms.service.auth.model.AuthPermissionBO;
|
||||
import com.pudonghot.yo.cms.service.tag.TaggableService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -11,9 +11,9 @@ import java.util.List;
|
||||
* @date Nov 02, 2019 12:52:34
|
||||
*/
|
||||
public interface AuthPermissionService
|
||||
extends TaggableService<AuthPermission,
|
||||
CreateFormAuthPermission,
|
||||
UpdateFormAuthPermission> {
|
||||
extends TaggableService<AuthPermissionBO,
|
||||
CreateFormAuthPermission,
|
||||
UpdateFormAuthPermission> {
|
||||
|
||||
/**
|
||||
* list permissions of auth user
|
@ -1,9 +1,9 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
package com.pudonghot.yo.cms.service.auth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthRole;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthRole;
|
||||
import com.pudonghot.yo.cms.service.auth.model.AuthRoleBO;
|
||||
import com.pudonghot.yo.cms.service.tag.TaggableService;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAuthRole;
|
||||
|
||||
/**
|
||||
@ -11,9 +11,9 @@ import com.pudonghot.yo.cms.form.update.UpdateFormAuthRole;
|
||||
* @date Dec 24, 2019 17:02:46
|
||||
*/
|
||||
public interface AuthRoleService
|
||||
extends TaggableService<AuthRole,
|
||||
CreateFormAuthRole,
|
||||
UpdateFormAuthRole> {
|
||||
extends TaggableService<AuthRoleBO,
|
||||
CreateFormAuthRole,
|
||||
UpdateFormAuthRole> {
|
||||
|
||||
/**
|
||||
* list roles of user
|
@ -1,6 +1,8 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
package com.pudonghot.yo.cms.service.auth;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthUser;
|
||||
import com.pudonghot.yo.cms.service.auth.model.AuthUserBO;
|
||||
import com.pudonghot.yo.cms.service.tag.TaggableService;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthUser;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAuthUser;
|
||||
|
||||
@ -9,7 +11,7 @@ import com.pudonghot.yo.cms.form.update.UpdateFormAuthUser;
|
||||
* @date Dec 24, 2019 16:50:15
|
||||
*/
|
||||
public interface AuthUserService
|
||||
extends TaggableService<AuthUser,
|
||||
CreateFormAuthUser,
|
||||
UpdateFormAuthUser> {
|
||||
extends TaggableService<AuthUserBO,
|
||||
CreateFormAuthUser,
|
||||
UpdateFormAuthUser> {
|
||||
}
|
@ -1,26 +1,25 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.auth.impl;
|
||||
|
||||
import lombok.val;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.pudonghot.yo.webauth.form.SessionForm;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthPermission;
|
||||
import com.pudonghot.yo.cms.service.auth.model.AuthPermissionBO;
|
||||
import com.pudonghot.yo.cms.service.tag.impl.TaggableServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.stream.Collectors;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import org.springframework.util.Assert;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthRoleMapper;
|
||||
import com.pudonghot.yo.dal.auth.AuthRoleDal;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthRole;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthPermissionMapper;
|
||||
import com.pudonghot.yo.webauth.form.SessionForm;
|
||||
import com.pudonghot.yo.dal.auth.AuthPermissionDal;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthPermission;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthPermissionRoleMapper;
|
||||
import com.pudonghot.yo.dal.auth.AuthPermissionRoleDal;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthPermissionRole;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.cms.service.AuthPermissionService;
|
||||
import com.pudonghot.yo.cms.service.auth.AuthPermissionService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthPermission;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAuthPermission;
|
||||
|
||||
/**
|
||||
@ -30,16 +29,17 @@ import com.pudonghot.yo.cms.form.update.UpdateFormAuthPermission;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AuthPermissionServiceImpl
|
||||
extends TaggableServiceImpl<AuthPermission,
|
||||
CreateFormAuthPermission,
|
||||
UpdateFormAuthPermission,
|
||||
AuthPermissionMapper>
|
||||
extends TaggableServiceImpl<AuthPermissionBO,
|
||||
CreateFormAuthPermission,
|
||||
UpdateFormAuthPermission,
|
||||
AuthPermission,
|
||||
AuthPermissionDal>
|
||||
implements AuthPermissionService {
|
||||
|
||||
@Autowired
|
||||
private AuthRoleMapper roleMapper;
|
||||
private AuthRoleDal roleDal;
|
||||
@Autowired
|
||||
private AuthPermissionRoleMapper permissionRoleMapper;
|
||||
private AuthPermissionRoleDal permissionRoleDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@ -47,7 +47,7 @@ public class AuthPermissionServiceImpl
|
||||
@Override
|
||||
protected void validate(final CreateFormAuthPermission form) {
|
||||
super.validate(form);
|
||||
Assert.state(!mapper.exists(
|
||||
Assert.state(!dal.exists(
|
||||
new Search(AuthPermission.PERMISSION, form.getPermission())),
|
||||
() -> "Auth permission [" + form.getPermission() + "] existed");
|
||||
}
|
||||
@ -56,9 +56,9 @@ public class AuthPermissionServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<AuthPermission> create(final CreateFormAuthPermission form) {
|
||||
final ViewModel<AuthPermission> vm = super.create(form);
|
||||
final AuthPermission agent = vm.getData();
|
||||
public AuthPermissionBO create(final CreateFormAuthPermission form) {
|
||||
val vm = super.create(form);
|
||||
val agent = vm;
|
||||
final Integer[] roles = form.getRoles();
|
||||
if (roles != null) {
|
||||
for (final Integer roleId : roles) {
|
||||
@ -72,26 +72,26 @@ public class AuthPermissionServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<AuthPermission> update(final UpdateFormAuthPermission form) {
|
||||
public AuthPermissionBO update(final UpdateFormAuthPermission form) {
|
||||
log.info("Update auth permission form [{}].", form);
|
||||
final ViewModel<AuthPermission> vm = super.update(form);
|
||||
final AuthPermission user = vm.getData();
|
||||
final Integer permissionId = user.getId();
|
||||
val vm = super.update(form);
|
||||
val user = vm;
|
||||
val permissionId = user.getId();
|
||||
|
||||
final Set<Integer> rolesExisted = permissionRoleMapper.list(
|
||||
val rolesExisted = permissionRoleDal.list(
|
||||
new Search(AuthPermissionRole.PERMISSION_ID, permissionId)).stream()
|
||||
.map(AuthPermissionRole::getRoleId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
final Pair<Set<Integer>, Set<Integer>> rolesDiff =
|
||||
val rolesDiff =
|
||||
diff(rolesExisted, form.getRoles());
|
||||
|
||||
for (final Integer roleId : rolesDiff.getLeft()) {
|
||||
for (val roleId : rolesDiff.getLeft()) {
|
||||
insertPermissionRole(user, roleId, form);
|
||||
}
|
||||
|
||||
if (!rolesDiff.getRight().isEmpty()) {
|
||||
permissionRoleMapper.delete(
|
||||
permissionRoleDal.delete(
|
||||
new Search(AuthPermissionRole.PERMISSION_ID, permissionId)
|
||||
.in(AuthPermissionRole.ROLE_ID, rolesDiff.getRight()));
|
||||
}
|
||||
@ -105,9 +105,9 @@ public class AuthPermissionServiceImpl
|
||||
@Override
|
||||
@Transactional
|
||||
public int delete(final Search search) {
|
||||
permissionRoleMapper.delete(
|
||||
permissionRoleDal.delete(
|
||||
new Search(AuthPermissionRole.PERMISSION, list(search)
|
||||
.stream().map(AuthPermission::getId)
|
||||
.stream().map(AuthPermissionBO::getId)
|
||||
.collect(Collectors.toList())));
|
||||
return super.delete(search);
|
||||
}
|
||||
@ -118,26 +118,26 @@ public class AuthPermissionServiceImpl
|
||||
@Override
|
||||
@Transactional
|
||||
public int delete(final Integer id) {
|
||||
permissionRoleMapper.delete(new Search(AuthPermissionRole.PERMISSION_ID, id));
|
||||
permissionRoleDal.delete(new Search(AuthPermissionRole.PERMISSION_ID, id));
|
||||
return super.delete(id);
|
||||
}
|
||||
|
||||
protected void insertPermissionRole(
|
||||
final AuthPermission model,
|
||||
final AuthPermissionBO model,
|
||||
final Integer roleId,
|
||||
final SessionForm form) {
|
||||
|
||||
final AuthRole role = roleMapper.find(roleId);
|
||||
val role = roleDal.find(roleId);
|
||||
Assert.state(role != null,
|
||||
() -> "No auth role [" + roleId + "] found");
|
||||
final AuthPermissionRole arg = new AuthPermissionRole();
|
||||
val arg = new AuthPermissionRole();
|
||||
arg.setPermissionId(model.getId());
|
||||
arg.setPermission(model.getPermission());
|
||||
arg.setRoleId(roleId);
|
||||
arg.setRole(role.getRole());
|
||||
arg.setCreatedBy(form.getAuthAccount());
|
||||
|
||||
permissionRoleMapper.insert(arg);
|
||||
permissionRoleDal.insert(arg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,6 +145,6 @@ public class AuthPermissionServiceImpl
|
||||
*/
|
||||
@Override
|
||||
public List<String> listOfUser(final String account) {
|
||||
return mapper.listOfUser(account);
|
||||
return dal.listOfUser(account);
|
||||
}
|
||||
}
|
@ -1,17 +1,19 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.auth.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthRole;
|
||||
import com.pudonghot.yo.cms.service.auth.model.AuthRoleBO;
|
||||
import com.pudonghot.yo.cms.service.tag.impl.TaggableServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthRoleMapper;
|
||||
import com.pudonghot.yo.dal.auth.AuthRoleDal;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthRole;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthUserRoleMapper;
|
||||
import com.pudonghot.yo.dal.auth.AuthUserRoleDal;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthUserRole;
|
||||
import com.pudonghot.yo.cms.service.AuthRoleService;
|
||||
import com.pudonghot.yo.cms.service.auth.AuthRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAuthRole;
|
||||
|
||||
@ -22,14 +24,15 @@ import com.pudonghot.yo.cms.form.update.UpdateFormAuthRole;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AuthRoleServiceImpl
|
||||
extends TaggableServiceImpl<AuthRole,
|
||||
CreateFormAuthRole,
|
||||
UpdateFormAuthRole,
|
||||
AuthRoleMapper>
|
||||
extends TaggableServiceImpl<AuthRoleBO,
|
||||
CreateFormAuthRole,
|
||||
UpdateFormAuthRole,
|
||||
AuthRole,
|
||||
AuthRoleDal>
|
||||
implements AuthRoleService {
|
||||
|
||||
@Autowired
|
||||
private AuthUserRoleMapper authUserRoleMapper;
|
||||
private AuthUserRoleDal authUserRoleDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@ -37,7 +40,7 @@ public class AuthRoleServiceImpl
|
||||
@Override
|
||||
protected void validate(final CreateFormAuthRole form) {
|
||||
super.validate(form);
|
||||
Assert.state(!mapper.exists(
|
||||
Assert.state(!dal.exists(
|
||||
new Search(AuthRole.ROLE, form.getRole())),
|
||||
() -> "Auth role [" + form.getRole() + "] existed");
|
||||
}
|
||||
@ -47,7 +50,7 @@ public class AuthRoleServiceImpl
|
||||
*/
|
||||
@Override
|
||||
public List<String> listOfUser(final String account) {
|
||||
return authUserRoleMapper.listCol(AuthUserRole.ROLE,
|
||||
return authUserRoleDal.listCol(AuthUserRole.ROLE,
|
||||
new Search(AuthUserRole.ACCOUNT, account));
|
||||
}
|
||||
}
|
@ -1,24 +1,25 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.auth.impl;
|
||||
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthRoleMapper;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthUserMapper;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthUserRoleMapper;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthUserTenantMapper;
|
||||
import com.pudonghot.yo.cms.service.auth.model.AuthUserBO;
|
||||
import com.pudonghot.yo.cms.service.tag.impl.TaggableServiceImpl;
|
||||
import com.pudonghot.yo.dal.auth.AuthRoleDal;
|
||||
import com.pudonghot.yo.dal.auth.AuthUserDal;
|
||||
import com.pudonghot.yo.dal.auth.AuthUserRoleDal;
|
||||
import com.pudonghot.yo.dal.auth.AuthUserTenantDal;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthUser;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthUserRole;
|
||||
import com.pudonghot.yo.dal.auth.model.AuthUserTenant;
|
||||
import com.pudonghot.yo.dal.tenant.TenantDal;
|
||||
import lombok.val;
|
||||
import com.pudonghot.yo.dal.mapper.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.stream.Collectors;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import org.springframework.util.Assert;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.webauth.form.SessionForm;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import com.pudonghot.yo.cms.service.AuthUserService;
|
||||
import com.pudonghot.yo.cms.service.auth.AuthUserService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormAuthUser;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormAuthUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -30,20 +31,21 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AuthUserServiceImpl
|
||||
extends TaggableServiceImpl<AuthUser,
|
||||
CreateFormAuthUser,
|
||||
UpdateFormAuthUser,
|
||||
AuthUserMapper>
|
||||
extends TaggableServiceImpl<AuthUserBO,
|
||||
CreateFormAuthUser,
|
||||
UpdateFormAuthUser,
|
||||
AuthUser,
|
||||
AuthUserDal>
|
||||
implements AuthUserService {
|
||||
|
||||
@Autowired
|
||||
private AuthRoleMapper roleMapper;
|
||||
private AuthRoleDal roleDal;
|
||||
@Autowired
|
||||
private AuthUserRoleMapper userRoleMapper;
|
||||
private AuthUserRoleDal userRoleDal;
|
||||
@Autowired
|
||||
private TenantMapper tenantMapper;
|
||||
private TenantDal tenantDal;
|
||||
@Autowired
|
||||
private AuthUserTenantMapper userTenantMapper;
|
||||
private AuthUserTenantDal userTenantDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@ -51,7 +53,7 @@ public class AuthUserServiceImpl
|
||||
@Override
|
||||
protected void validate(final CreateFormAuthUser form) {
|
||||
super.validate(form);
|
||||
Assert.state(!mapper.exists(
|
||||
Assert.state(!dal.exists(
|
||||
new Search(AuthUser.ACCOUNT, form.getAccount())),
|
||||
() -> "Auth user [" + form.getAccount() + "] existed");
|
||||
}
|
||||
@ -60,9 +62,9 @@ public class AuthUserServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<AuthUser> create(final CreateFormAuthUser form) {
|
||||
public AuthUserBO create(final CreateFormAuthUser form) {
|
||||
val vm = super.create(form);
|
||||
val agent = vm.getData();
|
||||
val agent = vm;
|
||||
val roles = form.getRoles();
|
||||
if (roles != null) {
|
||||
for (final Integer roleId : roles) {
|
||||
@ -83,13 +85,13 @@ public class AuthUserServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<AuthUser> update(UpdateFormAuthUser form) {
|
||||
public AuthUserBO update(UpdateFormAuthUser form) {
|
||||
val vm = super.update(form);
|
||||
val user = vm.getData();
|
||||
val user = vm;
|
||||
val userId = user.getId();
|
||||
|
||||
// Role
|
||||
val rolesExisted = userRoleMapper.list(
|
||||
val rolesExisted = userRoleDal.list(
|
||||
new Search(AuthUserRole.USER_ID, userId)).stream()
|
||||
.map(AuthUserRole::getRoleId)
|
||||
.collect(Collectors.toSet());
|
||||
@ -101,13 +103,13 @@ public class AuthUserServiceImpl
|
||||
}
|
||||
|
||||
if (!rolesDiff.getRight().isEmpty()) {
|
||||
userRoleMapper.delete(
|
||||
userRoleDal.delete(
|
||||
new Search(AuthUserRole.USER_ID, userId)
|
||||
.in(AuthUserRole.ROLE_ID, rolesDiff.getRight()));
|
||||
}
|
||||
|
||||
// Tenant
|
||||
val tenantsExisted = userTenantMapper.list(
|
||||
val tenantsExisted = userTenantDal.list(
|
||||
new Search(AuthUserTenant.USER_ID, userId)).stream()
|
||||
.map(AuthUserTenant::getTenantId)
|
||||
.collect(Collectors.toSet());
|
||||
@ -120,7 +122,7 @@ public class AuthUserServiceImpl
|
||||
}
|
||||
|
||||
if (!tenantsDiff.getRight().isEmpty()) {
|
||||
userTenantMapper.delete(
|
||||
userTenantDal.delete(
|
||||
new Search(AuthUserTenant.USER_ID, userId)
|
||||
.in(AuthUserTenant.TENANT_ID, tenantsDiff.getRight()));
|
||||
}
|
||||
@ -134,14 +136,14 @@ public class AuthUserServiceImpl
|
||||
@Override
|
||||
public int delete(final Search search) {
|
||||
val users = list(search).stream()
|
||||
.map(AuthUser::getId)
|
||||
.map(AuthUserBO::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!users.isEmpty()) {
|
||||
log.info("Delete auth users {}.", users);
|
||||
userRoleMapper.delete(
|
||||
userRoleDal.delete(
|
||||
new Search(AuthUserRole.USER_ID, users));
|
||||
userTenantMapper.delete(
|
||||
userTenantDal.delete(
|
||||
new Search(AuthUserTenant.USER_ID, users));
|
||||
return super.delete(search);
|
||||
}
|
||||
@ -154,16 +156,16 @@ public class AuthUserServiceImpl
|
||||
*/
|
||||
@Override
|
||||
public int delete(final Integer id) {
|
||||
userRoleMapper.delete(new Search(AuthUserRole.USER_ID, id));
|
||||
userTenantMapper.delete(new Search(AuthUserTenant.USER_ID, id));
|
||||
userRoleDal.delete(new Search(AuthUserRole.USER_ID, id));
|
||||
userTenantDal.delete(new Search(AuthUserTenant.USER_ID, id));
|
||||
return super.delete(id);
|
||||
}
|
||||
|
||||
protected void insertUserRole(final AuthUser model,
|
||||
protected void insertUserRole(final AuthUserBO model,
|
||||
final Integer roleId,
|
||||
final SessionForm form) {
|
||||
|
||||
val role = roleMapper.find(roleId);
|
||||
val role = roleDal.find(roleId);
|
||||
Assert.state(role != null,
|
||||
() -> "No auth role [" + roleId + "] found");
|
||||
val arg = new AuthUserRole();
|
||||
@ -173,13 +175,13 @@ public class AuthUserServiceImpl
|
||||
arg.setRole(role.getRole());
|
||||
arg.setCreatedBy(form.getAuthAccount());
|
||||
|
||||
userRoleMapper.insert(arg);
|
||||
userRoleDal.insert(arg);
|
||||
}
|
||||
|
||||
protected void insertUserTenant(final AuthUser model,
|
||||
protected void insertUserTenant(final AuthUserBO model,
|
||||
final Integer tenantId,
|
||||
final SessionForm form) {
|
||||
val tenant = tenantMapper.find(tenantId);
|
||||
val tenant = tenantDal.find(tenantId);
|
||||
Assert.state(tenant != null,
|
||||
() -> "No tenant [" + tenantId + "] found");
|
||||
val arg = new AuthUserTenant();
|
||||
@ -189,7 +191,7 @@ public class AuthUserServiceImpl
|
||||
arg.setTenantCode(tenant.getCode());
|
||||
arg.setCreatedBy(form.getAuthAccount());
|
||||
|
||||
userTenantMapper.insert(arg);
|
||||
userTenantDal.insert(arg);
|
||||
}
|
||||
|
||||
/**
|
@ -0,0 +1,18 @@
|
||||
package com.pudonghot.yo.cms.service.auth.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import com.pudonghot.yo.cms.service.model.TaggableServModel;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 30, 2019 17:52:25
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AuthPermissionBO extends TaggableServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String permission;
|
||||
private String roles;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.cms.service.auth.model;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 30, 2019 17:54:36
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AuthPermissionRoleBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer permissionId;
|
||||
private String permission;
|
||||
private Integer roleId;
|
||||
private String role;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.pudonghot.yo.cms.service.auth.model;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.TaggableServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 30, 2019 17:49:57
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AuthRoleBO extends TaggableServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String role;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.pudonghot.yo.cms.service.auth.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.pudonghot.yo.cms.service.model.TaggableServModel;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 30, 2019 17:48:47
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AuthUserBO extends TaggableServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String name;
|
||||
private String account;
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private String password;
|
||||
private boolean admin;
|
||||
private String roles;
|
||||
private String tenants;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.cms.service.auth.model;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Nov 30, 2019 17:55:06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AuthUserRoleBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer roleId;
|
||||
private String role;
|
||||
private Integer userId;
|
||||
private String account;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.pudonghot.yo.cms.service.auth.model;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Dec 25, 2019 14:35:54
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class AuthUserTenantBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer userId;
|
||||
private String account;
|
||||
private Integer tenantId;
|
||||
private String tenantCode;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.pudonghot.yo.cms.service.callinglist;
|
||||
|
||||
import java.util.List;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallingListHistoricalSummary;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 26, 2020 21:41:42
|
||||
*/
|
||||
public interface CallingListHistoricalService {
|
||||
|
||||
/**
|
||||
* Calling list historical summary
|
||||
*
|
||||
* @param campaignId campaign id
|
||||
* @return calling list prepared summary
|
||||
*/
|
||||
List<CallingListHistoricalSummary> summary(Integer campaignId);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.pudonghot.yo.cms.service.callinglist;
|
||||
|
||||
import java.util.List;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallingListPreparedSummary;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 20, 2020 14:42:24
|
||||
*/
|
||||
public interface CallingListPreparedService {
|
||||
|
||||
/**
|
||||
* Calling list prepared summary
|
||||
*
|
||||
* @param campaignId campaign id
|
||||
* @return calling list prepared summary
|
||||
*/
|
||||
List<CallingListPreparedSummary> summary(Integer campaignId);
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
package com.pudonghot.yo.cms.service;
|
||||
package com.pudonghot.yo.cms.service.callinglist;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.pudonghot.yo.cms.form.callinglist.FormRevert;
|
||||
import com.pudonghot.yo.dal.callinglist.model.CallingList;
|
||||
import me.chyxion.tigon.service.BaseCrudByFormService;
|
||||
import com.pudonghot.yo.cms.service.callinglist.model.CallingListBO;
|
||||
import me.chyxion.tigon.service.BaseService1;
|
||||
import com.pudonghot.yo.cms.form.callinglist.FormRedial;
|
||||
import com.pudonghot.yo.dal.dbobject.CallingListSummary;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallingListSummary;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormCallingList;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormCallingList;
|
||||
import com.pudonghot.yo.cms.form.callinglist.FormImportPrepared;
|
||||
@ -17,9 +17,9 @@ import com.pudonghot.yo.cms.form.callinglist.FormImportHistorical;
|
||||
* @date Sep 20, 2020 12:12:45
|
||||
*/
|
||||
public interface CallingListService
|
||||
extends BaseCrudByFormService<Integer, CallingList,
|
||||
CreateFormCallingList,
|
||||
UpdateFormCallingList> {
|
||||
extends BaseService1<CallingListBO,
|
||||
CreateFormCallingList,
|
||||
UpdateFormCallingList> {
|
||||
|
||||
/**
|
||||
* find campaign calling list summary
|
@ -0,0 +1,26 @@
|
||||
package com.pudonghot.yo.cms.service.callinglist.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.dal.callinglist.CallingListHistoricalDal;
|
||||
import com.pudonghot.yo.cms.service.callinglist.CallingListHistoricalService;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallingListHistoricalSummary;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 26, 2020 21:41:42
|
||||
*/
|
||||
@Service
|
||||
public class CallingListHistoricalServiceImpl implements CallingListHistoricalService {
|
||||
@Autowired
|
||||
private CallingListHistoricalDal dal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<CallingListHistoricalSummary> summary(final Integer campaignId) {
|
||||
return dal.summary(campaignId);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.pudonghot.yo.cms.service.callinglist.impl;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.dal.callinglist.CallingListPreparedDal;
|
||||
import com.pudonghot.yo.cms.service.callinglist.CallingListPreparedService;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallingListPreparedSummary;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 20, 2020 14:43:56
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CallingListPreparedServiceImpl implements CallingListPreparedService {
|
||||
|
||||
@Autowired
|
||||
private CallingListPreparedDal dal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<CallingListPreparedSummary> summary(final Integer campaignId) {
|
||||
return dal.summary(campaignId);
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.callinglist.impl;
|
||||
|
||||
import com.pudonghot.yo.cms.service.callinglist.model.CallingListBO;
|
||||
import lombok.val;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@ -9,26 +10,26 @@ import me.chyxion.tigon.mybatis.Search;
|
||||
import org.springframework.util.Assert;
|
||||
import me.chyxion.tigon.kit.sequence.IdSequence;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.campaign.mapper.CampaignMapper;
|
||||
import com.pudonghot.yo.dal.campaign.CampaignDal;
|
||||
import com.pudonghot.yo.dal.callinglist.model.CallingList;
|
||||
import com.pudonghot.yo.dal.callinglist.mapper.CallingListMapper;
|
||||
import com.pudonghot.yo.cms.service.CallingListService;
|
||||
import com.pudonghot.yo.dal.callinglist.CallingListDal;
|
||||
import com.pudonghot.yo.cms.service.callinglist.CallingListService;
|
||||
import com.pudonghot.yo.cms.form.callinglist.FormRevert;
|
||||
import com.pudonghot.yo.cms.form.callinglist.FormRedial;
|
||||
import com.pudonghot.yo.dal.callinglist.mapper.CallingListPreparedMapper;
|
||||
import com.pudonghot.yo.dal.dbobject.CallingListSummary;
|
||||
import com.pudonghot.yo.dal.request.ReqCallingListRedial;
|
||||
import com.pudonghot.yo.dal.request.ReqCallingListRevert;
|
||||
import com.pudonghot.yo.dal.callinglist.mapper.CallingListHistoricalMapper;
|
||||
import com.pudonghot.yo.dal.callinglist.CallingListPreparedDal;
|
||||
import com.pudonghot.yo.dal.callinglist.dbobject.CallingListSummary;
|
||||
import com.pudonghot.yo.dal.callinglist.request.ReqCallingListRedial;
|
||||
import com.pudonghot.yo.dal.callinglist.request.ReqCallingListRevert;
|
||||
import com.pudonghot.yo.dal.callinglist.CallingListHistoricalDal;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormCallingList;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormCallingList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.pudonghot.yo.cms.form.callinglist.FormImportPrepared;
|
||||
import com.pudonghot.yo.cms.form.callinglist.FormImportHistorical;
|
||||
import me.chyxion.tigon.service.support.BaseCrudByFormServiceSupport;
|
||||
import com.pudonghot.yo.dal.request.ReqCallingListPreparedMarkAsExport;
|
||||
import com.pudonghot.yo.dal.request.ReqCallingListHistoricalMarkAsExport;
|
||||
import me.chyxion.tigon.service.support.BaseService1Support;
|
||||
import com.pudonghot.yo.dal.callinglist.request.ReqCallingListPreparedMarkAsExport;
|
||||
import com.pudonghot.yo.dal.callinglist.request.ReqCallingListHistoricalMarkAsExport;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
@ -37,19 +38,19 @@ import com.pudonghot.yo.dal.request.ReqCallingListHistoricalMarkAsExport;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CallingListServiceImpl
|
||||
extends BaseCrudByFormServiceSupport<Integer,
|
||||
CallingList,
|
||||
CreateFormCallingList,
|
||||
UpdateFormCallingList,
|
||||
CallingListMapper>
|
||||
extends BaseService1Support<CallingListBO,
|
||||
CreateFormCallingList,
|
||||
UpdateFormCallingList,
|
||||
CallingList,
|
||||
CallingListDal>
|
||||
implements CallingListService {
|
||||
|
||||
@Autowired
|
||||
private CampaignMapper campaignMapper;
|
||||
private CampaignDal campaignDal;
|
||||
@Autowired
|
||||
private CallingListPreparedMapper callingListPreparedMapper;
|
||||
private CallingListPreparedDal callingListPreparedDal;
|
||||
@Autowired
|
||||
private CallingListHistoricalMapper callingListHistoricalMapper;
|
||||
private CallingListHistoricalDal callingListHistoricalDal;
|
||||
@Autowired
|
||||
private IdSequence idSeq;
|
||||
|
||||
@ -60,7 +61,7 @@ public class CallingListServiceImpl
|
||||
protected void beforeCreate(final CreateFormCallingList form, final CallingList model) {
|
||||
super.beforeCreate(form, model);
|
||||
val campaignId = form.getCampaignId();
|
||||
val campaign = campaignMapper.find(campaignId);
|
||||
val campaign = campaignDal.find(campaignId);
|
||||
Assert.state(campaign != null,
|
||||
() -> "无效的campaign[ " + campaignId + " ]");
|
||||
model.setCampaignKey(campaign.getCampaignKey());
|
||||
@ -71,7 +72,7 @@ public class CallingListServiceImpl
|
||||
*/
|
||||
@Override
|
||||
public List<CallingListSummary> summary(final Integer campaignId) {
|
||||
return mapper.summary(campaignId);
|
||||
return dal.summary(campaignId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,7 +83,7 @@ public class CallingListServiceImpl
|
||||
val arg = form.copy(new ReqCallingListRedial());
|
||||
arg.setOperator(form.getAuthAccount());
|
||||
log.info("RedialCallingList|{}", arg);
|
||||
return mapper.redial(arg);
|
||||
return dal.redial(arg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,7 +99,7 @@ public class CallingListServiceImpl
|
||||
.eq(CallingList.TASK_KEY, taskKey)
|
||||
.eq(CallingList.STATUS, CallingList.Status.READY);
|
||||
|
||||
if (!mapper.exists(search)) {
|
||||
if (!dal.exists(search)) {
|
||||
log.warn("No calling list found to revert.");
|
||||
return 0;
|
||||
}
|
||||
@ -107,20 +108,20 @@ public class CallingListServiceImpl
|
||||
update.put(CallingList.STATUS, CallingList.Status.REVERT);
|
||||
update.put(CallingList.UPDATED_BY, form.getAuthAccount());
|
||||
update.put(CallingList.UPDATED_TIME, new Date());
|
||||
mapper.update(update, search);
|
||||
dal.update(update, search);
|
||||
|
||||
val arg = form.copy(new ReqCallingListRevert());
|
||||
arg.setOperator(form.getAuthAccount());
|
||||
log.info("RevertCallingList|{}", arg);
|
||||
|
||||
if (form.getType() == CallingList.Type.FRESH) {
|
||||
callingListPreparedMapper.revert(arg);
|
||||
callingListPreparedDal.revert(arg);
|
||||
}
|
||||
else {
|
||||
callingListHistoricalMapper.revert(arg);
|
||||
callingListHistoricalDal.revert(arg);
|
||||
}
|
||||
|
||||
return mapper.delete(new Search(CallingList.TASK_KEY, taskKey)
|
||||
return dal.delete(new Search(CallingList.TASK_KEY, taskKey)
|
||||
.eq(CallingList.STATUS, CallingList.Status.REVERT));
|
||||
}
|
||||
|
||||
@ -139,10 +140,10 @@ public class CallingListServiceImpl
|
||||
argMarkAsExport.setLimit(form.getLimit());
|
||||
argMarkAsExport.setOperator(form.getAuthAccount());
|
||||
log.info("MarkCallingListPreparedExport|{}", argMarkAsExport);
|
||||
val rows = callingListPreparedMapper.markAsExport(argMarkAsExport);
|
||||
val rows = callingListPreparedDal.markAsExport(argMarkAsExport);
|
||||
log.info("MarkCallingListPreparedExportRows|{}", rows);
|
||||
|
||||
mapper.insertPrepared(form.getAuthAccount(),
|
||||
dal.insertPrepared(form.getAuthAccount(),
|
||||
exportBatchKey,
|
||||
form.getDailyFrom(),
|
||||
form.getDailyTo());
|
||||
@ -164,10 +165,10 @@ public class CallingListServiceImpl
|
||||
argMarkAsExport.setOperator(form.getAuthAccount());
|
||||
|
||||
log.info("MarkCallingListHistoricalExport|{}", argMarkAsExport);
|
||||
val rows = callingListHistoricalMapper.markAsExport(argMarkAsExport);
|
||||
val rows = callingListHistoricalDal.markAsExport(argMarkAsExport);
|
||||
log.info("MarkCallingListHistoricalExportRows|{}", rows);
|
||||
|
||||
mapper.insertHistorical(form.getAuthAccount(),
|
||||
dal.insertHistorical(form.getAuthAccount(),
|
||||
exportBatchKey,
|
||||
form.getDailyFrom().getSecondOfDay(),
|
||||
form.getDailyTo().getSecondOfDay());
|
@ -0,0 +1,50 @@
|
||||
package com.pudonghot.yo.cms.service.callinglist.model;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import com.pudonghot.yo.basic.model.DailyTime;
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Feb 05, 2020 12:53:34
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class CallingListBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private String tenantCode;
|
||||
private Integer campaignId;
|
||||
private String campaignKey;
|
||||
private Type type;
|
||||
private Date addedTime;
|
||||
private DailyTime dailyFrom;
|
||||
private DailyTime dailyTo;
|
||||
private String phone;
|
||||
private Status status;
|
||||
private Integer calledTimes;
|
||||
private String lastConnId;
|
||||
private Date lastCallStartTime;
|
||||
private Long lastCallDuration;
|
||||
private Boolean lastConnected;
|
||||
private String lastHangupCause;
|
||||
private String taskKey;
|
||||
private String caseKey;
|
||||
private String caseData;
|
||||
private String metaData;
|
||||
private String lockKey;
|
||||
private Date lockTime;
|
||||
|
||||
public enum Status {
|
||||
NOT_READY, READY, ACHIEVED, DIALING, CALLED, CANCELED, REVERT;
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
FRESH, OLD;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.pudonghot.yo.cms.service.callinglist.model;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 26, 2020 20:47:13
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class CallingListHistoricalBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private Integer campaignId;
|
||||
private String campaignKey;
|
||||
private Date addedTime;
|
||||
private Date lastDialDate;
|
||||
private String phone;
|
||||
private String caseKey;
|
||||
private String exportBatchKey;
|
||||
private Date exportTime;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.pudonghot.yo.cms.service.callinglist.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.pudonghot.yo.cms.service.model.BaseServModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 20, 2020 13:08:26
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class CallingListPreparedBO extends BaseServModel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer tenantId;
|
||||
private String tenantCode;
|
||||
private Integer campaignId;
|
||||
private String campaignKey;
|
||||
private Date addedTime;
|
||||
private String phone;
|
||||
private String insertBatchKey;
|
||||
|
||||
/**
|
||||
* 导出到拨打名单Key
|
||||
*/
|
||||
private String exportBatchKey;
|
||||
private String caseKey;
|
||||
private String caseData;
|
||||
private String metaData;
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.pudonghot.yo.cms.service.campaign;
|
||||
|
||||
import com.pudonghot.yo.cms.service.tag.TaggableService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormCampaign;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormCampaign;
|
||||
import com.pudonghot.yo.cms.service.campaign.model.CampaignBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Jan 02, 2020 16:44:02
|
||||
*/
|
||||
public interface CampaignService
|
||||
extends TaggableService<CampaignBO,
|
||||
CreateFormCampaign,
|
||||
UpdateFormCampaign> {
|
||||
}
|
@ -1,20 +1,25 @@
|
||||
package com.pudonghot.yo.cms.service.impl;
|
||||
package com.pudonghot.yo.cms.service.campaign.impl;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.pudonghot.yo.cms.service.campaign.model.CampaignBO;
|
||||
import com.pudonghot.yo.cms.service.tag.impl.TaggableServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.val;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import me.chyxion.tigon.kit.sequence.IdSequence;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.campaign.mapper.CampaignMapper;
|
||||
import com.pudonghot.yo.dal.campaign.CampaignDal;
|
||||
import com.pudonghot.yo.dal.campaign.model.Campaign;
|
||||
import com.pudonghot.yo.webauth.form.SessionForm;
|
||||
import com.pudonghot.yo.cms.service.CampaignService;
|
||||
import com.pudonghot.yo.cms.service.campaign.CampaignService;
|
||||
import com.pudonghot.yo.cms.form.create.CreateFormCampaign;
|
||||
import com.pudonghot.yo.dal.campaign.mapper.CampaignTrunkStrategyMapper;
|
||||
import com.pudonghot.yo.dal.campaign.CampaignTrunkStrategyDal;
|
||||
import com.pudonghot.yo.dal.campaign.model.CampaignTrunkStrategy;
|
||||
import com.pudonghot.yo.cms.form.update.UpdateFormCampaign;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -27,28 +32,29 @@ import com.pudonghot.yo.basic.model.campaign.enumeration.CampaignStatusEnum;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CampaignServiceImpl
|
||||
extends TaggableServiceImpl<Campaign,
|
||||
CreateFormCampaign,
|
||||
UpdateFormCampaign,
|
||||
CampaignMapper>
|
||||
extends TaggableServiceImpl<CampaignBO,
|
||||
CreateFormCampaign,
|
||||
UpdateFormCampaign,
|
||||
Campaign,
|
||||
CampaignDal>
|
||||
implements CampaignService {
|
||||
|
||||
@Autowired
|
||||
private IdSequence idSeq;
|
||||
@Autowired
|
||||
private CampaignTrunkStrategyMapper campaignTrunkStrategyMapper;
|
||||
private CampaignTrunkStrategyDal campaignTrunkStrategyDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<Campaign> create(final CreateFormCampaign form) {
|
||||
final ViewModel<Campaign> vm = super.create(form);
|
||||
public CampaignBO create(final CreateFormCampaign form) {
|
||||
val vm = super.create(form);
|
||||
|
||||
final Campaign agentGroup = vm.getData();
|
||||
final Integer[] strategies = form.getTrunkStrategies();
|
||||
val agentGroup = vm;
|
||||
val strategies = form.getTrunkStrategies();
|
||||
if (strategies != null) {
|
||||
for (final Integer strategy : strategies) {
|
||||
for (val strategy : strategies) {
|
||||
insertTrunkStrategy(agentGroup, strategy, form);
|
||||
}
|
||||
}
|
||||
@ -59,26 +65,26 @@ public class CampaignServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ViewModel<Campaign> update(final UpdateFormCampaign form) {
|
||||
final ViewModel<Campaign> vm = super.update(form);
|
||||
final Campaign agentGroup = vm.getData();
|
||||
final Integer agentGroupId = agentGroup.getId();
|
||||
public CampaignBO update(final UpdateFormCampaign form) {
|
||||
val vm = super.update(form);
|
||||
val agentGroup = vm;
|
||||
val agentGroupId = agentGroup.getId();
|
||||
|
||||
final Set<Integer> strategiesExisted = campaignTrunkStrategyMapper.list(
|
||||
val strategiesExisted = campaignTrunkStrategyDal.list(
|
||||
new Search(CampaignTrunkStrategy.CAMPAIGN_ID,
|
||||
agentGroupId)).stream()
|
||||
.map(CampaignTrunkStrategy::getTrunkStrategyId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
final Pair<Set<Integer>, Set<Integer>> strategiesDiff =
|
||||
val strategiesDiff =
|
||||
diff(strategiesExisted, form.getTrunkStrategies());
|
||||
|
||||
for (final Integer strategyId : strategiesDiff.getLeft()) {
|
||||
for (val strategyId : strategiesDiff.getLeft()) {
|
||||
insertTrunkStrategy(agentGroup, strategyId, form);
|
||||
}
|
||||
|
||||
if (!strategiesDiff.getRight().isEmpty()) {
|
||||
campaignTrunkStrategyMapper.delete(
|
||||
campaignTrunkStrategyDal.delete(
|
||||
new Search(CampaignTrunkStrategy.CAMPAIGN_ID, agentGroupId)
|
||||
.in(CampaignTrunkStrategy.TRUNK_STRATEGY_ID,
|
||||
strategiesDiff.getRight()));
|
||||
@ -98,7 +104,7 @@ public class CampaignServiceImpl
|
||||
}
|
||||
}
|
||||
|
||||
protected void insertTrunkStrategy(final Campaign agentGroup,
|
||||
protected void insertTrunkStrategy(final CampaignBO agentGroup,
|
||||
final Integer strategyId,
|
||||
final SessionForm form) {
|
||||
final CampaignTrunkStrategy model =
|
||||
@ -110,6 +116,6 @@ public class CampaignServiceImpl
|
||||
model.setCreatedBy(form.getAuthAccount());
|
||||
|
||||
log.info("Insert agent group trunk strategy [{}].", model);
|
||||
campaignTrunkStrategyMapper.insert(model);
|
||||
campaignTrunkStrategyDal.insert(model);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user