Commit c0900d0c authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents cbdd5384 1964a95d
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author huyc
* @Date 2022-8-17 10:38:08
* @Description
* @Version 1.0
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.salary", ignoreInvalidFields = false)
public class DaprSalarylProperties {
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String appUrl;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String appId;
String appPort;
String httpPort;
String grpcPort;
String metricsPort;
}
......@@ -15,3 +15,7 @@ dapr.archives.appId=yifu-archives
dapr.insurances.appUrl=http://yifu-auth.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.insurances.appId=yifu-insurances
#\u6D4B\u8BD5\u73AF\u5883-\u85AA\u8D44\u670D\u52A1
dapr.salary.appUrl=http://yifu-salary.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.salary.appId=yifu-salary
package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalarylProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsLabor;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @Author huyc
* @Description 定时任务具体执行类
* @Date 10:48 2022/8/17
* @Param
* @return
**/
@Component(value = "salaryTask")
@Slf4j
@EnableConfigurationProperties(DaprSalarylProperties.class)
public class salaryTask {
@Autowired
private DaprSalarylProperties daprSalarylProperties;
/**
* @return
* @Author huyc
* @Description
* @Date 10:48 2022/8/17
* @Param
**/
public void doStatisticsTaxDeclarer() throws Exception {
log.info("-------------生成申报对象-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(), daprSalarylProperties.getAppId(),
"/tstatisticsdeclarer/inner/doStatisticsTaxDeclarer", "", TStatisticsDeclarer.class,
SecurityConstants.FROM_IN);
log.info("-------------生成申报对象-定时任务结束------------");
}
/**
* @return
* @Author huyc
* @Description
* @Date 10:48 2022/8/17
* @Param
**/
public void doStatisticsLabor() throws Exception {
log.info("-------------生成本期劳务费-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(), daprSalarylProperties.getAppId(),
"/tstatisticslabor/inner/doStatisticsLabor", "", TStatisticsLabor.class,
SecurityConstants.FROM_IN);
log.info("-------------生成本期劳务费-定时任务结束------------");
}
/**
* @return
* @Author huyc
* @Description
* @Date 10:48 2022/8/17
* @Param
**/
public void doStatisticsRemuneration() throws Exception {
log.info("-------------生成本期劳务费-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(), daprSalarylProperties.getAppId(),
"/tstatisticsremuneration/inner/doStatisticsRemuneration", "",
TStatisticsRemuneration.class, SecurityConstants.FROM_IN);
log.info("-------------生成本期劳务费-定时任务结束------------");
}
}
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsRemunerationService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsRemunerationSearchVo;
......@@ -112,4 +113,18 @@ public class TStatisticsRemunerationController {
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsRemunerationService.batchDelete(declareMonth);
}
/**
* @param
* @Description: 生成本期稿酬
* @Author: huyc
* @Date: 2022-08-17 18:17:48
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Inner
@Operation(description = "生成本期稿酬")
@PostMapping("/inner/doStatisticsRemuneration")
public R doStatisticsRemuneration() {
return tStatisticsRemunerationService.doStatisticsRemuneration();
}
}
......@@ -23,6 +23,9 @@ import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 本期稿酬申报表
*
......@@ -37,4 +40,11 @@ public interface TStatisticsRemunerationMapper extends BaseMapper<TStatisticsRem
* @return
*/
IPage<TStatisticsRemuneration> getTStatisticsRemunerationPage(Page<TStatisticsRemuneration> page, @Param("tStatisticsRemuneration") TStatisticsRemuneration tStatisticsRemuneration);
/**
* @param
* @Description: 统计
* @return:
**/
List<TStatisticsRemuneration> doStatisticsRemuneration(@Param("nowMonth") String nowMonth, @Param("lastYear") String lastYear);
}
......@@ -49,4 +49,10 @@ public interface TStatisticsRemunerationService extends IService<TStatisticsRemu
*/
R batchDelete(String declareMonth);
/** 生成本期稿酬
* @param
* @return
**/
R doStatisticsRemuneration();
}
......@@ -269,7 +269,6 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TStatisticsLaborVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
......
......@@ -20,6 +20,7 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -143,6 +144,27 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
return null;
}
@Override
public R doStatisticsRemuneration() {
String nowMonth = DateUtil.addMonth(0); //本月
TStatisticsRemuneration std = new TStatisticsRemuneration();
std.setDeclareMonth(nowMonth);
QueryWrapper<TStatisticsRemuneration> queryWrapperSs = new QueryWrapper<>();
queryWrapperSs.setEntity(std);
long num = this.count(queryWrapperSs);
if (num > 0) {
return R.failed("上月数据已生成,不可重复生成!");
} else {
String lastMonth = DateUtil.addMonth(-1); //上月
String lastYear = lastMonth.substring(0,4);
List<TStatisticsRemuneration> stdvoList = baseMapper.doStatisticsRemuneration(nowMonth,lastYear);
for (TStatisticsRemuneration remuneration : stdvoList) {
this.save(remuneration);
}
return R.ok();
}
}
private List<TStatisticsRemuneration> noPageDiy(TStatisticsRemunerationSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsRemuneration> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
......@@ -105,7 +105,7 @@
b.UNIT_NAME DECLARE_UNIT,'雇员' OCCUPATION_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH like '${lastYear}%'
where a.DELETE_FLAG = '0' and a.SETTLEMENT_MONTH like '${lastYear}%'
GROUP BY a.EMP_IDCARD
</select>
</mapper>
......@@ -85,18 +85,17 @@
1=1
<include refid="tStatisticsLabor_where"/>
</where>
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select id="doStatisticsLabor" resultMap="tStatisticsLaborMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.SALARY_TAX PERSONAL_TAX,a.ACTUAL_SALARY INCOME,
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,sum(a.ACTUAL_SALARY) INCOME,
b.UNIT_NAME DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH like '${lastYear}%'
GROUP BY a.EMP_IDCARD
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '3'
GROUP BY a.EMP_IDCARD,a.EMP_NAME
</select>
</mapper>
......@@ -83,4 +83,15 @@
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select id="doStatisticsRemuneration" resultMap="tStatisticsRemunerationMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,
sum(a.ACTUAL_SALARY) INCOME,b.UNIT_NAME DECLARE_UNIT,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '4'
GROUP BY a.EMP_IDCARD,a.EMP_NAME
</select>
</mapper>
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