@ -69,7 +69,7 @@ public class TaskUController {
static class ListTParam {
private int pageNum ;
private int pageSize ;
@Schema ( title = "任务状态" , description = "0未上线; 1已上线; 2已结束 ")
@Schema ( title = "任务状态" , description = "0未上线; 1已上线; 2已结束 ; 3待领取 ")
private Integer status ;
@Schema ( title = "月份区间" )
private Integer month ;
@ -85,8 +85,12 @@ public class TaskUController {
@PostMapping ( "/list" )
public Result list ( @Validated @RequestBody ListTParam param , @RequestHeader ( required = false , value = "token" ) @Parameter ( name = "用户token" , description = "关联用户信息" ) String token ) {
QueryWrapper < Reference > qw = new QueryWrapper < > ( ) ;
if ( null ! = param . getStatus ( ) ) {
qw . eq ( "t1.status" , param . getStatus ( ) ) ;
Integer status = param . getStatus ( ) ;
if ( null ! = status ) {
qw . eq ( "t1.status" , status = = 3 ? 1 : status ) ;
if ( status = = 3 ) {
qw . ne ( "(SELECT count(*)!=0 from userTask as t4,user as t5 WHERE t1.id = t4.taskId and t4.userId = t5.id and t5.openid = +'" + new JwtUtil ( ) . parseOpenid ( token ) + "' )" , 1 ) ;
}
}
if ( null ! = param . getMonth ( ) ) {
qw . between ( "t1.creatAt" , LocalDateTime . now ( ) . minusMonths ( param . getMonth ( ) ) , LocalDateTime . now ( ) ) ;
@ -97,7 +101,6 @@ public class TaskUController {
IPage iPage = taskService . idList ( MybatisPlusUtil . SetNumPage ( param . getPageNum ( ) , param . getPageSize ( ) ) , param . getTagIdList ( ) , param . getBrandIdList ( ) , qw ) ;
List list = iPage . getRecords ( ) ;
if ( list . size ( ) > 0 ) {
System . out . println ( list ) ;
iPage . setRecords ( taskService . list ( new JwtUtil ( ) . parseOpenid ( token ) , list , param . getTagIdList ( ) , param . getBrandIdList ( ) , qw ) ) ;
}
return Result . success ( iPage ) ;
@ -113,8 +116,8 @@ public class TaskUController {
@Operation ( summary = "详情" )
@PostMapping ( "detail" )
public Result det ( @ RequestBody JSONObject obj , @RequestHeader ( required = false , value = "token" ) @Parameter ( name = "用户token" , description = "关联用户信息" ) String token ) {
Task task = taskService . detailById ( new JwtUtil ( ) . parseOpenid ( token ) , obj. getInteger ( "id" ) ) ;
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 ) ;
res . put ( "rewardRuleList" , rewardRulesList ) ;
@ -149,7 +152,7 @@ public class TaskUController {
}
customerActionNoteService . save (
new CustomerActionNote ( ) . setCustomerName ( param . getCustomerName ( ) ) . setTel ( param . getTel ( ) ) . setArea ( param . getArea ( ) ) . setTaskId ( param . getTaskId ( ) )
. setBrandList ( new CustomUtil ( ) . listToString ( param . getBrandList ( ) ) ) . setRemarks ( param . getRemarks ( ) ) . setProvideId ( useId ) . setCreatAt ( LocalDateTime . now ( ) ) ) ;
. setBrandList ( new CustomUtil ( ) . listToString ( param . getBrandList ( ) ) ) . setRemarks ( param . getRemarks ( ) ) . setProvideId ( useId ) . setCreatAt ( LocalDateTime . now ( ) ) ) ;
return Result . success ( "上传完成" ) ;
}
@ -159,9 +162,9 @@ public class TaskUController {
public Result customerNote ( @Validated @RequestBody JSONObject obj , @RequestHeader ( value = "token" ) @Parameter ( name = "登录token" ) String token ) {
IPage < Map > iPage = customerActionNoteService . pageList ( MybatisPlusUtil . SetPage ( obj ) , new JwtUtil ( ) . parseOpenid ( token ) ) ;
List < Map > records = iPage . getRecords ( ) ;
for ( Map m : records ) {
if ( m . get ( "brandList" ) ! = null ) {
m . replace ( "brandList" , new CustomUtil ( ) . stringToList ( m . get ( "brandList" ) . toString ( ) ) ) ;
for ( Map m : records ) {
if ( m . get ( "brandList" ) ! = null ) {
m . replace ( "brandList" , new CustomUtil ( ) . stringToList ( m . get ( "brandList" ) . toString ( ) ) ) ;
}
}
return Result . success ( iPage ) ;