exam-system/src/main/java/com/gkhy/exam/pay/controller/NonCoalPayController.java
@@ -124,7 +124,7 @@ /** * 删除非煤缴费管理 */ @DeleteMapping("/id") @DeleteMapping("/{id}") @ApiOperation(value = "删除非煤缴费管理") @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true) public AjaxResult remove(@PathVariable Long id) { @@ -153,7 +153,7 @@ /** * 删除【请填写功能名称】 */ @DeleteMapping("/delNonCalStu/id") @DeleteMapping("/delNonCalStu/{id}") @ApiOperation(value = "删除非煤缴费学员") @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true) public AjaxResult delNonCalStu(@PathVariable Long id) { exam-system/src/main/java/com/gkhy/exam/pay/entity/NonCoalPay.java
@@ -61,7 +61,7 @@ */ @Excel(name = "缴费类型1初训理论2初训实操3初训理论与实操4复训理论") @NotNull(message = "缴费类型不能为空") @ApiModelProperty("缴费类型") @ApiModelProperty("缴费类型1初训理论2初训实操3初训理论与实操4复训理论") private Long payType; /** @@ -85,7 +85,7 @@ */ @Excel(name = "季度1一季度2二季度3三季度4四季度") @NotNull(message = "季度不能为空") @ApiModelProperty("季度") @ApiModelProperty("季度1一季度2二季度3三季度4四季度") private Long quarter; /** @@ -93,7 +93,7 @@ */ @Excel(name = "交款人类型1个人2团体") @NotNull(message = "交款人类型不能为空") @ApiModelProperty("交款人类型") @ApiModelProperty("交款人类型1个人2团体") private Integer payPersonType; /** exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java
@@ -161,7 +161,7 @@ .eq(NonCoalPay::getDistrictCode, nonCoalPay.getDistrictCode()) .eq(NonCoalPay::getBatchName, nonCoalPay.getBatchName()) .eq(NonCoalPay::getDelFlag, 0); if (nonCoalPay.getId() == null) { if (nonCoalPay.getId() != null) { lambdaQueryWrapper.ne(NonCoalPay::getId, nonCoalPay.getId()); } Long l = baseMapper.selectCount(lambdaQueryWrapper); @@ -208,7 +208,7 @@ @Override @Transactional public int updateNonCoalPayTypeStatus(int payPersonType, Long id) { NonCoalPay byId = getById(id); NonCoalPay byId = nonCoalPayMapper.selectNonCoalPayById(id); if (byId == null) { throw new ServiceException("该数据不存在"); } @@ -246,8 +246,8 @@ */ @Override public int deleteNonCoalPayById(Long id) { NonCoalPay byId = getById(id); if (byId == null) { NonCoalPay nonCoalPay = nonCoalPayMapper.selectNonCoalPayById(id); if (nonCoalPay == null) { throw new ServiceException("该数据不存在"); } //验证是否有学员已缴费 exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayStudentServiceImpl.java
@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.exam.pay.dto.req.NonCoalPayStudentReqDto; import com.gkhy.exam.pay.entity.NonCoalPay; import com.gkhy.exam.pay.entity.NonCoalPayStudent; import com.gkhy.exam.pay.mapper.NonCoalPayMapper; import com.gkhy.exam.pay.mapper.NonCoalPayStudentMapper; import com.gkhy.exam.pay.service.NonCoalPayStudentService; import com.ruoyi.common.exception.ServiceException; @@ -30,6 +32,8 @@ public class NonCoalPayStudentServiceImpl extends ServiceImpl<NonCoalPayStudentMapper, NonCoalPayStudent> implements NonCoalPayStudentService { @Resource private NonCoalPayStudentMapper nonCoalPayStudentMapper; @Resource private NonCoalPayMapper nonCoalPayMapper; /** * 查询【请填写功能名称】 @@ -63,6 +67,8 @@ @Override public int insertNonCoalPayStudent(NonCoalPayStudent nonCoalPayStudent) { checkSameData(nonCoalPayStudent); NonCoalPay nonCoalPay = checkNonCoalPay(nonCoalPayStudent.getNonCoalPayId()); nonCoalPayStudent.setPayType(nonCoalPay.getPayType()); nonCoalPayStudent.setCreateBy(SecurityUtils.getUsername()); return nonCoalPayStudentMapper.insertNonCoalPayStudent(nonCoalPayStudent); } @@ -77,6 +83,7 @@ public int updateNonCoalPayStudent(NonCoalPayStudent nonCoalPayStudent) { checkData(nonCoalPayStudent.getId()); checkSameData(nonCoalPayStudent); nonCoalPayStudent.setPayType(null); nonCoalPayStudent.setUpdateBy(SecurityUtils.getUsername()); return nonCoalPayStudentMapper.updateNonCoalPayStudent(nonCoalPayStudent); } @@ -111,7 +118,7 @@ .eq(NonCoalPayStudent::getNonCoalPayId, nonCoalPay.getNonCoalPayId()) .eq(NonCoalPayStudent::getIdCard, nonCoalPay.getIdCard()) .eq(NonCoalPayStudent::getDelFlag, 0); if (nonCoalPay.getId() == null) { if (nonCoalPay.getId() != null) { lambdaQueryWrapper.ne(NonCoalPayStudent::getId, nonCoalPay.getId()); } Long l = baseMapper.selectCount(lambdaQueryWrapper); @@ -161,7 +168,8 @@ if (StringUtils.isNull(nonCoalPayStudents) || nonCoalPayStudents.isEmpty()) { throw new ServiceException("导入数据不能为空!"); } NonCoalPay nonCoalPay = checkNonCoalPay(nonCoalPayId); Integer payPersonType = nonCoalPay.getPayPersonType(); Set<String> collect = nonCoalPayStudents.stream() .map(NonCoalPayStudent::getIdCard) .collect(Collectors.toSet()); @@ -193,6 +201,7 @@ } else { stu.setPayType(1L); stu.setPayStatus(0L); stu.setPayType(payPersonType.longValue()); stu.setNonCoalPayId(nonCoalPayId); save(stu); successNum++; @@ -217,7 +226,7 @@ } private NonCoalPayStudent checkData(Long id) { NonCoalPayStudent byId = getById(id); NonCoalPayStudent byId = nonCoalPayStudentMapper.selectNonCoalPayStudentById(id); if (byId == null) { throw new RuntimeException("该数据不存在"); } @@ -229,4 +238,13 @@ } return byId; } private NonCoalPay checkNonCoalPay(Long nonCoalPayId) { NonCoalPay nonCoalPay = nonCoalPayMapper.selectNonCoalPayById(nonCoalPayId); if (nonCoalPay == null) { throw new ServiceException("该主数据不存在"); } return nonCoalPay; } } exam-system/src/main/resources/mapper/pay/NonCoalPayMapper.xml
@@ -117,7 +117,12 @@ <if test="payCompanyName != null and payCompanyName != ''">and a.pay_company_name like concat('%', #{payCompanyName}, '%') </if> <if test="params.startTime != null and params.startTime != ''"><!-- 开始时间检索 --> AND a.create_time >= #{params.startTime} </if> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> AND a.create_time <= #{params.endTime} </if> <if test="payCompanyCard != null and payCompanyCard != ''">and a.pay_company_card = #{payCompanyCard}</if> order by a.create_time desc </select> @@ -245,10 +250,10 @@ where id = #{id} </update> <update id="deleteNonCoalPayById" parameterType="Long"> <update id="deleteNonCoalPayById"> update non_coal_pay set del_flag = 2, update_by = #{updateBy} non_coal_pay update_by = #{updateBy} where id = #{id} </update> exam-system/src/main/resources/mapper/pay/NonCoalPayStudentMapper.xml
@@ -101,6 +101,7 @@ set pay_type = 2, update_by = #{updateBy} where non_coal_pay_id = #{id} and pay_status = 0 </update> <update id="updateNonCoalPayStudent" parameterType="NonCoalPayStudent"> update non_coal_pay_student