diff --git a/inventory-dao/src/main/java/com/rzyc/bean/PageDto.java b/inventory-dao/src/main/java/com/rzyc/bean/PageDto.java new file mode 100644 index 0000000..004b4eb --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/bean/PageDto.java @@ -0,0 +1,39 @@ +package com.rzyc.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author dong + * @date 2023-09-27 14:16 + * @Version V1.0 + */ +@ApiModel("分页") +public class PageDto { + + @NotNull(message = "页码不能为空") + @ApiModelProperty(value = "页码",required = true,example = "1") + private Integer page;//当前页 + + @NotNull(message = "每页条数不能为空") + @ApiModelProperty(value = "每页条数",required = true,example = "10") + private Integer pageSize;//每页显示多少条 + + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/bean/user/UserPerformInfo.java b/inventory-dao/src/main/java/com/rzyc/bean/user/UserPerformInfo.java new file mode 100644 index 0000000..0e9c3a2 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/bean/user/UserPerformInfo.java @@ -0,0 +1,110 @@ +package com.rzyc.bean.user; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.common.utils.excel.ExcelColumn; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 用户履职完成进度 + * @author dong + * @date 2023-09-27 14:08 + * @Version V1.0 + */ +@ApiModel("履职完成进度") +public class UserPerformInfo { + + @ApiModelProperty("用户id") + private String sysuserid; + + @ExcelColumn(value = "部门名", col = 1) + @ApiModelProperty("部门名") + private String unitName; + + @ExcelColumn(value = "岗位名", col = 2) + @ApiModelProperty("岗位名") + private String postName; + + @ExcelColumn(value = "姓名", col = 3) + @ApiModelProperty("姓名") + private String chinaname; + + @ExcelColumn(value = "登录账户", col = 4) + @ApiModelProperty("登录账户") + private String sysusername; + + @ExcelColumn(value = "联系电话", col = 5) + @ApiModelProperty("联系电话") + private String mobileTel; + + @ExcelColumn(value = "履职完成进度", col = 6) + @ApiModelProperty("履职完成进度") + private String completion; + + @ApiModelProperty("职务id") + private String systitle; + + public String getMobileTel() { + return mobileTel; + } + + public void setMobileTel(String mobileTel) { + this.mobileTel = mobileTel; + } + + public String getSysuserid() { + return sysuserid; + } + + public void setSysuserid(String sysuserid) { + this.sysuserid = sysuserid; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPostName() { + return postName; + } + + public void setPostName(String postName) { + this.postName = postName; + } + + public String getChinaname() { + return chinaname; + } + + public void setChinaname(String chinaname) { + this.chinaname = chinaname; + } + + public String getSysusername() { + return sysusername; + } + + public void setSysusername(String sysusername) { + this.sysusername = sysusername; + } + + public String getCompletion() { + return completion; + } + + public void setCompletion(String completion) { + this.completion = completion; + } + + public String getSystitle() { + return systitle; + } + + public void setSystitle(String systitle) { + this.systitle = systitle; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/bean/user/dto/UserPerformDto.java b/inventory-dao/src/main/java/com/rzyc/bean/user/dto/UserPerformDto.java new file mode 100644 index 0000000..5c0b71b --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/bean/user/dto/UserPerformDto.java @@ -0,0 +1,49 @@ +package com.rzyc.bean.user.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author dong + * @date 2023-09-27 14:14 + * @Version V1.0 + */ +@ApiModel("用户履职分页") +public class UserPerformDto { + + @ApiModelProperty("关键字") + private String condition; + + @NotNull(message = "用户不能为空") + @ApiModelProperty(value = "登录用户id",required = true) + private String userId; + + @ApiModelProperty("职务") + private String performId; + + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getPerformId() { + return performId; + } + + public void setPerformId(String performId) { + this.performId = performId; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/user/ListPerformMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/user/ListPerformMapper.java index 61f0c99..cbbe787 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/user/ListPerformMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/user/ListPerformMapper.java @@ -5,6 +5,7 @@ import com.rzyc.bean.UserDepart; import com.rzyc.bean.bigdata.user.UnitList; import com.rzyc.bean.user.PerformNum; import com.rzyc.bean.user.PerformRecord; +import com.rzyc.bean.user.UserPerformInfo; import com.rzyc.model.ent.SysEnterprise; import com.rzyc.model.user.ListPerform; import com.rzyc.model.user.ListPerformExample; @@ -142,4 +143,8 @@ public interface ListPerformMapper extends BaseMapper { Integer changePositionType(@Param("listPerformId") String listPerformId, @Param("positionType") Integer positionType); + /*用户履职清单完成情况*/ + List userPerformInfo(@Param("condition") String condition, + @Param("performId") String performId); + } diff --git a/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml b/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml index 62cc642..841bdbe 100644 --- a/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml +++ b/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml @@ -907,4 +907,31 @@ where ListPerformId = #{listPerformId} + + + + + + + + + + + + + + + diff --git a/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java b/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java index 209855e..ad24feb 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java @@ -4,11 +4,13 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.common.utils.*; import com.common.utils.encryption.PasswdFactory; +import com.common.utils.excel.ExcelUtils; import com.common.utils.jwt.JwtUtil; import com.common.utils.model.*; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.rzyc.advice.LoginAuth; +import com.rzyc.bean.PageDto; import com.rzyc.bean.UserDepart; import com.rzyc.bean.check.CheckList; import com.rzyc.bean.check.CheckPerform; @@ -32,6 +34,7 @@ import com.rzyc.model.oth.OtheWareHouse; import com.rzyc.model.personal.SysResource; import com.rzyc.model.user.*; import io.swagger.annotations.*; +import org.apache.catalina.User; import org.apache.commons.beanutils.BeanUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Controller; @@ -40,6 +43,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.util.*; @@ -1870,7 +1874,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController { @ApiOperation(value = "修改新增岗位", notes = "修改新增岗位") @PostMapping(value = "changePerform") @ResponseBody - public SingleResult changePerform(@Valid ChangePerformDto changePerformDto)throws Exception{ + public SingleResult changePerform(@Valid @RequestBody ChangePerformDto changePerformDto)throws Exception{ SingleResult result = new SingleResult<>(); ListPerform listPerform = new ListPerform(); BeanUtils.copyProperties(listPerform,changePerformDto); @@ -2948,5 +2952,60 @@ public class PcPersonalController extends com.rzyc.controller.BaseController { return result; } + /** + * 履职完成进度分页 + * @version v1.0 + * @author dong + * @date 2023/9/27 14:13 + */ + @ApiOperation(value = "履职完成进度", notes = "履职完成进度") + @GetMapping("/userPerform") + @ResponseBody + public SingleResult> userPerform(@Valid UserPerformDto userPerformDto,@Valid PageDto pageDto)throws Exception{ + SingleResult> result = new SingleResult<>(); + + String condition = TypeConversion.getCondition(userPerformDto.getCondition()); + + String performId = userPerformDto.getPerformId(); + if(StringUtils.isBlank(performId)){ + performId = getUnitId(userPerformDto.getUserId()); + } + //分页 + PageHelper.startPage(pageDto.getPage(), pageDto.getPageSize()); + Page page = (Page)listPerformMapper.userPerformInfo(condition,performId); + Pager pager = new Pager<>(); + getDatePage(pager,page); + result.setData(pager); + return result; + } + + /** + * userPerformExport + * @version v1.0 + * @author dong + * @date 2023/9/27 15:30 + */ + @ApiOperation(value = "导出用户履职情况", notes = "导出用户履职情况") + @GetMapping("userPerformExport") + @ResponseBody + public void userPerformExport(@Valid UserPerformDto userPerformDto, HttpServletResponse response)throws Exception{ + SingleResult> result = new SingleResult<>(); + + String condition = TypeConversion.getCondition(userPerformDto.getCondition()); + + String performId = userPerformDto.getPerformId(); + if(StringUtils.isBlank(performId)){ + performId = getUnitId(userPerformDto.getUserId()); + } + List userPerformInfos = listPerformMapper.userPerformInfo(condition,performId); + if(null != userPerformInfos && userPerformInfos.size() > 0){ + String excelName = "用户履职记录"+ DateUtils.getNowDateTimeStr("yyyyMMdd") +".xlsx"; + long t1 = System.currentTimeMillis(); + ExcelUtils.writeExcel(response, excelName,userPerformInfos, UserPerformInfo.class); + long t2 = System.currentTimeMillis(); + System.out.println(String.format("write over! cost:%sms", (t2 - t1))); + } + } + }