Browse Source

fix. 工时统计按人员加个查询条件

caozixuan 5 months ago
parent
commit
2d59f0fccb

+ 2 - 1
sop-api/src/main/java/com/qmth/sop/server/api/TBDingStatisticController.java

@@ -52,13 +52,14 @@ public class TBDingStatisticController {
     @RequestMapping(value = "/page", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = DingSubmitResult.class) })
     public Result findDingSubmitPage(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId,
+            @ApiParam(value = "人员姓名") @RequestParam(required = false) String personName,
             @ApiParam(value = "统计维度", required = true) @RequestParam DingStatisticTypeEnum type,
             @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
             @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
         switch (type) {
         case BY_PERSON:
             return ResultUtil.ok(
-                    tbdingStatisticByPersonService.findStatisticByPersonPage(serviceId, pageNumber, pageSize));
+                    tbdingStatisticByPersonService.findStatisticByPersonPage(serviceId, personName, pageNumber, pageSize));
         case BY_CRM:
             return ResultUtil.ok(tbdingStatisticByCrmService.findStatisticByCrmPage(serviceId, pageNumber, pageSize));
         case BY_SOP:

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/TBDingStatisticByPersonMapper.java

@@ -23,7 +23,8 @@ public interface TBDingStatisticByPersonMapper extends BaseMapper<TBDingStatisti
 
     List<DingStatisticByPersonDto> findStatisticByPersonList(@Param("serviceId") Long serviceId);
 
-    IPage<DingStatisticByPersonDto> findStatisticByPersonPage(@Param("iPage") Page<DingStatisticByPersonDto> iPage, @Param("serviceId") Long serviceId);
+    IPage<DingStatisticByPersonDto> findStatisticByPersonPage(@Param("iPage") Page<DingStatisticByPersonDto> iPage, @Param("serviceId") Long serviceId,
+            @Param("personName") String personName);
 
     void truncateTable();
 

+ 4 - 2
sop-business/src/main/java/com/qmth/sop/business/service/TBDingStatisticByPersonService.java

@@ -22,7 +22,7 @@ public interface TBDingStatisticByPersonService extends IService<TBDingStatistic
     /**
      * 按人员统计(统计区协数据)
      *
-     * @param datasource    考勤统计数据
+     * @param datasource        考勤统计数据
      * @param dingAddDatasource 工时增加数据
      */
     void buildStatisticByPerson(List<TBDingStatistic> datasource, List<TBDingAdd> dingAddDatasource);
@@ -31,11 +31,13 @@ public interface TBDingStatisticByPersonService extends IService<TBDingStatistic
      * 按人员统计(统计区协数据)
      *
      * @param serviceId  服务单元id
+     * @param personName 人员姓名
      * @param pageNumber 页码
      * @param pageSize   容量
      * @return 分页结果
      */
-    IPage<DingStatisticByPersonDto> findStatisticByPersonPage(Long serviceId, Integer pageNumber, Integer pageSize);
+    IPage<DingStatisticByPersonDto> findStatisticByPersonPage(Long serviceId, String personName, Integer pageNumber,
+            Integer pageSize);
 
     /**
      * 查询按人员统计列表

+ 3 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingStatisticByPersonServiceImpl.java

@@ -127,9 +127,10 @@ public class TBDingStatisticByPersonServiceImpl extends ServiceImpl<TBDingStatis
     }
 
     @Override
-    public IPage<DingStatisticByPersonDto> findStatisticByPersonPage(Long serviceId, Integer pageNumber,
+    public IPage<DingStatisticByPersonDto> findStatisticByPersonPage(Long serviceId, String personName, Integer pageNumber,
             Integer pageSize) {
-        return this.baseMapper.findStatisticByPersonPage(new Page<>(pageNumber, pageSize), serviceId);
+        personName = SystemConstant.translateSpecificSign(personName);
+        return this.baseMapper.findStatisticByPersonPage(new Page<>(pageNumber, pageSize), serviceId, personName);
     }
 
     @Override

+ 3 - 0
sop-business/src/main/resources/mapper/TBDingStatisticByPersonMapper.xml

@@ -57,6 +57,9 @@
             <if test="serviceId != null">
                 AND service_id = #{serviceId}
             </if>
+            <if test="personName != null and personName != ''">
+                AND user_info LIKE CONCAT('%', #{personName}, '%')
+            </if>
         </where>
     </select>
     <select id="findSopInfoBySopNo" resultType="com.qmth.sop.business.bean.dto.SopInfoDto">