7 changed files with 149 additions and 10 deletions
@ -0,0 +1,74 @@ |
|||||
|
package com.zdxt.code.service.impl; |
||||
|
|
||||
|
import com.zdxt.auth.dto.DeptBean; |
||||
|
import com.zdxt.auth.dto.UserBean; |
||||
|
import com.zdxt.auth.feign.DeptApi; |
||||
|
import com.zdxt.auth.feign.UserApi; |
||||
|
import com.zdxt.auth.project.system.dict.service.IDictDataService; |
||||
|
import com.zdxt.auth.project.system.user.service.IUserService; |
||||
|
import com.zdxt.code.domain.StatisticsIndicatorPart; |
||||
|
import com.zdxt.code.domain.Zfryjdm2405301; |
||||
|
import com.zdxt.code.mapper.StatisticalPanelMapper; |
||||
|
import com.zdxt.code.service.IZfryjdm2405301Service; |
||||
|
import com.zdxt.code.service.statisticalPanelService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.time.YearMonth; |
||||
|
|
||||
|
@Service |
||||
|
public class statisticalPanelServiceImpl implements statisticalPanelService { |
||||
|
|
||||
|
@Autowired |
||||
|
private StatisticalPanelMapper statisticalPanelMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
private UserApi userApi; |
||||
|
@Autowired |
||||
|
private DeptApi deptApi; |
||||
|
|
||||
|
@Autowired |
||||
|
private IDictDataService dictDataService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IUserService userService; |
||||
|
@Autowired |
||||
|
private IZfryjdm2405301Service iZfryjdm2405301Service; |
||||
|
|
||||
|
@Override |
||||
|
public void statisticalPanelDeptAndUser(StatisticsIndicatorPart statisticsIndicatorPart) { |
||||
|
//统计执法部门数量
|
||||
|
Integer deptTotal = statisticalPanelMapper.statisticalPanelDept(statisticsIndicatorPart); |
||||
|
//执法人员数量
|
||||
|
Integer userTotal = statisticalPanelMapper.statisticalPanelUser(statisticsIndicatorPart); |
||||
|
|
||||
|
UserBean user = userApi.getCurrentUser(); |
||||
|
//查询双系统执法人员信息
|
||||
|
Zfryjdm2405301 zfryjdm2405301 = |
||||
|
iZfryjdm2405301Service.selectZfryByZfCode(user.getLawCertificateNum()); |
||||
|
//通过机构代码查询执法主体信息
|
||||
|
statisticsIndicatorPart.setCreditCode(zfryjdm2405301.getZzjgdm()); |
||||
|
//本单位执法人员数量
|
||||
|
Integer oneselfUserTotal = statisticalPanelMapper.statisticalPanelOneselfDeptUser(statisticsIndicatorPart); |
||||
|
|
||||
|
//默认今年 同比 对比上一年 上一个季度 上一个月
|
||||
|
//TODO 没有选择
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public static YearMonth getPreviousQuarter(int year, int quarter) { |
||||
|
if (quarter == 1) { |
||||
|
return YearMonth.of(year - 1, 4); |
||||
|
} else { |
||||
|
return YearMonth.of(year, getFirstMonthOfQuarter(quarter - 1)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private static int getFirstMonthOfQuarter(int quarter) { |
||||
|
return 3 * (quarter - 1) + 1; |
||||
|
} |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
System.out.println(getPreviousQuarter(2024, 4)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
package com.zdxt.code.service; |
||||
|
|
||||
|
import com.zdxt.code.domain.StatisticsIndicatorPart; |
||||
|
|
||||
|
public interface statisticalPanelService { |
||||
|
|
||||
|
void statisticalPanelDeptAndUser(StatisticsIndicatorPart statisticsIndicatorPart); |
||||
|
} |
||||
Loading…
Reference in new issue