From 48f36bbc7ffb262e6a6ea5b1cc01a2cd054946ba Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期六, 01 六月 2019 11:26:45 +0800
Subject: [PATCH] 费用管理 包括物业费停车费等服务端功能开发完成待测试
---
FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java | 402 ++++++--------------------------------------------------
1 files changed, 48 insertions(+), 354 deletions(-)
diff --git a/FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java b/FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java
index d324d66..8003650 100644
--- a/FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java
+++ b/FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java
@@ -4,17 +4,18 @@
import com.java110.common.constant.ResponseConstant;
import com.java110.common.exception.DAOException;
import com.java110.common.util.DateUtil;
-import com.java110.fee.dao.IFeeServiceDao;
import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.fee.dao.IFeeServiceDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
- * 灏忓尯鏈嶅姟 涓庢暟鎹簱浜や簰
+ * 璐圭敤鏈嶅姟 涓庢暟鎹簱浜や簰
* Created by wuxw on 2017/4/5.
*/
@Service("feeServiceDaoImpl")
@@ -24,413 +25,106 @@
private static Logger logger = LoggerFactory.getLogger(FeeServiceDaoImpl.class);
/**
- * 灏忓尯淇℃伅灏佽
- *
- * @param businessFeeInfo 灏忓尯淇℃伅 灏佽
- * @throws DAOException
+ * 璐圭敤淇℃伅灏佽
+ * @param businessFeeInfo 璐圭敤淇℃伅 灏佽
+ * @throws DAOException DAO寮傚父
*/
@Override
public void saveBusinessFeeInfo(Map businessFeeInfo) throws DAOException {
businessFeeInfo.put("month", DateUtil.getCurrentMonth());
// 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨灏忓尯淇℃伅 鍏ュ弬 businessFeeInfo : {}", businessFeeInfo);
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeInfo", businessFeeInfo);
+ logger.debug("淇濆瓨璐圭敤淇℃伅 鍏ュ弬 businessFeeInfo : {}",businessFeeInfo);
+ int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeInfo",businessFeeInfo);
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessFeeInfo));
+ if(saveFlag < 1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璐圭敤鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessFeeInfo));
}
}
- /**
- * 灏忓尯灞炴�т俊鎭垎瑁�
- *
- * @param businessFeeAttr 灏忓尯灞炴�т俊鎭皝瑁�
- * @throws DAOException
- */
- @Override
- public void saveBusinessFeeAttr(Map businessFeeAttr) throws DAOException {
- businessFeeAttr.put("month", DateUtil.getCurrentMonth());
- // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨灏忓尯灞炴�т俊鎭� 鍏ュ弬 businessFeeAttr : {}", businessFeeAttr);
-
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeAttr", businessFeeAttr);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯灞炴�ф暟鎹け璐ワ細" + JSONObject.toJSONString(businessFeeAttr));
- }
- }
/**
- * 淇濆瓨灏忓尯鐓х墖淇℃伅
- *
- * @param businessFeePhoto 灏忓尯鐓х墖
- * @throws DAOException
- */
- @Override
- public void saveBusinessFeePhoto(Map businessFeePhoto) throws DAOException {
- businessFeePhoto.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨灏忓尯鐓х墖淇℃伅 鍏ュ弬 businessFeePhoto : {}", businessFeePhoto);
-
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeePhoto", businessFeePhoto);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鐓х墖鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessFeePhoto));
- }
- }
-
- /**
- * 淇濆瓨灏忓尯璇佷欢淇℃伅
- *
- * @param businessFeeCerdentials 灏忓尯璇佷欢
- * @throws DAOException
- */
- @Override
- public void saveBusinessFeeCerdentials(Map businessFeeCerdentials) throws DAOException {
- businessFeeCerdentials.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨灏忓尯璇佷欢淇℃伅 鍏ュ弬 businessFeeCerdentials : {}", businessFeeCerdentials);
-
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeCerdentials", businessFeeCerdentials);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯璇佷欢鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessFeeCerdentials));
- }
- }
-
- /**
- * 鏌ヨ灏忓尯淇℃伅
- *
+ * 鏌ヨ璐圭敤淇℃伅
* @param info bId 淇℃伅
- * @return 灏忓尯淇℃伅
- * @throws DAOException
+ * @return 璐圭敤淇℃伅
+ * @throws DAOException DAO寮傚父
*/
@Override
- public Map getBusinessFeeInfo(Map info) throws DAOException {
+ public List<Map> getBusinessFeeInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯淇℃伅 鍏ュ弬 info : {}", info);
+ logger.debug("鏌ヨ璐圭敤淇℃伅 鍏ュ弬 info : {}",info);
- List<Map> businessFeeInfos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeInfo", info);
- if (businessFeeInfos == null) {
- return null;
- }
- if (businessFeeInfos.size() > 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessFeeInfos锛�" + JSONObject.toJSONString(info));
- }
+ List<Map> businessFeeInfos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeInfo",info);
- return businessFeeInfos.get(0);
+ return businessFeeInfos;
}
- /**
- * 鏌ヨ灏忓尯灞炴��
- *
- * @param info bId 淇℃伅
- * @return 灏忓尯灞炴��
- * @throws DAOException
- */
- @Override
- public List<Map> getBusinessFeeAttrs(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
- List<Map> businessFeeAttrs = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeAttrs", info);
-
- return businessFeeAttrs;
- }
/**
- * 鏌ヨ灏忓尯鐓х墖
- *
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getBusinessFeePhoto(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯鐓х墖淇℃伅 鍏ュ弬 info : {}", info);
-
- List<Map> businessFeePhotos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeePhoto", info);
-
- return businessFeePhotos;
- }
-
- /**
- * 鏌ヨ灏忓尯璇佷欢
- *
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getBusinessFeeCerdentials(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯璇佷欢淇℃伅 鍏ュ弬 info : {}", info);
-
- List<Map> businessFeeCerdentialses = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeCerdentials", info);
-
- return businessFeeCerdentialses;
- }
-
- /**
- * 淇濆瓨灏忓尯淇℃伅 鍒� instance
- *
- * @param info bId 淇℃伅
- * @throws DAOException
+ * 淇濆瓨璐圭敤淇℃伅 鍒� instance
+ * @param info bId 淇℃伅
+ * @throws DAOException DAO寮傚父
*/
@Override
public void saveFeeInfoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨灏忓尯淇℃伅Instance 鍏ュ弬 info : {}", info);
+ logger.debug("淇濆瓨璐圭敤淇℃伅Instance 鍏ュ弬 info : {}",info);
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeeInfoInstance", info);
+ int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeeInfoInstance",info);
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
- }
- }
-
- @Override
- public void saveFeeAttrsInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨灏忓尯灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
-
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeeAttrsInstance", info);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
- }
- }
-
- @Override
- public void saveFeePhotoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨灏忓尯鐓х墖淇℃伅Instance 鍏ュ弬 info : {}", info);
-
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeePhotoInstance", info);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
+ if(saveFlag < 1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璐圭敤淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
}
}
/**
- * 鏌ヨ灏忓尯淇℃伅锛坕nstance锛�
- *
+ * 鏌ヨ璐圭敤淇℃伅锛坕nstance锛�
* @param info bId 淇℃伅
- * @return
- * @throws DAOException
+ * @return List<Map>
+ * @throws DAOException DAO寮傚父
*/
@Override
- public Map getFeeInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯淇℃伅 鍏ュ弬 info : {}", info);
+ public List<Map> getFeeInfo(Map info) throws DAOException {
+ logger.debug("鏌ヨ璐圭敤淇℃伅 鍏ュ弬 info : {}",info);
- List<Map> businessFeeInfos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeInfo", info);
- if (businessFeeInfos == null || businessFeeInfos.size() == 0) {
- return null;
- }
- if (businessFeeInfos.size() > 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getFeeInfo锛�" + JSONObject.toJSONString(info));
- }
+ List<Map> businessFeeInfos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeInfo",info);
- return businessFeeInfos.get(0);
- }
-
- /**
- * 灏忓尯灞炴�ф煡璇紙instance锛�
- *
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getFeeAttrs(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
-
- List<Map> feeAttrs = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeAttrs", info);
-
- return feeAttrs;
- }
-
- /**
- * 灏忓尯鐓х墖鏌ヨ锛坕nstance锛�
- *
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getFeePhoto(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯鐓х墖淇℃伅 鍏ュ弬 info : {}", info);
-
- List<Map> feePhotos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeePhoto", info);
-
- return feePhotos;
+ return businessFeeInfos;
}
/**
- * 淇敼灏忓尯淇℃伅
- *
+ * 淇敼璐圭敤淇℃伅
* @param info 淇敼淇℃伅
- * @throws DAOException
+ * @throws DAOException DAO寮傚父
*/
@Override
public void updateFeeInfoInstance(Map info) throws DAOException {
- logger.debug("淇敼灏忓尯淇℃伅Instance 鍏ュ弬 info : {}", info);
+ logger.debug("淇敼璐圭敤淇℃伅Instance 鍏ュ弬 info : {}",info);
- int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeeInfoInstance", info);
+ int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeeInfoInstance",info);
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
+ if(saveFlag < 1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼璐圭敤淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
}
}
- /**
- * 淇敼灏忓尯灞炴�т俊鎭紙instance锛�
- *
- * @param info 淇敼淇℃伅
- * @throws DAOException
+ /**
+ * 鏌ヨ璐圭敤鏁伴噺
+ * @param info 璐圭敤淇℃伅
+ * @return 璐圭敤鏁伴噺
*/
@Override
- public void updateFeeAttrInstance(Map info) throws DAOException {
- logger.debug("淇敼灏忓尯灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
+ public int queryFeesCount(Map info) {
+ logger.debug("鏌ヨ璐圭敤鏁版嵁 鍏ュ弬 info : {}",info);
- int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeeAttrInstance", info);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇敼 灏忓尯鐓х墖淇℃伅
- *
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- @Override
- public void updateFeePhotoInstance(Map info) throws DAOException {
- logger.debug("淇敼灏忓尯鐓х墖淇℃伅Instance 鍏ュ弬 info : {}", info);
-
- int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeePhotoInstance", info);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
- }
- }
-
-
- /**
- * 灏忓尯鎴愬憳鍔犲叆淇℃伅
- *
- * @param businessFeeMember 灏忓尯鎴愬憳淇℃伅 灏佽
- * @throws DAOException 鎿嶄綔鏁版嵁搴撳紓甯�
- */
- public void saveBusinessFeeMember(Map businessFeeMember) throws DAOException {
- logger.debug("灏忓尯鎴愬憳鍔犲叆 鍏ュ弬 businessFeeMember : {}", businessFeeMember);
- businessFeeMember.put("month", DateUtil.getCurrentMonth());
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeMember", businessFeeMember);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "灏忓尯鎴愬憳鍔犲叆澶辫触锛�" + JSONObject.toJSONString(businessFeeMember));
- }
- }
-
- /**
- * 鎴愬憳鍔犲叆 淇濆瓨淇℃伅鑷砳nstance
- *
- * @param info
- * @throws DAOException
- */
- @Override
- public void saveFeeMemberInstance(Map info) throws DAOException {
- logger.debug("灏忓尯鎴愬憳鍔犲叆Instance 鍏ュ弬 info : {}", info);
-
- int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeeMemberInstance", info);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅锛坆usiness杩囩▼锛�
- * 鏍规嵁bId 鏌ヨ灏忓尯淇℃伅
- *
- * @param info bId 淇℃伅
- * @return 灏忓尯淇℃伅
- * @throws DAOException
- */
- public Map getBusinessFeeMember(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
-
- List<Map> businessFeeMembers = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeMember", info);
- if (businessFeeMembers == null || businessFeeMembers.size() == 0) {
- return null;
- }
- if (businessFeeMembers.size() > 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessFeeMember锛�" + JSONObject.toJSONString(info));
- }
-
- return businessFeeMembers.get(0);
- }
-
- /**
- * 鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅锛坕nstance杩囩▼锛�
- * 鏍规嵁bId 鏌ヨ灏忓尯淇℃伅
- *
- * @param info bId 淇℃伅
- * @return 灏忓尯淇℃伅
- * @throws DAOException
- */
- public Map getFeeMember(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
-
- List<Map> memberFees = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeMember", info);
- if (memberFees == null || memberFees.size() == 0) {
- return null;
- }
- if (memberFees.size() > 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getFeeMember锛�" + JSONObject.toJSONString(info));
- }
-
- return memberFees.get(0);
- }
-
- /**
- * 淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅
- *
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- public void updateFeeMemberInstance(Map info) throws DAOException {
- logger.debug("淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅Instance 鍏ュ弬 info : {}", info);
-
- int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeeMemberInstance", info);
-
- if (saveFlag < 1) {
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
- }
- }
-
- /**
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getFeeMembers(Map info) throws DAOException {
- logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
-
- List<Map> memberFees = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeMember", info);
-
- return memberFees;
- }
-
- @Override
- public int getFeeMemberCount(Map info) {
- logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
-
- List<Map> memberFees = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeMemberCount", info);
-
- if (memberFees.size() < 1) {
+ List<Map> businessFeeInfos = sqlSessionTemplate.selectList("feeServiceDaoImpl.queryFeesCount", info);
+ if (businessFeeInfos.size() < 1) {
return 0;
}
- return Integer.parseInt(memberFees.get(0).get("count").toString());
+ return Integer.parseInt(businessFeeInfos.get(0).get("count").toString());
}
+
+
}
--
Gitblit v1.8.0