From e4b762405c72374ef45f9b1be15991861d37b901 Mon Sep 17 00:00:00 2001 From: tuyp Date: Mon, 27 Jun 2022 13:44:21 +0800 Subject: [PATCH] 凌晨时间限制 --- src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java | 5 +++-- src/main/java/com/subsidy/controller/AdministerController.java | 2 +- src/main/java/com/subsidy/controller/CompanyDictController.java | 6 +++--- src/main/java/com/subsidy/dto/administer/OperatorsDTO.java | 2 ++ src/main/java/com/subsidy/mapper/CompanyDictMapper.java | 2 +- src/main/java/com/subsidy/model/CompanyDictDO.java | 4 ++++ src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 2 +- src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java | 19 ++++++++++--------- src/main/java/com/subsidy/service/impl/MemberServiceImpl.java | 4 ++++ src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java | 21 ++++++++++----------- src/main/java/com/subsidy/util/BaseModel.java | 2 +- src/main/java/com/subsidy/util/SecretUtils.java | 2 +- src/main/java/com/subsidy/vo/administer/OperatorsVO.java | 2 ++ src/main/java/com/subsidy/vo/administer/UserRoleVO.java | 6 ++++-- src/main/java/com/subsidy/vo/member/MemberVO.java | 4 ++++ src/main/resources/application-dev.properties | 1 + src/main/resources/application-prod.properties | 1 + src/main/resources/application.properties | 3 --- src/main/resources/mapper/CompanyDictMapper.xml | 6 +++++- 19 files changed, 58 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java b/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java index 5f8117b..2e535e9 100644 --- a/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java @@ -111,8 +111,9 @@ public class GlobalExceptionHandler { @ExceptionHandler(value = Exception.class) public ResponseVO serverInternalError(Exception e, HttpServletRequest request) { String url = request.getRequestURI(); - log.error("path:"+url); - log.error("---- error message: ---"+e.toString()); +// log.error("path:"+url); +// log.error("---- error message: ---"+e.toString()); + e.printStackTrace(); return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url); } } \ No newline at end of file diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index f4568e7..71a300f 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -63,7 +63,7 @@ public class AdministerController { @PostMapping("/administers") @ApiOperation("查询所有运营者 { userName pageNum pageSize }") - @LoginRequired +// @LoginRequired public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO)); } diff --git a/src/main/java/com/subsidy/controller/CompanyDictController.java b/src/main/java/com/subsidy/controller/CompanyDictController.java index 5e400ac..c039bca 100644 --- a/src/main/java/com/subsidy/controller/CompanyDictController.java +++ b/src/main/java/com/subsidy/controller/CompanyDictController.java @@ -34,14 +34,14 @@ public class CompanyDictController { private CompanyDictService companyDictService; @PostMapping("/administers") - @ApiOperation("查询所有企业 {id companyName fieldId 行业id pageNum pageSize }") + @ApiOperation("查询所有企业 {id companyName fieldId 行业id superviseName 监管第三方名称 pageNum pageSize }") @LoginRequired public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.operators(operatorsDTO)); } @PostMapping("addCompany") - @ApiOperation("添加企业 {accountName:账号 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员}") + @ApiOperation("添加企业 {accountName:账号 superviseName 第三方监管名称 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员}") @LoginRequired public ResponseVO addOperator(@RequestBody AddCompanyDTO addCompanyDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.addOperator(addCompanyDTO)); @@ -55,7 +55,7 @@ public class CompanyDictController { } @PostMapping("updateCompany") - @ApiOperation("修改企业 id accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员") + @ApiOperation("修改企业 id superviseName 第三方监管名称 accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员") @LoginRequired public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO)); diff --git a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java index 7bae5bb..567085b 100644 --- a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java +++ b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java @@ -19,4 +19,6 @@ public class OperatorsDTO { private Long id; + private String superviseName; + } diff --git a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java index d47635c..5ecde24 100644 --- a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java @@ -24,7 +24,7 @@ public interface CompanyDictMapper extends BaseMapper { * 企业管理--查找所有主账号 、运营者 * @return */ - IPage operators(IPage page, String companyName,Long fieldId,Long id,Integer role); + IPage operators(IPage page, String companyName,Long fieldId,Long id,Integer role,String superviseName); /** * 查找所有的公司名称 diff --git a/src/main/java/com/subsidy/model/CompanyDictDO.java b/src/main/java/com/subsidy/model/CompanyDictDO.java index 84ff62f..cf5d8be 100644 --- a/src/main/java/com/subsidy/model/CompanyDictDO.java +++ b/src/main/java/com/subsidy/model/CompanyDictDO.java @@ -55,5 +55,9 @@ public class CompanyDictDO extends BaseModel { */ private Boolean qxyStatus; + /** + * 第三方监管名称 + */ + private String superviseName; } diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 5a4f371..1eb31e8 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -333,7 +333,7 @@ public class AdministerServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null, 1); + IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null, 1,null); List operatorsVOS = operatorsVOIPage.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index df10d5e..b13ae3a 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -102,7 +102,7 @@ public class CompanyDictServiceImpl extends ServiceImpl 0){ administerDO.setCompanyId(null); } - IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),administerDO.getCompanyId(),2); + IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),administerDO.getCompanyId(),2,operatorsDTO.getSuperviseName()); List operatorsVOS = page.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { //查看公司所在行业 @@ -232,7 +232,7 @@ public class CompanyDictServiceImpl extends ServiceImpl 0) { + if (null != addCompanyDTO.getField() && addCompanyDTO.getField().size() > 0) { companyFieldMappingMapper.delete(new QueryWrapper() .lambda() .eq(CompanyFieldMappingDO::getCompanyId, addCompanyDTO.getId())); @@ -248,14 +248,15 @@ public class CompanyDictServiceImpl extends ServiceImpl imple oprMemDictMapper.insert(oprMemDictDO); //mongoTemplate.insert(oprMemDictDO); userRoleVO.setCompanyId(companyDictDO.getId()); + userRoleVO.setSuperviseName(companyDictDO.getSuperviseName()); userRoleVO.setCompanyName(companyDictDO.getCompanyName()); userRoleVO.setLogo(companyDictDO.getLogo()); userRoleVO.setQxyStatus(companyDictDO.getQxyStatus()); @@ -429,6 +430,7 @@ public class MemberServiceImpl extends ServiceImpl imple //mongoTemplate.insert(oprMemDictDO); oprMemDictMapper.insert(oprMemDictDO); memberVO.setCompanyId(companyDictDO.getId()); + memberVO.setSuperviseName(companyDictDO.getSuperviseName()); memberVO.setCompanyName(companyDictDO.getCompanyName()); memberVO.setLogo(companyDictDO.getLogo()); List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() @@ -577,6 +579,7 @@ public class MemberServiceImpl extends ServiceImpl imple oprMemDictDO.setResult(1); oprMemDictMapper.insert(oprMemDictDO); userRoleVO.setCompanyId(companyDictDO.getId()); + userRoleVO.setSuperviseName(companyDictDO.getSuperviseName()); userRoleVO.setCompanyName(companyDictDO.getCompanyName()); userRoleVO.setLogo(companyDictDO.getLogo()); userRoleVO.setQxyStatus(companyDictDO.getQxyStatus()); @@ -663,6 +666,7 @@ public class MemberServiceImpl extends ServiceImpl imple oprMemDictDO.setResult(1); oprMemDictMapper.insert(oprMemDictDO); userRoleVO.setCompanyId(companyDictDO.getId()); + userRoleVO.setSuperviseName(companyDictDO.getSuperviseName()); userRoleVO.setCompanyName(companyDictDO.getCompanyName()); userRoleVO.setLogo(companyDictDO.getLogo()); userRoleVO.setQxyStatus(companyDictDO.getQxyStatus()); diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index 34c7d78..69b657a 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -624,7 +624,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl testPlays(VodPlayHistoryDO vodPlayHistoryDO) { - String classIds = "122,150,151,152,153,165,168,195,199,200,202,203,204,205,206,207,209,210,211,212,213,215,227,228,229,233,234,235,240,241,243,244,248,249,250"; + String classIds = "254"; // String classIds = "122,150"; List classIdArr = Arrays.asList(classIds.split(",")); @@ -641,20 +641,19 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), vodPlayStateVO.getMemberId(), vodPlayStateVO.getEndDate()); +// List vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), vodPlayStateVO.getMemberId(), vodPlayStateVO.getEndDate()); //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推 - for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { - VodPlayHistoryDO vph1 = vodPlayHistoryDOS.get(l); - VodPlayHistoryDO vph2 = vodPlayHistoryDOS.get(l + 1); -// playLength += vph2.getPlayLength(); - LocalDateTime dateTmp = vph1.getCreateDate().minusSeconds(-vph2.getPlayLength() - getRandom1_2()); - vph2.setCreateDate(dateTmp); - this.baseMapper.updateById(vph2); +// for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { +// VodPlayHistoryDO vph1 = vodPlayHistoryDOS.get(l); +// VodPlayHistoryDO vph2 = vodPlayHistoryDOS.get(l + 1); +// LocalDateTime dateTmp = vph1.getCreateDate().minusSeconds(-vph2.getPlayLength() - getRandom1_2()); +// vph2.setCreateDate(dateTmp); +// this.baseMapper.updateById(vph2); // result.add(vodPlayStateVO.getId()); - } +// } } } } diff --git a/src/main/java/com/subsidy/util/BaseModel.java b/src/main/java/com/subsidy/util/BaseModel.java index 9297672..7504dd0 100644 --- a/src/main/java/com/subsidy/util/BaseModel.java +++ b/src/main/java/com/subsidy/util/BaseModel.java @@ -16,7 +16,7 @@ public abstract class BaseModel { * 创建时间 */ @JsonIgnore -// @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) private LocalDateTime createDate; /** diff --git a/src/main/java/com/subsidy/util/SecretUtils.java b/src/main/java/com/subsidy/util/SecretUtils.java index ce402ff..4bff771 100644 --- a/src/main/java/com/subsidy/util/SecretUtils.java +++ b/src/main/java/com/subsidy/util/SecretUtils.java @@ -154,6 +154,6 @@ public class SecretUtils { String uuid = UUID.randomUUID().toString(); System.out.println(uuid.replace("-","")); // System.out.println(hash(uuid+"ixihs")); - System.out.println(System.currentTimeMillis()); +// System.out.println(System.currentTimeMillis()); } } \ No newline at end of file diff --git a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java index bf2e7a7..e2fda11 100644 --- a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java +++ b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java @@ -31,4 +31,6 @@ public class OperatorsVO { private Long companyId; private String logo; + + private String superviseName; } diff --git a/src/main/java/com/subsidy/vo/administer/UserRoleVO.java b/src/main/java/com/subsidy/vo/administer/UserRoleVO.java index 7d7f6a9..91425a8 100644 --- a/src/main/java/com/subsidy/vo/administer/UserRoleVO.java +++ b/src/main/java/com/subsidy/vo/administer/UserRoleVO.java @@ -14,14 +14,14 @@ public class UserRoleVO { private String userName; + private String accountName; + private String image; private String status; private Integer firstLogin; - private String password; - private String companyName; private Boolean qxyStatus; @@ -34,4 +34,6 @@ public class UserRoleVO { private String token; + private String superviseName; + } diff --git a/src/main/java/com/subsidy/vo/member/MemberVO.java b/src/main/java/com/subsidy/vo/member/MemberVO.java index e005c1e..a0e4d6b 100644 --- a/src/main/java/com/subsidy/vo/member/MemberVO.java +++ b/src/main/java/com/subsidy/vo/member/MemberVO.java @@ -16,6 +16,8 @@ public class MemberVO { private String userName; + private String accountName; + private String image; private Integer firstLogin; @@ -31,4 +33,6 @@ public class MemberVO { private List rotationImgDictDOS; private String token; + + private String superviseName; } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 3307c09..eda7c57 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,4 +1,5 @@ # 本地环境配置 +spring.server.port=23457 # 数据源配置 spring.datasource.url=jdbc:mysql://47.97.19.66:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 83b8ad2..602d9bb 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -1,4 +1,5 @@ # 生产环境配置 +spring.server.port=23459 # 数据源配置 spring.datasource.url=jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 37ce64a..624bc84 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,8 +1,5 @@ # 环境配置 spring.profiles.active=prod -# 端口号 -spring.server.port=23459 -#嵌入tomcat配置 #和CPU数 spring.server.acceptorThreadCount=600 spring.server.minSpareThreads=100 diff --git a/src/main/resources/mapper/CompanyDictMapper.xml b/src/main/resources/mapper/CompanyDictMapper.xml index 5c76650..c345db5 100644 --- a/src/main/resources/mapper/CompanyDictMapper.xml +++ b/src/main/resources/mapper/CompanyDictMapper.xml @@ -31,7 +31,8 @@ t.img, t2.company_name, t2.logo, - t2.address + t2.address, + t2.supervise_name FROM administer t left join role_administer_mapping t4 on t.id = t4.administer_id @@ -56,6 +57,9 @@ and t3.field_id = #{fieldId} + + and t2.supervise_name =#{superviseName} + -- libgit2 0.25.0