| | |
| | | <version>${project.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 统计报表--> |
| | | <dependency> |
| | | <groupId>com.project</groupId> |
| | | <artifactId>project-report</artifactId> |
| | | <version>${project.version}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | |
| | | <module>project-common</module> |
| | | <module>project-approval</module> |
| | | <module>project-enforce</module> |
| | | <module>project-report</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | |
| | | <artifactId>project-approval</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 审批流程--> |
| | | <!-- 执法业务--> |
| | | <dependency> |
| | | <groupId>com.project</groupId> |
| | | <artifactId>project-enforce</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- 统计报表--> |
| | | <dependency> |
| | | <groupId>com.project</groupId> |
| | | <artifactId>project-report</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | private final IEnforceOrderService iEnforceOrderService; |
| | | |
| | | |
| | | @ApiOperation("查询执法单列表") |
| | | @ApiOperation("信息公式列表") |
| | | @GetMapping("/showList") |
| | | public TableDataInfo showList() |
| | | { |
| | | startPage(); |
| | | List<EnforceOrderVo> list = iEnforceOrderService.showList(); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @ApiOperation("执法单列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(EnforceOrderQueryBo bo) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("查询执法单待审批列表") |
| | | @ApiOperation("审批人列表") |
| | | @GetMapping("/checkList") |
| | | public TableDataInfo checkList(EnforceOrderQueryBo bo) |
| | | { |
New file |
| | |
| | | package com.project.admin.controller.report; |
| | | |
| | | import com.project.common.core.controller.BaseController; |
| | | import com.project.common.core.domain.AjaxResult; |
| | | import com.project.report.service.IReportService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | |
| | | @Slf4j |
| | | @Api(value = "报表管理", tags = "报表管理") |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/report/team") |
| | | public class ReportController extends BaseController |
| | | { |
| | | |
| | | private final IReportService reportService; |
| | | |
| | | @ApiOperation("执法汇总数据") |
| | | @GetMapping("/getTotalInfo") |
| | | public AjaxResult getTotalInfo() |
| | | { |
| | | return AjaxResult.success(reportService.getTotalInfo()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("执法次数月度分布") |
| | | @GetMapping("/getMonthCount") |
| | | public AjaxResult getMonthCount(Long deptId) |
| | | { |
| | | return AjaxResult.success(reportService.getMonthCount(deptId)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("执法次数部门分布") |
| | | @GetMapping("/getDeptCount") |
| | | public AjaxResult getDeptCount(String yearMonth) |
| | | { |
| | | return AjaxResult.success(reportService.getDeptCount(yearMonth)); |
| | | } |
| | | |
| | | } |
| | |
| | | public AjaxResult updateProfile(@RequestBody SysUser user) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser sysUser = loginUser.getUser(); |
| | | user.setUserName(sysUser.getUserName()); |
| | | user.setUserName(user.getUserName()); |
| | | SysUser byId = userService.getById(user.getUserId()); |
| | | byId.setNickName(user.getNickName()); |
| | | byId.setPhonenumber(user.getPhonenumber()); |
| | | byId.setEmail(user.getEmail()); |
| | | byId.setSex(user.getSex()); |
| | | byId.setAvatar(user.getAvatar()); |
| | | byId.setDeptId(user.getDeptId()); |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) |
| | | && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) |
| | | { |
| | |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| | | } |
| | | user.setUserId(sysUser.getUserId()); |
| | | if (userService.updateUser(user) > 0) |
| | | int upd = userService.updateUser(byId); |
| | | if (upd > 0) |
| | | { |
| | | // 更新缓存用户信息 |
| | | sysUser.setNickName(user.getNickName()); |
| | | sysUser.setPhonenumber(user.getPhonenumber()); |
| | | sysUser.setEmail(user.getEmail()); |
| | | sysUser.setSex(user.getSex()); |
| | | sysUser.setAvatar(user.getAvatar()); |
| | | loginUser.setUser(byId); |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | { |
| | | |
| | | if (user.getDeptId()!=null){ |
| | | user.setUserType("01"); |
| | | SysDept sysDept = deptService.selectDeptById(user.getDeptId()); |
| | | if (sysDept.getAncestors().contains("101") || sysDept.getDeptId().equals(101L)){ |
| | | user.setUserType("01"); |
| | | user.setUserType("00"); |
| | | user.setRecommendPhone(deptService.getCheckDeptIdByLoginDeptId(user.getDeptId()).toString()); |
| | | } |
| | | } |
| | |
| | | public Docket enforceApi() |
| | | { |
| | | return new Docket(DocumentationType.OAS_30) |
| | | .groupName("执法流程") |
| | | .groupName("执法中心") |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.any()) |
| | |
| | | .pathMapping(pathMapping); |
| | | } |
| | | |
| | | @Bean |
| | | public Docket reportApi() |
| | | { |
| | | return new Docket(DocumentationType.OAS_30) |
| | | .groupName("报表中心") |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.any()) |
| | | .paths(PathSelectors.regex("/report/.*")) |
| | | .build() |
| | | /* 设置安全模式,swagger可以设置访问token */ |
| | | .securitySchemes(securitySchemes()) |
| | | .securityContexts(securityContexts()) |
| | | .pathMapping(pathMapping); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 安全模式,这里指定token通过Authorization头请求头传递 |
| | |
| | | - /**/*.js |
| | | - /websocket/** |
| | | - /chat/** |
| | | - /system/company/add |
| | | - /system/dict/** |
| | | - /system/doc/** |
| | | - /tool/** |
| | | - /verify/** |
| | | - /tool/** #临时白名单 |
| | | - /report/** |
| | | - /enforce/order/showList |
| | |
| | | package com.project.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Entity基类 |
| | | * |
| | | * |
| | | * @author project |
| | | */ |
| | | public class BaseEntity implements Serializable |
| | |
| | | |
| | | /** 搜索值 */ |
| | | @JsonIgnore |
| | | @TableField(exist = false) |
| | | private String searchValue; |
| | | |
| | | /** 创建者 */ |
| | |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | | @TableField(exist = false) |
| | | private String remark; |
| | | |
| | | /** 请求参数 */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | @TableField(exist = false) |
| | | private Map<String, Object> params; |
| | | |
| | | public String getSearchValue() |
| | |
| | | package com.project.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.project.common.core.domain.BaseEntity; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.project.common.core.domain.BaseEntity; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 部门表 sys_dept |
| | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | private String delFlag; |
| | | |
| | | /** 父部门名称 */ |
| | | @TableField(exist = false) |
| | | private String parentName; |
| | | |
| | | public String getParentName() { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | /** 子部门 */ |
| | | @TableField(exist = false) |
| | | private List<SysDept> children = new ArrayList<SysDept>(); |
| | | |
| | | public Long getDeptId() |
| | |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public List<SysDept> getChildren() |
| | | { |
New file |
| | |
| | | package com.project.common.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * @author Mr.Zhao |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class KeyVal |
| | | { |
| | | private String k; |
| | | private Object v; |
| | | } |
| | |
| | | |
| | | import com.project.enforce.domain.EnforceEvaluateAnswer; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | |
| | | /** |
| | | * 执法评价答案Mapper接口 |
| | |
| | | */ |
| | | public interface EnforceEvaluateAnswerMapper extends BaseMapper<EnforceEvaluateAnswer> { |
| | | |
| | | @Delete("delete from enforce_evaluate_answer") |
| | | void clearAnswer(); |
| | | } |
| | |
| | | |
| | | import com.project.enforce.domain.EnforceEvaluateQuestion; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | |
| | | /** |
| | | * 执法评价题目Mapper接口 |
| | |
| | | */ |
| | | public interface EnforceEvaluateQuestionMapper extends BaseMapper<EnforceEvaluateQuestion> { |
| | | |
| | | @Delete("delete from enforce_evaluate_question") |
| | | void clearQuestion(); |
| | | |
| | | } |
| | |
| | | package com.project.enforce.mapper; |
| | | |
| | | import com.project.enforce.domain.EnforceOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.project.common.vo.KeyVal; |
| | | import com.project.enforce.domain.EnforceOrder; |
| | | import com.project.enforce.domain.bo.queryBo.EnforceOrderQueryBo; |
| | | import com.project.enforce.domain.vo.EnforceOrderVo; |
| | | |
| | |
| | | |
| | | List<EnforceOrderVo> selectCheckList(EnforceOrderQueryBo bo); |
| | | |
| | | List<KeyVal> getMonthCount(Long deptId); |
| | | |
| | | List<KeyVal> getDeptCount(String yearMonth); |
| | | } |
| | |
| | | public interface IEnforceEvaluateQuestionService extends IBaseService<EnforceEvaluateQuestion> { |
| | | |
| | | |
| | | /** |
| | | * 清空评价项及答案 |
| | | */ |
| | | void clearQuestionAndAnswer(); |
| | | |
| | | } |
| | |
| | | */ |
| | | Boolean save(EnforceEvaluateBo bo); |
| | | |
| | | /** |
| | | * 评价模板详情 |
| | | * @return 评价信息 |
| | | */ |
| | | EnforceEvaluateVo getInfo(); |
| | | |
| | | |
| | |
| | | package com.project.enforce.service; |
| | | |
| | | import com.project.common.mybatis.IBaseService; |
| | | import com.project.common.vo.KeyVal; |
| | | import com.project.enforce.domain.EnforceOrder; |
| | | import com.project.enforce.domain.vo.EnforceOrderVo; |
| | | import com.project.enforce.domain.bo.editBo.EnforceOrderBo; |
| | | import com.project.enforce.domain.bo.queryBo.EnforceOrderQueryBo; |
| | | import com.project.common.mybatis.IBaseService; |
| | | import com.project.enforce.domain.vo.EnforceOrderVo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | * 查询待审核列表 |
| | | */ |
| | | List<EnforceOrderVo> queryCheckList(EnforceOrderQueryBo bo); |
| | | |
| | | /** |
| | | * 信息公式列表 |
| | | * @return 数据 |
| | | */ |
| | | List<EnforceOrderVo> showList(); |
| | | |
| | | /** |
| | | * 查询单个 |
| | |
| | | * @return true成功 false失败 |
| | | */ |
| | | Boolean deleteByIds(Collection<Long> ids); |
| | | |
| | | |
| | | /** |
| | | * 执法次数月度分布 |
| | | * @param deptId 机构id |
| | | * @return 月度分布 |
| | | */ |
| | | List<KeyVal> getMonthCount(Long deptId); |
| | | |
| | | |
| | | /** |
| | | * 执法次数部门分布 |
| | | * @param yearMonth 年月 |
| | | * @return 部门分布 |
| | | */ |
| | | List<KeyVal> getDeptCount(String yearMonth); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.project.enforce.domain.EnforceEvaluateQuestion; |
| | | import com.project.enforce.mapper.EnforceEvaluateAnswerMapper; |
| | | import com.project.enforce.mapper.EnforceEvaluateQuestionMapper; |
| | | import com.project.enforce.service.IEnforceEvaluateQuestionService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | public class EnforceEvaluateQuestionServiceImpl extends ServiceImpl<EnforceEvaluateQuestionMapper, EnforceEvaluateQuestion> implements IEnforceEvaluateQuestionService { |
| | | |
| | | private final EnforceEvaluateQuestionMapper questionMapper; |
| | | private final EnforceEvaluateAnswerMapper answerMapper; |
| | | |
| | | |
| | | |
| | | @Override//清空评价项及答案 |
| | | public void clearQuestionAndAnswer() |
| | | { |
| | | questionMapper.clearQuestion(); |
| | | answerMapper.clearAnswer(); |
| | | } |
| | | } |
| | |
| | | @Transactional |
| | | public Boolean save(EnforceEvaluateBo bo) |
| | | { |
| | | questionService.clearQuestionAndAnswer(); |
| | | List<EnforceEvaluateQuestion> questionList = bo.getQuestionList(); |
| | | if (StringUtils.isEmpty(questionList)){ |
| | | throw new BaseException("评价项不可为空!"); |
| | |
| | | import com.project.common.exception.base.BaseException; |
| | | import com.project.common.utils.SecurityUtils; |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.common.vo.KeyVal; |
| | | import com.project.enforce.domain.EnforceOrder; |
| | | import com.project.enforce.domain.bo.editBo.EnforceOrderBo; |
| | | import com.project.enforce.domain.bo.queryBo.EnforceOrderQueryBo; |
| | |
| | | public class EnforceOrderServiceImpl extends ServiceImpl<EnforceOrderMapper, EnforceOrder> implements IEnforceOrderService { |
| | | |
| | | private final ISysDeptService deptService; |
| | | private final EnforceOrderMapper orderMapper; |
| | | |
| | | |
| | | @Override//列表查询 |
| | |
| | | bo.setApplyDeptIds(deptService.getApplyDeptIdsByLoginUserId(loginUser.getUserId())); |
| | | |
| | | return this.baseMapper.selectCheckList(bo); |
| | | } |
| | | |
| | | @Override//信息公式列表 |
| | | public List<EnforceOrderVo> showList() |
| | | { |
| | | List<EnforceOrder> list = this.list(lq().eq(EnforceOrder::getIsShow, 1)); |
| | | return Convert.toList(EnforceOrderVo.class, list); |
| | | } |
| | | |
| | | @Override//id查询 |
| | |
| | | return this.removeByIds(ids); |
| | | } |
| | | |
| | | @Override//月度分布 |
| | | public List<KeyVal> getMonthCount(Long deptId) { |
| | | return orderMapper.getMonthCount(deptId); |
| | | } |
| | | |
| | | @Override//部门分布 |
| | | public List<KeyVal> getDeptCount(String yearMonth) |
| | | { |
| | | return orderMapper.getDeptCount(yearMonth); |
| | | } |
| | | |
| | | |
| | | //------------------------------------------------------------------------------------- |
| | | |
| | |
| | | from sys_job_log |
| | | </sql> |
| | | |
| | | <select id="selectCheckList" parameterType="EnforceOrderQueryBo" resultMap="EnforceOrderResult"> |
| | | <select id="selectCheckList" |
| | | parameterType="EnforceOrderQueryBo" |
| | | resultMap="EnforceOrderResult"> |
| | | <include refid="selectEnforceOrderVo"/> |
| | | <where> |
| | | <if test="orderNo != null and orderNo != ''"> |
| | |
| | | #{applyDeptId} |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getMonthCount" |
| | | parameterType="Long" |
| | | resultType="com.project.common.vo.KeyVal"> |
| | | select |
| | | MONTH(apply_time) AS k, |
| | | IFNULL(count(order_id),0) as v |
| | | from enforce_order |
| | | where 1=1 |
| | | <if test="deptId != null "> |
| | | AND apply_dept_id = #{deptId} |
| | | </if> |
| | | GROUP BY k |
| | | </select> |
| | | |
| | | <select id="getDeptCount" |
| | | parameterType="String" |
| | | resultType="com.project.common.vo.KeyVal"> |
| | | select |
| | | MONTH(check_dept_id) AS k, |
| | | IFNULL(count(order_id),0) as v |
| | | from enforce_order |
| | | where 1=1 |
| | | <if test="yearMonth!=null and yearMonth!=''"> |
| | | AND apply_time like concat('%', #{yearMonth}, '%') |
| | | </if> |
| | | GROUP BY k |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.project.framework.aspectj; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.project.system.domain.SysOperLog; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.AfterThrowing; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.NamedThreadLocal; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.project.common.annotation.Log; |
| | | import com.project.common.core.domain.model.LoginUser; |
| | |
| | | import com.project.common.utils.ip.IpUtils; |
| | | import com.project.framework.manager.AsyncManager; |
| | | import com.project.framework.manager.factory.AsyncFactory; |
| | | import com.project.system.domain.SysOperLog; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.AfterThrowing; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.NamedThreadLocal; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Collection; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 操作日志记录处理 |
| | | * |
| | | * |
| | | * @author project |
| | | */ |
| | | @Aspect |
| | |
| | | |
| | | /** |
| | | * 拦截异常操作 |
| | | * |
| | | * |
| | | * @param joinPoint 切点 |
| | | * @param e 异常 |
| | | */ |
| | |
| | | try |
| | | { |
| | | // 获取当前的用户 |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | LoginUser loginUser; |
| | | try { |
| | | loginUser = SecurityUtils.getLoginUser(); |
| | | } catch (Exception be){ |
| | | loginUser = null; |
| | | } |
| | | |
| | | // *========数据库日志=========*// |
| | | SysOperLog operLog = new SysOperLog(); |
| | |
| | | |
| | | /** |
| | | * 获取注解中对方法的描述信息 用于Controller层注解 |
| | | * |
| | | * |
| | | * @param log 日志 |
| | | * @param operLog 操作日志 |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取请求的参数,放到log中 |
| | | * |
| | | * |
| | | * @param operLog 操作日志 |
| | | * @throws Exception 异常 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 判断是否需要过滤的对象。 |
| | | * |
| | | * |
| | | * @param o 对象信息。 |
| | | * @return 如果是需要过滤的对象,则返回true;否则返回false。 |
| | | */ |
| | |
| | | package com.project.framework.mybatisplus; |
| | | |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import com.project.common.core.domain.model.LoginUser; |
| | | import com.project.common.utils.SecurityUtils; |
| | | import com.project.common.utils.StringUtils; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | |
| | | String createBy = (String) this.getFieldValByName("createBy", metaObject); |
| | | Object createTime = this.getFieldValByName("createTime", metaObject); |
| | | if (StringUtils.isEmpty(createBy)) { |
| | | createBy = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | LoginUser loginUser; |
| | | try { |
| | | loginUser = SecurityUtils.getLoginUser(); |
| | | } catch (Exception e){ |
| | | loginUser = null; |
| | | } |
| | | |
| | | if (loginUser == null) { |
| | | createBy = "系统操作"; |
| | | } else { |
| | | createBy = loginUser.getUser().getNickName(); |
| | | } |
| | | this.setFieldValByName("createBy", createBy, metaObject); |
| | | } |
| | | if (createTime == null) { |
| | | createTime = new Date(); |
| | | this.setFieldValByName("createTime", createTime, metaObject); |
| | | if (createTime == null) { |
| | | createTime = new Date(); |
| | | this.setFieldValByName("createTime", createTime, metaObject); |
| | | } |
| | | //endregion |
| | | //region 处理修改人信息 |
| | | Object updateBy = this.getFieldValByName("updateBy", metaObject); |
| | | Object updateTime = this.getFieldValByName("updateTime", metaObject); |
| | | if (updateBy == null) { |
| | | updateBy = createBy; |
| | | this.setFieldValByName("updateBy", updateBy, metaObject); |
| | | } |
| | | if (updateTime == null) { |
| | | updateTime = createTime; |
| | | this.setFieldValByName("updateTime", updateTime, metaObject); |
| | | } |
| | | //endregion |
| | | } |
| | | //endregion |
| | | //region 处理修改人信息 |
| | | Object updateBy = this.getFieldValByName("updateBy", metaObject); |
| | | Object updateTime = this.getFieldValByName("updateTime", metaObject); |
| | | if (updateBy == null) { |
| | | updateBy = createBy; |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | //region 处理修改人信息 |
| | | String updateBy; |
| | | LoginUser loginUser; |
| | | try { |
| | | loginUser = SecurityUtils.getLoginUser(); |
| | | } catch (Exception e){ |
| | | loginUser = null; |
| | | } |
| | | if (loginUser==null){ |
| | | updateBy = "系统操作"; |
| | | } else { |
| | | updateBy = loginUser.getUser().getNickName(); |
| | | } |
| | | this.setFieldValByName("updateBy", updateBy, metaObject); |
| | | } |
| | | if (updateTime == null) { |
| | | updateTime = createTime; |
| | | Date updateTime = new Date(); |
| | | this.setFieldValByName("updateTime", updateTime, metaObject); |
| | | //endregion |
| | | } |
| | | //endregion |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | //region 处理修改人信息 |
| | | String updateBy = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | this.setFieldValByName("updateBy", updateBy, metaObject); |
| | | Date updateTime = new Date(); |
| | | this.setFieldValByName("updateTime", updateTime, metaObject); |
| | | //endregion |
| | | } |
| | | @Override |
| | | public boolean openInsertFill() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean openInsertFill() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean openUpdateFill() { |
| | | return true; |
| | | } |
| | | @Override |
| | | public boolean openUpdateFill() { |
| | | return true; |
| | | } |
| | | } |
| | |
| | | int randomNum = ran.nextInt(10000); |
| | | code = String.format("%04d", randomNum); |
| | | log.info("手机号:"+phone+"->验证码:"+code); |
| | | boolean send = sendAl(phone, code); |
| | | if (send){ |
| | | redisCache.setCacheObject(getCacheKey(phone), code, Constants.PHONE_EXPIRATION, TimeUnit.MINUTES); |
| | | return true; |
| | | } |
| | | // boolean send = sendAl(phone, code); |
| | | // if (send){ |
| | | // redisCache.setCacheObject(getCacheKey(phone), code, Constants.PHONE_EXPIRATION, TimeUnit.MINUTES); |
| | | // return true; |
| | | // } |
| | | redisCache.setCacheObject(getCacheKey(phone), code, Constants.PHONE_EXPIRATION, TimeUnit.MINUTES); |
| | | return false; |
| | | } |
| | |
| | | if (!verified){ |
| | | throw new BaseException("手机号验证码校验失败!"); |
| | | } |
| | | SysUser user = userMapper.selectOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getPhonenumber,bo.getPhone())); |
| | | SysUser user = null; |
| | | if ("01".equals(bo.getUserType())){ |
| | | user = userMapper.selectOne(new LambdaQueryWrapper<SysUser>() |
| | | .eq(SysUser::getPhonenumber,bo.getPhone()) |
| | | .and(wrapper->wrapper.eq(SysUser::getUserType,"00").or().eq(SysUser::getUserType, "01"))); |
| | | } else { |
| | | user = userMapper.selectOne(new LambdaQueryWrapper<SysUser>() |
| | | .eq(SysUser::getPhonenumber,bo.getPhone()) |
| | | .eq(SysUser::getUserType,bo.getUserType()) |
| | | ); |
| | | } |
| | | if (user==null){ |
| | | throw new BaseException("您手机号尚未注册!"); |
| | | throw new BaseException("您手机号尚未注册或您选择登录类型有误!"); |
| | | } |
| | | if (!"0".equals(user.getStatus())){ |
| | | throw new BaseException("您账号已停用或待审批,请联系营商办管理人员!"); |
| | | } |
| | | return this.login(user.getUserName(), user.getRecommendUser(), null, null); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.project</groupId> |
| | | <artifactId>sqys_admin</artifactId> |
| | | <version>3.8.5</version> |
| | | </parent> |
| | | |
| | | <artifactId>project-report</artifactId> |
| | | |
| | | <description> |
| | | report统计报表 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- 系统 --> |
| | | <dependency> |
| | | <groupId>com.project</groupId> |
| | | <artifactId>project-enforce</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.project.report.service; |
| | | |
| | | import com.project.common.vo.KeyVal; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 功能描述: |
| | | * |
| | | * @author ZQN |
| | | * @version 1.0 |
| | | */ |
| | | |
| | | public interface IReportService |
| | | { |
| | | /** |
| | | * 汇总数据 |
| | | * @return 汇总数据 |
| | | */ |
| | | Map<String, Object> getTotalInfo(); |
| | | |
| | | /** |
| | | * 执法次数月度分布 |
| | | * @param deptId 部门id |
| | | * @return 执法次数 |
| | | */ |
| | | List<KeyVal> getMonthCount(Long deptId); |
| | | |
| | | /** |
| | | * 执法次数部门分布 |
| | | * @param yearMonth 年月 |
| | | * @return 执法次数 |
| | | */ |
| | | List<KeyVal> getDeptCount(String yearMonth); |
| | | } |
New file |
| | |
| | | package com.project.report.service.impl; |
| | | |
| | | import com.project.common.core.domain.entity.SysDept; |
| | | import com.project.common.core.domain.entity.SysUser; |
| | | import com.project.common.vo.KeyVal; |
| | | import com.project.enforce.domain.EnforceOrder; |
| | | import com.project.enforce.service.IEnforceComplaintLogService; |
| | | import com.project.enforce.service.IEnforceOrderService; |
| | | import com.project.report.service.IReportService; |
| | | import com.project.system.domain.SysCompany; |
| | | import com.project.system.domain.SysDoc; |
| | | import com.project.system.service.ISysCompanyService; |
| | | import com.project.system.service.ISysDeptService; |
| | | import com.project.system.service.ISysDocService; |
| | | import com.project.system.service.ISysUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 功能描述: |
| | | * |
| | | * @author ZQN |
| | | * @version 1.0 |
| | | */ |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ReportServiceImpl implements IReportService |
| | | { |
| | | private final ISysCompanyService companyService; |
| | | private final ISysDeptService deptService; |
| | | private final ISysUserService userService; |
| | | private final ISysDocService docService; |
| | | private final IEnforceOrderService orderService; |
| | | private final IEnforceComplaintLogService complaintLogService; |
| | | |
| | | private final String[] months = {"1","2","3","4","5","6","7","8","9","10","11","12"}; |
| | | |
| | | @Override//汇总 |
| | | public Map<String, Object> getTotalInfo() |
| | | { |
| | | |
| | | int companyNum = companyService.count(companyService.lq().eq(SysCompany::getCompanyStatus, 0)); |
| | | int enforceCompanyNum = orderService.count(orderService.lq().groupBy(EnforceOrder::getCompanyId)); |
| | | int enforceDeptNum = deptService.count(deptService.lq().eq(SysDept::getParentId,100)); |
| | | int enforceUserNum = userService.count(userService.lq().ne(SysUser::getUserType,"02")); |
| | | int enforceOrderNum = orderService.count(); |
| | | int complaintNum = complaintLogService.count(); |
| | | int docNum = docService.count(docService.lq().eq(SysDoc::getDocStatus,0)); |
| | | |
| | | Map<String, Object> result = new HashMap<>(7); |
| | | result.put("companyNum", companyNum); |
| | | result.put("enforceCompanyNum", enforceCompanyNum); |
| | | result.put("enforceDeptNum", enforceDeptNum); |
| | | result.put("enforceUserNum", enforceUserNum); |
| | | result.put("enforceOrderNum", enforceOrderNum); |
| | | result.put("complaintNum", complaintNum); |
| | | result.put("docNum", docNum); |
| | | return result; |
| | | } |
| | | |
| | | @Override//执法单位执法次数月度分布 |
| | | public List<KeyVal> getMonthCount(Long deptId) |
| | | { |
| | | List<KeyVal> list = orderService.getMonthCount(deptId); |
| | | Map<String, Object> resultMap = list.stream().collect(Collectors.toMap(KeyVal::getK,KeyVal::getV)); |
| | | |
| | | return Arrays.stream(months).map(e -> { |
| | | KeyVal keyVal; |
| | | if (resultMap.get(e) == null) { |
| | | keyVal = new KeyVal(e, 0); |
| | | } else { |
| | | keyVal = new KeyVal(e, resultMap.get(e)); |
| | | } |
| | | return keyVal; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override//执法单位执法次数部门分布 |
| | | public List<KeyVal> getDeptCount(String yearMonth) |
| | | { |
| | | List<KeyVal> list = orderService.getDeptCount(yearMonth); |
| | | Map<String, Object> resultMap = list.stream().collect(Collectors.toMap(KeyVal::getK,KeyVal::getV)); |
| | | |
| | | List<SysDept> depts = deptService.list(deptService.lq().eq(SysDept::getParentId, 100)); |
| | | |
| | | return depts.stream().map(e -> { |
| | | KeyVal keyVal; |
| | | if (resultMap.get(e.getDeptId().toString()) == null) { |
| | | keyVal = new KeyVal(e.getDeptName(), 0); |
| | | } else { |
| | | keyVal = new KeyVal(e.getDeptName(), resultMap.get(e.getDeptId().toString())); |
| | | } |
| | | return keyVal; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "验证码") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "登录用户类型:00营商办,01执法,02企业") |
| | | private String userType; |
| | | } |
| | |
| | | package com.project.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.project.common.core.domain.entity.SysDept; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * |
| | | * @author project |
| | | */ |
| | | public interface SysDeptMapper |
| | | public interface SysDeptMapper extends BaseMapper<SysDept> |
| | | { |
| | | /** |
| | | * 查询部门管理数据 |
| | |
| | | |
| | | import com.project.common.core.domain.TreeSelect; |
| | | import com.project.common.core.domain.entity.SysDept; |
| | | import com.project.common.mybatis.IBaseService; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * |
| | | * @author project |
| | | */ |
| | | public interface ISysDeptService |
| | | public interface ISysDeptService extends IBaseService<SysDept> |
| | | { |
| | | /** |
| | | * 查询部门管理数据 |
| | |
| | | SysCompany add = Convert.convert(SysCompany.class, bo); |
| | | add.setCompanyStatus(1); |
| | | validEntityBeforeSave(add); |
| | | add.setCompanyStatus(0); |
| | | boolean save = this.save(add); |
| | | addCompanyUser(add, 0); |
| | | return save; |
| | |
| | | if (phoneCount>0){ |
| | | throw new BaseException(String.format("%1$s,企业联系电话已存在!", entity.getCompanyName())); |
| | | } |
| | | SysUser user = new SysUser(); |
| | | user.setPhonenumber(entity.getCompanyPhone()); |
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { |
| | | throw new BaseException(String.format("%1$s,企业联系电话已存在,请更换手机号!", entity.getCompanyName())); |
| | | } |
| | | } else { |
| | | int codeCount = this.count(lq().eq(SysCompany::getCompanyCode, entity.getCompanyCode()).ne(SysCompany::getCompanyId,entity.getCompanyId())); |
| | | if (codeCount>0){ |
| | |
| | | errorList.add(new ImportError(0, "企业名已存在!")); |
| | | } |
| | | int phoneCount = this.count(lq().eq(SysCompany::getCompanyPhone, entity.getCompanyPhone())); |
| | | SysUser user = new SysUser(); |
| | | user.setPhonenumber(entity.getCompanyPhone()); |
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { |
| | | errorList.add(new ImportError(3, "企业联系电话系统中已存在,请更换电话!")); |
| | | } |
| | | if (phoneCount>0){ |
| | | errorList.add(new ImportError(3, "企业联系电话已存在!")); |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | userService.insertUser(user); |
| | | } |
| | |
| | | package com.project.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.project.common.annotation.DataScope; |
| | | import com.project.common.constant.UserConstants; |
| | | import com.project.common.core.domain.TreeSelect; |
| | |
| | | import com.project.system.mapper.SysDeptMapper; |
| | | import com.project.system.mapper.SysRoleMapper; |
| | | import com.project.system.service.ISysDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | * @author project |
| | | */ |
| | | @Service |
| | | public class SysDeptServiceImpl implements ISysDeptService |
| | | @RequiredArgsConstructor |
| | | public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService |
| | | { |
| | | @Autowired |
| | | private SysDeptMapper deptMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | | private final SysDeptMapper deptMapper; |
| | | private final SysRoleMapper roleMapper; |
| | | |
| | | /** |
| | | * 查询部门管理数据 |
| | |
| | | userPostMapper.deleteUserPostByUserId(userId); |
| | | // 新增用户与岗位管理 |
| | | insertUserPost(user); |
| | | |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |