feat: add home controller
This commit is contained in:
parent
bdac588824
commit
10315c6e0c
@ -299,7 +299,7 @@ public class TrunkServiceImpl
|
||||
|
||||
entityExtData.setTrunkAttrsList(beanService.convert(trunkAttrDal.listAll(tenantId), TrunkAttrBO.class));
|
||||
entityExtData.setInboundTargetTypesList(Arrays.asList(TrunkInboundTargetTypeEnum.values()));
|
||||
entityExtData.setAgentsList(beanService.convert(agentDal.listAll(tenantId), AgentBO.class));
|
||||
entityExtData.setAgentsList(beanService.convert(agentDal.listAll(), AgentBO.class));
|
||||
entityExtData.setAgentGroupsList(beanService.convert(agentGroupDal.listAll(tenantId), AgentGroupBO.class));
|
||||
entityExtData.setQueuesList(beanService.convert(queueDal.listAll(tenantId), QueueBO.class));
|
||||
entityExtData.setIvrMenusList(beanService.convert(ivrMenuDal.listAll(tenantId), IvrMenuBO.class));
|
||||
|
115
deploy
Executable file
115
deploy
Executable file
@ -0,0 +1,115 @@
|
||||
#!/bin/bash
|
||||
|
||||
# get real path of softlink
|
||||
get_real_path() {
|
||||
local f="$1"
|
||||
while [ -h "$f" ]; do
|
||||
ls=`ls -ld "$f"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
f="$link"
|
||||
else
|
||||
f=`dirname "$f"`/"$link"
|
||||
fi
|
||||
done
|
||||
echo "$f"
|
||||
}
|
||||
|
||||
prg_path=$(get_real_path "$0")
|
||||
echo "Script Path [$prg_path]"
|
||||
pushd $(dirname "$prg_path") > /dev/null
|
||||
PROJECT_HOME=$(pwd)
|
||||
echo "Project Home [$PROJECT_HOME]"
|
||||
|
||||
# if [[ ! -z "$1" ]]; then
|
||||
# APP=${1%/}
|
||||
# else
|
||||
# echo "App required."
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
|
||||
if [[ "$1" =~ cms/? ]]; then
|
||||
MODULE="cms/web"
|
||||
APP='cms-stage'
|
||||
|
||||
if [[ "$2" = 'yhp' ]]; then
|
||||
SERVER=yunhuipai@yhp-01
|
||||
fi
|
||||
|
||||
elif [[ "$1" =~ mpapi/? ]]; then
|
||||
MODULE='mpapi'
|
||||
APP='mpapi-stage'
|
||||
|
||||
if [[ "$2" = 'yhp' ]]; then
|
||||
SERVER=yunhuipai@yhp-01
|
||||
fi
|
||||
elif [[ "$1" =~ operation/? ]]; then
|
||||
MODULE='operation/web'
|
||||
APP='operation'
|
||||
elif [[ "$1" =~ one/? ]]; then
|
||||
MODULE="yunhuipai/one/web"
|
||||
APP='one'
|
||||
SERVER=yunhuipai@yhp-00
|
||||
elif [[ "$1" =~ portal/? ]]; then
|
||||
MODULE='yunhuipai/portal/web'
|
||||
APP='portal'
|
||||
SERVER=yunhuipai@yhp-00
|
||||
elif [[ "$1" =~ h5/? ]]; then
|
||||
MODULE='yunhuipai/portal/h5'
|
||||
APP='h5'
|
||||
else
|
||||
echo 'Arg module required.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$2" = 'zj' ]]; then
|
||||
SERVICE_HOME=/data/program/${APP}
|
||||
SERVER=apache@huitong
|
||||
MVN_PROFILE=cmp
|
||||
elif [[ "$2" = 'yhp' ]]; then
|
||||
SERVICE_HOME=/opt/application/${APP}
|
||||
MVN_PROFILE=yhp
|
||||
elif [[ "$2" = 'prod' ]]; then
|
||||
SERVER=xiandou@cy-crm
|
||||
SERVICE_HOME=/opt/application/${APP}
|
||||
MVN_PROFILE=default
|
||||
else
|
||||
echo "Profile required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mvn -P $MVN_PROFILE clean package -o -pl $MODULE -am -DskipTests -T 4C
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo 'Maven build failed.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARGET_DIR=$MODULE/target
|
||||
echo "Target dir [$TARGET_DIR]"
|
||||
JAR=$(find "$TARGET_DIR" -maxdepth 1 -type f -name "*.jar" | grep -v "sources.jar$")
|
||||
|
||||
if [ -z "$JAR" ]; then
|
||||
echo "Build target JAR is blank, exit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Target JAR [$JAR] found"
|
||||
|
||||
echo "Service Home [$SERVICE_HOME], Server [$SERVER]"
|
||||
|
||||
echo "$SERVER [ -f $SERVICE_HOME/lib/main.jar ] && mv $SERVICE_HOME/lib/main.jar $SERVICE_HOME/lib/main_prev.jar"
|
||||
ssh "$SERVER" "[ -f $SERVICE_HOME/lib/main.jar ] && mv $SERVICE_HOME/lib/main.jar $SERVICE_HOME/lib/main_prev.jar"
|
||||
|
||||
echo "$JAR $SERVER:$SERVICE_HOME/lib/main.jar"
|
||||
scp "$JAR" "$SERVER:$SERVICE_HOME/lib/main.jar"
|
||||
|
||||
echo "$SERVER $SERVICE_HOME/bin/stop.sh"
|
||||
ssh "$SERVER" "$SERVICE_HOME/bin/stop.sh"
|
||||
|
||||
echo "$SERVER $SERVICE_HOME/bin/start.sh"
|
||||
ssh "$SERVER" "$SERVICE_HOME/bin/start.sh"
|
||||
|
||||
popd > /dev/null
|
||||
|
@ -17,10 +17,9 @@ public interface AgentDal extends BaseDal<Long, Agent> {
|
||||
/**
|
||||
* list all
|
||||
*
|
||||
* @param tenantId
|
||||
* @return
|
||||
* @return agents
|
||||
*/
|
||||
List<Agent> listAll(Long tenantId);
|
||||
List<Agent> listAll();
|
||||
|
||||
/**
|
||||
* find agent by domain and account
|
||||
|
@ -4,12 +4,12 @@ import java.util.List;
|
||||
import com.pudonghot.tigon.mybatis.Search;
|
||||
import com.pudonghot.yo.dal.agent.AgentDal;
|
||||
import com.pudonghot.yo.dal.agent.model.Agent;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.tigon.dal.annotation.ListApi;
|
||||
import com.pudonghot.tigon.dal.request.FindDalReq;
|
||||
import com.pudonghot.tigon.dal.request.ListDalReq;
|
||||
import com.pudonghot.tigon.dal.annotation.FilterCol;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.yo.dal.common.TaggableDalImpl;
|
||||
import com.pudonghot.tigon.dal.annotation.FilterCol;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentMapper;
|
||||
import com.pudonghot.tigon.dal.annotation.TenantResource;
|
||||
|
||||
@ -61,9 +61,8 @@ public class AgentDalImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<Agent> listAll(final Long tenantId) {
|
||||
return list(Search.of(Agent.TENANT_ID, tenantId)
|
||||
.isTrue(Agent.ACTIVE));
|
||||
public List<Agent> listAll() {
|
||||
return list(Search.of().isTrue(Agent.ACTIVE));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -36,7 +36,7 @@
|
||||
<include refid="table" />
|
||||
<include refid="TaggableMapper.tagsFilterJoin" />
|
||||
<include refid="trunkStrategiesFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="trunkStrategiesCol">
|
||||
|
@ -34,7 +34,7 @@
|
||||
<include refid="table" />
|
||||
<include refid="TaggableMapper.tagsFilterJoin" />
|
||||
<include refid="queuesFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="queuesCol">
|
||||
|
@ -52,7 +52,7 @@
|
||||
<include refid="table" />
|
||||
<include refid="TaggableMapper.tagsFilterJoin" />
|
||||
<include refid="rolesFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="rolesCol">
|
||||
|
@ -36,7 +36,7 @@
|
||||
<include refid="TaggableMapper.tagsFilterJoin" />
|
||||
<include refid="rolesFilterJoin" />
|
||||
<include refid="tenantsFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="rolesCol">
|
||||
|
@ -34,7 +34,7 @@
|
||||
<include refid="table" />
|
||||
<include refid="TaggableMapper.tagsFilterJoin" />
|
||||
<include refid="trunkStrategiesFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="trunkStrategiesCol">
|
||||
|
@ -22,7 +22,7 @@
|
||||
select count(<include refid="primaryKey" />) from
|
||||
<include refid="table" />
|
||||
<include refid="TaggableMapper.tagsFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</sql>
|
||||
|
||||
<sql id="tagsCol">
|
||||
|
@ -8,7 +8,7 @@ import com.pudonghot.tigon.dal.annotation.ListApi;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.yo.dal.tenant.model.Tenant;
|
||||
import com.pudonghot.tigon.dal.annotation.FilterCol;
|
||||
import com.pudonghot.yo.dal.tenant.mapper.TenantMapper;
|
||||
import com.pudonghot.yo.dal.tenant.mapper.Tenant2Mapper;
|
||||
|
||||
/**
|
||||
* 租户
|
||||
@ -23,9 +23,9 @@ import com.pudonghot.yo.dal.tenant.mapper.TenantMapper;
|
||||
filterCols = {
|
||||
@FilterCol(Tenant.ACTIVE)
|
||||
})
|
||||
@Component
|
||||
@Component("yoTenantDalImpl")
|
||||
public class TenantDalImpl
|
||||
extends BaseDalImpl<Long, Tenant, TenantMapper>
|
||||
extends BaseDalImpl<Long, Tenant, Tenant2Mapper>
|
||||
implements TenantDal {
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
* @author Donghuang
|
||||
* @date Oct 28, 2019 14:11:50
|
||||
*/
|
||||
public interface TenantMapper extends BaseMapper<Long, Tenant> {
|
||||
public interface Tenant2Mapper extends BaseMapper<Long, Tenant> {
|
||||
|
||||
/**
|
||||
* list tenants of account
|
@ -7,7 +7,7 @@
|
||||
* @date Oct 28, 2019 14:12:11
|
||||
*/
|
||||
-->
|
||||
<mapper namespace="com.pudonghot.yo.dal.tenant.mapper.TenantMapper">
|
||||
<mapper namespace="com.pudonghot.yo.dal.tenant.mapper.Tenant2Mapper">
|
||||
|
||||
<select id="listOfUser" resultType="com.pudonghot.yo.dal.tenant.model.Tenant">
|
||||
select t.* from br_tenant t
|
@ -147,7 +147,7 @@
|
||||
<include refid="TaggableMapper.tagsFilterJoin" />
|
||||
<include refid="strategiesFilterJoin" />
|
||||
<include refid="attrsFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="strategiesCol">
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.pudonghot.yo.dal.mapper;
|
||||
|
||||
import com.pudonghot.yo.dal.tenant.mapper.TenantMapper;
|
||||
import com.pudonghot.yo.dal.tenant.mapper.Tenant2Mapper;
|
||||
import org.junit.Test;
|
||||
import com.pudonghot.tigon.mybatis.Search;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class TenantMapperTest extends TestBase {
|
||||
@Autowired
|
||||
private TenantMapper mapper;
|
||||
private Tenant2Mapper mapper;
|
||||
|
||||
@Test
|
||||
public void testList() {
|
||||
|
@ -18,7 +18,7 @@ import com.pudonghot.yo.basic.model.ValueTextModel;
|
||||
import com.pudonghot.yo.webauth.service.AuthService;
|
||||
import com.pudonghot.yo.dal.agent.mapper.AgentMapper;
|
||||
import com.pudonghot.yo.dal.auth.mapper.AuthUserMapper;
|
||||
import com.pudonghot.yo.dal.tenant.mapper.TenantMapper;
|
||||
import com.pudonghot.yo.dal.tenant.mapper.Tenant2Mapper;
|
||||
import org.apache.shiro.subject.SimplePrincipalCollection;
|
||||
import org.apache.shiro.subject.support.DelegatingSubject;
|
||||
import com.pudonghot.yo.webauth.response.AuthInfoServResp;
|
||||
@ -42,7 +42,7 @@ public class AuthServiceImpl implements AuthService {
|
||||
@Autowired
|
||||
private RedisClientApi redisClientApi;
|
||||
@Autowired
|
||||
private TenantMapper tenantDal;
|
||||
private Tenant2Mapper tenantDal;
|
||||
@Autowired
|
||||
private AuthUserMapper authUserDal;
|
||||
@Autowired
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.pudonghot.yo.operation.dal.agent;
|
||||
|
||||
import com.pudonghot.yo.operation.dal.agent.model.AgentDO;
|
||||
import java.util.List;
|
||||
import com.pudonghot.tigon.dal.BaseDal;
|
||||
import com.pudonghot.yo.operation.dal.agent.model.AgentDO;
|
||||
|
||||
/**
|
||||
* 调解员表
|
||||
@ -9,5 +10,7 @@ import com.pudonghot.tigon.dal.BaseDal;
|
||||
* @author Donghuang
|
||||
* @date Oct 01, 2024 14:18:46
|
||||
*/
|
||||
public interface AgentDal extends BaseDal<Long, AgentDO> {
|
||||
public interface Agent2Dal extends BaseDal<Long, AgentDO> {
|
||||
|
||||
List<AgentDO> listAll();
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.pudonghot.yo.operation.dal.agent.impl;
|
||||
|
||||
import com.pudonghot.tigon.dal.model.BaseDbEntity;
|
||||
import com.pudonghot.tigon.mybatis.Search;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.yo.operation.dal.agent.model.AgentDO;
|
||||
import com.pudonghot.yo.operation.dal.agent.mapper.Agent2Mapper;
|
||||
import com.pudonghot.yo.operation.dal.agent.Agent2Dal;
|
||||
import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调解员表
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 01, 2024 14:18:46
|
||||
*/
|
||||
@Component
|
||||
public class Agent2DalImpl
|
||||
extends BaseDalImpl<Long, AgentDO, Agent2Mapper>
|
||||
implements Agent2Dal {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<AgentDO> listAll() {
|
||||
return list(Search.of(BaseDbEntity.Fields.active, Boolean.TRUE));
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.pudonghot.yo.operation.dal.agent.impl;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.yo.operation.dal.agent.model.AgentDO;
|
||||
import com.pudonghot.yo.operation.dal.agent.mapper.AgentMapper;
|
||||
import com.pudonghot.yo.operation.dal.agent.AgentDal;
|
||||
import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
|
||||
/**
|
||||
* 调解员表
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 01, 2024 14:18:46
|
||||
*/
|
||||
@Component
|
||||
public class AgentDalImpl
|
||||
extends BaseDalImpl<Long, AgentDO, AgentMapper>
|
||||
implements AgentDal {
|
||||
}
|
@ -13,5 +13,5 @@ import com.pudonghot.yo.operation.dal.agent.model.AgentDO;
|
||||
*/
|
||||
@Mapper
|
||||
@Table("agent")
|
||||
public interface AgentMapper extends BaseMapper<Long, AgentDO> {
|
||||
public interface Agent2Mapper extends BaseMapper<Long, AgentDO> {
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.pudonghot.yo.operation.dal.agent.mapper.AgentMapper">
|
||||
<mapper namespace="com.pudonghot.yo.operation.dal.agent.mapper.Agent2Mapper">
|
||||
<!--
|
||||
/**
|
||||
* 调解员表
|
@ -0,0 +1,22 @@
|
||||
package com.pudonghot.yo.operation.dal.dept;
|
||||
|
||||
import com.pudonghot.tigon.dal.BaseDal;
|
||||
import com.pudonghot.yo.operation.dal.dept.model.DeptDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调解组织结构
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 12:12:11
|
||||
*/
|
||||
public interface DeptDal extends BaseDal<Long, DeptDO> {
|
||||
|
||||
/**
|
||||
* list top
|
||||
*
|
||||
* @return top depts
|
||||
*/
|
||||
List<DeptDO> listTop();
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.pudonghot.yo.operation.dal.dept.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.pudonghot.tigon.mybatis.Search;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
import com.pudonghot.tigon.dal.model.BaseDbEntity;
|
||||
import com.pudonghot.yo.operation.dal.dept.DeptDal;
|
||||
import com.pudonghot.yo.operation.dal.dept.model.DeptDO;
|
||||
import com.pudonghot.yo.operation.dal.dept.mapper.DeptMapper;
|
||||
|
||||
/**
|
||||
* 调解组织结构
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 12:12:11
|
||||
*/
|
||||
@Component
|
||||
public class DeptDalImpl
|
||||
extends BaseDalImpl<Long, DeptDO, DeptMapper>
|
||||
implements DeptDal {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<DeptDO> listTop() {
|
||||
return list(Search.of(DeptDO.Fields.parentId, 0L)
|
||||
.isFalse(BaseDbEntity.Fields.deleted)
|
||||
.isTrue(BaseDbEntity.Fields.active));
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.pudonghot.yo.operation.dal.dept.mapper;
|
||||
|
||||
import com.pudonghot.tigon.mybatis.Table;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.pudonghot.tigon.mybatis.BaseMapper;
|
||||
import com.pudonghot.yo.operation.dal.dept.model.DeptDO;
|
||||
|
||||
/**
|
||||
* 调解组织结构
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 12:12:11
|
||||
*/
|
||||
@Mapper
|
||||
@Table("tj_dept")
|
||||
public interface DeptMapper extends BaseMapper<Long, DeptDO> {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.pudonghot.yo.operation.dal.dept.mapper.DeptMapper">
|
||||
<!--
|
||||
/**
|
||||
* 调解组织结构
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 12:12:11
|
||||
*/
|
||||
-->
|
||||
</mapper>
|
@ -0,0 +1,35 @@
|
||||
package com.pudonghot.yo.operation.dal.dept.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import com.pudonghot.tigon.mybatis.NotUpdate;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import com.pudonghot.tigon.dal.model.BaseDbEntity;
|
||||
import com.pudonghot.tigon.mybatis.UseGeneratedKeys;
|
||||
import com.pudonghot.tigon.mybatis.NotUpdateWhenNull;
|
||||
|
||||
/**
|
||||
* 调解组织结构
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 12:12:11
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@UseGeneratedKeys
|
||||
@FieldNameConstants
|
||||
public class DeptDO extends BaseDbEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@NotUpdate
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotUpdateWhenNull
|
||||
private String name;
|
||||
}
|
@ -3,6 +3,8 @@ package com.pudonghot.yo.operation.dal.loanimport;
|
||||
import com.pudonghot.yo.operation.dal.loanimport.model.BatchNumberDO;
|
||||
import com.pudonghot.tigon.dal.BaseDal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 导入批次号
|
||||
*
|
||||
@ -10,4 +12,11 @@ import com.pudonghot.tigon.dal.BaseDal;
|
||||
* @date Oct 01, 2024 14:21:59
|
||||
*/
|
||||
public interface BatchNumberDal extends BaseDal<Long, BatchNumberDO> {
|
||||
|
||||
/**
|
||||
* commission org list
|
||||
*
|
||||
* @return commission org list
|
||||
*/
|
||||
List<String> commissionOrgList();
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
package com.pudonghot.yo.operation.dal.loanimport.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
import com.pudonghot.yo.operation.dal.loanimport.BatchNumberDal;
|
||||
import com.pudonghot.yo.operation.dal.loanimport.model.BatchNumberDO;
|
||||
import com.pudonghot.yo.operation.dal.loanimport.mapper.BatchNumberMapper;
|
||||
import com.pudonghot.yo.operation.dal.loanimport.BatchNumberDal;
|
||||
import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
|
||||
/**
|
||||
* 导入批次号
|
||||
@ -16,4 +17,12 @@ import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
public class BatchNumberDalImpl
|
||||
extends BaseDalImpl<Long, BatchNumberDO, BatchNumberMapper>
|
||||
implements BatchNumberDal {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<String> commissionOrgList() {
|
||||
return mapper.commissionOrgList();
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import com.pudonghot.tigon.mybatis.BaseMapper;
|
||||
import com.pudonghot.yo.operation.dal.loanimport.model.BatchNumberDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 导入批次号
|
||||
*
|
||||
@ -14,4 +16,11 @@ import com.pudonghot.yo.operation.dal.loanimport.model.BatchNumberDO;
|
||||
@Mapper
|
||||
@Table("import_batch_number")
|
||||
public interface BatchNumberMapper extends BaseMapper<Long, BatchNumberDO> {
|
||||
|
||||
/**
|
||||
* commission org list
|
||||
*
|
||||
* @return commission org list
|
||||
*/
|
||||
List<String> commissionOrgList();
|
||||
}
|
||||
|
@ -10,4 +10,11 @@
|
||||
* @date Oct 01, 2024 14:21:59
|
||||
*/
|
||||
-->
|
||||
|
||||
<select id="commissionOrgList" resultType="string">
|
||||
select distinct commission_org
|
||||
from <include refid="table" />
|
||||
where deleted = 0
|
||||
and active = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.pudonghot.yo.operation.dal.sms;
|
||||
|
||||
import com.pudonghot.yo.operation.dal.sms.model.SmsRecordDO;
|
||||
import com.pudonghot.tigon.dal.BaseDal;
|
||||
|
||||
/**
|
||||
* 短信发送记录
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
public interface SmsRecordDal extends BaseDal<Long, SmsRecordDO> {
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.dal.sms;
|
||||
|
||||
import java.util.List;
|
||||
import com.pudonghot.tigon.dal.BaseDal;
|
||||
import com.pudonghot.yo.operation.dal.sms.model.SmsTemplateDO;
|
||||
|
||||
/**
|
||||
* 短信模板
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
public interface SmsTemplateDal extends BaseDal<Long, SmsTemplateDO> {
|
||||
|
||||
/**
|
||||
* list all active
|
||||
*
|
||||
* @return sms templates
|
||||
*/
|
||||
List<SmsTemplateDO> listAllActive();
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.pudonghot.yo.operation.dal.sms.impl;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.yo.operation.dal.sms.model.SmsRecordDO;
|
||||
import com.pudonghot.yo.operation.dal.sms.mapper.SmsRecordMapper;
|
||||
import com.pudonghot.yo.operation.dal.sms.SmsRecordDal;
|
||||
import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
|
||||
/**
|
||||
* 短信发送记录
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
@Component
|
||||
public class SmsRecordDalImpl
|
||||
extends BaseDalImpl<Long, SmsRecordDO, SmsRecordMapper>
|
||||
implements SmsRecordDal {
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.pudonghot.yo.operation.dal.sms.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.pudonghot.tigon.mybatis.Search;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.pudonghot.tigon.dal.impl.BaseDalImpl;
|
||||
import com.pudonghot.tigon.dal.model.BaseDbEntity;
|
||||
import com.pudonghot.yo.operation.dal.sms.SmsTemplateDal;
|
||||
import com.pudonghot.yo.operation.dal.sms.model.SmsTemplateDO;
|
||||
import com.pudonghot.yo.operation.dal.sms.mapper.SmsTemplateMapper;
|
||||
|
||||
/**
|
||||
* 短信模板
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
@Component
|
||||
public class SmsTemplateDalImpl
|
||||
extends BaseDalImpl<Long, SmsTemplateDO, SmsTemplateMapper>
|
||||
implements SmsTemplateDal {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<SmsTemplateDO> listAllActive() {
|
||||
return list(Search.of(BaseDbEntity.Fields.active, Boolean.TRUE));
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.pudonghot.yo.operation.dal.sms.mapper;
|
||||
|
||||
import com.pudonghot.tigon.mybatis.Table;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.pudonghot.tigon.mybatis.BaseMapper;
|
||||
import com.pudonghot.yo.operation.dal.sms.model.SmsRecordDO;
|
||||
|
||||
/**
|
||||
* 短信发送记录
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
@Mapper
|
||||
@Table("sms_record")
|
||||
public interface SmsRecordMapper extends BaseMapper<Long, SmsRecordDO> {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.pudonghot.yo.operation.dal.sms.mapper.SmsRecordMapper">
|
||||
<!--
|
||||
/**
|
||||
* 短信发送记录
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
-->
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
package com.pudonghot.yo.operation.dal.sms.mapper;
|
||||
|
||||
import com.pudonghot.tigon.mybatis.Table;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.pudonghot.tigon.mybatis.BaseMapper;
|
||||
import com.pudonghot.yo.operation.dal.sms.model.SmsTemplateDO;
|
||||
|
||||
/**
|
||||
* 短信模板
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
@Mapper
|
||||
@Table("sms_template")
|
||||
public interface SmsTemplateMapper extends BaseMapper<Long, SmsTemplateDO> {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.pudonghot.yo.operation.dal.sms.mapper.SmsTemplateMapper">
|
||||
<!--
|
||||
/**
|
||||
* 短信模板
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
-->
|
||||
</mapper>
|
@ -0,0 +1,76 @@
|
||||
package com.pudonghot.yo.operation.dal.sms.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import com.pudonghot.tigon.dal.model.BaseDbEntity;
|
||||
import com.pudonghot.tigon.mybatis.UseGeneratedKeys;
|
||||
|
||||
/**
|
||||
* 短信发送记录
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@UseGeneratedKeys
|
||||
@FieldNameConstants
|
||||
public class SmsRecordDO extends BaseDbEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 案件关联id
|
||||
*/
|
||||
private Long loanId;
|
||||
|
||||
/**
|
||||
* 联系人id
|
||||
*/
|
||||
private Long contactId;
|
||||
|
||||
/**
|
||||
* 调解员ID
|
||||
*/
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 案件关联id
|
||||
*/
|
||||
private Long templateId;
|
||||
|
||||
/**
|
||||
* 发送手机号
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 短信内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 短信类型:self or thirdParty
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 发送者
|
||||
*/
|
||||
private String sender;
|
||||
|
||||
/**
|
||||
* 发送请求
|
||||
*/
|
||||
private String request;
|
||||
|
||||
/**
|
||||
* 发送响应
|
||||
*/
|
||||
private String response;
|
||||
|
||||
/**
|
||||
* 发送结果:SUCCESS FAIL 等
|
||||
*/
|
||||
private String result;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.pudonghot.yo.operation.dal.sms.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import com.pudonghot.tigon.dal.model.BaseDbEntity;
|
||||
import com.pudonghot.tigon.mybatis.UseGeneratedKeys;
|
||||
|
||||
/**
|
||||
* 短信模板
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:44:21
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@UseGeneratedKeys
|
||||
@FieldNameConstants
|
||||
public class SmsTemplateDO extends BaseDbEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 短信标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 短信内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 短信类型:self or thirdParty
|
||||
*/
|
||||
private String type;
|
||||
}
|
@ -62,6 +62,10 @@
|
||||
</dependency>
|
||||
|
||||
<!-- 2nd Dependencies -->
|
||||
<dependency>
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
<artifactId>yo-dal</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pudonghot.yo</groupId>
|
||||
<artifactId>yo-tj-operation-dal</artifactId>
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.pudonghot.yo.operation.service.auth;
|
||||
|
||||
import com.pudonghot.yo.operation.service.auth.response.AuthInfoBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 03, 2024 13:54:49
|
||||
*/
|
||||
public interface AuthService {
|
||||
|
||||
/**
|
||||
* get auth info
|
||||
*
|
||||
* @return auth info
|
||||
*/
|
||||
AuthInfoBO authInfo(String account);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.pudonghot.yo.operation.service.auth.impl;
|
||||
|
||||
import lombok.val;
|
||||
import com.pudonghot.tigon.dal.hook.AuthHook;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.yo.dal.auth.AuthPermissionDal;
|
||||
import com.pudonghot.yo.operation.service.auth.AuthService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.operation.service.auth.response.AuthInfoBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 03, 2024 13:56:46
|
||||
*/
|
||||
@Service
|
||||
public class AuthServiceImpl implements AuthService {
|
||||
|
||||
@Autowired
|
||||
private AuthHook<Long> authHook;
|
||||
@Autowired
|
||||
private AuthPermissionDal authPermissionDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public AuthInfoBO authInfo(final String account) {
|
||||
val resp = new AuthInfoBO();
|
||||
resp.setAccount(account);
|
||||
resp.setPerms(authPermissionDal.listOfUser(account));
|
||||
return resp;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.pudonghot.yo.operation.service.auth.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 03, 2024 13:55:48
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class AuthInfoBO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* account
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* permissions
|
||||
*/
|
||||
private List<String> perms;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.pudonghot.yo.operation.service.home;
|
||||
|
||||
import java.util.List;
|
||||
import com.pudonghot.yo.operation.service.home.response.AgentListRespBO;
|
||||
import com.pudonghot.yo.operation.service.home.response.DeptListRespBO;
|
||||
import com.pudonghot.yo.operation.service.home.response.SmsTplListRespBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 04, 2024 16:35:45
|
||||
*/
|
||||
public interface HomeService {
|
||||
|
||||
/**
|
||||
* all agent list
|
||||
*
|
||||
* @return agents
|
||||
*/
|
||||
List<AgentListRespBO> agentList();
|
||||
|
||||
/**
|
||||
* commission org list
|
||||
* @return commission org list
|
||||
*/
|
||||
List<String> commissionOrgList();
|
||||
|
||||
/**
|
||||
* all sms template list
|
||||
*
|
||||
* @return sms tpl list
|
||||
*/
|
||||
List<SmsTplListRespBO> smsTplList();
|
||||
|
||||
/**
|
||||
* dept list
|
||||
*
|
||||
* @return dept list
|
||||
*/
|
||||
List<DeptListRespBO> deptList();
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.pudonghot.yo.operation.service.home.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.pudonghot.yo.dal.agent.AgentDal;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.tigon.kit.bean.BeanService;
|
||||
import com.pudonghot.yo.operation.dal.dept.DeptDal;
|
||||
import com.pudonghot.yo.operation.dal.sms.SmsTemplateDal;
|
||||
import com.pudonghot.yo.operation.service.home.HomeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.operation.dal.loanimport.BatchNumberDal;
|
||||
import com.pudonghot.yo.operation.service.home.response.DeptListRespBO;
|
||||
import com.pudonghot.yo.operation.service.home.response.AgentListRespBO;
|
||||
import com.pudonghot.yo.operation.service.home.response.SmsTplListRespBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 04, 2024 16:36:30
|
||||
*/
|
||||
@Service
|
||||
public class HomeServiceImpl implements HomeService {
|
||||
|
||||
@Autowired
|
||||
private AgentDal agentDal;
|
||||
@Autowired
|
||||
private BeanService beanService;
|
||||
@Autowired
|
||||
private BatchNumberDal batchNumberDal;
|
||||
@Autowired
|
||||
private SmsTemplateDal smsTemplateDal;
|
||||
@Autowired
|
||||
private DeptDal deptDal;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<AgentListRespBO> agentList() {
|
||||
return beanService.convert(agentDal.listAll(), AgentListRespBO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<String> commissionOrgList() {
|
||||
return batchNumberDal.commissionOrgList();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<SmsTplListRespBO> smsTplList() {
|
||||
return beanService.convert(smsTemplateDal.listAllActive(), SmsTplListRespBO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<DeptListRespBO> deptList() {
|
||||
return beanService.convert(deptDal.listTop(), DeptListRespBO.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.service.home.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 04, 2024 16:33:47
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class AgentListRespBO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private String account;
|
||||
private String name;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.service.home.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 04, 2024 16:33:47
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class DeptListRespBO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.service.home.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 04, 2024 16:33:47
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class SmsTplListRespBO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private String title;
|
||||
private String content;
|
||||
}
|
@ -1,8 +1,19 @@
|
||||
package com.pudonghot.yo.operation.service.loanimport;
|
||||
|
||||
import com.pudonghot.yo.operation.service.loanimport.request.LoanImportReqBO;
|
||||
import com.pudonghot.yo.operation.service.loanimport.response.LoanImportRespBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 01, 2024 20:00:10
|
||||
*/
|
||||
public interface LoanImportService {
|
||||
|
||||
/**
|
||||
* import
|
||||
*
|
||||
* @param req req
|
||||
* @return rows
|
||||
*/
|
||||
LoanImportRespBO loanImport(LoanImportReqBO req);
|
||||
}
|
||||
|
@ -1,12 +1,67 @@
|
||||
package com.pudonghot.yo.operation.service.loanimport.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.val;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||
import com.pudonghot.tigon.file.util.StreamUtils;
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.read.listener.ReadListener;
|
||||
import com.alibaba.excel.exception.ExcelDataConvertException;
|
||||
import com.pudonghot.yo.operation.service.loanimport.LoanImportService;
|
||||
import com.pudonghot.yo.operation.service.loanimport.request.LoanImportReqBO;
|
||||
import com.pudonghot.yo.operation.service.loanimport.model.ApplicationImportBO;
|
||||
import com.pudonghot.yo.operation.service.loanimport.response.LoanImportRespBO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 01, 2024 20:00:34
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class LoanImportServiceImpl implements LoanImportService {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoanImportRespBO loanImport(final LoanImportReqBO req) {
|
||||
StreamUtils.openStream(req.getFile(), inputStream -> {
|
||||
|
||||
val excelReader = EasyExcel.read(inputStream).build();
|
||||
val sheets = excelReader.excelExecutor().sheetList();
|
||||
|
||||
for (val sheet : sheets) {
|
||||
val sheetName = sheet.getSheetName();
|
||||
ReadSheet readSheet1 =
|
||||
EasyExcel.readSheet(0).head(ApplicationImportBO.class).registerReadListener(
|
||||
new ReadListener<ApplicationImportBO>() {
|
||||
@Override
|
||||
public void invoke(ApplicationImportBO data, AnalysisContext context) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext context) {
|
||||
|
||||
}
|
||||
}
|
||||
).build();
|
||||
// excelReader.read(sheet1);
|
||||
}
|
||||
// try {
|
||||
// EasyExcel.read(inputStream, modelClass, reader).customObject(metaData).sheet(0).doRead();
|
||||
// }
|
||||
// catch (final ExcelDataConvertException e) {
|
||||
// log.error("Excel data convert exception caused.", e);
|
||||
// throw new IllegalStateException("Excel数据类型转换错误,行:"
|
||||
// + e.getRowIndex()
|
||||
// + ",列:" + e.getColumnIndex()
|
||||
// + ",数据:" + getCellValue(e.getCellData()));
|
||||
// }
|
||||
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import com.pudonghot.tigon.kit.bean.annotation.ShallowField;
|
||||
|
||||
/**
|
||||
* 批量中标导出
|
||||
* Loan import
|
||||
*
|
||||
* @author Donghuang
|
||||
* @date Sep 27, 2024 15:16:12
|
||||
* @date Oct 02, 2024 21:09:30
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ -23,12 +23,6 @@ public class LoanImportReqBO implements Serializable {
|
||||
@ShallowField
|
||||
private MultipartFile file;
|
||||
|
||||
public enum OverwriteEnum {
|
||||
ERROR,
|
||||
IGNORE,
|
||||
FORCE
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.service.loanimport.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.util.List;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 02, 2024 21:11:56
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class LoanImportRespBO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer total;
|
||||
private List<String> errors;
|
||||
}
|
@ -20,6 +20,7 @@ spring:
|
||||
|
||||
mybatis:
|
||||
mapper-locations:
|
||||
- classpath*:com/pudonghot/yo/dal/*/mapper/*Mapper.xml
|
||||
- classpath*:com/pudonghot/yo/operation/dal/*/mapper/*Mapper.xml
|
||||
- classpath*:com/pudonghot/tigon/cms/dal/*/mapper/*Mapper.xml
|
||||
lazy-initialization: false
|
||||
|
@ -4,7 +4,7 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yo-tj-op-web</artifactId>
|
||||
<artifactId>yo-tj-operation-web</artifactId>
|
||||
<name>Yo Tiaojie Operation Web</name>
|
||||
<description>Yo Tiaojie Operation Web</description>
|
||||
|
||||
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.Executor;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.pudonghot.tigon.mybatis.BaseMapper;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -26,9 +26,17 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
||||
*/
|
||||
@EnableAsync
|
||||
@EnableScheduling
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(scanBasePackages = {
|
||||
"com.pudonghot.yo.dal",
|
||||
"com.pudonghot.yo.operation"
|
||||
})
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
@MapperScan(basePackages = "com.pudonghot.yo.operation.dal", annotationClass = Mapper.class)
|
||||
@MapperScan(basePackages = {
|
||||
"com.pudonghot.yo.dal",
|
||||
"com.pudonghot.yo.operation.dal"
|
||||
},
|
||||
markerInterface = BaseMapper.class
|
||||
)
|
||||
public class YoOperation implements WebMvcConfigurer, AsyncConfigurer {
|
||||
|
||||
private final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
@ -36,7 +44,7 @@ public class YoOperation implements WebMvcConfigurer, AsyncConfigurer {
|
||||
executor.setCorePoolSize(10);
|
||||
executor.setMaxPoolSize(20);
|
||||
executor.setQueueCapacity(200);
|
||||
executor.setThreadNamePrefix("Auction-");
|
||||
executor.setThreadNamePrefix("Operation-");
|
||||
executor.initialize();
|
||||
}
|
||||
|
||||
|
@ -1,29 +1,24 @@
|
||||
package com.pudonghot.yo.operation.auth.listener;
|
||||
|
||||
import com.pudonghot.tigon.cms.auth.SessionAbility;
|
||||
import com.pudonghot.tigon.cms.dal.auth.AuthAccountDal;
|
||||
import com.pudonghot.tigon.security.event.OnLoginSuccessEvent;
|
||||
// import com.pudonghot.zhujia.auction.cms.service.auth.PhpSessionService;
|
||||
// import com.pudonghot.zhujia.auction.cms.service.auth.request.WriteSessionReqBO;
|
||||
import io.buji.pac4j.subject.Pac4jPrincipal;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.val;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import io.buji.pac4j.subject.Pac4jPrincipal;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import com.pudonghot.tigon.security.event.OnLoginSuccessEvent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Apr 15, 2024 11:30:34
|
||||
*/
|
||||
@Slf4j
|
||||
// @Component
|
||||
public class OnLoginSuccessListener
|
||||
implements ApplicationListener<OnLoginSuccessEvent>, SessionAbility {
|
||||
|
||||
// @Autowired
|
||||
// private PhpSessionService phpSessionService;
|
||||
@Component
|
||||
public class OnLoginSuccessListener implements ApplicationListener<OnLoginSuccessEvent> {
|
||||
@Autowired
|
||||
private AuthAccountDal adminUserDal;
|
||||
private RedisTemplate<String, String> redisTpl;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@ -37,14 +32,10 @@ public class OnLoginSuccessListener
|
||||
val principal = (Pac4jPrincipal) subject.getPrincipal();
|
||||
val profile = principal.getProfile();
|
||||
val account = profile.getId();
|
||||
val user = adminUserDal.findByAccount(account);
|
||||
val sessionId = (String) session.getId();
|
||||
|
||||
// 写入PHP Session
|
||||
// val writeSessionReq = new WriteSessionReqBO();
|
||||
// writeSessionReq.setSessionId(String.valueOf(session.getId()));
|
||||
// writeSessionReq.setUsername(account);
|
||||
// writeSessionReq.setNickname(user.getNickname());
|
||||
//
|
||||
// phpSessionService.write(writeSessionReq);
|
||||
// 写入Go Session
|
||||
log.info("Write session [{}] [{}].", sessionId, account);
|
||||
redisTpl.opsForValue().set(sessionId, account, 7, TimeUnit.DAYS);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
package com.pudonghot.yo.operation.auth.listener;
|
||||
|
||||
import lombok.val;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import com.pudonghot.tigon.security.event.OnLogoutEvent;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 12:00:38
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class OnLogoutListener implements ApplicationListener<OnLogoutEvent> {
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> redisTpl;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onApplicationEvent(final OnLogoutEvent event) {
|
||||
val subject = event.getSubject();
|
||||
log.info("Subject [{}] logout.", subject);
|
||||
|
||||
val session = subject.getSession();
|
||||
val sessionId = (String) session.getId();
|
||||
|
||||
// 删除Go Session
|
||||
log.info("Remove session [{}].");
|
||||
redisTpl.delete(sessionId);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.pudonghot.yo.operation.controller.auth;
|
||||
|
||||
import lombok.val;
|
||||
import io.buji.pac4j.subject.Pac4jPrincipal;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import com.pudonghot.tigon.kit.bean.BeanService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.operation.service.auth.AuthService;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.yo.operation.controller.auth.response.AuthInfoVO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Apr 28, 2024 14:32:58
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/api/auth")
|
||||
public class OpAuthController {
|
||||
|
||||
@Autowired
|
||||
private BeanService beanService;
|
||||
@Autowired
|
||||
private AuthService authService;
|
||||
|
||||
@RequestMapping("/info2")
|
||||
public AuthInfoVO info(final HttpServletRequest request) {
|
||||
val principal = (Pac4jPrincipal) request.getUserPrincipal();
|
||||
val profile = principal.getProfile();
|
||||
val account = profile.getId();
|
||||
return beanService.convert(authService.authInfo(account), AuthInfoVO.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.pudonghot.yo.operation.controller.auth.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Apr 26, 2024 16:33:46
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class AuthInfoVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 用户手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* gender
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
@JsonAlias("perms")
|
||||
private List<String> resources;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.pudonghot.yo.operation.controller.home;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import com.pudonghot.tigon.kit.bean.BeanService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.pudonghot.yo.operation.service.home.HomeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.pudonghot.yo.operation.controller.home.response.DeptListRespVO;
|
||||
import com.pudonghot.yo.operation.controller.home.response.AgentListRespVO;
|
||||
import com.pudonghot.yo.operation.controller.home.response.SmsTplListRespVO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 04, 2024 16:29:48
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/api/home")
|
||||
public class HomeController {
|
||||
|
||||
@Autowired
|
||||
private HomeService homeService;
|
||||
@Autowired
|
||||
private BeanService beanService;
|
||||
|
||||
@RequestMapping("/agent-list")
|
||||
public List<AgentListRespVO> agentList() {
|
||||
return beanService.convert(homeService.agentList(), AgentListRespVO.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/case-mark-list")
|
||||
public List<String> caseMarkList() {
|
||||
return Arrays.asList("A+", "A", "B+", "B", "C+", "C", "D");
|
||||
}
|
||||
|
||||
@RequestMapping("/commission-org-list")
|
||||
public List<String> commissionOrList() {
|
||||
return homeService.commissionOrgList();
|
||||
}
|
||||
|
||||
@RequestMapping("/sms-tpl-list")
|
||||
public List<SmsTplListRespVO> smsTplList() {
|
||||
return beanService.convert(homeService.smsTplList(), SmsTplListRespVO.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/dept-list")
|
||||
public List<DeptListRespVO> deptList() {
|
||||
return beanService.convert(homeService.deptList(), DeptListRespVO.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.controller.home.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 04, 2024 16:33:47
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class AgentListRespVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private String account;
|
||||
private String name;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.controller.home.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 12:19:06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class DeptListRespVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.controller.home.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 07, 2024 11:51:45
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class SmsTplListRespVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private String title;
|
||||
private String content;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.pudonghot.yo.operation.controller.loanimport;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.pudonghot.yo.operation.service.loanimport.LoanImportService;
|
||||
import com.pudonghot.yo.operation.controller.loanimport.request.LoanImportReqVO;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 02, 2024 21:07:55
|
||||
*/
|
||||
@RequestMapping("/api/loan")
|
||||
public class LoanImportController {
|
||||
|
||||
@Autowired
|
||||
private LoanImportService loanImportService;
|
||||
|
||||
@PostMapping("/import")
|
||||
public void loanImport(@Valid final LoanImportReqVO req) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.pudonghot.yo.operation.controller.loanimport.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
import com.pudonghot.tigon.annotation.Trim;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.pudonghot.tigon.kit.bean.annotation.ShallowField;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Oct 02, 2024 21:07:32
|
||||
*/
|
||||
@Trim
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class LoanImportReqVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull
|
||||
@ShallowField
|
||||
private MultipartFile file;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pudonghot.yo.operation.controller.loanimport.response;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Donghuang
|
||||
* @date Sep 28, 2024 13:18:59
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class LoanImportRespVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer total;
|
||||
private List<String> errors;
|
||||
}
|
@ -30,6 +30,7 @@ spring:
|
||||
|
||||
mybatis:
|
||||
mapper-locations:
|
||||
- classpath*:com/pudonghot/yo/dal/*/mapper/*Mapper.xml
|
||||
- classpath*:com/pudonghot/yo/operation/dal/*/mapper/*Mapper.xml
|
||||
- classpath*:com/pudonghot/tigon/cms/dal/*/mapper/*Mapper.xml
|
||||
lazy-initialization: false
|
||||
@ -69,10 +70,9 @@ tigon:
|
||||
/assets/**=anon
|
||||
/api/**=user
|
||||
|
||||
zhujia:
|
||||
auction:
|
||||
websocket:
|
||||
allowed-origins: >
|
||||
http://localhost:[*],
|
||||
http://127.0.0.1:[*]
|
||||
https://*.zhujiachefu.com
|
||||
yo:
|
||||
websocket:
|
||||
allowed-origins: >
|
||||
http://localhost:[*],
|
||||
http://127.0.0.1:[*]
|
||||
https://*.zhujiachefu.com
|
||||
|
@ -49,7 +49,7 @@
|
||||
select count(<include refid="primaryKey" />) from
|
||||
<include refid="table" />
|
||||
<include refid="rolesFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="rolesCol">
|
||||
|
@ -33,7 +33,7 @@
|
||||
<include refid="table" />
|
||||
<include refid="rolesFilterJoin" />
|
||||
<include refid="tenantsFilterJoin" />
|
||||
<include refid="Tigon.searchForCount" />
|
||||
<include refid="Tigon.npSearch" />
|
||||
</select>
|
||||
|
||||
<sql id="rolesCol">
|
||||
|
Loading…
x
Reference in New Issue
Block a user