|
@@ -1138,3 +1138,68 @@ func (r *QhjMgrContract) GetDataEx() (interface{}, error) {
|
|
|
}
|
|
}
|
|
|
return sData, err
|
|
return sData, err
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// QhjMgrPickGoods 提货商品
|
|
|
|
|
+type QhjMgrPickGoods struct {
|
|
|
|
|
+ PICKUPGOODSID string `json:"pickupgoodsid" xorm:"PICKUPGOODSID"` // 提货商品ID
|
|
|
|
|
+ PICKUPGOODSNAME string `json:"pickupgoodsname" xorm:"PICKUPGOODSNAME"` // 提货商品名称
|
|
|
|
|
+ PICKUPGOODSUNITID int32 `json:"pickupgoodsunitid" xorm:"PICKUPGOODSUNITID"` // 单位ID
|
|
|
|
|
+ PICKUPGOODSAGREEUNIT float64 `json:"pickupgoodsagreeunit" xorm:"PICKUPGOODSAGREEUNIT"` // 合约乘数
|
|
|
|
|
+ PICKUPGOODSDESC string `json:"pickupgoodsdesc" xorm:"PICKUPGOODSDESC"` // 描述
|
|
|
|
|
+ IMAGEADDRESS string `json:"imageaddress" xorm:"IMAGEADDRESS"` // 图片
|
|
|
|
|
+ REMARK string `json:"remark" xorm:"REMARK"` // 备注
|
|
|
|
|
+ MODIFYSRC int32 `json:"modifysrc" xorm:"MODIFYSRC"` // 修改来源 - 1:管理端 2:终端
|
|
|
|
|
+ MODIFIERID int64 `json:"modifierid" xorm:"MODIFIERID"` // 修改人
|
|
|
|
|
+ UPDATETIME string `json:"updatetime" xorm:"UPDATETIME"` // 更新时间
|
|
|
|
|
+ PREPAREDAYS int32 `json:"preparedays" xorm:"PREPAREDAYS"` // 备货期(天)
|
|
|
|
|
+ PICKUPGOODSSTATUS int32 `json:"pickupgoodsstatus" xorm:"PICKUPGOODSSTATUS"` // 状态 - 1:正常 2:停用 3:注销
|
|
|
|
|
+ GOODSID int32 `json:"goodsid" xorm:"'GOODSID'"` // 商品id
|
|
|
|
|
+ PICKUPRATIO float64 `json:"pickupratio" xorm:"'PICKUPRATIO'"` // 提货系数
|
|
|
|
|
+
|
|
|
|
|
+ MODIFIERNAME string `json:"modifiername"` // 修改人名称
|
|
|
|
|
+ FilterStatus string `json:"-"` // 状态过淲
|
|
|
|
|
+ ENUMDICNAME string `json:"enumdicname"` // 单位名称(提货商品)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *QhjMgrPickGoods) calc() {
|
|
|
|
|
+ if r.MODIFYSRC == 1 {
|
|
|
|
|
+ r.MODIFIERNAME = mtpcache.GetSystemmangerLoginCode(r.MODIFIERID)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ r.MODIFIERNAME = mtpcache.GetLoginCodeByLoginId(r.MODIFIERID)
|
|
|
|
|
+ }
|
|
|
|
|
+ if r.MODIFIERNAME == "" {
|
|
|
|
|
+ r.MODIFIERNAME = mtpcache.GetUserNameByUserId(r.MODIFIERID)
|
|
|
|
|
+ }
|
|
|
|
|
+ r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.PICKUPGOODSUNITID)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *QhjMgrPickGoods) buildSql() string {
|
|
|
|
|
+ var sqlId utils.SQLVal = "SELECT t.PICKUPGOODSID," +
|
|
|
|
|
+ " t.PICKUPGOODSNAME," +
|
|
|
|
|
+ " t.PICKUPGOODSUNITID," +
|
|
|
|
|
+ " t.PICKUPGOODSAGREEUNIT," +
|
|
|
|
|
+ " to_char(t.PICKUPGOODSDESC) PICKUPGOODSDESC," +
|
|
|
|
|
+ " to_char(t.IMAGEADDRESS) IMAGEADDRESS," +
|
|
|
|
|
+ " t.REMARK," +
|
|
|
|
|
+ " t.MODIFYSRC," +
|
|
|
|
|
+ " t.MODIFIERID," +
|
|
|
|
|
+ " to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
|
|
|
|
|
+ " t.PREPAREDAYS," +
|
|
|
|
|
+ " t.PICKUPGOODSSTATUS," +
|
|
|
|
|
+ " FROM PICKUPGOODS t" +
|
|
|
|
|
+ " WHERE 1 = 1"
|
|
|
|
|
+ if len(r.FilterStatus) > 0 {
|
|
|
|
|
+ sqlId.Join(fmt.Sprintf(" and t.PICKUPGOODSSTATUS in(%v)", r.FilterStatus))
|
|
|
|
|
+ }
|
|
|
|
|
+ return sqlId.String()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetDataEx 获取提货商品
|
|
|
|
|
+func (r *QhjMgrPickGoods) GetDataEx() (interface{}, error) {
|
|
|
|
|
+ sData := make([]QhjMgrPickGoods, 0)
|
|
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
|
|
+ for i := range sData {
|
|
|
|
|
+ sData[i].calc()
|
|
|
|
|
+ }
|
|
|
|
|
+ return sData, err
|
|
|
|
|
+}
|