瀏覽代碼

更新了导出股东导出时搜索条件

LiRong 2 月之前
父節點
當前提交
1584443365

+ 2 - 2
ruoyi-equity/src/main/java/com/ruoyi/equity/controller/ShareholderInfoController.java

@@ -154,8 +154,8 @@ public class ShareholderInfoController extends BaseController {
     @ApiOperation("导出股东信息")
     @PreAuthorize("@ss.hasPermi('equity:info:exportEquityInfo')")
     @PostMapping("/exportEquityInfo")
-    public void exportEquityInfo(HttpServletResponse response) {
-        List<ShareholderInfoVO> list = shareholderInfoService.selectShareholderInfoListByIds();
+    public void exportEquityInfo(HttpServletResponse response,ShareholderInfoDTO shareholderInfoDTO) {
+        List<ShareholderInfoVO> list = shareholderInfoService.selectShareholderInfoListByIds(shareholderInfoDTO);
         ExcelUtil<ShareholderInfoVO> util = new ExcelUtil<>(ShareholderInfoVO.class);
         util.hideColumn("controlledCompany");
         util.convertByExp("shareholderType","1=个人主题,2=公司主体","");

+ 1 - 1
ruoyi-equity/src/main/java/com/ruoyi/equity/mapper/ShareholderInfoMapper.java

@@ -90,7 +90,7 @@ public interface ShareholderInfoMapper extends BaseMapper<ShareholderInfo>
 
     List<ShareholderInfo> selectOnlyCompany();
 
-    List<ShareholderInfoVO> selectShareholderInfoexport();
+    List<ShareholderInfoVO> selectShareholderInfoexport(ShareholderInfoDTO shareholderInfoDTO);
 
     Long selectShareholderInfo(String shareholderName);
 

+ 1 - 1
ruoyi-equity/src/main/java/com/ruoyi/equity/service/IShareholderInfoService.java

@@ -74,7 +74,7 @@ public interface IShareholderInfoService extends IService<ShareholderInfo>
 
     List<ShareholderInfo> selectOnlyCompany();
 
-    List<ShareholderInfoVO> selectShareholderInfoListByIds();
+    List<ShareholderInfoVO> selectShareholderInfoListByIds(ShareholderInfoDTO shareholderInfoDTO);
 
     String importEqityInfo(List<ShareholderInfo> equityList, Boolean updateSupport, String operName);
 

+ 7 - 2
ruoyi-equity/src/main/java/com/ruoyi/equity/service/impl/ShareholderInfoServiceImpl.java

@@ -2,12 +2,14 @@ package com.ruoyi.equity.service.impl;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.exception.user.OnlyOneMainCompanyAllowedException;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.bean.BeanValidators;
@@ -243,9 +245,9 @@ public class ShareholderInfoServiceImpl extends ServiceImpl<ShareholderInfoMappe
     }
 
     @Override
-    public List<ShareholderInfoVO> selectShareholderInfoListByIds() {
+    public List<ShareholderInfoVO> selectShareholderInfoListByIds(ShareholderInfoDTO shareholderInfoDTO) {
 
-        List<ShareholderInfoVO> list = shareholderInfoMapper.selectShareholderInfoexport();
+        List<ShareholderInfoVO> list = shareholderInfoMapper.selectShareholderInfoexport(shareholderInfoDTO);
         return list;
     }
 
@@ -272,6 +274,9 @@ public class ShareholderInfoServiceImpl extends ServiceImpl<ShareholderInfoMappe
                     BeanValidators.validateWithException(validator, info);
                     info.setCreateBy(operName);
                     info.setShareholderId(id);
+                    LocalDateTime now = LocalDateTime.now();
+                    Date date = DateUtils.toDate(now);
+                    info.setUpdateTime(date);
                     shareholderInfoMapper.updateShareholderInfo(info);
                     successNum++;
                     successMsg.append("<br/>" + successNum + "、股东名称: " + info.getShareholderName() + " 更新成功");

+ 11 - 5
ruoyi-equity/src/main/resources/mapper/equity/ShareholderInfoMapper.xml

@@ -131,10 +131,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
 
-    <select id="selectShareholderInfoexport" resultType="com.ruoyi.equity.domain.vo.ShareholderInfoVO">
-        select shareholder_name, shareholder_type, shareholding_ratio, company_valuation, is_subject,  remark ,
-               (select shareholder_name from e_shareholder_info where info.controlled_company = shareholder_id) as companyName
-        from e_shareholder_info info where shareholder_type != 3 order by shareholding_ratio desc;
+    <select id="selectShareholderInfoexport" parameterType="ShareholderInfoDTO" resultType="com.ruoyi.equity.domain.vo.ShareholderInfoVO">
+        select esi.*,
+        esi2.shareholder_name as companyName
+        from e_shareholder_info esi left join e_shareholder_info esi2 on esi.controlled_company = esi2.shareholder_id
+        where (esi.is_subject = 1 or esi.node_type in (1, 0))
+        <if test="shareholderName != null  and shareholderName != ''"> and esi.shareholder_name like concat('%', #{shareholderName}, '%')</if>
+        <if test="shareholderType != null  and shareholderType != ''"> and esi.shareholder_type = #{shareholderType}</if>
+        <if test="companyName != null and companyName !=''"> and (select shareholder_name from e_shareholder_info e where e.shareholder_id = esi.controlled_company )  like concat('%', #{companyName}, '%')</if>
+        order by shareholding_ratio desc
     </select>
 
 
@@ -182,7 +187,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateShareholderInfo" parameterType="ShareholderInfo">
         update e_shareholder_info
         <trim prefix="SET" suffixOverrides=",">
-            <if test="shareholderName != null">shareholder_name = #{shareholderName},</if>
+            <if test="shareholderName != null">shareholder_name = #{share
+            holderName},</if>
             <if test="shareholderType != null">shareholder_type = #{shareholderType},</if>
         </trim>
         where