mirror of
https://github.com/chatopera/cosin.git
synced 2025-07-24 08:31:45 +08:00
Enable display external CRM info and wait for db connection ready befer operations
This commit is contained in:
parent
9490cc251e
commit
e548b815e1
@ -136,7 +136,7 @@ public class ApiWlContactsController extends Handler {
|
||||
final String uid = j.get("uid").getAsString();
|
||||
final String sid = j.get("sid").getAsString();
|
||||
final String cid = j.get("cid").getAsString();
|
||||
Contacts record = contactsRes.findOneByWluidAndWlsidAndWlcid(uid, sid, cid);
|
||||
Contacts record = contactsRes.findOneByWluidAndWlsidAndWlcidAndDatastatus(uid, sid, cid, false);
|
||||
boolean isNew = false;
|
||||
if (record == null) {
|
||||
// create new obj
|
||||
|
@ -307,7 +307,7 @@ public class IMController extends Handler {
|
||||
final String company_name,
|
||||
final String system_name) {
|
||||
if (StringUtils.isNotBlank(uid) && StringUtils.isNotBlank(sid) && StringUtils.isNotBlank(cid)) {
|
||||
Contacts data = contactsRes.findOneByWluidAndWlsidAndWlcid(uid, sid, cid);
|
||||
Contacts data = contactsRes.findOneByWluidAndWlsidAndWlcidAndDatastatus(uid, sid, cid, false);
|
||||
if (data == null) {
|
||||
data = new Contacts();
|
||||
data.setCreater(gid);
|
||||
@ -367,7 +367,7 @@ public class IMController extends Handler {
|
||||
onlineUserRes.save(onlineUser);
|
||||
}
|
||||
|
||||
Contacts usc = contactsRes.findOneByWluidAndWlsidAndWlcid(uid, sid, cid);
|
||||
Contacts usc = contactsRes.findOneByWluidAndWlsidAndWlcidAndDatastatus(uid, sid, cid, false);
|
||||
if (usc != null) {
|
||||
return "usc";
|
||||
} else {
|
||||
@ -766,7 +766,7 @@ public class IMController extends Handler {
|
||||
String cid = (String) request.getSession().getAttribute("Sessioncid");
|
||||
|
||||
if (StringUtils.isNotBlank(uid) && StringUtils.isNotBlank(sid) && StringUtils.isNotBlank(cid)) {
|
||||
Contacts contacts1 = contactsRes.findOneByWluidAndWlsidAndWlcid(uid, sid, cid);
|
||||
Contacts contacts1 = contactsRes.findOneByWluidAndWlsidAndWlcidAndDatastatus(uid, sid, cid, false);
|
||||
if (contacts1 != null) {
|
||||
agentUserRepository.findOneByUseridAndOrgi(userid, orgi).ifPresent(p -> {
|
||||
// 关联AgentService的联系人
|
||||
|
@ -29,7 +29,7 @@ public interface ContactsRepository extends ElasticsearchRepository<Contacts, St
|
||||
|
||||
List<Contacts> findOneByDatastatusIsFalseAndPhoneAndOrgi(String phone, String orgi);
|
||||
|
||||
Contacts findOneByWluidAndWlsidAndWlcid(String wluid, String wlsid, String wlcid);
|
||||
Contacts findOneByWluidAndWlsidAndWlcidAndDatastatus(String wluid, String wlsid, String wlcid, Boolean datastatus);
|
||||
|
||||
List<Contacts> findByskypeidAndDatastatus(String skypeid, Boolean datastatus);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<View alias="agentservice">
|
||||
<SQL>
|
||||
<![CDATA[
|
||||
select * from uk_agentservice where satisfaction = 1 <#if skill?? && skill!=""> AND agentskill = '${skill!''}'</#if> <#if agent?? && agent!=""> AND agentno = '${agent!''}'</#if> <#if orgi?? && orgi!=""> AND orgi = '${orgi!''}'</#if> <#if begin?? && begin!=""> AND satistime >= str_to_date('${begin!''}', '%Y-%m-%d %H:%i:%s')</#if> <#if end?? && end!=""> AND satistime <= str_to_date('${end!''} 23:59:59', '%Y-%m-%d %H:%i:%s')</#if>
|
||||
select * from uk_agentservice where 1 = 1 <#if skill?? && skill!=""> AND agentskill = '${skill!''}'</#if> <#if agent?? && agent!=""> AND agentno = '${agent!''}'</#if> <#if orgi?? && orgi!=""> AND orgi = '${orgi!''}'</#if> <#if begin?? && begin!=""> AND satistime >= str_to_date('${begin!''}', '%Y-%m-%d %H:%i:%s')</#if> <#if end?? && end!=""> AND satistime <= str_to_date('${end!''} 23:59:59', '%Y-%m-%d %H:%i:%s')</#if>
|
||||
]]>
|
||||
</SQL>
|
||||
</View>
|
||||
@ -25,9 +25,9 @@
|
||||
<Hierarchy hasAll='true' allMemberName='合计' >
|
||||
<Level name='日期' column='satistime' uniqueMembers='false'>
|
||||
<KeyExpression>
|
||||
<SQL dialect="generic">date_format(agentservice.createtime,'%Y-%m-%d')</SQL>
|
||||
<SQL dialect="mysql">date_format(agentservice.createtime,'%Y-%m-%d')</SQL>
|
||||
<SQL dialect="oracle">TO_DATE(agentservice.createtime,'YYYY-MM-DD')</SQL>
|
||||
<SQL dialect="generic">date_format(agentservice.satistime,'%Y-%m-%d')</SQL>
|
||||
<SQL dialect="mysql">date_format(agentservice.satistime,'%Y-%m-%d')</SQL>
|
||||
<SQL dialect="oracle">TO_DATE(agentservice.satistime,'YYYY-MM-DD')</SQL>
|
||||
</KeyExpression>
|
||||
</Level>
|
||||
</Hierarchy>
|
||||
|
Binary file not shown.
Binary file not shown.
@ -84,7 +84,7 @@
|
||||
<div class="uk-layui-form">
|
||||
<input hidden value="${contacts.id!''}" id="contactsId"/>
|
||||
<input hidden value="${contacts.creater!''}" id="creater"/>
|
||||
<div class="layui-collapse">
|
||||
<div class="layui-collapse" id="basic">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">基本信息</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
@ -192,11 +192,44 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<#if contacts.wlusername?? || contacts.wluid??>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">用户名(id):</label>
|
||||
<div class="layui-input-inline" style="margin-left:5px;line-height: 2.5em;">
|
||||
${contacts.wlusername!''}
|
||||
<span>(${contacts.wluid!''})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
<#if contacts.wlcompany_name?? || contacts.wlcid??>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">公司名称(id):</label>
|
||||
<div class="layui-input-inline" style="margin-left:5px;line-height: 2.5em;">
|
||||
${contacts.wlcompany_name!''}
|
||||
<span>(${contacts.wlcid!''})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
<#if contacts.wlsystem_name?? || contacts.wlsid??>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">子系统名称(id):</label>
|
||||
<div class="layui-input-inline" style="margin-left:5px;line-height: 2.5em;">
|
||||
${contacts.wlsystem_name!''}
|
||||
<span>(${contacts.wlsid!''})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">联系人地址:</label>
|
||||
<div class="layui-input-inline" style="width: 159%;">
|
||||
<input type="text" name="address" readonly value="${contacts.address!''}" class="layui-input">
|
||||
<input type="text" name="address" readonly value="${contacts.address!''}" class="layui-input" style="width: 425px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -204,7 +237,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">联系人说明:</label>
|
||||
<div class="layui-input-inline" style="width: 149%;">
|
||||
<textarea name="memo" class="layui-textarea" readonly>${contacts.memo!''}</textarea>
|
||||
<textarea name="memo" class="layui-textarea" readonly style="width: 425px;">${contacts.memo!''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -255,6 +288,13 @@
|
||||
width: 100%;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
#basic .layui-form-label{
|
||||
width: 115px;
|
||||
}
|
||||
#basic .layui-input-inline{
|
||||
width: 270px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function getNotesByContactId () {
|
||||
|
@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<font color="red">*(必填项)</font> (需要导入的联系人数据Excel文件)
|
||||
<a href="/res/template.html?filename=contacts_template.xls" target="_blank" style="margin-left:20px;">
|
||||
<a href="/res/template.html?filename=contacts_template.xlsx" target="_blank" style="margin-left:20px;">
|
||||
<i class="layui-icon"></i>
|
||||
下载模板
|
||||
</a>
|
||||
|
@ -62,11 +62,11 @@
|
||||
<div class="layui-input-inline" style="width: auto;margin-right:0px;">
|
||||
<label class="layui-form-label" style="width: auto;">日期范围:</label>
|
||||
<div class="layui-input-inline" style="width: auto;margin-right:0px;">
|
||||
<input type="text" name="start_time" class="layui-input ukefu-input" id="start_time" value="${begin!''}" placeholder="开始时间">
|
||||
<input type="text" name="begin" class="layui-input ukefu-input" id="start_time" value="${begin!''}" placeholder="开始时间">
|
||||
</div>
|
||||
<label class="layui-form-label" style="width: auto;">~</label>
|
||||
<div class="layui-input-inline" style="width: auto;margin-right:0px;">
|
||||
<input type="text" name="end_time" class="layui-input ukefu-input" value="${end!''}" id="end_time" placeholder="结束时间">
|
||||
<input type="text" name="end" class="layui-input ukefu-input" value="${end!''}" id="end_time" placeholder="结束时间">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -61,11 +61,11 @@
|
||||
<div class="layui-input-inline" style="width: auto;margin-right:0px;">
|
||||
<label class="layui-form-label" style="width: auto;">日期范围:</label>
|
||||
<div class="layui-input-inline" style="width: auto;margin-right:0px;">
|
||||
<input name="start_time" id="start_time" class="layui-input ukefu-input" placeholder="开始日期" value="${begin!''}" >
|
||||
<input name="begin" id="start_time" class="layui-input ukefu-input" placeholder="开始日期" value="${begin!''}" >
|
||||
</div>
|
||||
<label class="layui-form-label" style="width: auto;">~</label>
|
||||
<div class="layui-input-inline" style="width: auto;margin-right:0px;">
|
||||
<input name="end_time" id="end_time" class="layui-input ukefu-input" placeholder="结束日期" value="${end!''}" >
|
||||
<input name="end" id="end_time" class="layui-input ukefu-input" placeholder="结束日期" value="${end!''}" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,8 +12,6 @@ CONTACT_CENTER_DB=`parse_dbname ${SPRING_DATASOURCE_URL}`
|
||||
CONTACT_CENTER_WAR=/opt/chatopera/contact-center.war
|
||||
MYSQL_SCRIPT_NAME=cosinee-MySQL-slim.sql
|
||||
|
||||
println "[setup] connecting to $MYSQL_WRITEMODE_IP:$MYSQL_WRITEMODE_PORT/$CONTACT_CENTER_DB with $SPRING_DATASOURCE_USERNAME/****"
|
||||
|
||||
# functions
|
||||
function import_db(){
|
||||
if [ ! -f $1 ]; then exit 1; fi
|
||||
@ -57,6 +55,14 @@ function init_db(){
|
||||
|
||||
# main
|
||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
||||
println "[setup] connecting to $MYSQL_WRITEMODE_IP:$MYSQL_WRITEMODE_PORT/$CONTACT_CENTER_DB with $SPRING_DATASOURCE_USERNAME/****"
|
||||
|
||||
## wait for database connection ...
|
||||
while ! mysqladmin --user=${SPRING_DATASOURCE_USERNAME} --password=${SPRING_DATASOURCE_PASSWORD} --host=${MYSQL_WRITEMODE_IP} --port=${MYSQL_WRITEMODE_PORT} ping --silent &> /dev/null ; do
|
||||
echo "Waiting for database connection..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# check if database exist, if not, create it.
|
||||
mysqlshow -h ${MYSQL_WRITEMODE_IP} \
|
||||
-P ${MYSQL_WRITEMODE_PORT} \
|
||||
|
@ -13,8 +13,6 @@ CONTACT_CENTER_WAR=/opt/chatopera/contact-center.war
|
||||
APP_WAR_EXTRACTED=/tmp/ROOT
|
||||
UPGRADE_DB_SCRIPT_DIR=$APP_WAR_EXTRACTED/upgrade
|
||||
|
||||
println "[upgrade] connecting to $MYSQL_WRITEMODE_IP:$MYSQL_WRITEMODE_PORT/$CONTACT_CENTER_DB with $SPRING_DATASOURCE_USERNAME/****"
|
||||
|
||||
# functions
|
||||
function upgrade_db(){
|
||||
if [ ! -f $1 ]; then exit 1; fi
|
||||
@ -46,12 +44,19 @@ function extract_war(){
|
||||
|
||||
# main
|
||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
||||
println "[upgrade] connecting to $MYSQL_WRITEMODE_IP:$MYSQL_WRITEMODE_PORT/$CONTACT_CENTER_DB with $SPRING_DATASOURCE_USERNAME/****"
|
||||
## check upgrade footprint
|
||||
if [ -f /opt/chatopera/upgrade.his ]; then
|
||||
echo "[upgrade] upgrade has been done with previous start."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## wait for database connection ...
|
||||
while ! mysqladmin --user=${SPRING_DATASOURCE_USERNAME} --password=${SPRING_DATASOURCE_PASSWORD} --host=${MYSQL_WRITEMODE_IP} --port=${MYSQL_WRITEMODE_PORT} ping --silent &> /dev/null ; do
|
||||
echo "Waiting for database connection..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
## check root dir
|
||||
if [ ! -d $APP_WAR_EXTRACTED ]; then
|
||||
extract_war
|
||||
@ -73,4 +78,4 @@ fi
|
||||
## touch upgrade footprint
|
||||
if [ ! -f /opt/chatopera/upgrade.his ]; then
|
||||
touch /opt/chatopera/upgrade.his
|
||||
fi
|
||||
fi
|
||||
|
@ -7956,7 +7956,7 @@ VALUES
|
||||
('2c9480886e91d9e5016e91f528b901c1', '联系人备注', NULL, NULL, NULL, 'memo', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('2c9480886e91d9e5016e91f528b901c3', '修改时间', NULL, NULL, NULL, 'updatetime', 0, 'datetime', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('2c9480886e91d9e5016e91f528ba01c6', '创建时间', NULL, NULL, NULL, 'createtime', 0, 'datetime', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('2c9480886e91d9e5016e91f528ba01c7', '联系人姓名', NULL, NULL, NULL, 'name', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, '', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('2c9480886e91d9e5016e91f528ba01c7', '联系人姓名', NULL, NULL, NULL, 'name', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, '', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 'required', NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('2c9480886e91d9e5016e91f528ba01ca', '分享给', NULL, NULL, NULL, 'shares', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('2c9480886e91d9e5016e91f528bb01d0', 'skypeid', NULL, NULL, NULL, 'skypeid', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('2c9480886e91d9e5016e91f528bb01d1', '人员id', NULL, NULL, NULL, 'wluid', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
@ -8001,6 +8001,7 @@ VALUES
|
||||
('402870876e5d9773016e5e9cc63d028e', 'updatetime', NULL, NULL, NULL, 'updatetime', 0, 'datetime', '402870876e5d9773016e5e9cc6370270', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_servicesummary', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
|
||||
('402870876e5d9773016e5e9cc63d028f', 'processmemo', NULL, NULL, NULL, 'processmemo', 0, 'text', '402870876e5d9773016e5e9cc6370270', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_servicesummary', NULL, 100, 0, 1, 0, 65535, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for uk_tabletask
|
||||
-- ----------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user