zhangjinli 3 years ago
parent 4eb4c29dc8
commit b4666f6c56

@ -341,9 +341,11 @@ public class TaskController {
@adminTokenValid
public Result det(@Validated @RequestBody DetTaskParam param) {
Task task = taskService.detailById(null, param.getId());
List rewardRulesList = rewardRuleService.listByTemplateId(task.getRewardRuleTemplateId());
JSONObject res = (JSONObject) JSONObject.toJSON(task);
if(task!=null) {
List rewardRulesList = rewardRuleService.listByTemplateId(task.getRewardRuleTemplateId());
res.put("rewardRuleList", rewardRulesList);
}
return Result.success(res);
}

@ -51,7 +51,7 @@ public class UserAccountController {
private int pageSize;
@Schema(title = "用户名")
private String name;
@Schema(title = "账号状态",description = "0审核中1审核通过2审核拒绝3已停用")
@Schema(title = "账号状态",description = "0审核中1审核通过2审核拒绝")
private Integer status;
@Schema(title = "部门id")
private Integer departmentId;
@ -76,9 +76,9 @@ public class UserAccountController {
@Schema(title = "用户账号id")
private Integer id;
@NotNull(message = "状态不能为空")
@Min(value = 1, message = "最小值为1")
@Max(value = 3, message = "最小值为1")
@Schema(title = "状态",description = "1审核通过2审核拒绝3停用")
@Min(value = 1, message = "1审核通过2审核拒绝")
@Max(value = 3, message = "1审核通过2审核拒绝")
@Schema(title = "状态",description = "1审核通过2审核拒绝")
private Integer status;
@Schema(title = "拒绝原因")
private String reason;
@ -97,7 +97,7 @@ public class UserAccountController {
}
UpdateWrapper<UserAccount> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", param.getId()).set("status",param.getStatus()).set("updateAt",LocalDateTime.now());
updateWrapper.set("reason",param.getStatus()==3?param.getReason():"");
updateWrapper.set("reason",param.getStatus()==2?param.getReason():"");
userAccountService.update(updateWrapper);
return Result.success("修改完成");
}

@ -87,7 +87,8 @@ public class TaskUController {
@Operation(summary = "列表")
@PostMapping("/list")
public Result list(@Validated @RequestBody ListTParam param, @RequestHeader(required = false, value = "token") @Parameter(name = "用户token", description = "关联用户信息") String token) {
@tokenValid
public Result list(@Validated @RequestBody ListTParam param, @RequestHeader String token) {
QueryWrapper<Reference> qw = new QueryWrapper<>();
Integer status = param.getStatus();
qw.ne("t1.status",0);
@ -126,9 +127,11 @@ public class TaskUController {
@PostMapping("detail")
public Result det(@Validated @RequestBody DetTaskParam param, @RequestHeader(required = false, value = "token") @Parameter(name = "用户token", description = "关联用户信息") String token) {
Task task = taskService.detailById(new JwtUtil().parseOpenid(token), param.getId());
List rewardRulesList = rewardRuleService.listByTemplateId(task.getRewardRuleTemplateId());
JSONObject res = (JSONObject) JSONObject.toJSON(task);
if(task!=null) {
List rewardRulesList = rewardRuleService.listByTemplateId(task.getRewardRuleTemplateId());
res.put("rewardRuleList", rewardRulesList);
}
return Result.success(res);
}

@ -23,6 +23,7 @@ public interface UserAccountMapper extends BaseMapper<UserAccount> {
"from userAccount as t1 " +
"left join user as t2 on t1.userId = t2.id " +
"left join qywxDepartment as t3 on t2.main_department = t3.departmentId " +
"where 1=1" +
"<if test='ew != null'>" +
"<if test='ew.nonEmptyOfWhere'>" +
"AND" +

@ -122,6 +122,9 @@ public class Task extends Model {
@TableField(exist = false)
private List<String> teachRefeUrlList;
@Schema(title="接受任务部门列表")
@TableField(exist = false)
private List departmentList;
@Schema(title = "是否被用户接受")
@TableField(exist = false)

@ -16,7 +16,7 @@ public class JwtUtil {
private String secret = "secret";
private String adminSecret = "adminSecret";
private long expire = 24*60*60;
private long expire = 30*24*60*60;
/**
* jwt

@ -22,22 +22,25 @@
<result column="teachRefeFileUrl" property="teachRefeFileUrl"/>
<result column="teachRefeType" property="teachRefeType"/>
</collection>
<collection property="departmentList" ofType="java.util.Map" autoMapping="false">
<id column="departmentId" property="departmentId"/>
<result column="departmentName" property="departmentName"/>
</collection>
</resultMap>
<select id="list" resultMap="taskListMap">
SELECT
t1.*,t2.tagId,t3.title as tagTitle,t4.brandId,t5.name as brandName,r1.fileUrl as teachRefeFileUrl,r1.type as teachRefeType
t1.*,t2.tagId,t3.title as tagTitle,t4.brandId,t5.name as brandName
<if test='openid!=null'>
,(SELECT count(*)!=0 from userTask as t4,user as t5
WHERE t1.id = t4.taskId and t4.userId = t5.id and t5.openid = #{openid} ) as isReceived
</if>
from task as t1
<!-- left JOIN ( SELECT taskTag.*,tag.title from tag,taskTag WHERE taskTag.tagId = tag.id ) AS t2-->
<!-- on t1.id =t2.taskId-->
<!-- LEFT JOIN ( SELECT taskBrand.*,brand.name from brand,taskBrand WHERE taskBrand.brandId = brand.id ) as t3-->
<!-- on t1.id = t3.taskId-->
<!-- left JOIN ( SELECT taskTag.*,tag.title from tag,taskTag WHERE taskTag.tagId = tag.id ) AS t2-->
<!-- on t1.id =t2.taskId-->
<!-- LEFT JOIN ( SELECT taskBrand.*,brand.name from brand,taskBrand WHERE taskBrand.brandId = brand.id ) as t3-->
<!-- on t1.id = t3.taskId-->
LEFT JOIN taskTag as t2 on t1.id = t2.taskId LEFT JOIN tag as t3 on t3.id = t2.tagId
LEFT JOIN taskBrand as t4 on t1.id = t4.taskId LEFT JOIN brand as t5 on t5.id = t4.brandId
LEFT JOIN taskTeachRefe as r1 on t1.id = r1.taskId
WHERE t1.id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
<if test="tagIdList !=null and tagIdList.size()!=0 ">
@ -62,7 +65,8 @@
<select id="detailById" resultMap="taskListMap">
SELECT
t1.*,t2.tagId,t2.title as tagTitle,t3.brandId,t3.name as brandName,t4.referenceId,t4.title as referenceTitle,
t4.type as referenceType,t4.fileUrl as referenceFileUrl,t4.coverUrl as referenceCoverUrl
t4.type as referenceType,t4.fileUrl as referenceFileUrl,t4.coverUrl as referenceCoverUrl,
r1.fileUrl as teachRefeFileUrl,r1.type as teachRefeType,r2.departmentId,r2.name as departmentName
<if test='openid!=null'>
,(SELECT count(*)!=0 from userTask as t4,user as t5
WHERE t1.id = t4.taskId and t4.userId = t5.id and t5.openid = #{openid} ) as isReceived
@ -73,8 +77,10 @@
LEFT JOIN ( SELECT taskBrand.*,brand.name from brand,taskBrand WHERE taskBrand.brandId = brand.id ) as t3
on t1.id = t3.taskId
LEFT JOIN ( SELECT taskReference.*,reference.title,reference.type,reference.fileUrl,reference.coverUrl from
reference,taskReference WHERE taskReference.referenceId = reference.id ) as t4
on t1.id = t4.taskId
reference,taskReference WHERE taskReference.referenceId = reference.id ) as t4 on t1.id = t4.taskId
LEFT JOIN taskTeachRefe as r1 on t1.id = r1.taskId
LEFT JOIN (select taskDepartment.*,qywxDepartment.name from taskDepartment,qywxDepartment
where taskDepartment.departmentId = qywxDepartment.departmentId ) as r2 on t1.id = r2.taskId
WHERE t1.id =#{id}
</select>

Loading…
Cancel
Save