|
@@ -1615,6 +1615,7 @@ type WrFAProductDetail struct {
|
|
|
|
|
|
|
|
func (r *WrFAProductDetail) calc() {
|
|
func (r *WrFAProductDetail) calc() {
|
|
|
r.LOANTAG = IFValue(r.ISAUTOLOAN == 1, "放款快", "").(string)
|
|
r.LOANTAG = IFValue(r.ISAUTOLOAN == 1, "放款快", "").(string)
|
|
|
|
|
+ r.USERNAME = EncryptByStar(r.USERNAME)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrFAProductDetail) buildSqlByWrFactorTypeId() string {
|
|
func (r *WrFAProductDetail) buildSqlByWrFactorTypeId() string {
|
|
@@ -1859,7 +1860,7 @@ func (r *WrStandardFactoryItem) buildSql() string {
|
|
|
" where dp.isvalid = 1" +
|
|
" where dp.isvalid = 1" +
|
|
|
" and di.isvalid = 1"
|
|
" and di.isvalid = 1"
|
|
|
sqlId.And("t.WRSTANDARDID", r.WRSTANDARDID)
|
|
sqlId.And("t.WRSTANDARDID", r.WRSTANDARDID)
|
|
|
- sqlId.Join(" order by t.dgfactoryitemtypeid, di.dgfactoryitemvalue")
|
|
|
|
|
|
|
+ sqlId.Join(" order by t.dgfactoryitemtypeid, di.orderindex")
|
|
|
return sqlId.String()
|
|
return sqlId.String()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2067,7 +2068,7 @@ type WrFinanceBuyApply struct {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrFinanceBuyApply) calc() {
|
|
func (r *WrFinanceBuyApply) calc() {
|
|
|
-
|
|
|
|
|
|
|
+ r.FINANCENAME = EncryptByStar(r.FINANCENAME)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrFinanceBuyApply) buildSql() string {
|
|
func (r *WrFinanceBuyApply) buildSql() string {
|
|
@@ -2487,12 +2488,16 @@ type WrDeliveryDetail struct {
|
|
|
USERNAME string `json:"username" xorm:"'USERNAME'"` // 用户名称
|
|
USERNAME string `json:"username" xorm:"'USERNAME'"` // 用户名称
|
|
|
MATCHUSERNAME string `json:"matchusername" xorm:"'MATCHUSERNAME'"` // 对手方名称(仓单持有人)
|
|
MATCHUSERNAME string `json:"matchusername" xorm:"'MATCHUSERNAME'"` // 对手方名称(仓单持有人)
|
|
|
TRADEDATE string `json:"tradedate" xorm:"'TRADEDATE'"` // 交易日(yyyymmdd)
|
|
TRADEDATE string `json:"tradedate" xorm:"'TRADEDATE'"` // 交易日(yyyymmdd)
|
|
|
|
|
+ WRTYPENAME string `json:"wrtypename" xorm:"'WRTYPENAME'"` // 商品
|
|
|
|
|
|
|
|
XGOODSAMOUNT SFLOAT64 `json:"xgoodsamount"` // 合约金额 = 货款金额(DELIVERYAMOUNT) - 点价货款(P1GOODSREMAINAMOUNT)
|
|
XGOODSAMOUNT SFLOAT64 `json:"xgoodsamount"` // 合约金额 = 货款金额(DELIVERYAMOUNT) - 点价货款(P1GOODSREMAINAMOUNT)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrDeliveryDetail) calc() {
|
|
func (r *WrDeliveryDetail) calc() {
|
|
|
r.MATCHUSERNAME = EncryptByStar(r.MATCHUSERNAME)
|
|
r.MATCHUSERNAME = EncryptByStar(r.MATCHUSERNAME)
|
|
|
|
|
+ if r.WRTYPENAME != "" {
|
|
|
|
|
+ r.WRTYPENAME = strings.ReplaceAll(r.WRTYPENAME, ",", "-")
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrDeliveryDetail) buildSql() string {
|
|
func (r *WrDeliveryDetail) buildSql() string {
|
|
@@ -2520,15 +2525,24 @@ func (r *WrDeliveryDetail) buildSql() string {
|
|
|
" ta.accountname taaccountname," +
|
|
" ta.accountname taaccountname," +
|
|
|
" u.userid," +
|
|
" u.userid," +
|
|
|
" u.accountname username," +
|
|
" u.accountname username," +
|
|
|
- " u2.accountname matchusername" +
|
|
|
|
|
|
|
+ " u2.accountname matchusername," +
|
|
|
|
|
+ " wd.wrstandardname || w.wrfactortypename2 as WRTYPENAME" +
|
|
|
" from deliverydetail t" +
|
|
" from deliverydetail t" +
|
|
|
- " left join goods g on t.xgoodsid=g.goodsid" +
|
|
|
|
|
- " left join goods g2 on t.pgoodsid=g2.goodsid" +
|
|
|
|
|
- " left join taaccount ta on t.accountid=ta.accountid" +
|
|
|
|
|
- " left join useraccount u on ta.userid=u.userid" +
|
|
|
|
|
- " left join taaccount ta2 on t.accountid=ta2.accountid" +
|
|
|
|
|
- " left join useraccount u2 on ta2.userid=u2.userid" +
|
|
|
|
|
- " where 1=1"
|
|
|
|
|
|
|
+ " left join goods g" +
|
|
|
|
|
+ " on t.xgoodsid = g.goodsid" +
|
|
|
|
|
+ " left join goods g2" +
|
|
|
|
|
+ " on t.pgoodsid = g2.goodsid" +
|
|
|
|
|
+ " left join taaccount ta" +
|
|
|
|
|
+ " on t.accountid = ta.accountid" +
|
|
|
|
|
+ " left join useraccount u" +
|
|
|
|
|
+ " on ta.userid = u.userid" +
|
|
|
|
|
+ " left join taaccount ta2" +
|
|
|
|
|
+ " on t.accountid = ta2.accountid" +
|
|
|
|
|
+ " left join useraccount u2" +
|
|
|
|
|
+ " on ta2.userid = u2.userid" +
|
|
|
|
|
+ " left join wrfactortype w on t.wrfactortypeid=w.wrfactortypeid" +
|
|
|
|
|
+ " left join wrstandard wd on w.wrstandardid=wd.wrstandardname" +
|
|
|
|
|
+ " where 1 = 1"
|
|
|
sqlId.AndEx("u.userid", r.USERID, r.USERID > 0)
|
|
sqlId.AndEx("u.userid", r.USERID, r.USERID > 0)
|
|
|
sqlId.AndEx("t.accountid", r.ACCOUNTID, r.ACCOUNTID > 0)
|
|
sqlId.AndEx("t.accountid", r.ACCOUNTID, r.ACCOUNTID > 0)
|
|
|
return sqlId.String()
|
|
return sqlId.String()
|
|
@@ -2849,6 +2863,9 @@ type WrDeliveryAvalidHoldLB struct {
|
|
|
USERNAME string `json:"username" xorm:"'USERNAME'"` // 仓单持有人
|
|
USERNAME string `json:"username" xorm:"'USERNAME'"` // 仓单持有人
|
|
|
PRICEMOVE float64 `json:"pricemove" xorm:"'PRICEMOVE'"` // 升贴水
|
|
PRICEMOVE float64 `json:"pricemove" xorm:"'PRICEMOVE'"` // 升贴水
|
|
|
WRTYPENAME string `json:"wrtypename"` // 商品
|
|
WRTYPENAME string `json:"wrtypename"` // 商品
|
|
|
|
|
+ UNITID int32 `json:"-" xorm:"'UNITID'"` // 品类单位id
|
|
|
|
|
+
|
|
|
|
|
+ ENUMDICNAME string `json:"enumdicname"` // 单位名称
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrDeliveryAvalidHoldLB) calc() {
|
|
func (r *WrDeliveryAvalidHoldLB) calc() {
|
|
@@ -2861,6 +2878,7 @@ func (r *WrDeliveryAvalidHoldLB) calc() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
r.WRTYPENAME = strings.ReplaceAll(r.WRTYPENAME, ",", "-")
|
|
r.WRTYPENAME = strings.ReplaceAll(r.WRTYPENAME, ",", "-")
|
|
|
|
|
+ r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.UNITID)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrDeliveryAvalidHoldLB) buildSql() string {
|
|
func (r *WrDeliveryAvalidHoldLB) buildSql() string {
|
|
@@ -2902,6 +2920,7 @@ func (r *WrDeliveryAvalidHoldLB) buildSql() string {
|
|
|
" end as avalidqty," +
|
|
" end as avalidqty," +
|
|
|
" wd.wrstandardname," +
|
|
" wd.wrstandardname," +
|
|
|
" wd.wrstandardcode," +
|
|
" wd.wrstandardcode," +
|
|
|
|
|
+ " wd.unitid," +
|
|
|
" h.warehousecode," +
|
|
" h.warehousecode," +
|
|
|
" h.warehousename," +
|
|
" h.warehousename," +
|
|
|
" g1.goodscode xgoodscode," +
|
|
" g1.goodscode xgoodscode," +
|
|
@@ -2953,3 +2972,119 @@ func (r *WrDeliveryAvalidHoldLB) GetDataEx() (interface{}, error) {
|
|
|
}
|
|
}
|
|
|
return sData, err
|
|
return sData, err
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// WrUserFriend 我的朋友
|
|
|
|
|
+type WrUserFriend struct {
|
|
|
|
|
+ USERID int64 `json:"userid" xorm:"'USERID'" form:"userid"` // 用户id(查我的朋友时填自己的userid, 找新朋友时填写新朋友userid)
|
|
|
|
|
+ FRIENDUSERID int64 `json:"frienduserid" xorm:"'FRIENDUSERID'"` // 朋友id
|
|
|
|
|
+ FRIENDNAME string `json:"friendname" xorm:"'FRIENDNAME'"` // 朋友名称(已脱敏)
|
|
|
|
|
+
|
|
|
|
|
+ QueryType int32 `json:"querytype"` // 查询类型 1-查我的朋友 2-查找新朋友
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrUserFriend) calc() {
|
|
|
|
|
+ r.FRIENDNAME = EncryptByStar(r.FRIENDNAME)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrUserFriend) buildSql() string {
|
|
|
|
|
+ var sqlId utils.SQLVal
|
|
|
|
|
+ if r.QueryType == 1 {
|
|
|
|
|
+ sqlId = "select t.userid, t.frienduserid, u.accountname friendname" +
|
|
|
|
|
+ " from UserFriend t" +
|
|
|
|
|
+ " left join useraccount u" +
|
|
|
|
|
+ " on t.frienduserid = u.userid" +
|
|
|
|
|
+ " where 1 = 1"
|
|
|
|
|
+ sqlId.And("t.userid", r.USERID)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ sqlId =
|
|
|
|
|
+ "select t.userid frienduserid, t.accountname friendname" +
|
|
|
|
|
+ " from useraccount t" +
|
|
|
|
|
+ " where 1 = 1"
|
|
|
|
|
+ sqlId.And("t.userid", r.USERID)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return sqlId.String()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetDataEx 获取我的朋友
|
|
|
|
|
+func (r *WrUserFriend) GetDataEx() (interface{}, error) {
|
|
|
|
|
+ sData := make([]WrUserFriend, 0)
|
|
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
|
|
+ for i := range sData {
|
|
|
|
|
+ sData[i].calc()
|
|
|
|
|
+ sData[i].QueryType = r.QueryType
|
|
|
|
|
+ }
|
|
|
|
|
+ return sData, err
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// WrFriendApply 好友申请
|
|
|
|
|
+type WrFriendApply struct {
|
|
|
|
|
+ FRIENDAPPLYID string `json:"friendapplyid" xorm:"FRIENDAPPLYID" form:"friendapplyid"` // 申请ID(SEQ_FRIENDAPPLY)
|
|
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID" form:"userid"` // 申请人用户ID
|
|
|
|
|
+ FRIENDUSERID string `json:"frienduserid" xorm:"FRIENDUSERID" form:"frienduserid"` // 好友用户ID
|
|
|
|
|
+ APPLYSRC int32 `json:"applysrc" xorm:"APPLYSRC"` // 申请来源 - 1:管理端 2:终端
|
|
|
|
|
+ APPLICANTID int64 `json:"applicantid" xorm:"APPLICANTID" form:"applicantid"` // 申请人
|
|
|
|
|
+ REMARK string `json:"remark" xorm:"REMARK"` // 备注
|
|
|
|
|
+ APPLYTIME string `json:"applytime" xorm:"APPLYTIME"` // 申请时间
|
|
|
|
|
+ APPLYSTATUS int32 `json:"applystatus" xorm:"APPLYSTATUS"` // 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
|
|
|
|
|
+ AUDITORID int64 `json:"auditorid" xorm:"AUDITORID" form:"auditorid"` // 审核人
|
|
|
|
|
+ AUDITSRC int32 `json:"auditsrc" xorm:"AUDITSRC"` // 审核来源 - 1:管理端 2:终端
|
|
|
|
|
+ AUDITTIME string `json:"audittime" xorm:"AUDITTIME"` // 审核时间
|
|
|
|
|
+ AUDITREMARK string `json:"auditremark" xorm:"AUDITREMARK"` // 审核备注
|
|
|
|
|
+
|
|
|
|
|
+ FRIENDNAME string `json:"friendname" xorm:"'FRIENDNAME'"` // 好友名字(已脱敏)
|
|
|
|
|
+ APPLYNAME string `json:"applyname" xorm:"'APPLYNAME'"` // 申请人名称
|
|
|
|
|
+ AUDITNAME string `json:"auditname" xorm:"'AUDITNAME'"` // 审核人名称
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrFriendApply) calc() {
|
|
|
|
|
+ r.FRIENDNAME = EncryptByStar(r.FRIENDNAME)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrFriendApply) buildSql() string {
|
|
|
|
|
+ var sqlId utils.SQLVal = "with tmp as" +
|
|
|
|
|
+ " (select 2 as src," +
|
|
|
|
|
+ " loginid as usid," +
|
|
|
|
|
+ " nvl(to_char(accountname), to_char(logincode)) username" +
|
|
|
|
|
+ " from loginaccount" +
|
|
|
|
|
+ " union all" +
|
|
|
|
|
+ " select 1 as src, autoid as usid, rolename" +
|
|
|
|
|
+ " from systemmanagerrole)" +
|
|
|
|
|
+ "select t.friendapplyid," +
|
|
|
|
|
+ " t.userid," +
|
|
|
|
|
+ " t.frienduserid," +
|
|
|
|
|
+ " t.applysrc," +
|
|
|
|
|
+ " t.applicantid," +
|
|
|
|
|
+ " t.remark," +
|
|
|
|
|
+ " to_char(t.applytime, 'yyyy-mm-dd hh24:mi:ss') applytime," +
|
|
|
|
|
+ " t.applystatus," +
|
|
|
|
|
+ " t.auditorid," +
|
|
|
|
|
+ " t.auditsrc," +
|
|
|
|
|
+ " to_char(t.audittime, 'yyyy-mm-dd hh24:mi:ss') audittime," +
|
|
|
|
|
+ " t.auditremark," +
|
|
|
|
|
+ " u.accountname friendname," +
|
|
|
|
|
+ " k1.username as applyname," +
|
|
|
|
|
+ " k2.username as auditname" +
|
|
|
|
|
+ " from FriendApply t" +
|
|
|
|
|
+ " left join useraccount u" +
|
|
|
|
|
+ " on t.frienduserid = u.userid" +
|
|
|
|
|
+ " left join tmp k1" +
|
|
|
|
|
+ " on t.applicantid = k1.usid" +
|
|
|
|
|
+ " and t.applysrc = k1.src" +
|
|
|
|
|
+ " left join tmp k2" +
|
|
|
|
|
+ " on t.auditorid = k2.usid" +
|
|
|
|
|
+ " and t.auditsrc = k2.src" +
|
|
|
|
|
+ " where 1=1"
|
|
|
|
|
+ sqlId.And("t.userid", r.USERID)
|
|
|
|
|
+ return sqlId.String()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetDataEx 获取好友申请
|
|
|
|
|
+func (r *WrFriendApply) GetDataEx() (interface{}, error) {
|
|
|
|
|
+ sData := make([]WrFriendApply, 0)
|
|
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
|
|
+ for i := range sData {
|
|
|
|
|
+ sData[i].calc()
|
|
|
|
|
+ }
|
|
|
|
|
+ return sData, err
|
|
|
|
|
+}
|