宣传片批量设置已观看
This commit is contained in:
parent
a401815a90
commit
b716a6f89f
|
@ -60,11 +60,11 @@ public class AdminApplication {
|
|||
// });
|
||||
}
|
||||
|
||||
@Bean
|
||||
/*@Bean
|
||||
@PostConstruct
|
||||
void init(){
|
||||
String res = cxFeignClient.getToken("5bb50ad0cc40e10565089c35aa61e7f3","k9?8bCqaQ*R1e2Wx0f65AzY4^]LDp@_Z");
|
||||
CxFeignConfig.token = res;
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
package net.shapelight.modules.changqing.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.shapelight.common.utils.PageUtils;
|
||||
import net.shapelight.common.utils.R;
|
||||
import net.shapelight.modules.changqing.entity.TenSafeVideoEntity;
|
||||
import net.shapelight.modules.changqing.service.TenSafeVideoService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 宣传片表
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("safe/video")
|
||||
@Api(value = "宣传片", tags = {"宣传片"})
|
||||
public class TenSafeVideoController {
|
||||
@Autowired
|
||||
private TenSafeVideoService tenSafeVideoService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
// @RequiresPermissions("ten:safe:video")
|
||||
@ApiOperation(value = "查询列表", response = TenSafeVideoEntity.class)
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
PageUtils page = tenSafeVideoService.queryPage(params);
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@GetMapping("/info/{id}")
|
||||
// @RequiresPermissions("ten:safe:video")
|
||||
@ApiOperation(value = "查询详情", response = TenSafeVideoEntity.class)
|
||||
public R info(@PathVariable("id") Long id) {
|
||||
TenSafeVideoEntity tenSafeVideo = tenSafeVideoService.getById(id);
|
||||
return R.ok().put("data", tenSafeVideo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
// @RequiresPermissions("ten:safe:video")
|
||||
@ApiOperation(value = "保存", response = TenSafeVideoEntity.class)
|
||||
public R save(@RequestBody TenSafeVideoEntity tenSafeVideo) {
|
||||
tenSafeVideoService.save(tenSafeVideo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
// @RequiresPermissions("ten:safe:video")
|
||||
@ApiOperation(value = "修改", response = TenSafeVideoEntity.class)
|
||||
public R update(@RequestBody TenSafeVideoEntity tenSafeVideo) {
|
||||
tenSafeVideoService.updateById(tenSafeVideo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
// @RequiresPermissions("ten:safe:video")
|
||||
@ApiOperation(value = "删除", response = TenSafeVideoEntity.class)
|
||||
public R delete(@RequestBody Long[] ids) {
|
||||
tenSafeVideoService.removeByIds(Arrays.asList(ids));
|
||||
return R.ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package net.shapelight.modules.changqing.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.shapelight.modules.changqing.entity.TenSafeVideoEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 宣传片表
|
||||
*/
|
||||
@Mapper
|
||||
public interface TenSafeVideoDao extends BaseMapper<TenSafeVideoEntity> {
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package net.shapelight.modules.changqing.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 宣传片表
|
||||
*/
|
||||
@Data
|
||||
@TableName("ten_safe_video")
|
||||
public class TenSafeVideoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 视频名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private Long cellId;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String cellName;
|
||||
|
||||
/**
|
||||
* 上传人ID
|
||||
*/
|
||||
private Long uploadId;
|
||||
|
||||
/**
|
||||
* 上传人姓名
|
||||
*/
|
||||
private String uploadName;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 视频地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 上次播放时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date playTime;
|
||||
|
||||
/**
|
||||
* 播放次数
|
||||
*/
|
||||
private Integer playCount;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package net.shapelight.modules.changqing.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.shapelight.common.utils.PageUtils;
|
||||
import net.shapelight.modules.changqing.entity.TenSafeVideoEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 宣传片表
|
||||
*/
|
||||
public interface TenSafeVideoService extends IService<TenSafeVideoEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package net.shapelight.modules.changqing.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.shapelight.common.utils.PageUtils;
|
||||
import net.shapelight.common.utils.Query;
|
||||
import net.shapelight.modules.changqing.dao.TenSafeVideoDao;
|
||||
import net.shapelight.modules.changqing.entity.TenSafeVideoEntity;
|
||||
import net.shapelight.modules.changqing.service.TenSafeVideoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service("tenSafeVideoService")
|
||||
public class TenSafeVideoServiceImpl extends ServiceImpl<TenSafeVideoDao, TenSafeVideoEntity> implements TenSafeVideoService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<TenSafeVideoEntity> page = this.page(
|
||||
new Query<TenSafeVideoEntity>().getPage(params),
|
||||
new QueryWrapper<TenSafeVideoEntity>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
}
|
|
@ -137,6 +137,7 @@ public class SysLoginController extends AbstractController{
|
|||
|
||||
//this.loginForm.password = base.encode('f4fab52d797e197c'+this.loginForm.password)
|
||||
String p = Base64.decodeStr(form.getPassword());
|
||||
System.out.println("p" + p);
|
||||
p = p.substring(16);
|
||||
form.setPassword(p);
|
||||
//用户信息
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.shapelight.modules.ten.controller;
|
|||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
|
@ -22,6 +23,7 @@ import net.shapelight.common.config.GlobalValue;
|
|||
import net.shapelight.common.config.MinioConfig;
|
||||
import net.shapelight.common.utils.*;
|
||||
import net.shapelight.commons.engine.sdk.PalmSDK;
|
||||
import net.shapelight.commons.engine.sdk.PicSDK;
|
||||
import net.shapelight.commons.engine.sdk.SdkImageUtils;
|
||||
import net.shapelight.commons.engine.sdk.palm.FaceFeatureBase;
|
||||
import net.shapelight.commons.engine.sdk.palm.OutArg;
|
||||
|
@ -31,6 +33,7 @@ import net.shapelight.modules.excel.model.PersonModel;
|
|||
import net.shapelight.modules.face.entity.UserCompareInfo;
|
||||
import net.shapelight.modules.face.util.Base64Util;
|
||||
import net.shapelight.modules.face.util.UserInfo;
|
||||
import net.shapelight.modules.face.util.UserRamCache;
|
||||
import net.shapelight.modules.face.util.UserRamGroup;
|
||||
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
||||
import net.shapelight.modules.sys.controller.AbstractController;
|
||||
|
@ -40,6 +43,9 @@ import net.shapelight.modules.sys.service.SysUserService;
|
|||
import net.shapelight.modules.ten.entity.*;
|
||||
import net.shapelight.modules.ten.service.*;
|
||||
import net.shapelight.modules.ten.vo.PersonExcelModel;
|
||||
import net.shapelight.modules.vo.TenDeviceVo;
|
||||
import net.shapelight.modules.vo.TenPersonOperationVo;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
@ -458,7 +464,7 @@ public class TenPersonController extends AbstractController {
|
|||
if(card!=null){
|
||||
return R.error("卡号已录入");
|
||||
}
|
||||
// tenDoorCardService.saveTenPerson(tenPerson);
|
||||
// tenDoorCardService.save(tenPerson);
|
||||
}
|
||||
|
||||
|
||||
|
@ -601,7 +607,7 @@ public class TenPersonController extends AbstractController {
|
|||
// }
|
||||
//
|
||||
// }
|
||||
//// tenDoorCardService.saveTenPerson(tenPerson);
|
||||
//// tenDoorCardService.save(tenPerson);
|
||||
// }
|
||||
|
||||
String resStr = tenPersonService.updateTenPersonById(tenPerson);
|
||||
|
@ -679,7 +685,7 @@ public class TenPersonController extends AbstractController {
|
|||
// }else{
|
||||
// syncEntity.setState(Constant.PERSON_SYNC_MODIFY);
|
||||
// syncEntity.setLastUpdateTime(tenPerson.getLastUpdateTime());
|
||||
// tenPersonSyncService.updateTenPersonById(syncEntity);
|
||||
// tenPersonSyncService.updateById(syncEntity);
|
||||
//
|
||||
// //下发通知
|
||||
// List<TenPersonOperationVo> list = new ArrayList<>();
|
||||
|
@ -700,7 +706,7 @@ public class TenPersonController extends AbstractController {
|
|||
// if(syncEntity!=null){
|
||||
// syncEntity.setState(Constant.PERSON_SYNC_DELETE);
|
||||
// syncEntity.setLastUpdateTime(tenPerson.getLastUpdateTime());
|
||||
// tenPersonSyncService.updateTenPersonById(syncEntity);
|
||||
// tenPersonSyncService.updateById(syncEntity);
|
||||
// //下发通知
|
||||
// List<TenPersonOperationVo> list = new ArrayList<>();
|
||||
// TenPersonOperationVo vo = new TenPersonOperationVo();
|
||||
|
@ -1236,7 +1242,7 @@ public class TenPersonController extends AbstractController {
|
|||
if(card!=null){
|
||||
return R.error("卡号已录入");
|
||||
}
|
||||
// tenDoorCardService.saveTenPerson(tenPerson);
|
||||
// tenDoorCardService.save(tenPerson);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1440,4 +1446,22 @@ public class TenPersonController extends AbstractController {
|
|||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置已观看宣传片
|
||||
*/
|
||||
@PostMapping("/setWatchSafeVideo")
|
||||
@RequiresPermissions("ten:person")
|
||||
@ApiOperation(value = "批量设置已观看宣传片", response = TenPersonEntity.class)
|
||||
public R batchSetWatchSafeVideo(@RequestBody List<Map<String, String>> params) {
|
||||
if (params.size() > 20) {
|
||||
return R.error("最多选择20条数据");
|
||||
}
|
||||
boolean result = tenPersonService.setWatchSafeVideo(params);
|
||||
if (result) {
|
||||
return R.ok();
|
||||
} else {
|
||||
return R.error("批量设置失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,4 +136,5 @@ public interface TenPersonDao extends BaseMapper<TenPersonEntity>{
|
|||
|
||||
List<TenDeptPersonCount> findDeptCount(@Param("tenantId")String tenantId);
|
||||
|
||||
int updateWatchSafeVideo(@Param("personId")Long personId,@Param("cellId")Long cellId);
|
||||
}
|
||||
|
|
|
@ -375,4 +375,10 @@ public class TenPersonEntity extends BaseEntity implements Serializable {
|
|||
private String householder;
|
||||
private String relation;
|
||||
|
||||
//-----------------长庆新增字段
|
||||
private Integer isEnterSulfurArea;
|
||||
private Integer isProtectDevice;
|
||||
private Integer isWatchSafeVideo;
|
||||
private String belongContractorName;
|
||||
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ public interface TenPersonService extends IService<TenPersonEntity> {
|
|||
// boolean removeById(Long roomId,Long cellId);
|
||||
|
||||
boolean removeByIdList(List<Map<String,String>> roomIdList);
|
||||
boolean setWatchSafeVideo(List<Map<String, String>> params);
|
||||
|
||||
boolean reviewByIdList(List<Map<String,String>> roomIdList);
|
||||
|
||||
|
|
|
@ -1078,6 +1078,25 @@ public class TenPersonServiceImpl extends ServiceImpl<TenPersonDao,TenPersonEnti
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean setWatchSafeVideo(List<Map<String, String>> roomIdList) {
|
||||
Long cellId = 0L;
|
||||
List<Long> personIds = new ArrayList<>();
|
||||
Long tenantId = 0l;
|
||||
for (Map<String, String> param : roomIdList) {
|
||||
Long personId = Long.parseLong(param.get("personId"));
|
||||
cellId = Long.parseLong(param.get("cellId"));
|
||||
TenPersonEntity entity = tenPersonDao.selectById(personId, cellId);
|
||||
entity.setLastUpdateTime(new Date());
|
||||
tenPersonDao.updateById(entity);
|
||||
|
||||
//删除人员
|
||||
tenPersonDao.updateWatchSafeVideo(personId, cellId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@CacheEvict(value = "TenPerson", allEntries = true)
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="net.shapelight.modules.ten.dao.TenSafeVideoDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="net.shapelight.modules.changqing.entity.TenSafeVideoEntity" id="tenSafeVideoMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="cellId" column="cell_id"/>
|
||||
<result property="cellName" column="cell_name"/>
|
||||
<result property="uploadId" column="upload_id"/>
|
||||
<result property="uploadName" column="upload_name"/>
|
||||
<result property="uploadTime" column="upload_time"/>
|
||||
<result property="url" column="url"/>
|
||||
<result property="playTime" column="play_time"/>
|
||||
<result property="playCount" column="play_count"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
|
@ -1572,5 +1572,9 @@
|
|||
group by d.name
|
||||
</select>
|
||||
|
||||
<update id="updateWatchSafeVideo">
|
||||
update ten_person set is_watch_safe_video = 1
|
||||
where person_id = #{personId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue