Commit 692e6b3d by 邓实川 Committed by chenzg

企业中心操作日志

parent 913a8613
package cn.timer.api.controller.qyzx; package cn.timer.api.controller.qyzx;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
...@@ -37,6 +40,7 @@ import cn.timer.api.bean.qyzx.QyzxLogBuy; ...@@ -37,6 +40,7 @@ import cn.timer.api.bean.qyzx.QyzxLogBuy;
import cn.timer.api.bean.qyzx.QyzxOperLog; import cn.timer.api.bean.qyzx.QyzxOperLog;
import cn.timer.api.bean.qyzx.QyzxPayServe; import cn.timer.api.bean.qyzx.QyzxPayServe;
import cn.timer.api.bean.qyzx.QyzxSuggestionFeeback; import cn.timer.api.bean.qyzx.QyzxSuggestionFeeback;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth; import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM; import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
...@@ -253,10 +257,9 @@ public class QyzxController { ...@@ -253,10 +257,9 @@ public class QyzxController {
@GetMapping(value = "/entlist") @GetMapping(value = "/entlist")
@ApiOperation(value = "企业列表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "企业列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxEntInfoM>> entlist1(@CurrentUser UserBean userBean) { public Result<List<QyzxEntInfoM>> entlist1(@CurrentUser UserBean userBean) {
List<Object> orgCodes = qyzxEmpEntAssoMapper.selectObjs(new QueryWrapper<QyzxEmpEntAsso>().lambda() List<Object> orgCodes = qyzxEmpEntAssoMapper.selectObjs(new QueryWrapper<QyzxEmpEntAsso>().lambda()
.select(QyzxEmpEntAsso::getOrgCode) .select(QyzxEmpEntAsso::getOrgCode).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
List<QyzxEntInfoM> qyzxEntInfoMs = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper) List<QyzxEntInfoM> qyzxEntInfoMs = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper)
.in(CollUtil.isNotEmpty(orgCodes), QyzxEntInfoM::getId, orgCodes).list(); .in(CollUtil.isNotEmpty(orgCodes), QyzxEntInfoM::getId, orgCodes).list();
return ResultUtil.data(qyzxEntInfoMs, "获取企业信息成功"); return ResultUtil.data(qyzxEntInfoMs, "获取企业信息成功");
...@@ -281,7 +284,7 @@ public class QyzxController { ...@@ -281,7 +284,7 @@ public class QyzxController {
if (ctrl == null) { if (ctrl == null) {
return ResultUtil.data(menus, "你不是该企业的用户!"); return ResultUtil.data(menus, "你不是该企业的用户!");
} }
if (SysRoleType.U_TYPE_ADMIN.getType().equals(ctrl.getUserType()) if (SysRoleType.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
|| SysRoleType.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) { || SysRoleType.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
} else { } else {
...@@ -400,8 +403,8 @@ public class QyzxController { ...@@ -400,8 +403,8 @@ public class QyzxController {
@GetMapping(value = "/fwjs") @GetMapping(value = "/fwjs")
@ApiOperation(value = "查看服务计算", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "查看服务计算", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxAttaFwjsb>> fwjs(@CurrentUser UserBean userBean) { public Result<List<QyzxAttaFwjsb>> fwjs(@CurrentUser UserBean userBean) {
List<QyzxAttaFwjsb> qyzxAttaFpgl = QyzxAttaFwjsb.builder().build() List<QyzxAttaFwjsb> qyzxAttaFpgl = QyzxAttaFwjsb.builder().build().selectList(
.selectList(new QueryWrapper<QyzxAttaFwjsb>().lambda().eq(QyzxAttaFwjsb::getEmpNum, userBean.getEmpNum())); new QueryWrapper<QyzxAttaFwjsb>().lambda().eq(QyzxAttaFwjsb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(qyzxAttaFpgl, "获取服务计算成功"); return ResultUtil.data(qyzxAttaFpgl, "获取服务计算成功");
} }
...@@ -473,7 +476,23 @@ public class QyzxController { ...@@ -473,7 +476,23 @@ public class QyzxController {
qyzxOperLogQuaryDto.getTotalPage() == null ? 10 : qyzxOperLogQuaryDto.getTotalPage()); qyzxOperLogQuaryDto.getTotalPage() == null ? 10 : qyzxOperLogQuaryDto.getTotalPage());
qyzxOperLogQuaryDto.setOrgCode(userBean.getOrgCode()); qyzxOperLogQuaryDto.setOrgCode(userBean.getOrgCode());
IPage<QyzxOperLog> pages = qyzxOperLogMapper.selectPageByQuery(page, qyzxOperLogQuaryDto); // IPage<QyzxOperLog> pages = qyzxOperLogMapper.selectPageByQuery(page, qyzxOperLogQuaryDto);
if (qyzxOperLogQuaryDto.getEmpNums() == null) {
YgglMainEmp main = YgglMainEmp.builder().build()
.selectOne(new LambdaQueryWrapper<YgglMainEmp>().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getIsManager, 1)
.select(YgglMainEmp::getEmpNum, YgglMainEmp::getIsManager));
List<YgglMainEmp> child = YgglMainEmp.builder().build()
.selectList(new LambdaQueryWrapper<YgglMainEmp>().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getIsManager, 2)
.select(YgglMainEmp::getEmpNum, YgglMainEmp::getIsManager));
child.add(main);
Collections.sort(child, Comparator.comparing(YgglMainEmp::getIsManager));
List<Integer> empNums = child.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
qyzxOperLogQuaryDto.setEmpNums(empNums);
}
IPage<QyzxOperLog> pages = qyzxOperLogMapper.selectPageByQuery2(page, qyzxOperLogQuaryDto);
List<QyzxOperLog> listOl = pages.getRecords(); List<QyzxOperLog> listOl = pages.getRecords();
return ResultUtil.data(pages, listOl, "操作成功!"); return ResultUtil.data(pages, listOl, "操作成功!");
......
...@@ -42,7 +42,7 @@ public class QyzxOperLogServiceImpl implements QyzxOperLogService ...@@ -42,7 +42,7 @@ public class QyzxOperLogServiceImpl implements QyzxOperLogService
@Override @Override
public IPage<QyzxOperLog> selectPageByQuery(IPage<QyzxOperLog> page,QyzxOperLogQuaryDto operLog) public IPage<QyzxOperLog> selectPageByQuery(IPage<QyzxOperLog> page,QyzxOperLogQuaryDto operLog)
{ {
return operLogMapper.selectPageByQuery(page,operLog); return operLogMapper.selectPageByQuery2(page,operLog);
} }
/** /**
......
...@@ -27,7 +27,8 @@ public interface QyzxOperLogMapper extends BaseMapper<QyzxOperLog> { ...@@ -27,7 +27,8 @@ public interface QyzxOperLogMapper extends BaseMapper<QyzxOperLog> {
* @param operLog 操作日志对象 * @param operLog 操作日志对象
* @return 操作日志集合 * @return 操作日志集合
*/ */
public IPage<QyzxOperLog> selectPageByQuery(IPage<QyzxOperLog> page,@Param("param") QyzxOperLogQuaryDto operLog); // public IPage<QyzxOperLog> selectPageByQuery(IPage<QyzxOperLog> page,@Param("param") QyzxOperLogQuaryDto operLog);
public IPage<QyzxOperLog> selectPageByQuery2(IPage<QyzxOperLog> page,@Param("param") QyzxOperLogQuaryDto operLog);
// //
// /** // /**
// * 批量删除系统操作日志 // * 批量删除系统操作日志
......
package cn.timer.api.dto.qyzx; package cn.timer.api.dto.qyzx;
import java.util.List;
import cn.timer.api.utils.Page; import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -19,6 +21,9 @@ public class QyzxOperLogQuaryDto extends Page{ ...@@ -19,6 +21,9 @@ public class QyzxOperLogQuaryDto extends Page{
@ApiModelProperty(value="企业id",example="101") @ApiModelProperty(value="企业id",example="101")
private Integer orgCode; private Integer orgCode;
@ApiModelProperty(value="员工id",example="101")
private List<Integer> empNums;
@ApiModelProperty(value="业务类型(0其它 1新增 2修改 3删除)",example="101") @ApiModelProperty(value="业务类型(0其它 1新增 2修改 3删除)",example="101")
private Integer businessType; private Integer businessType;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
oper_ip, oper_ip,
oper_location, oper_location,
<!-- oper_param, --> <!-- oper_param, -->
json_result, <!-- json_result, -->
status, status,
error_msg, error_msg,
oper_time oper_time
...@@ -96,6 +96,52 @@ ...@@ -96,6 +96,52 @@
ORDER BY a.oper_time DESC ORDER BY a.oper_time DESC
</select> </select>
<select id="selectPageByQuery2" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM qyzx_oper_log a
WHERE a.org_code = #{param.orgCode}
<if test="param.empNums != null and param.empNums.size() > 0">
<choose>
<when test="param.empNums.size() > 1">
AND a.emp_num IN
(
<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
#{it}
</foreach>
)
</when>
<otherwise>
AND a.emp_num = #{param.empNums[0]}
</otherwise>
</choose>
</if>
<if test="param.query != null and param.query != ''">
and (
a.title like CONCAT('%',#{param.query},'%') or
a.oper_name like CONCAT('%',#{param.query},'%') or
a.oper_id like CONCAT('%',#{param.query},'%')
)
</if>
<if test="param.businessType != null">
and a.business_type = #{param.businessType}
</if>
<if test="param.operatorType != null">
and a.operator_type = #{param.operatorType}
</if>
<if test="param.requestMethod != null">
and a.request_method = #{param.requestMethod}
</if>
<if test="param.startTime != null and param.startTime != ''">
and a.oper_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and a.oper_time <![CDATA[ <= ]]> #{param.endTime}
</if>
ORDER BY a.oper_time DESC
</select>
<!-- <!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxOperLog"> <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxOperLog">
......
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