Commit e290c31a authored by 廖旭伟's avatar 廖旭伟

用户表增加单位属性;员工名片日浏览量初始化任务

parent fb23a5ce
......@@ -55,7 +55,8 @@ INSERT INTO `mortals_xhx_resource` VALUES (null, '员工离职信息-菜单管
-- 2024-11-20
-- ----------------------------
ALTER TABLE `mortals_xhx_bussinesscard` MODIFY COLUMN `companyId` bigint(20) DEFAULT NULL COMMENT '记录名片持有者所在公司或组织的名称ID';
ALTER TABLE `mortals_xhx_bussinesscard` ADD COLUMN `companyAdress` varchar(256) COMMENT '名片展示设置';
ALTER TABLE `mortals_xhx_bussinesscard` ADD COLUMN `setting` varchar(256) COMMENT '名片展示设置';
ALTER TABLE `mortals_xhx_bussinesscard` ADD COLUMN `companyAdress` varchar(256) COMMENT '单位地址';
ALTER TABLE `mortals_xhx_news_record` ADD COLUMN `viewId` bigint(20) COMMENT '查看人id';
ALTER TABLE `mortals_xhx_staff_record` ADD COLUMN `viewId` bigint(20) COMMENT '查看人id';
......@@ -80,4 +81,7 @@ PRIMARY KEY (`id`)
,KEY `viewId` (`viewId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='名片访问记录信息';
ALTER TABLE `mortals_xhx_user` ADD COLUMN `photoPath` varchar(255) COMMENT '头像地址';
\ No newline at end of file
ALTER TABLE `mortals_xhx_user` ADD COLUMN `photoPath` varchar(255) COMMENT '头像地址';
ALTER TABLE `mortals_xhx_user` ADD COLUMN `companyAdress` varchar(512) COMMENT '单位地址';
INSERT INTO `mortals_xhx_task` (`name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('员工名片日访问数初始化', 'StaffViewsByDayInit', '0', 'StaffViewsByDayInit', NULL, NULL, '1', '0', '00:00', NULL, NULL, NULL, '0', NULL, '1', '系统管理员');
\ No newline at end of file
......@@ -109,6 +109,11 @@ public class UserEntity extends UserVo implements IUser {
*/
private String photoPath;
/**
* 单位地址
*/
private String companyAdress;
public UserEntity(){}
......@@ -418,6 +423,14 @@ public class UserEntity extends UserVo implements IUser {
this.photoPath = photoPath;
}
public String getCompanyAdress() {
return companyAdress;
}
public void setCompanyAdress(String companyAdress) {
this.companyAdress = companyAdress;
}
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -487,5 +500,7 @@ public class UserEntity extends UserVo implements IUser {
this.lastLoginAddress = "";
this.photoPath = "";
this.companyAdress = "";
}
}
\ No newline at end of file
......@@ -202,6 +202,12 @@ public class UserQuery extends UserEntity {
/** 头像地址排除列表 */
private List <String> photoPathNotList;
/** 单位地址 */
private List<String> companyAdressList;
/** 单位地址排除列表 */
private List <String> companyAdressNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<UserQuery> orConditionList;
......@@ -1272,6 +1278,22 @@ public class UserQuery extends UserEntity {
this.photoPathNotList = photoPathNotList;
}
/**
* 获取 单位地址
* @return companyAdressNotList
*/
public List<String> getCompanyAdressNotList(){
return this.companyAdressNotList;
}
/**
* 设置 单位地址
* @param companyAdressNotList
*/
public void setCompanyAdressNotList(List<String> companyAdressNotList){
this.companyAdressNotList = companyAdressNotList;
}
/**
* 设置 用户ID,主键,自增长
* @param id
......@@ -1919,6 +1941,24 @@ public class UserQuery extends UserEntity {
return this;
}
/**
* 设置 单位地址
* @param companyAdress
*/
public UserQuery companyAdress(String companyAdress){
setCompanyAdress(companyAdress);
return this;
}
/**
* 设置 单位地址
* @param companyAdressList
*/
public UserQuery companyAdressList(List<String> companyAdressList){
this.companyAdressList = companyAdressList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.daemon.task;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.module.staff.dao.StaffDao;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 员工名片日访问数初始化
*/
@Slf4j
@Service("StaffViewsByDayInit")
public class StaffViewsByDayInitTaskImpl implements ITaskExcuteService {
@Autowired
private StaffService staffService;
@Override
public void excuteTask(ITask task) throws AppException {
List<StaffEntity> staffEntityList = staffService.getAllList();
List<StaffEntity> updateList = new ArrayList<>();
for (StaffEntity entity:staffEntityList){
StaffEntity update = new StaffEntity();
update.setId(entity.getId());
update.setViewsByDay(0);
updateList.add(update);
}
if(updateList.size()>0){
staffService.update(updateList);
}
}
@Override
public void stopTask(ITask task) throws AppException {
}
}
......@@ -29,6 +29,7 @@
<result property="staffId" column="staffId" />
<result property="openId" column="openId" />
<result property="photoPath" column="photoPath" />
<result property="companyAdress" column="companyAdress" />
</resultMap>
<!-- 表所有列 -->
......@@ -106,23 +107,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('photoPath') or colPickMode == 1 and data.containsKey('photoPath')))">
a.photoPath,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('companyAdress') or colPickMode == 1 and data.containsKey('companyAdress')))">
a.companyAdress,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath)
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath,companyAdress)
VALUES
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{staffId},#{openId},#{photoPath})
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{staffId},#{openId},#{photoPath},#{companyAdress})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath)
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath,companyAdress)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.staffId},#{item.openId},#{item.photoPath})
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.staffId},#{item.openId},#{item.photoPath},#{item.companyAdress})
</foreach>
</insert>
......@@ -219,6 +223,9 @@
<if test="(colPickMode==0 and data.containsKey('photoPath')) or (colPickMode==1 and !data.containsKey('photoPath'))">
a.photoPath=#{data.photoPath},
</if>
<if test="(colPickMode==0 and data.containsKey('companyAdress')) or (colPickMode==1 and !data.containsKey('companyAdress'))">
a.companyAdress=#{data.companyAdress},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -422,6 +429,13 @@
</if>
</foreach>
</trim>
<trim prefix="companyAdress=(case" suffix="ELSE companyAdress end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('companyAdress')) or (colPickMode==1 and !item.containsKey('companyAdress'))">
when a.id=#{item.id} then #{item.companyAdress}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -1076,6 +1090,27 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('companyAdress')">
<if test="conditionParamRef.companyAdress != null and conditionParamRef.companyAdress != ''">
${_conditionType_} a.companyAdress like #{${_conditionParam_}.companyAdress}
</if>
<if test="conditionParamRef.companyAdress == null">
${_conditionType_} a.companyAdress is null
</if>
</if>
<if test="conditionParamRef.containsKey('companyAdressList') and conditionParamRef.companyAdressList.size() > 0">
${_conditionType_} a.companyAdress in
<foreach collection="conditionParamRef.companyAdressList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('companyAdressNotList') and conditionParamRef.companyAdressNotList.size() > 0">
${_conditionType_} a.companyAdress not in
<foreach collection="conditionParamRef.companyAdressNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -1307,6 +1342,11 @@
<if test='orderCol.photoPath != null and "DESC".equalsIgnoreCase(orderCol.photoPath)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('companyAdress')">
a.companyAdress
<if test='orderCol.companyAdress != null and "DESC".equalsIgnoreCase(orderCol.companyAdress)'>DESC</if>
,
</if>
</trim>
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment