Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 1b8fb5fac3 Merge branch 'dev' of http://62.234.3.186:3000/sxyanzhu/jhprjv2 into dev 2024-03-17 17:00:20 +08:00
姜玉琦 10aa8b23a7 提交代码 2024-03-17 17:00:12 +08:00
18 changed files with 279 additions and 30 deletions

View File

@ -40,7 +40,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh_test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: Sxyanzhu@cf
# 从库数据源

View File

@ -46,6 +46,14 @@ public interface IFlowBusinessKeyService {
*/
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity);
/**
*
* @param flowTaskEntity
* @return
*/
public List<Map<String, Object>> findAwaitCountGroupByCategory(FlowTaskEntity flowTaskEntity);
/**
*
* @param flowTaskEntity

View File

@ -89,6 +89,16 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
return flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity);
}
/**
*
* @param flowTaskEntity
* @return
*/
@Override
public List<Map<String, Object>> findAwaitCountGroupByCategory(FlowTaskEntity flowTaskEntity){
return flowBusinessKeyMapper.findAwaitCountGroupByCategory(flowTaskEntity);
}
/**
*
* @param flowTaskEntity

View File

@ -652,7 +652,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
.taskAssignee(flowTaskVo.getUserId())
.singleResult();
if (ObjectUtil.isNull(currTaskIns)) {
throw new RuntimeException("当前任务不存在,无法执行撤回操作");
throw new RuntimeException("当前任务无法执行撤回操作或不存在。");
}
// 获取 bpmn 模型
BpmnModel bpmnModel = repositoryService.getBpmnModel(currTaskIns.getProcessDefinitionId());

View File

@ -142,7 +142,7 @@ public class SysLoginService
public void validateCaptcha(String username, String code, String uuid)
{
boolean captchaEnabled = configService.selectCaptchaEnabled();
if (code!=null && uuid!=null && captchaEnabled)
if (captchaEnabled)
{
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
String captcha = redisCache.getCacheObject(verifyKey);

View File

@ -148,6 +148,25 @@ public class TokenService
redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
}
/**
*
*
* @param token token
*/
public void refreshMobileToken(String token)
{
Claims claims = parseToken(token);
// 解析对应的权限以及用户信息
String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid);
LoginUser user = redisCache.getCacheObject(userKey);
user.setLoginTime(System.currentTimeMillis());
int mobileExpireTime = expireTime * 3650 * 60 ;
user.setExpireTime(user.getLoginTime() + mobileExpireTime * MILLIS_MINUTE);
// 根据uuid将loginUser缓存
redisCache.setCacheObject(userKey, user, mobileExpireTime, TimeUnit.MINUTES);
}
/**
*
*

View File

@ -38,6 +38,13 @@ public interface FlowBusinessKeyMapper {
*/
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity);
/**
*
* @param flowTaskEntity
* @return
*/
public List<Map<String, Object>> findAwaitCountGroupByCategory(FlowTaskEntity flowTaskEntity);
/**
*
* @param flowTaskEntity

View File

@ -4,29 +4,28 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.FlowBusinessKeyMapper">
<!-- fa.procInsId,-->
<!-- fa.deployId,-->
<!-- fa.createTime,-->
<!-- fa.finishTime,-->
<!-- fa.duration,-->
<!-- fa.procDefKey,-->
<!-- fa.procDefName,-->
<!-- fa.procDefVersion,-->
<!-- fa.category,-->
<!-- fa.businessKey,-->
<!-- fa.businessDeptId,-->
<!-- fa.businessKeyName,-->
<!-- fa.startUserId,-->
<!-- fa.startUserName,-->
<!-- fa.startDeptName,-->
<!-- fa.taskId,-->
<!-- fa.taskName,-->
<!-- fa.assigneeId,-->
<!-- fa.assigneeName,-->
<!-- fa.assigneeDeptName-->
<select id="selectAllFlowTaskByParams" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
SELECT
fa.procInsId,
fa.deployId,
fa.createTime,
fa.finishTime,
fa.duration,
fa.procDefKey,
fa.procDefName,
fa.procDefVersion,
fa.category,
fa.businessKey,
fa.businessDeptId,
fa.businessKeyName,
fa.startUserId,
fa.startUserName,
fa.startDeptName,
fa.taskId,
fa.taskName,
fa.assigneeId,
fa.assigneeName,
fa.assigneeDeptName
FROM
SELECT * FROM
vw_flow_all fa
<where>
<if test="taskName != null and taskName != ''"> and fa.taskName like concat('%', #{taskName}, '%')</if>
@ -96,6 +95,40 @@
order by fa.createTime desc
</select>
<!--根据条件查询我的代办分组数量统计-->
<select id="findAwaitCountGroupByCategory" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="map">
select fa.category,count(1) as total from vw_flow_await fa
where
1=1
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
<if test="businessKey != null and businessKey != ''"> and fa.businessKey = #{businessKey}</if>
<if test="businessKeyName != null and businessKeyName != ''"> and fa.businessKeyName like concat('%', #{businessKeyName}, '%')</if>
<if test="params.beginDate != null and params.beginDate != '' and params.endDate != null and params.endDate != ''"> and fa.createTime between #{params.beginDate} and #{params.endDate}</if>
<!-- 查询条件-项目部门 -->
<if test="projectDeptId != null "> and fa.businessDeptId = #{projectDeptId}</if>
<!--子部门数据-->
<if test='nowRole == "4"'> and fa.businessDeptId = #{nowDept}</if>
<!--监理单位/总包公司/分包单位查询当前关联数据-->
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and fa.businessKey in (select DISTINCT projectId from sur_project_unit_info where unitId=#{nowDept} and del_flag=0)</if>
<!--普通用户查询项目人员-->
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and fa.businessKey in (select DISTINCT project_id from sur_project_userinfo where user_id=#{nowUser} and is_del=0)</if>
AND (fa.ASSIGNEE_ = #{nowUser}
OR (
fa.ASSIGNEE_ IS NULL
AND (
fa.USER_ID_ = #{nowUser}
OR (
fa.GROUP_ID_ IN
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
)
)
)
)
group by fa.category
</select>
<!--查询我的已办任务-->
<select id="selectMyFinishedFlowTask" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="map">
select fa.* from vw_flow_finished fa

View File

@ -0,0 +1,97 @@
package com.ruoyi.web.common;
import com.google.code.kaptcha.Producer;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/wechat")
public class CaptchaController
{
@Resource(name = "captchaProducer")
private Producer captchaProducer;
@Resource(name = "captchaProducerMath")
private Producer captchaProducerMath;
@Autowired
private RedisCache redisCache;
@Autowired
private ISysConfigService configService;
/**
*
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = configService.selectCaptchaEnabled();
ajax.put("captchaEnabled", captchaEnabled);
if (!captchaEnabled)
{
return ajax;
}
// 保存验证码信息
String uuid = IdUtils.simpleUUID();
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
String capStr = null, code = null;
BufferedImage image = null;
// 生成验证码
String captchaType = RuoYiConfig.getCaptchaType();
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(captchaType))
{
capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr);
}
System.out.println("CODE======================>>>>"+code);
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
// 转换流信息写出
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
try
{
ImageIO.write(image, "jpg", os);
}
catch (IOException e)
{
return AjaxResult.error(e.getMessage());
}
ajax.put("uuid", uuid);
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;
}
}

View File

@ -216,6 +216,22 @@ public class WcFlowableController extends BaseController {
return getDataTable(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity));
}
/**
*
* @param flowTaskEntity
* @return
*/
@PostMapping(value = "/findAwaitCountGroupByCategory")
public AjaxResult findAwaitCountGroupByCategory(@RequestBody FlowTaskEntity flowTaskEntity) {
//这里不分页,这里实时查询用户角色
flowTaskEntity.setRoleIds(sysUserService.selectUserRoles(flowTaskEntity.getNowUserName()));
String nowDept = flowTaskEntity.getNowDept();
if(flowTaskEntity.getRoleIds().contains(Convert.toLong(SysRoleEnum.ZGS.getCode()))){
flowTaskEntity.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(Convert.toLong(nowDept))));
}
return success(flowBusinessKeyService.findAwaitCountGroupByCategory(flowTaskEntity));
}
/**
*
* @param flowTaskEntity

View File

@ -37,6 +37,19 @@ public class WcProjectStandardController extends BaseController {
return success(surProjectStandardService.selectSurProjectStandardList(surProjectStandard));
}
/**
*
* @param surProjectStandard
* @return
*/
@GetMapping("/findCountByType")
public AjaxResult findCountByType(SurProjectStandard surProjectStandard){
if(surProjectStandard.getDeptId()==0){
surProjectStandard.setDeptId(null);
}
return success(surProjectStandardService.selectSurProjectStandardGroupByType(surProjectStandard));
}
/**
*
* @param id

View File

@ -50,9 +50,11 @@ public class WechatUserLoginController extends BaseController {
{
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), null,
null);
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
ajax.put(Constants.TOKEN, token);
// 移动端这里刷新token有效期为长期
tokenService.refreshMobileToken(token);
ajax.put("data",wechatUserLoginService.findUserInfo(loginBody.getUsername(),loginBody.getOpenId()));
return ajax;
}

View File

@ -39,9 +39,10 @@ public class WechatUserLoginServiceImpl implements IWechatUserLoginService {
private static Map<String,String>appInfo = new HashMap<>();
static {
//产发数字系统
//产发数字系统
appInfo.put("wxc44b5d588f599758","b4da7402397f559395db7c1b0534c369");
appInfo.put("wx9997d071b4996f23","5bcc9ca17b31133d93a025871fc5021d");
//新产发数字系统
appInfo.put("wx9997d071b4996f23","5bcc9ca17b31133d93a025871fc5021d");
}
@Autowired

View File

@ -42,7 +42,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh_test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: Sxyanzhu@cf
# 从库数据源

View File

@ -1,6 +1,7 @@
package com.yanzhu.jh.project.mapper;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.yanzhu.jh.project.domain.SurProjectStandard;
@ -29,6 +30,14 @@ public interface SurProjectStandardMapper
*/
public List<SurProjectStandard> selectSurProjectStandardList(SurProjectStandard surProjectStandard);
/**
*
*
* @param surProjectStandard
* @return
*/
public List<Map<String,Object>> selectSurProjectStandardGroupByType(SurProjectStandard surProjectStandard);
/**
*
*

View File

@ -1,6 +1,7 @@
package com.yanzhu.jh.project.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.yanzhu.jh.project.domain.SurProjectStandard;
@ -29,6 +30,14 @@ public interface ISurProjectStandardService
*/
public List<SurProjectStandard> selectSurProjectStandardList(SurProjectStandard surProjectStandard);
/**
*
*
* @param surProjectStandard
* @return
*/
public List<Map<String,Object>> selectSurProjectStandardGroupByType(SurProjectStandard surProjectStandard);
/**
*
*

View File

@ -1,6 +1,7 @@
package com.yanzhu.jh.project.service.impl;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.utils.DateUtils;
@ -47,6 +48,17 @@ public class SurProjectStandardServiceImpl implements ISurProjectStandardService
return surProjectStandardMapper.selectSurProjectStandardList(surProjectStandard);
}
/**
*
*
* @param surProjectStandard
* @return
*/
@Override
public List<Map<String,Object>> selectSurProjectStandardGroupByType(SurProjectStandard surProjectStandard){
return surProjectStandardMapper.selectSurProjectStandardGroupByType(surProjectStandard);
}
/**
*
*

View File

@ -42,6 +42,19 @@
order by sps.standard_type,sps.ord
</select>
<select id="selectSurProjectStandardGroupByType" parameterType="SurProjectStandard" resultType="map">
select sps.standard_type as standardType, count(1) as total from sur_project_standard sps
<where>
<if test="projectId != null "> and sps.project_id = #{projectId}</if>
<if test="deptId != null "> and sps.dept_id = #{deptId}</if>
<if test="imageFile != null and imageFile != ''"> and sps.image_file = #{imageFile}</if>
<if test="standardDesc != null and standardDesc != ''"> and sps.standard_desc = #{standardDesc}</if>
<if test="ord != null "> and sps.ord = #{ord}</if>
<if test="isDel != null "> and sps.is_del = #{isDel}</if>
</where>
group by sps.standard_type
</select>
<select id="selectSurProjectStandardById" parameterType="Long" resultMap="SurProjectStandardResult">
<include refid="selectSurProjectStandardVo"/>
where sps.id = #{id}