Commit a4cc521f authored by huyuchen's avatar huyuchen

缴费库 代码修改

parent 7a323d93
......@@ -770,6 +770,7 @@
<where>
1=1
AND EMP_IDCARD_NO = #{idCard}
AND IS_EFFECT = 0
</where>
ORDER BY CREATE_TIME desc
</select>
......
......@@ -53,55 +53,60 @@ public class TPaymentInfoController {
/**
* 简单分页查询
* @param page 分页对象
*
* @param page 分页对象
* @param tPaymentInfo 缴费库
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TPaymentInfo>> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
return new R<>(tPaymentInfoService.getTPaymentInfoPage(page,tPaymentInfo));
return new R<>(tPaymentInfoService.getTPaymentInfoPage(page, tPaymentInfo));
}
/**
* 通过id查询缴费库
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R<TPaymentInfo> getById(@PathVariable("id" ) String id) {
@GetMapping("/{id}")
public R<TPaymentInfo> getById(@PathVariable("id") String id) {
return R.ok(tPaymentInfoService.getById(id));
}
/**
* 修改缴费库
*
* @param tPaymentInfo 缴费库
* @return R
*/
@Operation(summary = "修改缴费库", description = "修改缴费库:hasPermission('social_tpaymentinfo_edit')")
@SysLog("修改缴费库" )
@SysLog("修改缴费库")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_edit')" )
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_edit')")
public R<Boolean> updateById(@RequestBody TPaymentInfo tPaymentInfo) {
return R.ok(tPaymentInfoService.updateById(tPaymentInfo));
}
/**
* 通过id删除缴费库
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除缴费库", description = "通过id删除缴费库:hasPermission('social_tpaymentinfo_del')")
@SysLog("通过id删除缴费库" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')" )
@SysLog("通过id删除缴费库")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')")
public R removeById(@PathVariable String id) {
return tPaymentInfoService.removeInFoById(id);
}
/**
* 通过ids删除一条记录
*
* @param ids
* @return R
*/
......@@ -115,6 +120,7 @@ public class TPaymentInfoController {
/**
* 通过id查询单条记录(包含明细)
*
* @param id
* @return R
*/
......@@ -126,6 +132,7 @@ public class TPaymentInfoController {
/**
* 省市社保 批量导入
*
* @author huyc
* @date 2022-07-22
**/
......@@ -134,12 +141,13 @@ public class TPaymentInfoController {
@SysLog("批量新增缴费库")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_batchImport')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam String random){
return tPaymentInfoService.importSocialDiy(file.getInputStream(),random);
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam String random) {
return tPaymentInfoService.importSocialDiy(file.getInputStream(), random);
}
/**
* 导入省市社保-合肥三险
*
* @author huyc
* @date 2022-07-22
**/
......@@ -148,12 +156,13 @@ public class TPaymentInfoController {
@SysLog("批量新增缴费库-合肥三险")
@PostMapping("/importListSocialHeFei")
public R<List<ErrorMessage>> importListSocialHeFei(@RequestBody MultipartFile file, @RequestParam String random,
@RequestParam(value = "type") String type){
return tPaymentInfoService.importSocialHeFeiDiy(file.getInputStream(),random,type);
@RequestParam(value = "type") String type) {
return tPaymentInfoService.importSocialHeFeiDiy(file.getInputStream(), random, type);
}
/**
* 导入公积金
*
* @author huyc
* @date 2022-07-27
**/
......@@ -162,12 +171,13 @@ public class TPaymentInfoController {
@SysLog("导入公积金")
@PostMapping("/batchImportPaymentFundInfo")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_batchImport')")
public R<List<ErrorMessage>> importListFund(@RequestBody MultipartFile file){
public R<List<ErrorMessage>> importListFund(@RequestBody MultipartFile file) {
return tPaymentInfoService.batchImportPaymentFundInfo(file.getInputStream());
}
/**
* 缴费库 批量导出
*
* @author huyc
* @date 2022-07-22
**/
......@@ -175,7 +185,29 @@ public class TPaymentInfoController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
public void export(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
tPaymentInfoService.listExport(response,searchVo);
tPaymentInfoService.listExport(response, searchVo);
}
/**
* 根据条件批量删除
*
* @param empIdCard 员工身份证
* @param socialHouseId 社保户
* @param fundHouseId 公积金户
* @param socialCreateMonth 生成月份
* @param socialPayMonth 缴纳月份
* @return R
*/
@Operation(description = "根据条件批量删除 hasPermission('social_tpaymentinfo_del')")
@SysLog("根据条件批量删除")
@PostMapping("/removeBatchByIdsAndType")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')")
public R removeBatchByIdsAndType(@RequestParam(name = "empIdCard", required = false) String empIdCard,
@RequestParam(name = "socialHouseId", required = false) String socialHouseId,
@RequestParam(name = "fundHouseId", required = false) String fundHouseId,
@RequestParam(name = "socialCreateMonth", required = false) String socialCreateMonth,
@RequestParam(name = "socialPayMonth", required = false) String socialPayMonth) {
return tPaymentInfoService.removeBatchByInfo(empIdCard, socialHouseId,
fundHouseId, socialCreateMonth, socialPayMonth);
}
}
......@@ -99,4 +99,18 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
**/
R getAllInfoById(String id);
/**
* 根据条件批量删除
* @Author huyc
* @Date 2022-07-29
* @param empIdCard 员工身份证
* @param socialHouseId 社保户
* @param fundHouseId 公积金户
* @param socialCreateMonth 生成月份
* @param socialPayMonth 缴纳月份
* @return
**/
R removeBatchByInfo(String empIdCard, String socialHouseId, String fundHouseId,
String socialCreateMonth, String socialPayMonth);
}
......@@ -17,13 +17,15 @@ package com.yifu.cloud.plus.v1.yifu.social.service.impl;/*
import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.read.listener.ReadListener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
......@@ -46,7 +48,6 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -236,6 +237,47 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.ok(vo, "查询成功!");
}
@Override
public R removeBatchByInfo(String empIdCard, String socialHouseId, String fundHouseId,
String socialCreateMonth, String socialPayMonth) {
YifuUser user = SecurityUtils.getUser();
LambdaQueryWrapper<TPaymentInfo> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(empIdCard)) {
wrapper.eq(TPaymentInfo::getEmpIdcard, empIdCard);
}
if (Common.isNotNull(socialHouseId)) {
wrapper.eq(TPaymentInfo::getSocialHousehold, socialHouseId);
}
if (Common.isNotNull(fundHouseId)) {
wrapper.eq(TPaymentInfo::getProvidentHousehold, fundHouseId);
}
if (Common.isNotNull(socialCreateMonth)) {
wrapper.eq(TPaymentInfo::getSocialCreateMonth, socialCreateMonth);
}
if (Common.isNotNull(socialPayMonth)) {
wrapper.eq(TPaymentInfo::getSocialPayMonth, socialPayMonth);
}
List<TPaymentInfo> list = baseMapper.selectList(wrapper);
List<String> idList = new ArrayList<>();
if (Common.isNotNull(list)) {
for (TPaymentInfo paymentInfo : list) {
if ((!user.getId().equals(paymentInfo.getCreateBy()) ||
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus()))
&& !CommonConstants.ONE_STRING.equals(user.getId())) {
return R.failed("存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!");
} else {
idList.add(paymentInfo.getId());
}
}
} else {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
baseMapper.deleteBatchIds(idList);
return R.ok();
}
@Override
public R<List<ErrorMessage>> importSocialDiy(InputStream inputStream, String random) {
YifuUser user = SecurityUtils.getUser();
......
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