wangliang 1 год назад
Родитель
Сommit
cf722eaeb5

+ 7 - 7
sop-api/install/mysql/init/init.sql

@@ -738,6 +738,7 @@ CREATE TABLE `t_b_delay_warn` (
                                   `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
                                   `update_time` bigint DEFAULT NULL COMMENT '更新时间',
+                                  `close_time` bigint DEFAULT NULL COMMENT '关闭时间',
                                   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='延期预警跟进表';
 
@@ -1193,6 +1194,7 @@ CREATE TABLE `t_b_violation` (
                                  `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                  `update_id` bigint DEFAULT NULL COMMENT '更新人id',
                                  `update_time` bigint DEFAULT NULL COMMENT '更新时间',
+                                 `close_time` bigint DEFAULT NULL COMMENT '关闭时间',
                                  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='sop违规登记表';
 
@@ -1563,13 +1565,11 @@ INSERT INTO `sys_config` VALUES (28, NULL, 'sms.flow.project.exchange.finish.cod
 INSERT INTO `sys_config` VALUES (29, NULL, 'sms.flow.ding.exception.finish.code', '异常审核通知', 'SMS_462700329', NULL, 1, 1, 1, NULL, NULL, NULL);
 INSERT INTO `sys_config` VALUES (30, NULL, 'sms.sop.after.remind.code', '延期提醒通知', 'SMS_462700328', NULL, 1, 1, 1, NULL, NULL, NULL);
 INSERT INTO `sys_config` VALUES (31, NULL, 'sms.violation.remind.code', '违规提醒通知', 'SMS_462805303', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (32, NULL, 'wxapp.appid', '微信appId', 'wx8b4c77de1b6f387b', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (33, NULL, 'wxapp.request.url', '微信请求url', 'https://api.weixin.qq.com/sns/jscode2session', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (34, NULL, 'wxapp.phone.bind.new.url', '微信手机号绑定url(新)', 'https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (35, NULL, 'face.verify.baiduLocalAppId', '百度人脸识别appId', 'test', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (36, NULL, 'face.verify.baiduLocalUrlPrefix', '百度人脸识别请求url', 'http://192.168.20.253', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (37, NULL, 'baidu.face.compare.url', '百度人脸识别人脸比对接口', '/face-api/v3/face/match', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (38, NULL, 'baidu.face.compare.score', '百度人脸识别人脸比对阈值', '70', NULL, 1, 1, 1, NULL, NULL, NULL);
+INSERT INTO `sys_config` VALUES (32, NULL, 'baidu.face.compare.url', '百度人脸识别人脸比对接口', '/face-api/v3/face/match', NULL, 1, 1, 1, NULL, NULL, NULL);
+INSERT INTO `sys_config` VALUES (33, NULL, 'baidu.face.compare.score', '百度人脸识别人脸比对阈值', '70', NULL, 1, 1, 1, NULL, NULL, NULL);
+INSERT INTO `sys_config` VALUES (34, NULL, 'fxxk.app.auth.url', '纷享销客应用级授权接口', 'https://open.fxiaoke.com/cgi/corpAccessToken/get/V2', NULL, 1, 1, 1, NULL, NULL, NULL);
+INSERT INTO `sys_config` VALUES (35, NULL, 'fxxk.user.by.mobile.url', '纷享销客根据手机号查询员工接口', 'https://open.fxiaoke.com/cgi/user/getByMobile', NULL, 1, 1, 1, NULL, NULL, NULL);
+INSERT INTO `sys_config` VALUES (36, NULL, 'fxxk.custom.query.url', '纷享销客查询自定义对象接口', 'https://openfxiaokecom/cgi/crm/custom/v2/data/query', NULL, 1, 1, 1, NULL, NULL, NULL);
 
 INSERT INTO `sys_privilege` VALUES (1, '系统管理', 'systemManage', 'MENU', NULL, 8, NULL, NULL, 1, 0, 1);
 INSERT INTO `sys_privilege` VALUES (2, '配置管理', 'configureManage', 'MENU', 1, 1, NULL, NULL, 1, 0, 1);

+ 13 - 1
sop-api/src/main/resources/application.properties

@@ -88,4 +88,16 @@ com.qmth.solar.access-key=9ed64a57627845118913229ad578939b
 com.qmth.solar.access-secret=0qtqPS9S3DnjR043nuszsrUttl6ufqvc
 com.qmth.solar.app-code=sop
 
-com.qmth.sms.server=https://solar.qmth.com.cn
+com.qmth.sms.server=https://solar.qmth.com.cn
+
+wxapp.appid=wx8b4c77de1b6f387b
+
+face.verify.baiduLocalAppId=test
+face.verify.baiduLocalUrlPrefix=http://192.168.20.253
+
+fxxk.app.id=FSAID_131c93b
+fxxk.app.secrete=5d590b10cca24ce5a51fc716564aac9f
+fxxk.permanent.code=4EFBD3FCF655B4D934C163EA5ECE638D
+fxxk.curren.open.user.id=FSUID_AE9192D544DCF7924E88E9EA800641C7
+fxxk.api.name.crm=object_zS8me__c
+fxxk.api.name.crm.detail=object_bs553__c

+ 2 - 2
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -837,7 +837,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_DEPLOYMENT_NO_DATA.exception());
         if ((tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW ||
                 tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW)) {
-            if (currFlowTaskResult.getSetup().intValue() == 3) {
+            if (Objects.nonNull(currFlowTaskResult) && currFlowTaskResult.getSetup().intValue() == 3) {
                 List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
                 List<FlowFormWidgetResult> flowFormWidgetResultListNew = new ArrayList<>();
                 if (!CollectionUtils.isEmpty(taskList) && taskList.size() > 1) {
@@ -907,7 +907,7 @@ public class ActivitiServiceImpl implements ActivitiService {
                             }
                         }
                     }
-                    if (Objects.isNull(sysRole)) {
+                    if (Objects.isNull(sysRole) && Objects.nonNull(currFlowTaskResult)) {
                         currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
                     }
                 }

+ 8 - 11
sop-business/src/main/java/com/qmth/sop/business/service/impl/TWxappInfoServiceImpl.java

@@ -7,8 +7,6 @@ import com.qmth.boot.core.solar.model.WxappPhoneNumber;
 import com.qmth.boot.core.solar.model.WxappSession;
 import com.qmth.boot.core.solar.service.SolarService;
 import com.qmth.sop.business.bean.result.LoginResult;
-import com.qmth.sop.business.cache.CommonCacheService;
-import com.qmth.sop.business.entity.SysConfig;
 import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.entity.TWxappInfo;
 import com.qmth.sop.business.mapper.TWxappInfoMapper;
@@ -19,6 +17,7 @@ import com.qmth.sop.common.enums.AppSourceEnum;
 import com.qmth.sop.common.enums.ExceptionResultEnum;
 import com.qmth.sop.common.util.ByteUtil;
 import com.qmth.sop.common.util.ShaUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -50,12 +49,12 @@ public class TWxappInfoServiceImpl extends ServiceImpl<TWxappInfoMapper, TWxappI
     @Resource
     SolarService solarService;
 
-    @Resource
-    CommonCacheService commonCacheService;
-
     @Resource
     TWxappInfoService tWxappInfoService;
 
+    @Value("${wxapp.appid}")
+    String wxappId;
+
     /**
      * 微信登录
      *
@@ -92,10 +91,9 @@ public class TWxappInfoServiceImpl extends ServiceImpl<TWxappInfoMapper, TWxappI
     @Override
     @Transactional
     public LoginResult wxappLoginByPhoneCode(String loginCode, String phoneCode) throws NoSuchAlgorithmException {
-        SysConfig sysConfigWxappId = commonCacheService.addSysConfigCache(SystemConstant.WXAPP_APP_ID);
-        Optional.ofNullable(sysConfigWxappId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置微信小程序appid"));
+        Optional.ofNullable(wxappId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置微信小程序appid"));
 
-        WxappPhoneNumber wxappPhoneNumber = solarService.getWxappPhoneNumber(sysConfigWxappId.getConfigValue(), phoneCode);
+        WxappPhoneNumber wxappPhoneNumber = solarService.getWxappPhoneNumber(wxappId, phoneCode);
         Optional.ofNullable(wxappPhoneNumber).orElseThrow(() -> ExceptionResultEnum.WXAPP_PHONE_NO_DATA.exception());
 
         List<SysUser> sysUserList = sysUserService.list(new QueryWrapper<SysUser>().lambda().eq(SysUser::getMobileNumber, wxappPhoneNumber.getPurePhoneNumber()));
@@ -193,8 +191,7 @@ public class TWxappInfoServiceImpl extends ServiceImpl<TWxappInfoMapper, TWxappI
      * @return
      */
     private WxappSession getAuthorization(String loginCode) {
-        SysConfig sysConfigWxappId = commonCacheService.addSysConfigCache(SystemConstant.WXAPP_APP_ID);
-        Optional.ofNullable(sysConfigWxappId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置微信小程序appid"));
-        return solarService.getWxappSessionByCode(sysConfigWxappId.getConfigValue(), loginCode);
+        Optional.ofNullable(wxappId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置微信小程序appid"));
+        return solarService.getWxappSessionByCode(wxappId, loginCode);
     }
 }

+ 10 - 3
sop-business/src/main/java/com/qmth/sop/business/sync/FaceApiUtils.java

@@ -8,6 +8,7 @@ import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.ExceptionResultEnum;
 import com.qmth.sop.common.util.FileUtil;
 import com.qmth.sop.common.util.HttpUtil;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -28,6 +29,12 @@ public class FaceApiUtils {
     @Resource
     private SysConfigService sysConfigService;
 
+    @Value("${face.verify.baiduLocalAppId}")
+    String faceVerifyBaiduLocalAppId;
+
+    @Value("${face.verify.baiduLocalUrlPrefix}")
+    String faceVerifyBaiduLocalUrlPrefix;
+
     /**
      * 百度人脸识别-人脸对比
      *
@@ -37,11 +44,11 @@ public class FaceApiUtils {
      * @throws IOException 异常
      */
     public BigDecimal faceMatch(File f1, File f2) throws IOException {
-        String appId = sysConfigService.findByConfigKey(SystemConstant.FACE_VERIFY_BAIDU_LOCAL_APP_ID).getConfigValue();
-        String uri = sysConfigService.findByConfigKey(SystemConstant.FACE_VERIFY_BAIDU_LOCAL_URL_PREFIX).getConfigValue();
+//        String appId = sysConfigService.findByConfigKey(SystemConstant.FACE_VERIFY_BAIDU_LOCAL_APP_ID).getConfigValue();
+//        String uri = sysConfigService.findByConfigKey(SystemConstant.FACE_VERIFY_BAIDU_LOCAL_URL_PREFIX).getConfigValue();
         String url = sysConfigService.findByConfigKey(SystemConstant.BAIDU_FACE_COMPARE_URL).getConfigValue();
 
-        String postUrl = uri + url + "?appId=" + appId;
+        String postUrl = faceVerifyBaiduLocalUrlPrefix + url + "?appId=" + faceVerifyBaiduLocalAppId;
         List<FaceMatchParam> faceMatchParamList = new ArrayList<>();
         FaceMatchParam p1 = new FaceMatchParam();
         p1.setImage(FileUtil.fileToBase64(f1));

+ 29 - 9
sop-business/src/main/java/com/qmth/sop/business/sync/FxxkApiUtils.java

@@ -15,6 +15,7 @@ import com.qmth.sop.common.util.JacksonUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -32,21 +33,39 @@ public class FxxkApiUtils {
 
     private static final Logger log = LoggerFactory.getLogger(FxxkApiUtils.class);
 
+    @Value("${fxxk.app.id}")
+    String fxxkAppId;
+
+    @Value("${fxxk.app.secret}")
+    String fxxkAppSecret;
+
+    @Value("${fxxk.permanent.code}")
+    String fxxkPermanentCode;
+
+    @Value("${fxxk.curren.open.user.id}")
+    String fxxkCurrenOpenUserId;
+
+    @Value("${fxxk.api.name.crm}")
+    String fxxkApiNameCrm;
+
+    @Value("${fxxk.api.name.crm.detail}")
+    String fxxkApiNameCrmDetail;
+
     /**
      * 查询纷享销客应用级授权
      *
      * @return 应用级授权信息
      */
     public FxxkAppAuthInfo findFxxkAppAuthInfo() {
-        String appId = sysConfigService.findByConfigKey(SystemConstant.FXXK_APP_ID).getConfigValue();
-        String appSecret = sysConfigService.findByConfigKey(SystemConstant.FXXK_APP_SECRET).getConfigValue();
-        String permanentCode = sysConfigService.findByConfigKey(SystemConstant.FXXK_PERMANENT_CODE).getConfigValue();
+//        String appId = sysConfigService.findByConfigKey(SystemConstant.FXXK_APP_ID).getConfigValue();
+//        String appSecret = sysConfigService.findByConfigKey(SystemConstant.FXXK_APP_SECRET).getConfigValue();
+//        String permanentCode = sysConfigService.findByConfigKey(SystemConstant.FXXK_PERMANENT_CODE).getConfigValue();
         String postUrl = sysConfigService.findByConfigKey(SystemConstant.FXXK_APP_AUTH_URL).getConfigValue();
         try {
             Map<String, Object> map = new HashMap<>();
-            map.put("appId", validParam(appId, null, true, "纷享销客AppID"));
-            map.put("appSecret", validParam(appSecret, null, true, "纷享销客APPSecret"));
-            map.put("permanentCode", validParam(permanentCode, null, true, "纷享销客永久授权码"));
+            map.put("appId", validParam(fxxkAppId, null, true, "纷享销客AppID"));
+            map.put("appSecret", validParam(fxxkAppSecret, null, true, "纷享销客APPSecret"));
+            map.put("permanentCode", validParam(fxxkPermanentCode, null, true, "纷享销客永久授权码"));
             String requestJson = JacksonUtil.parseJson(map);
 
             String result = HttpUtil.postJson(postUrl, requestJson, null, null, false);
@@ -103,7 +122,7 @@ public class FxxkApiUtils {
      * 查询自定义对象列表
      */
     public List<FxxkCrm> findCustomList() {
-        String currentOpenUserId = sysConfigService.findByConfigKey(SystemConstant.FXXK_CURRENT_OPEN_USER_ID).getConfigValue();
+//        String currentOpenUserId = sysConfigService.findByConfigKey(SystemConstant.FXXK_CURRENT_OPEN_USER_ID).getConfigValue();
         String postUrl = sysConfigService.findByConfigKey(SystemConstant.FXXK_CUSTOM_QUERY_URL).getConfigValue();
         try {
             FxxkAppAuthInfo fxxkAppAuthInfo = this.findFxxkAppAuthInfo();
@@ -113,10 +132,11 @@ public class FxxkApiUtils {
             Map<String, Object> map = new HashMap<>();
             map.put("corpAccessToken", validParam(corpAccessToken, null, true, "企业应用访问公司合法性凭证"));
             map.put("corpId", validParam(corpId, null, true, "开放平台公司帐号"));
-            map.put("currentOpenUserId", validParam(currentOpenUserId, null, true, "当前操作人OpenUserID"));
+            map.put("currentOpenUserId", validParam(fxxkCurrenOpenUserId, null, true, "当前操作人OpenUserID"));
 
             Map<String, Object> dataMap = new HashMap<>();
-            dataMap.put("dataObjectApiName", sysConfigService.findByConfigKey(SystemConstant.FXXK_API_NAME_CRM).getConfigValue());
+//            dataMap.put("dataObjectApiName", sysConfigService.findByConfigKey(SystemConstant.FXXK_API_NAME_CRM).getConfigValue());
+            dataMap.put("dataObjectApiName", fxxkApiNameCrm);
 
             Map<String, Object> queryMap = new HashMap<>();
             queryMap.put("offset", 0.0);

+ 11 - 12
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -190,24 +190,23 @@ public class SystemConstant {
     public static final String SMS_FLOW_DING_EXCEPTION_FINISH_CODE = "sms.flow.ding.exception.finish.code";
     public static final String SMS_SOP_AFTER_REMIND_CODE = "sms.sop.after.remind.code";
     public static final String SMS_VIOLATION_REMIND_CODE = "sms.violation.remind.code";
-    public static final String WXAPP_APP_ID = "wxapp.appid";
-    public static final String WXAPP_REQUEST_URL = "wxapp.request.url";
-    public static final String WXAPP_PHONE_BIND_NEW_URL = "wxapp.phone.bind.new.url";
-    public static final String FACE_VERIFY_BAIDU_LOCAL_APP_ID = "face.verify.baiduLocalAppId";
-    public static final String FACE_VERIFY_BAIDU_LOCAL_URL_PREFIX = "face.verify.baiduLocalUrlPrefix";
+//    public static final String WXAPP_APP_ID = "wxapp.appid";
+//    public static final String WXAPP_REQUEST_URL = "wxapp.request.url";
+//    public static final String WXAPP_PHONE_BIND_NEW_URL = "wxapp.phone.bind.new.url";
+//    public static final String FACE_VERIFY_BAIDU_LOCAL_APP_ID = "face.verify.baiduLocalAppId";
+//    public static final String FACE_VERIFY_BAIDU_LOCAL_URL_PREFIX = "face.verify.baiduLocalUrlPrefix";
     public static final String BAIDU_FACE_COMPARE_URL = "baidu.face.compare.url";
     public static final String BAIDU_FACE_COMPARE_SCORE = "baidu.face.compare.score";
-    public static final String FXXK_APP_ID = "fxxk.app.id";
-    public static final String FXXK_APP_SECRET = "fxxk.app.secret";
-    public static final String FXXK_PERMANENT_CODE = "fxxk.permanent.code";
-    public static final String FXXK_CURRENT_OPEN_USER_ID = "fxxk.curren.open.user.id";
-    public static final String FXXK_API_NAME_CRM = "fxxk.api.name.crm";
-    public static final String FXXK_API_NAME_CRM_DETAIL = "fxxk.api.name.crm.detail";
+//    public static final String FXXK_APP_ID = "fxxk.app.id";
+//    public static final String FXXK_APP_SECRET = "fxxk.app.secret";
+//    public static final String FXXK_PERMANENT_CODE = "fxxk.permanent.code";
+//    public static final String FXXK_CURRENT_OPEN_USER_ID = "fxxk.curren.open.user.id";
+//    public static final String FXXK_API_NAME_CRM = "fxxk.api.name.crm";
+//    public static final String FXXK_API_NAME_CRM_DETAIL = "fxxk.api.name.crm.detail";
     public static final String FXXK_APP_AUTH_URL = "fxxk.app.auth.url";
     public static final String FXXK_USER_BY_MOBILE_URL = "fxxk.user.by.mobile.url";
     public static final String FXXK_CUSTOM_QUERY_URL = "fxxk.custom.query.url";
 
-
     /**
      * api前缀
      */