Merge branch 'dev' of SH-Arbitrate/Mediation-Backend into prod

This commit was merged in pull request #99.
This commit is contained in:
2024-02-27 18:04:47 +08:00
committed by Gitea
11 changed files with 92 additions and 24 deletions
@@ -5,7 +5,9 @@ import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
@@ -26,6 +28,8 @@ public class WeChatUserController extends BaseController {
private WeChatUserService weChatUserService;
@Autowired
private SysRoleMapper roleMapper;
@Autowired
private SysUserMapper userMapper;
/**
* 小程序端获取手机验证码
* @param userVO
@@ -67,5 +71,16 @@ public class WeChatUserController extends BaseController {
logger.info("调用小程序注册==="+ientityAuthentication.toString());
return weChatUserService.registerUser(ientityAuthentication);
}
@Anonymous
@GetMapping("/verifyUserName")
public AjaxResult verifyUserName(@RequestParam("userName") String userName)
{
SysUser sysUser = userMapper.checkUserNameUnique(userName);
if(sysUser==null){
return AjaxResult.success();
}else {
return AjaxResult.error("用户名已存在!");
}
}
}
@@ -6,7 +6,8 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://121.40.189.20:3306/mediation_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
# url: jdbc:mysql://121.40.189.20:3306/mediation_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
url: jdbc:mysql://121.40.189.20:3306/mediation_system_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: YMzc157#
# 从库数据源
@@ -17,8 +17,8 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 6001
# 测试环境6001,开发环境7001
port: 7001
servlet:
# 应用的访问路径
context-path: /
@@ -131,8 +131,8 @@ mybatis:
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# PageHelper分页插件
pagehelper:
helperDialect: mysql
@@ -188,6 +188,9 @@ imConfig:
organizeConfig:
# creditCode
creditCode: 910000058386410047
# 引入仲裁系统url配置
arbitrateConfig:
url: http://121.40.189.20:9001/callArbitrateCaseApplication/generateCaseApplication
#jodconverter:
# local:
# host: 121.40.189.20
@@ -99,7 +99,7 @@ public class MsCaseApplication {
private String payType;
/**
* 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁
* 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁,5-达成和解
*/
@Column(name = "media_result")
private Integer mediaResult;
@@ -73,6 +73,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
* 缴费拒绝原因
*/
private String reason;
/**
* 签名按钮显示,0-显示,1-不显示
*/
private Integer signButtonFlag;
}
@@ -34,7 +34,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
* @param caseStatusNames
* @return
*/
@Select("<script> select t.* from (select c.id,c.room_id roomId,c.mediation_method mediationMethod," +
@Select("<script> select t.* from (select c.media_result mediaResult,c.id,c.room_id roomId,c.mediation_method mediationMethod," +
" CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
+
"0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
@@ -80,7 +80,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"<if test=\"req.endTime != null and req.endTime != ''\">" +
"and c.create_time &lt;= #{req.endTime}</if>" +
" </where> " +
"union select c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
"union select c.media_result mediaResult,c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
+
" CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
+
@@ -42,4 +42,11 @@ public interface MsCaseAttachMapper {
* @param ids
*/
void batchDelete(@Param("ids")List<Long> ids);
/**
* 根据附件名查找数量
* @param fileName
* @return
*/
int countByfileName(@Param("annexName") String fileName,@Param("caseAppliId") Long caseAppliId);
}
@@ -88,6 +88,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/
@Value("${organizeConfig.creditCode}")
private long creditCode;
@Value("${arbitrateConfig.url}")
private String arbitrateUrl;
@Autowired
MsCaseApplicationService caseApplicationService;
@Autowired
@@ -185,6 +188,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
// Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
// 是否调解员
boolean isMediatorRole=false;
// 如果是申请人,可以看见申请人为自己(即自然人)或者委托代理人为自己的案件(即机构)
for (SysRole role : roles) {
if(StrUtil.isNotEmpty(role.getRoleName())){
@@ -209,6 +214,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
break;
}
if(StrUtil.equals(role.getRoleName(),"调解员")) {
isMediatorRole=true;
req.setMediatorId(String.valueOf(sysUser.getUserId()));
break;
}
@@ -220,7 +226,21 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
startPage();
// 查询案件列表
return msCaseApplicationMapper.list(req, caseStatusNames);
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, caseStatusNames);
if (CollectionUtil.isNotEmpty(list)) {
// 判断调解员签名按钮权限,0-显示,1-不显示
for (MsCaseApplicationVO vo : list) {
if (isMediatorRole && vo.getMediaResult()!=null && vo.getMediaResult()==5) {
// 是调解员并且是和解协议,不显示
vo.setSignButtonFlag(1);
}else {
vo.setSignButtonFlag(0);
}
}
}
return list;
}
@Override
@@ -1317,7 +1337,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
}else {
// 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()});
smsFlag = SmsUtils.sendSms(application.getId(), "2077966", phone, new String[]{application.getCaseNum(),application.getHearDate()});
sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线下调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
}
@@ -1824,7 +1844,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
long timestamp = System.currentTimeMillis();
String signStr = SignCheckUtils.getSign(paramsbody, accessSec, timestamp);
String urlstr = "http://localhost:8001/callArbitrateCaseApplication/generateCaseApplication";
String urlstr = arbitrateUrl;
HttpResponse httpResponse = (HttpResponse) HttpRequest.post(urlstr)
.header("timestampstr", String.valueOf(timestamp))
.header("signstr", signStr)
@@ -2027,6 +2047,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if(caseFlow != null){
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
}
application.setMediaResult(mediaResult);
@@ -538,7 +538,14 @@ public class MsSignSealServiceImpl implements MsSignSealService {
}
}
datas.put("finishCasenode", recordsNew);
if(caseLogRecordsin!=null&&caseLogRecordsin.size()>0){
datas.put("finishCasenode", recordsNew);
}else {
MsCaseLogRecordVO msCaseLogRecordVO1 = new MsCaseLogRecordVO();
msCaseLogRecordVO1.setContent("结束");
recordsNew.add(msCaseLogRecordVO1);
datas.put("finishCasenode", recordsNew);
}
datas.put("inCasenode", caseLogRecordsin);
datas.put("nextCasenode", caseLogRecordsnext);
return success(datas);
@@ -53,8 +53,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import static com.ruoyi.common.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
import static com.ruoyi.common.utils.file.FileUploadUtils.*;
/**
* @author wangqiong
@@ -454,23 +453,29 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
fileName = fileName.replace("/", "");
fileName=fileId+fileName;
String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
String annexName=System.currentTimeMillis()+fileName;
String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), annexName).getAbsolutePath();
staticAndMksDir = Paths.get(absPath).toFile().toString();
long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
if(downloadFile>0) {
Example example = new Example(MsCaseApplication.class);
example.createCriteria().andEqualTo("roomId", roomId);
MsCaseApplication caseApplication = caseApplicationMapper.selectOneByExample(example);
if(caseApplication != null) {
String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
// 存入数据库
MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
.annexName(fileName)
.annexPath(annexName)
.annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
.build();
caseAttachMapper.save(caseAttach);
return annexName;
// 根据文件名称查询附件,如果该视频已存在则不存入数据库
int count= caseAttachMapper.countByfileName(fileName,caseApplication.getId());
if(count<1) {
annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), annexName);
// 存入数据库
MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
.annexName(fileName)
.annexPath(annexName)
.annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
.build();
caseAttachMapper.save(caseAttach);
return annexName;
}
}
}
}
@@ -104,6 +104,9 @@
</if>
</where>
</select>
<select id="countByfileName" resultType="java.lang.Integer">
select count(1) from ms_case_attach where case_appli_id=#{caseAppliId} and annex_name=#{annexName}
</select>
<update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
update ms_case_attach