Kaynağa Gözat

完善查询接口

shiyj1101 4 yıl önce
ebeveyn
işleme
dc2cc241ba

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/accountWithdrawalApply/AccountWithdrawalApplyDto.java

@@ -22,6 +22,7 @@ private String acctId;
 private String state;
 private String applyUserTel;
 private String applyUserId;
+private String stateName;
 
 
     private Date createTime;
@@ -94,4 +95,12 @@ public void setApplyUserId(String applyUserId) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getStateName() {
+        return stateName;
+    }
+
+    public void setStateName(String stateName) {
+        this.stateName = stateName;
+    }
 }

+ 100 - 3
java110-db/src/main/resources/mapper/acct/AccountWithdrawalApplyServiceDaoImplMapper.xml

@@ -21,9 +21,10 @@ apply_id,apply_user_name,amount,context,acct_id,state,apply_user_tel,apply_user_
 
     <!-- 查询账户提现信息 add by wuxw 2018-07-03 -->
     <select id="getAccountWithdrawalApplyInfo" parameterType="Map" resultType="Map">
-        select  t.apply_id,t.apply_id applyId,t.apply_user_name,t.apply_user_name applyUserName,t.amount,t.create_time,t.create_time createTime,t.context,t.acct_id,t.acct_id acctId,t.status_cd,t.status_cd statusCd,t.state,t.apply_user_tel,t.apply_user_tel applyUserTel,t.apply_user_id,t.apply_user_id applyUserId 
-from account_withdrawal_apply t 
-where 1 =1 
+    select  t.apply_id,t.apply_id applyId,t.apply_user_name,t.apply_user_name applyUserName,t.amount,t.create_time,t.create_time createTime,t.context,t.acct_id,t.acct_id acctId,t.status_cd,t.status_cd statusCd,t.state,t.apply_user_tel,t.apply_user_tel applyUserTel,t.apply_user_id,t.apply_user_id applyUserId,t1.`name` stateName
+    from account_withdrawal_apply t left join t_dict t1 on t.state = t1.status_cd
+    where t1.table_name='account_withdrawal_apply'
+      and t1.table_columns='state'
 <if test="applyId !=null and applyId != ''">
    and t.apply_id= #{applyId}
 </if> 
@@ -139,4 +140,100 @@ where 1 =1
 
      </select>
 
+    <!-- 查询账户提现信息 add by wuxw 2018-07-03 -->
+    <select id="listStateWithdrawalApplys" parameterType="Map" resultType="Map">
+        select  t.apply_id,t.apply_id applyId,t.apply_user_name,t.apply_user_name applyUserName,t.amount,t.create_time,t.create_time createTime,t.context,t.acct_id,t.acct_id acctId,t.status_cd,t.status_cd statusCd,t.state,t.apply_user_tel,t.apply_user_tel applyUserTel,t.apply_user_id,t.apply_user_id applyUserId,t1.`name` stateName
+        from account_withdrawal_apply t left join t_dict t1 on t.state = t1.status_cd
+        where t1.table_name='account_withdrawal_apply'
+        and t1.table_columns='state'
+        <if test="applyId !=null and applyId != ''">
+            and t.apply_id= #{applyId}
+        </if>
+        <if test="applyUserName !=null and applyUserName != ''">
+            and t.apply_user_name= #{applyUserName}
+        </if>
+        <if test="amount !=null and amount != ''">
+            and t.amount= #{amount}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="acctId !=null and acctId != ''">
+            and t.acct_id= #{acctId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="states != null and states != null">
+            and t.state in
+            <foreach collection="states" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+
+        <if test="applyUserTel !=null and applyUserTel != ''">
+            and t.apply_user_tel= #{applyUserTel}
+        </if>
+        <if test="applyUserId !=null and applyUserId != ''">
+            and t.apply_user_id= #{applyUserId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+    <!-- 查询账户提现信息 add by wuxw 2018-07-03 -->
+    <select id="listStateWithdrawalApplysCount" parameterType="Map" resultType="Map">
+        select  count(*)
+        from account_withdrawal_apply t left join t_dict t1 on t.state = t1.status_cd
+        where t1.table_name='account_withdrawal_apply'
+        and t1.table_columns='state'
+        <if test="applyId !=null and applyId != ''">
+            and t.apply_id= #{applyId}
+        </if>
+        <if test="applyUserName !=null and applyUserName != ''">
+            and t.apply_user_name= #{applyUserName}
+        </if>
+        <if test="amount !=null and amount != ''">
+            and t.amount= #{amount}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="acctId !=null and acctId != ''">
+            and t.acct_id= #{acctId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="states != null and states != null">
+            and t.state in
+            <foreach collection="states" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+
+        <if test="applyUserTel !=null and applyUserTel != ''">
+            and t.apply_user_tel= #{applyUserTel}
+        </if>
+        <if test="applyUserId !=null and applyUserId != ''">
+            and t.apply_user_id= #{applyUserId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
 </mapper>

+ 19 - 0
java110-interface/src/main/java/com/java110/intf/acct/IAccountWithdrawalApplyInnerServiceSMO.java

@@ -7,6 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -50,4 +51,22 @@ public interface IAccountWithdrawalApplyInnerServiceSMO {
      */
     @RequestMapping(value = "/queryAccountWithdrawalApplysCount", method = RequestMethod.POST)
     int queryAccountWithdrawalApplysCount(@RequestBody AccountWithdrawalApplyDto accountWithdrawalApplyDto);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param states 数据对象分享
+     * @return AccountWithdrawalApplyDto 对象数据
+     */
+    @RequestMapping(value = "/listStateWithdrawalApplys", method = RequestMethod.POST)
+    List<AccountWithdrawalApplyDto> listStateWithdrawalApplys(@RequestParam String [] states, int page, int row);
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param states 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/listStateWithdrawalApplysCount", method = RequestMethod.POST)
+    int listStateWithdrawalApplysCount(@RequestParam String [] states);
 }

+ 12 - 0
service-acct/src/main/java/com/java110/acct/api/AccountWithdrawalApplyApi.java

@@ -103,7 +103,19 @@ public class AccountWithdrawalApplyApi {
         accountWithdrawalApplyDto.setRow(row);
         accountWithdrawalApplyDto.setApplyUserName(applyUserName);
         accountWithdrawalApplyDto.setApplyUserTel(applyUserTel);
+        if(null == state || "".equals( state )){
+            state = "";
+        }
         accountWithdrawalApplyDto.setState(state);
         return getAccountWithdrawalApplyBMOImpl.get(accountWithdrawalApplyDto);
     }
+
+
+    @RequestMapping(value = "/listStateWithdrawalApplys", method = RequestMethod.GET)
+    public ResponseEntity<String> listStateWithdrawalApplys(@RequestParam(value = "page") int page,
+                                                              @RequestParam(value = "row") int row,
+                                                              @RequestParam(value = "state",required = false) String [] state) {
+
+        return getAccountWithdrawalApplyBMOImpl.listStateWithdrawalApplys( state, page,row);
+    }
 }

+ 8 - 0
service-acct/src/main/java/com/java110/acct/bmo/accountWithdrawalApply/IGetAccountWithdrawalApplyBMO.java

@@ -12,5 +12,13 @@ public interface IGetAccountWithdrawalApplyBMO {
      */
     ResponseEntity<String> get(AccountWithdrawalApplyDto accountWithdrawalApplyDto);
 
+    /**
+     * 查询账户提现
+     * add by wuxw
+     * @param
+     * @return
+     */
+    ResponseEntity<String> listStateWithdrawalApplys(String [] states,int page,int row);
+
 
 }

+ 19 - 0
service-acct/src/main/java/com/java110/acct/bmo/accountWithdrawalApply/impl/GetAccountWithdrawalApplyBMOImpl.java

@@ -43,4 +43,23 @@ public class GetAccountWithdrawalApplyBMOImpl implements IGetAccountWithdrawalAp
         return responseEntity;
     }
 
+    @Override
+    public ResponseEntity<String> listStateWithdrawalApplys(String[] states, int page, int row) {
+
+        int count = accountWithdrawalApplyInnerServiceSMOImpl.listStateWithdrawalApplysCount( states);
+
+        List<AccountWithdrawalApplyDto> accountWithdrawalApplyDtos = null;
+        if (count > 0) {
+            accountWithdrawalApplyDtos = accountWithdrawalApplyInnerServiceSMOImpl.listStateWithdrawalApplys(states, page, row);
+        } else {
+            accountWithdrawalApplyDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) page), count, accountWithdrawalApplyDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
 }

+ 16 - 0
service-acct/src/main/java/com/java110/acct/dao/IAccountWithdrawalApplyServiceDao.java

@@ -58,4 +58,20 @@ public interface IAccountWithdrawalApplyServiceDao {
      */
     int queryAccountWithdrawalApplysCount(Map info);
 
+    /**
+     * 查询账户提现信息(instance过程)
+     * 根据bId 查询账户提现信息
+     * @param info bId 信息
+     * @return 账户提现信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> listStateWithdrawalApplys(Map info) throws DAOException;
+
+    /**
+     * 查询账户提现总数
+     *
+     * @param info 账户提现信息
+     * @return 账户提现数量
+     */
+    int listStateWithdrawalApplysCount(Map info);
 }

+ 30 - 0
service-acct/src/main/java/com/java110/acct/dao/impl/AccountWithdrawalApplyServiceDaoImpl.java

@@ -94,5 +94,35 @@ public class AccountWithdrawalApplyServiceDaoImpl extends BaseServiceDao impleme
         return Integer.parseInt(businessAccountWithdrawalApplyInfos.get(0).get("count").toString());
     }
 
+    /**
+     * 查询账户提现信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> listStateWithdrawalApplys(Map info) throws DAOException {
+        logger.debug("查询账户提现信息 入参 info : {}",info);
+
+        List<Map> businessAccountWithdrawalApplyInfos = sqlSessionTemplate.selectList("accountWithdrawalApplyServiceDaoImpl.listStateWithdrawalApplys",info);
+
+        return businessAccountWithdrawalApplyInfos;
+    }
+
+    /**
+     * 查询账户提现数量
+     * @param info 账户提现信息
+     * @return 账户提现数量
+     */
+    @Override
+    public int listStateWithdrawalApplysCount(Map info) {
+        logger.debug("查询账户提现数据 入参 info : {}",info);
 
+        List<Map> businessAccountWithdrawalApplyInfos = sqlSessionTemplate.selectList("accountWithdrawalApplyServiceDaoImpl.listStateWithdrawalApplysCount", info);
+        if (businessAccountWithdrawalApplyInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessAccountWithdrawalApplyInfos.get(0).get("count").toString());
+    }
 }

+ 30 - 0
service-acct/src/main/java/com/java110/acct/smo/impl/AccountWithdrawalApplyInnerServiceSMOImpl.java

@@ -5,15 +5,19 @@ import com.java110.acct.dao.IAccountWithdrawalApplyServiceDao;
 import com.java110.dto.accountWithdrawalApply.AccountWithdrawalApplyDto;
 import com.java110.intf.acct.IAccountWithdrawalApplyInnerServiceSMO;
 import com.java110.po.accountWithdrawalApply.AccountWithdrawalApplyPo;
+import com.java110.utils.constant.StatusConstant;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.PageDto;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @ClassName FloorInnerServiceSMOImpl
@@ -73,6 +77,32 @@ public class AccountWithdrawalApplyInnerServiceSMOImpl extends BaseServiceSMO im
     public int queryAccountWithdrawalApplysCount(@RequestBody AccountWithdrawalApplyDto accountWithdrawalApplyDto) {
         return accountWithdrawalApplyServiceDaoImpl.queryAccountWithdrawalApplysCount(BeanConvertUtil.beanCovertMap(accountWithdrawalApplyDto));    }
 
+    @Override
+    public List<AccountWithdrawalApplyDto> listStateWithdrawalApplys(@RequestParam String[] states, int page, int row) {
+
+        //校验是否传了 分页信息
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            page = ((page - 1) * row);
+        }
+
+        Map stateInfo = new HashMap();
+        stateInfo.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        stateInfo.put("states", states);
+        stateInfo.put("page", page);
+        stateInfo.put("row", row);
+
+        return BeanConvertUtil.covertBeanList(accountWithdrawalApplyServiceDaoImpl.listStateWithdrawalApplys(stateInfo), AccountWithdrawalApplyDto.class);
+    }
+
+
+    @Override
+    public int listStateWithdrawalApplysCount(@RequestParam String[] states) {
+        Map stateInfo = new HashMap();
+        stateInfo.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        stateInfo.put("states", states);
+        return accountWithdrawalApplyServiceDaoImpl.listStateWithdrawalApplysCount(stateInfo);    }
+
     public IAccountWithdrawalApplyServiceDao getAccountWithdrawalApplyServiceDaoImpl() {
         return accountWithdrawalApplyServiceDaoImpl;
     }