diff --git a/shapelight-admin/src/main/java/net/shapelight/AdminApplication.java b/shapelight-admin/src/main/java/net/shapelight/AdminApplication.java index d8abce3..7237089 100644 --- a/shapelight-admin/src/main/java/net/shapelight/AdminApplication.java +++ b/shapelight-admin/src/main/java/net/shapelight/AdminApplication.java @@ -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; - } + }*/ } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/changqing/controller/TenSafeVideoController.java b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/controller/TenSafeVideoController.java new file mode 100644 index 0000000..0dd2474 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/controller/TenSafeVideoController.java @@ -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 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(); + } +} \ No newline at end of file diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/changqing/dao/TenSafeVideoDao.java b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/dao/TenSafeVideoDao.java new file mode 100644 index 0000000..0541031 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/dao/TenSafeVideoDao.java @@ -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 { +} \ No newline at end of file diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/changqing/entity/TenSafeVideoEntity.java b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/entity/TenSafeVideoEntity.java new file mode 100644 index 0000000..431bfb2 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/entity/TenSafeVideoEntity.java @@ -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; +} \ No newline at end of file diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/changqing/service/TenSafeVideoService.java b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/service/TenSafeVideoService.java new file mode 100644 index 0000000..35fc772 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/service/TenSafeVideoService.java @@ -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 { + PageUtils queryPage(Map params); +} \ No newline at end of file diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/changqing/service/impl/TenSafeVideoServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/service/impl/TenSafeVideoServiceImpl.java new file mode 100644 index 0000000..9a40324 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/changqing/service/impl/TenSafeVideoServiceImpl.java @@ -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 implements TenSafeVideoService { + + @Override + public PageUtils queryPage(Map params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + ); + + return new PageUtils(page); + } +} \ No newline at end of file diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/sys/controller/SysLoginController.java b/shapelight-admin/src/main/java/net/shapelight/modules/sys/controller/SysLoginController.java index 7a59b58..b18c00b 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/sys/controller/SysLoginController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/sys/controller/SysLoginController.java @@ -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); //用户信息 diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java index 28c9a50..2f44e18 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java @@ -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 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 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> params) { + if (params.size() > 20) { + return R.error("最多选择20条数据"); + } + boolean result = tenPersonService.setWatchSafeVideo(params); + if (result) { + return R.ok(); + } else { + return R.error("批量设置失败"); + } + } } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonDao.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonDao.java index cbb5f45..5a9c8f4 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonDao.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonDao.java @@ -136,4 +136,5 @@ public interface TenPersonDao extends BaseMapper{ List findDeptCount(@Param("tenantId")String tenantId); + int updateWatchSafeVideo(@Param("personId")Long personId,@Param("cellId")Long cellId); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/entity/TenPersonEntity.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/entity/TenPersonEntity.java index 9ce3461..ba57626 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/entity/TenPersonEntity.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/entity/TenPersonEntity.java @@ -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; + } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonService.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonService.java index 7c9f1f3..ed2d026 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonService.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonService.java @@ -30,6 +30,7 @@ public interface TenPersonService extends IService { // boolean removeById(Long roomId,Long cellId); boolean removeByIdList(List> roomIdList); + boolean setWatchSafeVideo(List> params); boolean reviewByIdList(List> roomIdList); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java index 4208e7f..e36b2b9 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java @@ -1078,6 +1078,25 @@ public class TenPersonServiceImpl extends ServiceImpl> roomIdList) { + Long cellId = 0L; + List personIds = new ArrayList<>(); + Long tenantId = 0l; + for (Map 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) diff --git a/shapelight-admin/src/main/resources/mapper/changqing/TenSafeVideoDao.xml.xml b/shapelight-admin/src/main/resources/mapper/changqing/TenSafeVideoDao.xml.xml new file mode 100644 index 0000000..80de992 --- /dev/null +++ b/shapelight-admin/src/main/resources/mapper/changqing/TenSafeVideoDao.xml.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shapelight-admin/src/main/resources/mapper/ten/TenPersonDao.xml b/shapelight-admin/src/main/resources/mapper/ten/TenPersonDao.xml index d5c0510..ce89582 100644 --- a/shapelight-admin/src/main/resources/mapper/ten/TenPersonDao.xml +++ b/shapelight-admin/src/main/resources/mapper/ten/TenPersonDao.xml @@ -1572,5 +1572,9 @@ group by d.name + + update ten_person set is_watch_safe_video = 1 + where person_id = #{personId} +