新的接口编写
This commit is contained in:
parent
8a2f08e44e
commit
b7409820d2
|
|
@ -14,6 +14,9 @@
|
|||
</properties>
|
||||
<dependencies>
|
||||
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.rzyc</groupId>
|
||||
<artifactId>utils</artifactId>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -22,6 +22,7 @@ public interface EducationStudyMapper extends BaseMapper<EducationStudy> {
|
|||
List<EducationStudyListVo> selectEducationStudyList(@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("enterpriseId") String enterpriseId,
|
||||
@Param("memberId") String memberId,
|
||||
@Param("queryWord") String queryWord);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface EntUserMapper extends BaseMapper<EntUser> {
|
||||
|
||||
List<String> selectUsernamesByIds(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 查询企业用户by名字
|
||||
* @param name 用户名
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
|
|
|
|||
|
|
@ -4,22 +4,23 @@
|
|||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.rzyc.model.EducationResource">
|
||||
<id column="id" property="id"/>
|
||||
<result column="industry_id" property="industryId"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<id column="id" property="id" />
|
||||
<result column="industry_id" property="industryId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="name" property="name" />
|
||||
<result column="content" property="content" />
|
||||
<result column="img" property="img" />
|
||||
<result column="study_date" property="studyDate" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</sql>
|
||||
<select id="selectEducationResourceList" resultType="com.rzyc.bean.pojo.vo.EducationResourceVo">
|
||||
SELECT id,industry_id,user_id,`name`,content,DATE_FORMAT(create_time,'%Y-%m-%d')create_time
|
||||
SELECT id,industry_id,user_id,img,`name`,DATE_FORMAT(create_time,'%Y-%m-%d')create_time
|
||||
FROM `education_resource`
|
||||
WHERE industry_id = #{industryId}
|
||||
<if test="queryWord!=null and queryWord!=''">
|
||||
|
|
|
|||
|
|
@ -5,24 +5,28 @@
|
|||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.rzyc.model.EducationStudy">
|
||||
<id column="id" property="id"/>
|
||||
<result column="enterprise_id" property="enterpriseId"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="study_date" property="studyDate"/>
|
||||
<result column="study_unit" property="studyUnit"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<id column="id" property="id" />
|
||||
<result column="enterprise_id" property="enterpriseId" />
|
||||
<result column="title" property="title" />
|
||||
<result column="content" property="content" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="member_id" property="memberId" />
|
||||
<result column="study_date" property="studyDate" />
|
||||
<result column="study_unit" property="studyUnit" />
|
||||
<result column="create_time" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, enterprise_id, title, content, user_id, study_date, study_unit, create_time
|
||||
id, enterprise_id, title, content, user_id, member_id, study_date, study_unit, create_time
|
||||
</sql>
|
||||
<select id="selectEducationStudyList" resultType="com.rzyc.bean.pojo.vo.EducationStudyListVo">
|
||||
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}
|
||||
<if test="memberId!=null and memberId!=''">
|
||||
and find_in_set(#{memberId}, member_id)
|
||||
</if>
|
||||
<if test="queryWord!=null and queryWord!=''">
|
||||
and title like concat('%',#{queryWord},'%')
|
||||
</if>
|
||||
|
|
@ -33,4 +37,7 @@
|
|||
Order By create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -4,47 +4,51 @@
|
|||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.rzyc.model.ent.EntUser">
|
||||
<id column="ent_user_id" property="entUserId" />
|
||||
<result column="post_id" property="postId" />
|
||||
<result column="enterprise_id" property="enterpriseId" />
|
||||
<result column="name" property="name" />
|
||||
<result column="mobile" property="mobile" />
|
||||
<result column="user_type" property="userType" />
|
||||
<result column="age" property="age" />
|
||||
<result column="work_time" property="workTime" />
|
||||
<result column="password" property="password" />
|
||||
<result column="post_path" property="postPath" />
|
||||
<result column="post_path_name" property="postPathName" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
<result column="modify_by" property="modifyBy" />
|
||||
<id column="ent_user_id" property="entUserId"/>
|
||||
<result column="post_id" property="postId"/>
|
||||
<result column="enterprise_id" property="enterpriseId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="mobile" property="mobile"/>
|
||||
<result column="user_type" property="userType"/>
|
||||
<result column="age" property="age"/>
|
||||
<result column="work_time" property="workTime"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="post_path" property="postPath"/>
|
||||
<result column="post_path_name" property="postPathName"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="create_by" property="createBy"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<result column="modify_by" property="modifyBy"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectByName" resultMap="BaseResultMap">
|
||||
select * from ent_user where name = #{name} and use_state = 1
|
||||
select *
|
||||
from ent_user
|
||||
where name = #{name}
|
||||
and use_state = 1
|
||||
</select>
|
||||
|
||||
<resultMap id="entUserListStatistic" type="com.rzyc.model.ent.EntUser">
|
||||
<id column="ent_user_id" property="entUserId" />
|
||||
<result column="post_id" property="postId" />
|
||||
<result column="enterprise_id" property="enterpriseId" />
|
||||
<result column="name" property="name" />
|
||||
<result column="mobile" property="mobile" />
|
||||
<result column="user_type" property="userType" />
|
||||
<result column="age" property="age" />
|
||||
<result column="work_time" property="workTime" />
|
||||
<result column="password" property="password" />
|
||||
<result column="post_path" property="postPath" />
|
||||
<result column="post_path_name" property="postPathName" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="modify_by" property="modifyBy" />
|
||||
<id column="ent_user_id" property="entUserId"/>
|
||||
<result column="post_id" property="postId"/>
|
||||
<result column="enterprise_id" property="enterpriseId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="mobile" property="mobile"/>
|
||||
<result column="user_type" property="userType"/>
|
||||
<result column="age" property="age"/>
|
||||
<result column="work_time" property="workTime"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="post_path" property="postPath"/>
|
||||
<result column="post_path_name" property="postPathName"/>
|
||||
<result column="create_by" property="createBy"/>
|
||||
<result column="modify_by" property="modifyBy"/>
|
||||
<result column="noTimeout" property="noTimeout"/>
|
||||
<result column="overtime" property="overtime"/>
|
||||
<result column="ongoingTask" property="ongoingTask"/>
|
||||
|
|
@ -57,89 +61,111 @@
|
|||
|
||||
<select id="selectEntUserList" resultMap="entUserListStatistic">
|
||||
select t1.*,sum(case when task_state = 1 then 1 else 0 end) as ongoingTask,
|
||||
sum(case when task_state = 2 then 1 else 0 end) as finishTask,
|
||||
sum(case when task_state = 3 then 1 else 0 end) as overTimeTask
|
||||
from (select eu.ent_user_id,eu.post_id,eu.enterprise_id,eu.name,eu.mobile,eu.user_type,eu.age,eu.work_time,eu.password,eu.post_path,eu.post_path_name,eu.create_by,eu.modify_by,eu.job_number,
|
||||
ep.name postName,eut.name userTypeName,
|
||||
sum(case when credential_state = 1 then 1 else 0 end)as noTimeout,
|
||||
sum(case when credential_state = 2 then 1 else 0 end)as overtime
|
||||
sum(case when task_state = 2 then 1 else 0 end) as finishTask,
|
||||
sum(case when task_state = 3 then 1 else 0 end) as overTimeTask
|
||||
from (select
|
||||
eu.ent_user_id,eu.post_id,eu.enterprise_id,eu.name,eu.mobile,eu.user_type,eu.age,eu.work_time,eu.password,eu.post_path,eu.post_path_name,eu.create_by,eu.modify_by,eu.job_number,
|
||||
ep.name postName,eut.name userTypeName,
|
||||
sum(case when credential_state = 1 then 1 else 0 end)as noTimeout,
|
||||
sum(case when credential_state = 2 then 1 else 0 end)as overtime
|
||||
from ent_user eu
|
||||
left join ent_post ep on eu.post_id = ep.post_id
|
||||
left join ent_user_credential euc on eu.ent_user_id = euc.ent_user_id
|
||||
left join ent_user_type eut on eut.id = eu.user_type
|
||||
where eu.use_state = 1
|
||||
<if test="null != keyContent and '' != keyContent">
|
||||
and ( eu.name like concat('%',#{keyContent},'%')
|
||||
or eu.job_number like concat('%',#{keyContent},'%')
|
||||
or ep.name like concat('%',#{keyContent},'%'))
|
||||
</if>
|
||||
<if test="null != postId and '' != postId">
|
||||
and eu.post_path like concat('%',#{postId},'%')
|
||||
</if>
|
||||
<if test="null != userType and '' != userType">
|
||||
and eu.user_type = #{userType}
|
||||
</if>
|
||||
<if test="null != enterpriseId and '' != enterpriseId">
|
||||
and eu.enterprise_id = #{enterpriseId}
|
||||
</if>
|
||||
group by eu.ent_user_id)as t1
|
||||
left join ent_post_task ept on t1.ent_user_id = ept.ent_user_id
|
||||
group by t1.ent_user_id
|
||||
left join ent_post ep on eu.post_id = ep.post_id
|
||||
left join ent_user_credential euc on eu.ent_user_id = euc.ent_user_id
|
||||
left join ent_user_type eut on eut.id = eu.user_type
|
||||
where eu.use_state = 1
|
||||
<if test="null != keyContent and '' != keyContent">
|
||||
and ( eu.name like concat('%',#{keyContent},'%')
|
||||
or eu.job_number like concat('%',#{keyContent},'%')
|
||||
or ep.name like concat('%',#{keyContent},'%'))
|
||||
</if>
|
||||
<if test="null != postId and '' != postId">
|
||||
and eu.post_path like concat('%',#{postId},'%')
|
||||
</if>
|
||||
<if test="null != userType and '' != userType">
|
||||
and eu.user_type = #{userType}
|
||||
</if>
|
||||
<if test="null != enterpriseId and '' != enterpriseId">
|
||||
and eu.enterprise_id = #{enterpriseId}
|
||||
</if>
|
||||
group by eu.ent_user_id)as t1
|
||||
left join ent_post_task ept on t1.ent_user_id = ept.ent_user_id
|
||||
group by t1.ent_user_id
|
||||
</select>
|
||||
|
||||
<select id="selectEntUserListNoPage" resultMap="BaseResultMap">
|
||||
select * from ent_user eu where eu.user_type = 2 and use_state = 1
|
||||
select * from ent_user eu where eu.user_type = 2 and use_state = 1
|
||||
<if test="null != name and '' != name">
|
||||
and eu.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="null != enterpriseId and '' != enterpriseId">
|
||||
and eu.enterprise_id = #{enterpriseId}
|
||||
and eu.enterprise_id = #{enterpriseId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="updateEntUser" parameterType="com.rzyc.model.ent.EntUser">
|
||||
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>
|
||||
<update id="stopUseEntUser">
|
||||
update ent_user set use_state = #{useState} where ent_user_id = #{entUserId}
|
||||
update ent_user
|
||||
set use_state = #{useState}
|
||||
where ent_user_id = #{entUserId}
|
||||
</update>
|
||||
|
||||
<select id="validMobile" resultMap="BaseResultMap">
|
||||
select ent_user_id,name,mobile,password,post_id from ent_user where mobile = #{mobile}
|
||||
<if test="null != entUserId and '' != entUserId" >
|
||||
and ent_user_id != #{entUserId}
|
||||
<if test="null != entUserId and '' != entUserId">
|
||||
and ent_user_id != #{entUserId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="validAccount" resultMap="BaseResultMap">
|
||||
select ent_user_id,name,mobile,password,post_id from ent_user where account = #{account}
|
||||
<if test="null != entUserId and '' != entUserId" >
|
||||
and ent_user_id != #{entUserId}
|
||||
<if test="null != entUserId and '' != entUserId">
|
||||
and ent_user_id != #{entUserId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="validName" resultMap="BaseResultMap">
|
||||
select ent_user_id,name,mobile from ent_user where name = #{name}
|
||||
select ent_user_id, name, mobile
|
||||
from ent_user
|
||||
where name = #{name}
|
||||
</select>
|
||||
|
||||
<delete id="deleteLegalPerson">
|
||||
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}
|
||||
</delete>
|
||||
|
||||
<select id="selectNoEntPostListUser" resultMap="BaseResultMap">
|
||||
select eu.* from ent_user eu left join ent_post_list epl on eu.ent_user_id = epl.ent_user_id and epl.post_list_id is null
|
||||
select eu.*
|
||||
from ent_user eu
|
||||
left join ent_post_list epl on eu.ent_user_id = epl.ent_user_id and epl.post_list_id is null
|
||||
</select>
|
||||
<select id="selectUsernamesByIds" resultType="java.lang.String" parameterType="java.util.List">
|
||||
select name
|
||||
FROM ent_user
|
||||
where
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
ent_user_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -227,6 +227,12 @@
|
|||
<artifactId>easyexcel</artifactId>
|
||||
<version>3.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- easyExcel -->
|
||||
|
||||
</dependencies>
|
||||
|
|
|
|||
|
|
@ -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<ListPageVo<EducationStudyListVo>> getList(@Valid PageDto dto, Integer year, String enterpriseId) throws Exception {
|
||||
public SingleResult<ListPageVo<EducationStudyListVo>> getList(@Valid PageDto dto, Integer year, String enterpriseId,String memberId) {
|
||||
SingleResult<ListPageVo<EducationStudyListVo>> 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<EducationStudyListVo> list = (Page<EducationStudyListVo>) educationStudyMapper.selectEducationStudyList(startDate, endDate, enterpriseId, dto.getCondition());
|
||||
Page<EducationStudyListVo> list = (Page<EducationStudyListVo>) educationStudyMapper.selectEducationStudyList(startDate, endDate, enterpriseId,memberId, dto.getCondition());;
|
||||
ListPageVo<EducationStudyListVo> 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<Object> result = new SingleResult<>();
|
||||
Integer count = educationStudyMapper.selectCount(
|
||||
new QueryWrapper<EducationStudy>().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<com.rzyc.bean.pojo.vo.EducationStudyVo>
|
||||
**/
|
||||
@ApiOperation(value = "获取培训学习详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "主键", dataType = "string", paramType = "query", required = true)
|
||||
})
|
||||
@GetMapping("/getDetails")
|
||||
@ResponseBody
|
||||
public SingleResult<EducationStudyVo> getDetails(@NotBlank(message = "id不能为空") String id){
|
||||
SingleResult<EducationStudyVo> result = new SingleResult<>();
|
||||
EducationStudy educationStudy = educationStudyMapper.selectById(id);
|
||||
List<String> memberIds = Arrays.asList(educationStudy.getMemberId().split(","));
|
||||
logger.info("memberIds: => {}",memberIds);
|
||||
List<String> strings = entUserMapper.selectUsernamesByIds(memberIds);
|
||||
logger.info("memberNames: => {}",strings);
|
||||
StringBuilder strb = new StringBuilder();
|
||||
for (int i=0;i<strings.size();i++){
|
||||
if (i == strings.size() -1){
|
||||
strb.append(strings.get(i));
|
||||
}else {
|
||||
strb.append(strings.get(i)+",");
|
||||
}
|
||||
}
|
||||
EducationStudyVo educationStudyVo = new EducationStudyVo();
|
||||
BeanUtils.copyProperties(educationStudy,educationStudyVo);
|
||||
educationStudyVo.setMemberNames(strb.toString());
|
||||
educationStudyVo.setStudyDate(DateUtils.parseDate2String(educationStudy.getStudyDate(),"yyyy-MM-dd"));
|
||||
educationStudyVo.setCreateTime(DateUtils.parseDate2String(educationStudy.getCreateTime(),"yyyy-MM-dd"));
|
||||
result.setData(educationStudyVo);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description:获取培训资料列表
|
||||
* @author: SYZ
|
||||
* @date: 2023/3/29 20:18
|
||||
* @param: [dto]
|
||||
* @return: com.common.utils.model.SingleResult<com.rzyc.bean.pojo.vo.ListPageVo<com.rzyc.bean.pojo.vo.EducationResourceVo>>
|
||||
**/
|
||||
@ApiOperation(value = "获取培训资料列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "entId",value = "企业id",dataType = "string",paramType = "query",required = true)
|
||||
})
|
||||
@GetMapping("/getEducationResourceList")
|
||||
@ResponseBody
|
||||
public SingleResult<ListPageVo<EducationResourceVo>> getEducationResourceList(@Valid PageDto dto,String entId){
|
||||
SingleResult<ListPageVo<EducationResourceVo>> result = new SingleResult<>();
|
||||
SysEnterprise sysEnterprise = sysEnterpriseMapper.selectOne(
|
||||
new QueryWrapper<SysEnterprise>().select("*").eq("SysEnterpriseId",entId)
|
||||
);
|
||||
if (null == sysEnterprise){
|
||||
return result.setCodeMessageChain(Code.ERROR.getCode(), "企业id错误");
|
||||
}
|
||||
PageHelper.startPage(dto.getPage(), dto.getPageSize());
|
||||
Page<EducationResourceVo> page = (Page<EducationResourceVo>) educationResourceMapper.selectEducationResourceList(dto.getCondition(),sysEnterprise.getWorkClassId());
|
||||
ListPageVo<EducationResourceVo> 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<com.rzyc.model.EducationResource>
|
||||
**/
|
||||
@ApiOperation(value = "获取培训资料详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id",value = "主键",dataType = "string",paramType = "query",required = true)
|
||||
})
|
||||
@GetMapping("/getEducationResourceDetails")
|
||||
@ResponseBody
|
||||
public SingleResult<EducationResource> getEducationResourceDetails(@NotBlank(message = "id不能为空") String id){
|
||||
SingleResult<EducationResource> result = new SingleResult<>();
|
||||
EducationResource educationResource = educationResourceMapper.selectById(id);
|
||||
result.setData(educationResource);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
||||
/**
|
||||
* 配置类脱敏加密工具
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -5,3 +5,4 @@ spring:
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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<com.rzyc.model.EducationResource>
|
||||
**/
|
||||
@ApiOperation(value = "获取培训资料详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id",value = "主键",dataType = "string",paramType = "query",required = true)
|
||||
})
|
||||
@GetMapping("/getEducationResourceDetails")
|
||||
@ResponseBody
|
||||
public SingleResult<EducationResource> getEducationResourceDetails(@NotBlank(message = "id不能为空") String id){
|
||||
SingleResult<EducationResource> result = new SingleResult<>();
|
||||
EducationResource educationResource = educationResourceMapper.selectById(id);
|
||||
result.setData(educationResource);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user