zhangjinli 3 years ago
parent 6192b0f55e
commit 4ddb38a763

@ -3,6 +3,7 @@ package com.zh.project0512.controller.manage;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.zh.project0512.annotation.adminTokenValid;
import com.zh.project0512.model.Brand;
import com.zh.project0512.model.Tag;
@ -65,11 +66,11 @@ public class TagController {
private Integer id;
}
@Operation(summary = "删除标签")
@Operation(summary = "删除标签(软删除)")
@PostMapping("/del")
@adminTokenValid
public Result del(@Validated @RequestBody DelTagParam param) {
return MybatisPlusUtil.sqlResult(tagService.removeById(param.getId()), "删除");
return MybatisPlusUtil.sqlResult(tagService.update(new UpdateWrapper<Tag>().eq("id", param.getId()).set("isDeleted", 1)), "删除");
}
@Data
@ -95,8 +96,8 @@ public class TagController {
@adminTokenValid
public Result list(@RequestBody(required = false) JSONObject obj) {
QueryWrapper<Tag> qw = new QueryWrapper<>();
qw.orderByAsc("sortWeight").orderByDesc("updateAt","creatAt");
return Result.success(tagService.pageMaps(MybatisPlusUtil.SetPage(obj),qw));
qw.orderByAsc("sortWeight").orderByDesc("updateAt", "creatAt");
return Result.success(tagService.pageMaps(MybatisPlusUtil.SetPage(obj), qw));
}
@Data
@ -118,10 +119,10 @@ public class TagController {
Tag tag = tagService.getById(param.getId());
int origin = tag.getSortWeight();
int current = param.getSortWeight();
if(origin==current){
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION,"权重无变化");
if (origin == current) {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "权重无变化");
}
tagService.updSort(origin,current,origin>current);
tagService.updSort(origin, current, origin > current);
return Result.success("修改完成");
}
}

@ -1,6 +1,15 @@
package com.zh.project0512.controller.manage;
import com.alibaba.fastjson.JSONObject;
import com.zh.project0512.annotation.adminTokenValid;
import com.zh.project0512.service.IVideoEffectSettingService;
import com.zh.project0512.utils.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -13,8 +22,16 @@ import org.springframework.web.bind.annotation.RestController;
* @author zh
* @since 2022-06-14
*/
@Tag(name = "视频传播系数管理")
@RestController
@RequestMapping("/video-effect-setting")
@RequestMapping("/videoEffectSetting")
public class VideoEffectSettingController {
@Autowired
private IVideoEffectSettingService videoEffectSettingService;
@Operation(summary = "列表")
@PostMapping("/list")
@adminTokenValid
public Result list() {
return Result.success(videoEffectSettingService.list());
}
}

@ -162,6 +162,19 @@ public class TaskUController {
if (useId == null) {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "未找到该用户");
}
if(param.getTaskId()!=null) {
Integer taskStatus = userTaskService.userTaskStatus(useId, param.getTaskId());
if (taskStatus == null) {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "用户未接受任务");
} else if (taskStatus == 0) {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "任务未开始");
} else if (taskStatus == 2) {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "任务已结束");
}
}
if(null !=customerActionNoteService.getOne(new QueryWrapper<CustomerActionNote>().eq("tel",param.getTel()))){
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "该手机用户已在线索里");
}
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()));

@ -4,8 +4,10 @@ package com.zh.project0512.controller.wxApp;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zh.project0512.annotation.tokenValid;
import com.zh.project0512.model.UserTask;
import com.zh.project0512.model.Video;
import com.zh.project0512.service.IUserService;
import com.zh.project0512.service.IUserTaskService;
import com.zh.project0512.service.IVideoService;
import com.zh.project0512.utils.JwtUtil;
import com.zh.project0512.utils.MybatisPlusUtil;
@ -42,6 +44,8 @@ public class VideoUController {
private IVideoService videoService;
@Autowired
private IUserService userService;
@Autowired
private IUserTaskService userTaskService;
@Data
static class UserAddParam {
@ -65,6 +69,14 @@ public class VideoUController {
if (useId == null) {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "未找到该用户");
}
Integer taskStatus = userTaskService.userTaskStatus(useId, param.getId());
if(taskStatus ==null){
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "用户未接受任务");
}else if(taskStatus == 0){
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "任务未开始");
}else if(taskStatus == 2){
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "任务已结束");
}
videoService.save(new Video().setUserId(useId).setTaskId(param.getId()).setType(param.getType()).setUrl(param.getUrl()).setCreatAt(LocalDateTime.now()));
return Result.success("添加完成!");
}

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zh.project0512.model.CustomerActionNote;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zh.project0512.model.Reference;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -19,6 +20,11 @@ import java.util.Map;
* @since 2022-05-30
*/
public interface CustomerActionNoteMapper extends BaseMapper<CustomerActionNote> {
@Select("insert into customerActionNote " +
"( provideId, area, creatAt, brandList, tel, taskId, remarks, customerName ) " +
"select ( #{provideId}, #{area}, #{creatAt}, #{brandList}, #{tel}, #{taskId}, #{remarks}, #{customerName} ) " +
"WHERE not EXISTS (SELECT 1 FROM user WHERE tel =#{tel}) ")
void add(CustomerActionNote customerActionNote);
@Select("<script> " +
"select t1.*,t2.name as provideName,t3.title as taskTitle, t4.departmentId,t4.name as departmentName\n" +
"from customerActionNote as t1\n" +

@ -20,10 +20,10 @@ public interface TagMapper extends BaseMapper<Tag> {
@Update("<script>" +
"update tag set sortWeight = -1 where sortWeight = #{origin};\n" +
"<if test='originHigherCurrent'> " +
"update tag set sortWeight = sortWeight + 1 where sortWeight &gt;= #{current} and sortWeight &lt; #{origin};"+
"update tag set sortWeight = sortWeight + 1 where sortWeight &lt;&gt; 0 and sortWeight &gt;= #{current} and sortWeight &lt; #{origin};"+
"</if>" +
"<if test='!originHigherCurrent'> " +
"update tag set sortWeight = sortWeight - 1 where sortWeight &gt; #{origin} and sortWeight &lt;= #{current};\n" +
"update tag set sortWeight = sortWeight - 1 where sortWeight &lt;&gt; 0 and sortWeight &gt; #{origin} and sortWeight &lt;= #{current};\n" +
"</if>" +
"update tag set sortWeight = #{current} where sortWeight = -1;" +
"</script>")

@ -2,6 +2,8 @@ package com.zh.project0512.mapper;
import com.zh.project0512.model.UserTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
/**
* <p>
@ -12,5 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @since 2022-05-27
*/
public interface UserTaskMapper extends BaseMapper<UserTask> {
@Select("select task.status from task inner join userTask on userTask.taskId = task.id and taskId = #{taskId} and userId = #{userId}")
Integer userTaskStatus(int userId,int taskId);
}

@ -62,4 +62,11 @@ public class Brand extends Model {
@Schema(title = "排序权重:数字越小排序靠前")
@TableField("sortWeight")
private Integer sortWeight;
/**
* :01
*/
@Schema(title = "是否删除:0否1是")
@TableField("isDeleted")
private Integer isDeleted;
}

@ -51,4 +51,11 @@ public class Tag extends Model {
@Schema(title = "排序权重:数字越小排序靠前")
@TableField("sortWeight")
private Integer sortWeight;
/**
* :01
*/
@Schema(title = "是否删除:0否1是")
@TableField("isDeleted")
private Integer isDeleted;
}

@ -53,5 +53,17 @@ public class TeachingRefe extends Model {
@TableField("updateAt")
private LocalDateTime updateAt;
/**
* :
*/
@Schema(title = "排序权重:数字越小排序靠前")
@TableField("sortWeight")
private Integer sortWeight;
/**
* :01
*/
@Schema(title = "是否删除:0否1是")
@TableField("isDeleted")
private Integer isDeleted;
}

@ -19,6 +19,7 @@ import java.util.Map;
* @since 2022-05-30
*/
public interface ICustomerActionNoteService extends IService<CustomerActionNote> {
void add(CustomerActionNote customerActionNote);
IPage<Map> pageList(IPage page,String openid, @Param("ew") Wrapper<CustomerActionNote> queryWrapper);
/**

@ -12,5 +12,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @since 2022-05-27
*/
public interface IUserTaskService extends IService<UserTask> {
Integer userTaskStatus(int userId,int taskId);
}

@ -37,6 +37,9 @@ public class CustomerActionNoteServiceImpl extends ServiceImpl<CustomerActionNot
@Resource
RewardRuleMapper rewardRuleMapper;
public void add(CustomerActionNote customerActionNote){
customerActionNoteMapper.add(customerActionNote);
}
public IPage<Map> pageList(IPage page,String openid, @Param("ew") Wrapper<CustomerActionNote> queryWrapper){
return customerActionNoteMapper.pageList(page,openid,queryWrapper);
}

@ -4,6 +4,7 @@ import com.zh.project0512.model.UserTask;
import com.zh.project0512.mapper.UserTaskMapper;
import com.zh.project0512.service.IUserTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@ -16,5 +17,9 @@ import org.springframework.stereotype.Service;
*/
@Service
public class UserTaskServiceImpl extends ServiceImpl<UserTaskMapper, UserTask> implements IUserTaskService {
@Autowired
private UserTaskMapper userTaskMapper;
public Integer userTaskStatus(int userId,int taskId){
return userTaskMapper.userTaskStatus(userId, taskId);
}
}

Loading…
Cancel
Save