From b7409820d213d213f90141ee3049ac0d4c5e6780 Mon Sep 17 00:00:00 2001 From: longxiuwen <2691049525@qq.com> Date: Thu, 30 Mar 2023 19:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=8E=A5=E5=8F=A3=E7=BC=96?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-dao/pom.xml | 3 + .../pojo/dto/AddEducationResourceDto.java | 12 ++ .../bean/pojo/dto/AddEducationStudyDto.java | 10 + .../bean/pojo/vo/EducationResourceVo.java | 11 + .../bean/pojo/vo/EducationStudyListVo.java | 12 ++ .../rzyc/bean/pojo/vo/EducationStudyVo.java | 124 ++++++++++++ .../com/rzyc/mapper/EducationStudyMapper.java | 1 + .../com/rzyc/mapper/ent/EntUserMapper.java | 2 + .../com/rzyc/model/EducationResource.java | 26 ++- .../java/com/rzyc/model/EducationStudy.java | 14 +- .../mapper/EducationResourceMapper.xml | 21 +- .../resources/mapper/EducationStudyMapper.xml | 27 ++- .../resources/mapper/ent/EntUserMapper.xml | 188 ++++++++++-------- inventory-ent/pom.xml | 6 + .../controller/EducationStudyController.java | 114 ++++++++++- .../java/com/rzyc/service/TaskService.java | 4 - .../com/rzyc/utils/StringEncryptorTest.java | 6 - .../com/rzyc/utils/easyexcel/ReadTest.java | 4 +- .../src/main/resources/application-dev.yml | 2 +- .../src/main/resources/application.yml | 1 + .../controller/IndustryListController.java | 22 +- .../src/main/resources/application-dev.yml | 2 +- 22 files changed, 487 insertions(+), 125 deletions(-) create mode 100644 inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyVo.java diff --git a/inventory-dao/pom.xml b/inventory-dao/pom.xml index 11139b6..cd296b8 100644 --- a/inventory-dao/pom.xml +++ b/inventory-dao/pom.xml @@ -14,6 +14,9 @@ + + + com.rzyc utils diff --git a/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationResourceDto.java b/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationResourceDto.java index c450aeb..9efc563 100644 --- a/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationResourceDto.java +++ b/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationResourceDto.java @@ -36,6 +36,18 @@ public class AddEducationResourceDto { @TableField("content") private String content; + @ApiModelProperty(value = "图片") + @TableField("img") + private String img; + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + public String getId() { return id; } diff --git a/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationStudyDto.java b/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationStudyDto.java index c614e00..30e90ba 100644 --- a/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationStudyDto.java +++ b/inventory-dao/src/main/java/com/rzyc/bean/pojo/dto/AddEducationStudyDto.java @@ -31,12 +31,22 @@ public class AddEducationStudyDto { @NotBlank(message = "不能为空") private String userId; + @ApiModelProperty(value = "成员id多个‘,’分割") + private String memberId; + @ApiModelProperty(value = "培训的学习时间") private String studyDate; @ApiModelProperty(value = "培训的学习单位") private String studyUnit; + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } public String getId() { return id; diff --git a/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationResourceVo.java b/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationResourceVo.java index dac2013..a1f8134 100644 --- a/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationResourceVo.java +++ b/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationResourceVo.java @@ -23,6 +23,9 @@ public class EducationResourceVo { @ApiModelProperty(value = "上传人id") private String userId; + @ApiModelProperty(value = "图片") + private String img; + @ApiModelProperty(value = "资料名") private String name; @@ -56,6 +59,14 @@ public class EducationResourceVo { this.userId = userId; } + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + public String getName() { return name; } diff --git a/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyListVo.java b/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyListVo.java index cdc9e31..2b67399 100644 --- a/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyListVo.java +++ b/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyListVo.java @@ -32,6 +32,10 @@ public class EducationStudyListVo { @TableField("user_id") private String userId; + @ApiModelProperty(value = "成员名字(,分割)") + @TableField("member_id") + private String memberId; + @ApiModelProperty(value = "培训的学习时间") @TableField("study_date") private String studyDate; @@ -40,6 +44,14 @@ public class EducationStudyListVo { @TableField("study_unit") private String studyUnit; + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + public String getId() { return id; } diff --git a/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyVo.java b/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyVo.java new file mode 100644 index 0000000..dd80f94 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/bean/pojo/vo/EducationStudyVo.java @@ -0,0 +1,124 @@ +package com.rzyc.bean.pojo.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; + +/** + * @BelongsProject: inventory-api + * @BelongsPackage: com.rzyc.bean.pojo.vo + * @Author: SYZ + * @CreateTime: 2023-03-30 13:08 + * @Version: 1.0 + */ +public class EducationStudyVo { + + @ApiModelProperty(value = "主键") + @TableId("id") + private String id; + + @ApiModelProperty(value = "企业id") + @TableField("enterprise_id") + private String enterpriseId; + + @ApiModelProperty(value = "摘要") + @TableField("title") + private String title; + + @ApiModelProperty(value = "内容") + @TableField("content") + private String content; + + @ApiModelProperty(value = "上传人id") + @TableField("user_id") + private String userId; + + @ApiModelProperty(value = "成员名字(,分割)") + @TableField("member_id") + private String memberNames; + + @ApiModelProperty(value = "培训的学习时间") + @TableField("study_date") + private String studyDate; + + @ApiModelProperty(value = "培训的学习单位") + @TableField("study_unit") + private String studyUnit; + + @ApiModelProperty(value = "创建时间") + @TableField("create_time") + private String createTime; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getMemberNames() { + return memberNames; + } + + public void setMemberNames(String memberNames) { + this.memberNames = memberNames; + } + + public String getStudyDate() { + return studyDate; + } + + public void setStudyDate(String studyDate) { + this.studyDate = studyDate; + } + + public String getStudyUnit() { + return studyUnit; + } + + public void setStudyUnit(String studyUnit) { + this.studyUnit = studyUnit; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } +} + diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EducationStudyMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EducationStudyMapper.java index 458f224..7aa24a8 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EducationStudyMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EducationStudyMapper.java @@ -22,6 +22,7 @@ public interface EducationStudyMapper extends BaseMapper { List selectEducationStudyList(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("enterpriseId") String enterpriseId, + @Param("memberId") String memberId, @Param("queryWord") String queryWord); } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java index 16c48ce..0c4ccac 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java @@ -18,6 +18,8 @@ import java.util.List; @Repository public interface EntUserMapper extends BaseMapper { + List selectUsernamesByIds(@Param("ids") List ids); + /** * 查询企业用户by名字 * @param name 用户名 diff --git a/inventory-dao/src/main/java/com/rzyc/model/EducationResource.java b/inventory-dao/src/main/java/com/rzyc/model/EducationResource.java index 9c1bed1..12fbc17 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EducationResource.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EducationResource.java @@ -14,7 +14,7 @@ import io.swagger.annotations.ApiModelProperty; *

* * @author - * @since 2023-03-29 + * @since 2023-03-30 */ @TableName("education_resource") @ApiModel(value="EducationResource对象", description="") @@ -42,6 +42,14 @@ public class EducationResource implements Serializable { @TableField("content") private String content; + @ApiModelProperty(value = "图片") + @TableField("img") + private String img; + + @ApiModelProperty(value = "培训时间") + @TableField("study_date") + private Date studyDate; + @ApiModelProperty(value = "创建时间") @TableField("create_time") private Date createTime; @@ -85,6 +93,20 @@ public class EducationResource implements Serializable { public void setContent(String content) { this.content = content; } + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + public Date getStudyDate() { + return studyDate; + } + + public void setStudyDate(Date studyDate) { + this.studyDate = studyDate; + } public Date getCreateTime() { return createTime; } @@ -108,6 +130,8 @@ public class EducationResource implements Serializable { ", userId=" + userId + ", name=" + name + ", content=" + content + + ", img=" + img + + ", studyDate=" + studyDate + ", createTime=" + createTime + ", modifyTime=" + modifyTime + "}"; diff --git a/inventory-dao/src/main/java/com/rzyc/model/EducationStudy.java b/inventory-dao/src/main/java/com/rzyc/model/EducationStudy.java index a0ac0f4..be4a79d 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EducationStudy.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EducationStudy.java @@ -14,7 +14,7 @@ import io.swagger.annotations.ApiModelProperty; *

* * @author - * @since 2023-03-27 + * @since 2023-03-30 */ @TableName("education_study") @ApiModel(value="EducationStudy对象", description="教育培训表") @@ -42,6 +42,10 @@ public class EducationStudy implements Serializable { @TableField("user_id") private String userId; + @ApiModelProperty(value = "成员名字(,分割)") + @TableField("member_id") + private String memberId; + @ApiModelProperty(value = "培训的学习时间") @TableField("study_date") private Date studyDate; @@ -89,6 +93,13 @@ public class EducationStudy implements Serializable { public void setUserId(String userId) { this.userId = userId; } + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } public Date getStudyDate() { return studyDate; } @@ -119,6 +130,7 @@ public class EducationStudy implements Serializable { ", title=" + title + ", content=" + content + ", userId=" + userId + + ", memberId=" + memberId + ", studyDate=" + studyDate + ", studyUnit=" + studyUnit + ", createTime=" + createTime + diff --git a/inventory-dao/src/main/resources/mapper/EducationResourceMapper.xml b/inventory-dao/src/main/resources/mapper/EducationResourceMapper.xml index 09ad859..1ab5f4c 100644 --- a/inventory-dao/src/main/resources/mapper/EducationResourceMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EducationResourceMapper.xml @@ -4,22 +4,23 @@ - - - - - - - + + + + + + + + + - id - , industry_id, user_id, name, content, create_time, modify_time + id, industry_id, user_id, name, content, img, study_date, create_time, modify_time - SELECT id,enterprise_id,title,content,user_id,DATE_FORMAT(study_date,'%Y-%m-%d')'study_date',study_unit + SELECT id,enterprise_id,title,content,user_id,member_id,DATE_FORMAT(study_date,'%Y-%m-%d')'study_date',study_unit FROM `education_study` WHERE enterprise_id = #{enterpriseId} + + and find_in_set(#{memberId}, member_id) + and title like concat('%',#{queryWord},'%') @@ -33,4 +37,7 @@ Order By create_time DESC + + + diff --git a/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml b/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml index 8ecc64a..153c84c 100644 --- a/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml +++ b/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml @@ -4,47 +4,51 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - ent_user_id, post_id, enterprise_id, name, mobile, user_type, age, work_time, password, post_path, post_path_name, create_time, create_by, modify_time, modify_by + ent_user_id + , post_id, enterprise_id, name, mobile, user_type, age, work_time, password, post_path, post_path_name, create_time, create_by, modify_time, modify_by - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -57,89 +61,111 @@ - update ent_user set post_id = #{entUser.postId}, - enterprise_id = #{entUser.enterpriseId}, - name = #{entUser.name}, - mobile = #{entUser.mobile}, - user_type = #{entUser.userType}, - age = #{entUser.age}, - work_time = #{entUser.workTime}, - password = #{entUser.password}, - post_path = #{entUser.postPath}, + update ent_user + set post_id = #{entUser.postId}, + enterprise_id = #{entUser.enterpriseId}, + name = #{entUser.name}, + mobile = #{entUser.mobile}, + user_type = #{entUser.userType}, + age = #{entUser.age}, + work_time = #{entUser.workTime}, + password = #{entUser.password}, + post_path = #{entUser.postPath}, post_path_name = #{entUser.postPathName}, - job_number = #{entUser.jobNumber}, - modify_time = #{entUser.modifyTime}, - modify_by = #{entUser.modifyBy} - where ent_user_id = #{entUser.entUserId} + job_number = #{entUser.jobNumber}, + modify_time = #{entUser.modifyTime}, + modify_by = #{entUser.modifyBy} + where ent_user_id = #{entUser.entUserId} - update ent_user set use_state = #{useState} where ent_user_id = #{entUserId} + update ent_user + set use_state = #{useState} + where ent_user_id = #{entUserId} - delete from ent_user where post_path_name = #{legalPerson} and enterprise_id = #{enterpriseId} + delete + from ent_user + where post_path_name = #{legalPerson} + and enterprise_id = #{enterpriseId} - + + diff --git a/inventory-ent/pom.xml b/inventory-ent/pom.xml index db0314f..bc6b68c 100644 --- a/inventory-ent/pom.xml +++ b/inventory-ent/pom.xml @@ -227,6 +227,12 @@ easyexcel 3.1.3
+ + org.testng + testng + RELEASE + compile +
diff --git a/inventory-ent/src/main/java/com/rzyc/controller/EducationStudyController.java b/inventory-ent/src/main/java/com/rzyc/controller/EducationStudyController.java index 33caa89..cec0b39 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/EducationStudyController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/EducationStudyController.java @@ -7,18 +7,21 @@ import com.common.utils.model.Code; import com.common.utils.model.SingleResult; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; -import com.rzyc.bean.pojo.dto.AddEducationResourceDto; import com.rzyc.bean.pojo.dto.AddEducationStudyDto; import com.rzyc.bean.pojo.vo.EducationResourceVo; import com.rzyc.bean.pojo.vo.EducationStudyListVo; +import com.rzyc.bean.pojo.vo.EducationStudyVo; import com.rzyc.bean.pojo.vo.ListPageVo; import com.rzyc.bean.task.dto.PageDto; import com.rzyc.model.EducationResource; import com.rzyc.model.EducationStudy; +import com.rzyc.model.ent.SysEnterprise; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.validation.annotation.Validated; @@ -26,7 +29,8 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotBlank; -import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -46,6 +50,9 @@ import java.util.stream.Collectors; @Validated public class EducationStudyController extends BaseController { + protected final static Logger logger = LoggerFactory.getLogger(EducationStudyController.class); + + /** * @description:获取培训学习列表 * @author: SYZ @@ -56,11 +63,12 @@ public class EducationStudyController extends BaseController { @ApiOperation(value = "获取培训学习列表") @ApiImplicitParams({ @ApiImplicitParam(name = "year", value = "年份", dataType = "int", paramType = "query"), - @ApiImplicitParam(name = "enterpriseId", value = "企业id", dataType = "string", paramType = "query", required = true) + @ApiImplicitParam(name = "enterpriseId", value = "企业id", dataType = "string", paramType = "query", required = true), + @ApiImplicitParam(name = "memberId", value = "成员id", dataType = "string", paramType = "query") }) @GetMapping("/getList") @ResponseBody - public SingleResult> getList(@Valid PageDto dto, Integer year, String enterpriseId) throws Exception { + public SingleResult> getList(@Valid PageDto dto, Integer year, String enterpriseId,String memberId) { SingleResult> result = new SingleResult<>(); String startDate = ""; String endDate = ""; @@ -69,7 +77,7 @@ public class EducationStudyController extends BaseController { endDate = DateUtils.parseDate2String(DateUtils.getLastDayOfMonth(year, 12), "yyyy-MM-dd HH:mm:ss"); } PageHelper.startPage(dto.getPage(), dto.getPageSize()); - Page list = (Page) educationStudyMapper.selectEducationStudyList(startDate, endDate, enterpriseId, dto.getCondition()); + Page list = (Page) educationStudyMapper.selectEducationStudyList(startDate, endDate, enterpriseId,memberId, dto.getCondition());; ListPageVo pageVo = new ListPageVo<>(); pageVo.setRows(list); pageVo.setTotal(list.getTotal()); @@ -79,6 +87,8 @@ public class EducationStudyController extends BaseController { return result; } + + /** * @description:添加培训学习 * @author: SYZ @@ -89,7 +99,7 @@ public class EducationStudyController extends BaseController { @ApiOperation(value = "添加培训学习") @PostMapping("/addOne") @ResponseBody - public SingleResult addOne(@Valid AddEducationStudyDto dto) { + public SingleResult addOne(@RequestBody @Valid AddEducationStudyDto dto) { SingleResult result = new SingleResult<>(); Integer count = educationStudyMapper.selectCount( new QueryWrapper().select("1").eq("id", dto.getId()) @@ -100,6 +110,7 @@ public class EducationStudyController extends BaseController { educationStudy.setTitle(StringUtils.isBlank(dto.getTitle()) ? "" : dto.getTitle()); educationStudy.setContent(StringUtils.isBlank(dto.getContent()) ? "" : dto.getContent()); educationStudy.setUserId(StringUtils.isBlank(dto.getUserId()) ? "" : dto.getUserId()); + educationStudy.setMemberId(StringUtils.isBlank(dto.getMemberId()) ? "" : dto.getMemberId()); educationStudy.setStudyDate(DateUtils.parseString2Date(dto.getStudyDate(), "yyyy-MM-dd")); educationStudy.setStudyUnit(StringUtils.isBlank(dto.getStudyUnit()) ? "" : dto.getStudyUnit()); educationStudy.setCreateTime(new Date()); @@ -129,6 +140,97 @@ public class EducationStudyController extends BaseController { return (0 == delRow) ? result.setCodeMessageChain(Code.ERROR.getCode(), "失败") : result.setCodeMessageChain(Code.SUCCESS.getCode(), "成功"); } + /** + * @description:获取培训学习详情 + * @author: SYZ + * @date: 2023/3/30 14:36 + * @param: [id] + * @return: com.common.utils.model.SingleResult + **/ + @ApiOperation(value = "获取培训学习详情") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "主键", dataType = "string", paramType = "query", required = true) + }) + @GetMapping("/getDetails") + @ResponseBody + public SingleResult getDetails(@NotBlank(message = "id不能为空") String id){ + SingleResult result = new SingleResult<>(); + EducationStudy educationStudy = educationStudyMapper.selectById(id); + List memberIds = Arrays.asList(educationStudy.getMemberId().split(",")); + logger.info("memberIds: => {}",memberIds); + List strings = entUserMapper.selectUsernamesByIds(memberIds); + logger.info("memberNames: => {}",strings); + StringBuilder strb = new StringBuilder(); + for (int i=0;i> + **/ + @ApiOperation(value = "获取培训资料列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "entId",value = "企业id",dataType = "string",paramType = "query",required = true) + }) + @GetMapping("/getEducationResourceList") + @ResponseBody + public SingleResult> getEducationResourceList(@Valid PageDto dto,String entId){ + SingleResult> result = new SingleResult<>(); + SysEnterprise sysEnterprise = sysEnterpriseMapper.selectOne( + new QueryWrapper().select("*").eq("SysEnterpriseId",entId) + ); + if (null == sysEnterprise){ + return result.setCodeMessageChain(Code.ERROR.getCode(), "企业id错误"); + } + PageHelper.startPage(dto.getPage(), dto.getPageSize()); + Page page = (Page) educationResourceMapper.selectEducationResourceList(dto.getCondition(),sysEnterprise.getWorkClassId()); + ListPageVo pageVo = new ListPageVo<>(); + pageVo.setRows(page); + pageVo.setTotal(page.getTotal()); + pageVo.setPage(page.getPageNum()); + pageVo.setPageSize(page.getPageSize()); + result.setData(pageVo); + return result; + } + + + /** + * @description:获取培训资料详情 + * @author: SYZ + * @date: 2023/3/30 14:37 + * @param: [id] + * @return: com.common.utils.model.SingleResult + **/ + @ApiOperation(value = "获取培训资料详情") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "主键",dataType = "string",paramType = "query",required = true) + }) + @GetMapping("/getEducationResourceDetails") + @ResponseBody + public SingleResult getEducationResourceDetails(@NotBlank(message = "id不能为空") String id){ + SingleResult result = new SingleResult<>(); + EducationResource educationResource = educationResourceMapper.selectById(id); + result.setData(educationResource); + return result; + } diff --git a/inventory-ent/src/main/java/com/rzyc/service/TaskService.java b/inventory-ent/src/main/java/com/rzyc/service/TaskService.java index c38bd9e..11dae93 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/TaskService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/TaskService.java @@ -3,7 +3,6 @@ package com.rzyc.service; import com.common.utils.DateUtils; import com.common.utils.RandomNumber; import com.common.utils.encryption.MD5; -import com.common.utils.model.SingleResult; import com.rzyc.bean.check.CheckPerform; import com.rzyc.controller.BaseController; import com.rzyc.model.*; @@ -11,11 +10,8 @@ import com.rzyc.model.check.BookEntHT; import com.rzyc.model.check.BookenthtCompany; import com.rzyc.model.ent.SysEnterprise; import com.rzyc.model.user.SysUser; -import org.junit.Test; import org.springframework.stereotype.Service; -import java.text.DateFormat; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; diff --git a/inventory-ent/src/main/java/com/rzyc/utils/StringEncryptorTest.java b/inventory-ent/src/main/java/com/rzyc/utils/StringEncryptorTest.java index 71936c8..ddd7c7d 100644 --- a/inventory-ent/src/main/java/com/rzyc/utils/StringEncryptorTest.java +++ b/inventory-ent/src/main/java/com/rzyc/utils/StringEncryptorTest.java @@ -3,16 +3,10 @@ package com.rzyc.utils; import com.rzyc.controller.BaseController; -import com.rzyc.model.EntDeviceInsCycle; import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; import org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig; import org.junit.Test; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.List; - /** * 配置类脱敏加密工具 diff --git a/inventory-ent/src/main/java/com/rzyc/utils/easyexcel/ReadTest.java b/inventory-ent/src/main/java/com/rzyc/utils/easyexcel/ReadTest.java index 635556c..71c61f7 100644 --- a/inventory-ent/src/main/java/com/rzyc/utils/easyexcel/ReadTest.java +++ b/inventory-ent/src/main/java/com/rzyc/utils/easyexcel/ReadTest.java @@ -6,9 +6,9 @@ import com.rzyc.mapper.ent.BaseInClassMapper; import com.rzyc.mapper.ent.InListItemMapper; import com.rzyc.mapper.ent.InListMapper; import com.rzyc.model.EasyExcel.EasyExcelInList; +import jdk.nashorn.internal.ir.annotations.Ignore; import lombok.extern.slf4j.Slf4j; -import org.junit.Ignore; -import org.junit.Test; + import org.springframework.beans.factory.annotation.Autowired; /** diff --git a/inventory-ent/src/main/resources/application-dev.yml b/inventory-ent/src/main/resources/application-dev.yml index 4ab94de..4046ba0 100644 --- a/inventory-ent/src/main/resources/application-dev.yml +++ b/inventory-ent/src/main/resources/application-dev.yml @@ -38,7 +38,7 @@ spring: #数据库 datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://121.40.106.103:3306/inventory_copy?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false& + url: jdbc:mysql://121.40.106.103:3306/inventory_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false& username: rzyc password: ENC(FDlRK2MAcJBMF7UBHBJPLGzRkpWQ4T6dgYP2bDnTodQ=) tomcat: diff --git a/inventory-ent/src/main/resources/application.yml b/inventory-ent/src/main/resources/application.yml index a6560f0..7a61ab4 100644 --- a/inventory-ent/src/main/resources/application.yml +++ b/inventory-ent/src/main/resources/application.yml @@ -5,3 +5,4 @@ spring: + diff --git a/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java b/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java index 0361fca..eb8011f 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java @@ -421,6 +421,7 @@ public class IndustryListController extends BaseController{ BeanUtils.copyProperties(dto,educationResource); educationResource.setName(StringUtils.isBlank(dto.getName()) ? "" : dto.getName()); educationResource.setContent(StringUtils.isBlank(dto.getContent()) ? "" : dto.getContent()); + educationResource.setImg(StringUtils.isBlank(dto.getImg()) ? "" : dto.getImg()); if (0 == count){ educationResource.setCreateTime(new Date()); educationResource.setModifyTime(new Date()); @@ -450,8 +451,25 @@ public class IndustryListController extends BaseController{ return (0 == delRow) ? result.setCodeMessageChain(Code.ERROR.getCode(), "失败") : result.setCodeMessageChain(Code.SUCCESS.getCode(), "成功"); } - - + /** + * @description:获取培训资料详情 + * @author: SYZ + * @date: 2023/3/30 14:37 + * @param: [id] + * @return: com.common.utils.model.SingleResult + **/ + @ApiOperation(value = "获取培训资料详情") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "主键",dataType = "string",paramType = "query",required = true) + }) + @GetMapping("/getEducationResourceDetails") + @ResponseBody + public SingleResult getEducationResourceDetails(@NotBlank(message = "id不能为空") String id){ + SingleResult result = new SingleResult<>(); + EducationResource educationResource = educationResourceMapper.selectById(id); + result.setData(educationResource); + return result; + } diff --git a/inventory-gov/src/main/resources/application-dev.yml b/inventory-gov/src/main/resources/application-dev.yml index e577c31..be3ca07 100644 --- a/inventory-gov/src/main/resources/application-dev.yml +++ b/inventory-gov/src/main/resources/application-dev.yml @@ -40,7 +40,7 @@ spring: #数据库 datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://121.40.106.103:3306/inventory_copy?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false + url: jdbc:mysql://121.40.106.103:3306/inventory_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false username: rzyc password: ENC(FDlRK2MAcJBMF7UBHBJPLGzRkpWQ4T6dgYP2bDnTodQ=) tomcat: