Ver código fonte

资金流水查询:// OPERATETYPENAME 显示时,旧的号段用operateType, 新的使用accountBusinessCode

deng.yinping 2 anos atrás
pai
commit
027587b716
1 arquivos alterados com 18 adições e 4 exclusões
  1. 18 4
      controllers/taaccount/taaccount.go

+ 18 - 4
controllers/taaccount/taaccount.go

@@ -153,8 +153,10 @@ func QueryAmountLog(c *gin.Context) {
 	// 查询数据
 	datas := make([]QueryAmountLogRsp, 0)
 	engine := db.GetEngine()
+	// OPERATETYPENAME 显示时,旧的号段用operateType, 新的使用accountBusinessCode
 	s := engine.Table("TAACCOUNTLOG").
-		Join("INNER", "ENUMDICITEM", "ENUMDICITEM.ENUMITEMSTATUS = 1 and ENUMDICITEM.ENUMDICID = 67 and ENUMDICITEM.ENUMITEMNAME = TAACCOUNTLOG.BUSINESSCODE").
+		Join("INNER", "ENUMDICITEM", "ENUMDICITEM.ENUMITEMSTATUS = 1 and ENUMDICITEM.ENUMDICCODE = 'accountBusinessCode' and ENUMDICITEM.ENUMITEMNAME = TAACCOUNTLOG.BUSINESSCODE").
+		Join("LEFT", "ENUMDICITEM e", "e.ENUMDICCODE = 'operateType' and e.ENUMITEMNAME = TAACCOUNTLOG.OPERATETYPE").
 		Join("LEFT", "MARKET", "MARKET.MARKETID = TAACCOUNTLOG.MARKETID").
 		Join("LEFT", "GOODS", "GOODS.GOODSID = TAACCOUNTLOG.GOODSID").
 		Join("LEFT", "AUCTION_ORDERINFO", "AUCTION_ORDERINFO.GOODSID = TAACCOUNTLOG.GOODSID").
@@ -164,7 +166,12 @@ func QueryAmountLog(c *gin.Context) {
 				GOODS.GOODSCODE, GOODS.GOODSNAME, 
 				AUCTION_ORDERINFO.GOODSCODE AS AGOODSCODE, AUCTION_ORDERINFO.GOODSNAME AS AGOODSNAME, 
 				DELIVERYGOODS.DELIVERYGOODSCODE AS DGOODSCODE, DELIVERYGOODS.DELIVERYGOODSNAME AS DGOODSNAME, 
-				ENUMDICITEM.ENUMDICNAME AS OPERATETYPENAME`).
+				CASE 
+					WHEN (TAACCOUNTLOG.BUSINESSCODE > 700 AND TAACCOUNTLOG.BUSINESSCODE < 800) OR (TAACCOUNTLOG.BUSINESSCODE > 1900) 
+						THEN DECODE(TAACCOUNTLOG.BUSINESSCODE, NULL, '--', 0, '系统', ENUMDICITEM.ENUMDICNAME)
+         			ELSE
+          				DECODE(TAACCOUNTLOG.OPERATETYPE, NULL, '--', 0, '系统', E.ENUMDICNAME) 
+				END AS OPERATETYPENAME`).
 		Where(fmt.Sprintf("TAACCOUNTLOG.AMOUNT <> 0 and TAACCOUNTLOG.ACCOUNTID in (%s)", req.AccountID)).Desc("TAACCOUNTLOG.AUTOID")
 	if len(req.OperateType) > 0 {
 		s = s.And(fmt.Sprintf("TAACCOUNTLOG.BUSINESSCODE in (%s)", req.OperateType))
@@ -266,8 +273,10 @@ func QueryHisAmountLog(c *gin.Context) {
 	// 查询数据
 	datas := make([]QueryHisAmountLogRsp, 0)
 	engine := db.GetEngine()
+	// OPERATETYPENAME 显示时,旧的号段用operateType, 新的使用accountBusinessCode
 	s := engine.Table("HIS_TAACCOUNTLOG").
-		Join("INNER", "ENUMDICITEM", "ENUMDICITEM.ENUMITEMSTATUS = 1 and ENUMDICITEM.ENUMDICID = 67 and ENUMDICITEM.ENUMITEMNAME = HIS_TAACCOUNTLOG.BUSINESSCODE").
+		Join("INNER", "ENUMDICITEM", "ENUMDICITEM.ENUMITEMSTATUS = 1 and ENUMDICITEM.ENUMDICCODE = 'accountBusinessCode' and ENUMDICITEM.ENUMITEMNAME = HIS_TAACCOUNTLOG.BUSINESSCODE").
+		Join("LEFT", "ENUMDICITEM e", "e.ENUMDICCODE = 'operateType' and e.ENUMITEMNAME = HIS_TAACCOUNTLOG.OPERATETYPE").
 		Join("LEFT", "MARKET", "MARKET.MARKETID = HIS_TAACCOUNTLOG.MARKETID").
 		Join("LEFT", "GOODS", "GOODS.GOODSID = HIS_TAACCOUNTLOG.GOODSID").
 		Join("LEFT", "HIS_AUCTION_ORDERINFO", "HIS_AUCTION_ORDERINFO.GOODSID = HIS_TAACCOUNTLOG.GOODSID and HIS_AUCTION_ORDERINFO.ISVALIDDATA = 1").
@@ -277,7 +286,12 @@ func QueryHisAmountLog(c *gin.Context) {
 				GOODS.GOODSCODE, GOODS.GOODSNAME, 
 				HIS_AUCTION_ORDERINFO.GOODSCODE AS AGOODSCODE, HIS_AUCTION_ORDERINFO.GOODSNAME AS AGOODSNAME, 
 				DELIVERYGOODS.DELIVERYGOODSCODE AS DGOODSCODE, DELIVERYGOODS.DELIVERYGOODSNAME AS DGOODSNAME, 
-				ENUMDICITEM.ENUMDICNAME AS OPERATETYPENAME`).
+				CASE 
+					WHEN (HIS_TAACCOUNTLOG.BUSINESSCODE > 700 AND HIS_TAACCOUNTLOG.BUSINESSCODE < 800) OR (HIS_TAACCOUNTLOG.BUSINESSCODE > 1900) 
+						THEN DECODE(HIS_TAACCOUNTLOG.BUSINESSCODE, NULL, '--', 0, '系统', ENUMDICITEM.ENUMDICNAME)
+         			ELSE
+          				DECODE(HIS_TAACCOUNTLOG.OPERATETYPE, NULL, '--', 0, '系统', E.ENUMDICNAME) 
+				END AS OPERATETYPENAME`).
 		Where(fmt.Sprintf(`HIS_TAACCOUNTLOG.ISVALIDDATA = 1 and HIS_TAACCOUNTLOG.AMOUNT <> 0 and HIS_TAACCOUNTLOG.ACCOUNTID in (%s)`, req.AccountID)).Desc("HIS_TAACCOUNTLOG.AUTOID")
 	if len(req.OperateType) > 0 {
 		s = s.And(fmt.Sprintf("HIS_TAACCOUNTLOG.BUSINESSCODE in (%s)", req.OperateType))