yxh
2023-05-31 e7acba8aaaa91a067728d4769b4af5a9dd6ac189
Merge remote-tracking branch 'origin/master'
已添加1个文件
已修改5个文件
254 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFunddetailController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/FunddetailReqVo.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceFunddetailMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFunddetailService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceFunddetailMapper.xml 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFunddetailController.java
@@ -6,10 +6,13 @@
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.domain.FunddetailReqVo;
import com.ruoyi.project.domain.ServiceFund;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -41,8 +44,7 @@
@Api("费用申请明细")
@RestController
@RequestMapping("/project/funddetail")
public class ServiceFunddetailController extends BaseController
{
public class ServiceFunddetailController extends BaseController {
    @Autowired
    private IServiceFunddetailService serviceFunddetailService;
@@ -53,8 +55,7 @@
    @ApiOperation("查询费用申请明细列表")
    //@PreAuthorize("@ss.hasPermi('project:funddetail:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceFunddetail serviceFunddetail)
    {
    public TableDataInfo list(ServiceFunddetail serviceFunddetail) {
        startPage();
        //List<ServiceFunddetail> list = serviceFunddetailService.queryList(serviceFunddetail);
        List<ServiceFunddetail> list = serviceFunddetailService.selectServiceFunddetailList(serviceFunddetail);
@@ -68,8 +69,7 @@
    //@PreAuthorize("@ss.hasPermi('project:funddetail:export')")
    @Log(title = "费用申请明细", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceFunddetail serviceFunddetail)
    {
    public AjaxResult export(ServiceFunddetail serviceFunddetail) {
        List<ServiceFunddetail> list = serviceFunddetailService.queryList(serviceFunddetail);
        ExcelUtil<ServiceFunddetail> util = new ExcelUtil<ServiceFunddetail>(ServiceFunddetail.class);
        return util.exportExcel(list, "费用申请明细数据");
@@ -81,8 +81,7 @@
    @ApiOperation("获取费用申请明细详细信息")
    //@PreAuthorize("@ss.hasPermi('project:funddetail:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceFunddetailService.getById(id));
    }
@@ -94,8 +93,7 @@
    @Log(title = "费用申请明细", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceFunddetail serviceFunddetail)
    {
    public AjaxResult add(@RequestBody ServiceFunddetail serviceFunddetail) {
        return toAjax(serviceFunddetailService.save(serviceFunddetail));
    }
@@ -107,8 +105,7 @@
    @Log(title = "费用申请明细", businessType = BusinessType.UPDATE)
    @PutMapping
    @RepeatSubmit    
    public AjaxResult edit(@RequestBody ServiceFunddetail serviceFunddetail)
    {
    public AjaxResult edit(@RequestBody ServiceFunddetail serviceFunddetail) {
        return toAjax(serviceFunddetailService.updateById(serviceFunddetail));
    }
@@ -119,8 +116,7 @@
    //@PreAuthorize("@ss.hasPermi('project:funddetail:remove')")
    @Log(title = "费用申请明细", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceFunddetailService.removeByIds(Arrays.asList(ids)));
    }
@@ -131,12 +127,22 @@
    @ApiOperation("删除报销申请明细并修改金额")
    @Log(title = "报销申请明细", businessType = BusinessType.DELETE)
    @DeleteMapping("/deleteDetail/{id}")
    public AjaxResult deleteDetail(@PathVariable Long id)
    {
    public AjaxResult deleteDetail(@PathVariable Long id) {
        return AjaxResult.success(serviceFunddetailService.deleteDetail(id));
    }
    /**
     * æ ¹æ®å—益人编号获取费用申请明细信息
     */
    @ApiOperation("根据受益人编号获取费用申请明细信息")
    @PostMapping("/getDataBybeneficiaryNo")
    public AjaxResult getDataBybeneficiaryNo(@RequestBody FunddetailReqVo funddetailReqVo) {
//        if (StringUtils.isEmpty(funddetailReqVo.getBeneficiaryNo())) {
//            return AjaxResult.error("受益人编号不能为空");
//        }
        List<ServiceFunddetail> dataBybeneficiaryNo = serviceFunddetailService.getDataBybeneficiaryNo(funddetailReqVo);
        return AjaxResult.success(dataBybeneficiaryNo);
    }
}
ruoyi-project/src/main/java/com/ruoyi/project/domain/FunddetailReqVo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
package com.ruoyi.project.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * è´¹ç”¨ç”³è¯·æŸ¥è¯¢VO
 *
 * @author ls
 * @date 2023-05-30
 */
@Data
@ApiModel("费用申请明细")
public class FunddetailReqVo extends BaseEntity {
    /**
     * æœåŠ¡å¯¹è±¡åç§°
     */
    @ApiModelProperty("受益人编号")
    private String beneficiaryNo;
    /**
     * ç”³è¯·å¼€å§‹æ—¶é—´
     */
    @ApiModelProperty("申请开始时间")
    private String starttime;
    /**
     * ç”³è¯·å¼€å§‹æ—¶é—´
     */
    @ApiModelProperty("申请结束时间")
    private String endtime;
}
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceFunddetailMapper.java
@@ -3,6 +3,8 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import com.ruoyi.project.domain.FunddetailReqVo;
import com.ruoyi.project.domain.ServiceFunddetail;
import org.apache.ibatis.annotations.Param;
@@ -37,4 +39,6 @@
    List<ServiceFunddetail> getAllDetailsByFDIDLWF(Long id);
    int countItem(@Param("fundid") Long fundid, @Param("itemid") Long itemid);
    public List<ServiceFunddetail> getDataBybeneficiaryNo(FunddetailReqVo funddetailReqVo);
}
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceFunddetailService.java
@@ -2,7 +2,10 @@
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.project.domain.FunddetailReqVo;
import com.ruoyi.project.domain.ServiceFunddetail;
import org.springframework.web.bind.annotation.RequestBody;
/**
 * è´¹ç”¨ç”³è¯·æ˜Žç»†Service接口
@@ -19,7 +22,12 @@
     * @param serviceFunddetail è´¹ç”¨ç”³è¯·æ˜Žç»†
     * @return è´¹ç”¨ç”³è¯·æ˜Žç»†é›†åˆ
     */
    public List<ServiceFunddetail> queryList(ServiceFunddetail serviceFunddetail);
    List<ServiceFunddetail> queryList(ServiceFunddetail serviceFunddetail);
    /**
     * æ ¹æ®å—益人编号获取费用申请明细信息
     */
    List<ServiceFunddetail> getDataBybeneficiaryNo(FunddetailReqVo funddetailReqVo);
    List<ServiceFunddetail> getAllDetailsByFDIDLW(Long id);
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java
@@ -1,10 +1,10 @@
package com.ruoyi.project.service.impl;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
import java.util.List;
import com.ruoyi.project.domain.ServiceFund;
import com.ruoyi.project.domain.ServiceReimbursement;
import com.ruoyi.project.domain.ServiceReimbursementdetail;
import com.ruoyi.project.domain.*;
import com.ruoyi.project.mapper.ServiceFundMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -13,7 +13,6 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.mapper.ServiceFunddetailMapper;
import com.ruoyi.project.domain.ServiceFunddetail;
import com.ruoyi.project.service.IServiceFunddetailService;
/**
@@ -23,8 +22,7 @@
 * @date 2022-01-25
 */
@Service
public class ServiceFunddetailServiceImpl extends ServiceImpl<ServiceFunddetailMapper, ServiceFunddetail> implements IServiceFunddetailService
{
public class ServiceFunddetailServiceImpl extends ServiceImpl<ServiceFunddetailMapper, ServiceFunddetail> implements IServiceFunddetailService {
    @Autowired
    ServiceFunddetailMapper serviceFunddetailMapper;
@@ -76,6 +74,21 @@
    }
    @Override
    public List<ServiceFunddetail> getDataBybeneficiaryNo(FunddetailReqVo funddetailReqVo) {
        if (StringUtils.isEmpty(funddetailReqVo.getStarttime())) {
            // èŽ·å–å½“æœˆç¬¬ä¸€å¤©æ—¥æœŸ
            funddetailReqVo.setStarttime(LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()).toString());
        }
        if (StringUtils.isEmpty(funddetailReqVo.getEndtime())) {
            // èŽ·å–å½“æœˆæœ€åŽä¸€å¤©æ—¥æœŸ
            funddetailReqVo.setEndtime(LocalDate.now().with(TemporalAdjusters.lastDayOfMonth()).toString());
        }
        List<ServiceFunddetail> dataBybeneficiaryNo = serviceFunddetailMapper.getDataBybeneficiaryNo(funddetailReqVo);
        return dataBybeneficiaryNo;
    }
    @Override
    public List<ServiceFunddetail> getAllDetailsByFDIDLW(Long id) {
        return serviceFunddetailMapper.getAllDetailsByFDIDLW(id);
    }
ruoyi-project/src/main/resources/mapper/project/ServiceFunddetailMapper.xml
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.mapper.ServiceFunddetailMapper">
    
    <resultMap type="ServiceFunddetail" id="ServiceFunddetailResult">
    <resultMap type="com.ruoyi.project.domain.ServiceFunddetail" id="ServiceFunddetailResult">
        <result property="id"    column="ID"    />
        <result property="fundid"    column="fundID"    />
        <result property="beneficiaryname"    column="BeneficiaryName"    />
@@ -57,14 +57,66 @@
    </resultMap>
    <sql id="selectServiceFunddetailVo">
        select ID, fundID, InfoId, DonorNo, DonorName, BeneficiaryName, BeneficiaryNo, UnitName, UnitNo, UnitUserNo, Title, OrderNo, ItemCode, IDCardType, IDCardNo, Sex, FamilyRelations, Phone, DepositBank, BankCardNo, BranchBankName, AnnexBankCard, AnnexRegistForm, ApplyType,ApplyTypeName, ItemID, ItemName, ItemType, Amount, PrepaidAmount, TaxAmount, InvoiceCount, TaxedAmount, AttachCount, Quantity, Price, Remark, RecordStatus, del_flag, create_by, create_time, update_by, update_time, uploadflag, uploadtime,SERVICESSCOPE,SERVICESSCOPENAME,SERVICETYPE,SERVICETYPENAME from service_funddetail
        select ID,
               fundID,
               InfoId,
               DonorNo,
               DonorName,
               BeneficiaryName,
               BeneficiaryNo,
               UnitName,
               UnitNo,
               UnitUserNo,
               Title,
               OrderNo,
               ItemCode,
               IDCardType,
               IDCardNo,
               Sex,
               FamilyRelations,
               Phone,
               DepositBank,
               BankCardNo,
               BranchBankName,
               AnnexBankCard,
               AnnexRegistForm,
               ApplyType,
               ApplyTypeName,
               ItemID,
               ItemName,
               ItemType,
               Amount,
               PrepaidAmount,
               TaxAmount,
               InvoiceCount,
               TaxedAmount,
               AttachCount,
               Quantity,
               Price,
               Remark,
               RecordStatus,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               uploadflag,
               uploadtime,
               SERVICESSCOPE,
               SERVICESSCOPENAME,
               SERVICETYPE,
               SERVICETYPENAME
        from service_funddetail
    </sql>
    <select id="selectServiceFunddetailList" parameterType="ServiceFunddetail" resultMap="ServiceFunddetailResult">
    <select id="selectServiceFunddetailList" parameterType="com.ruoyi.project.domain.ServiceFunddetail"
            resultMap="ServiceFunddetailResult">
        <include refid="selectServiceFunddetailVo"/>
        <where>
            del_flag = '0'
            <if test="beneficiaryname != null  and beneficiaryname != ''"> and BeneficiaryName like concat('%', #{beneficiaryname}, '%')</if>
            <if test="beneficiaryname != null  and beneficiaryname != ''">and BeneficiaryName like concat('%',
                #{beneficiaryname}, '%')
            </if>
            <if test="unitname != null  and unitname != ''"> and UnitName like concat('%', #{unitname}, '%')</if>
            <if test="applytype != null  and applytype != ''"> and ApplyType = #{applytype}</if>
            <if test="itemname != null  and itemname != ''"> and ItemName like concat('%', #{itemname}, '%')</if>
@@ -109,8 +161,73 @@
        where fundID = #{id} and ItemType = "12"
    </select>
    <select id="countItem" resultType="java.lang.Integer">
        select count(*) from service_funddetail
        where ItemID = #{itemid} and fundID = #{fundid} and del_flag = '0'
        select count(*)
        from service_funddetail
        where ItemID = #{itemid}
          and fundID = #{fundid}
          and del_flag = '0'
    </select>
    <select id="getDataBybeneficiaryNo" parameterType="com.ruoyi.project.domain.FunddetailReqVo"
            resultMap="ServiceFunddetailResult">
        select a.ID,
        a.fundID,
        a.InfoId,
        a.DonorNo,
        a.DonorName,
        a.BeneficiaryName,
        a.BeneficiaryNo,
        a.UnitName,
        a.UnitNo,
        a.UnitUserNo,
        a.Title,
        a.OrderNo,
        a.ItemCode,
        a.IDCardType,
        a.IDCardNo,
        a.Sex,
        a.FamilyRelations,
        a.Phone,
        a.DepositBank,
        a.BankCardNo,
        a.BranchBankName,
        a.AnnexBankCard,
        a.AnnexRegistForm,
        a.ApplyType,
        a.ApplyTypeName,
        a.ItemID,
        a.ItemName,
        a.ItemType,
        a.Amount,
        a.PrepaidAmount,
        a.TaxAmount,
        a.InvoiceCount,
        a.TaxedAmount,
        a.AttachCount,
        a.Quantity,
        a.Price,
        a.Remark,
        a.RecordStatus,
        a.del_flag,
        a.create_by,
        a.create_time,
        a.update_by,
        a.update_time,
        a.uploadflag,
        a.uploadtime,
        a.SERVICESSCOPE,
        a.SERVICESSCOPENAME,
        a.SERVICETYPE,
        a.SERVICETYPENAME
        from service_funddetail a,
        service_fund b
        where a.del_flag = '0'
        and a.fundID = b.id
        <if test="beneficiaryNo != null  and beneficiaryNo != '' ">and a.beneficiaryNo = #{beneficiaryNo}</if>
        and b.create_time >= #{starttime}
        and b.create_time &lt;= #{endtime}
    </select>
</mapper>