|
|
@@ -63,16 +63,14 @@ func (this *PaymentInfoController) GetEntityList() {
|
|
|
|
|
|
var registerUser register.OilCorporateInfo
|
|
|
sql := " UserName='" + this.User.Username + "'"
|
|
|
- svcPerm.GetEntity(®isterUser,sql)
|
|
|
+ svcPerm.GetEntity(®isterUser, sql)
|
|
|
|
|
|
isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
|
|
|
if !svcPerm.IsAdmin(this.User.Id) && !isauth {
|
|
|
|
|
|
- where = where + " and (p.CreateUserId = '" + this.User.Id + "' or s.CommercialNo='"+registerUser.CommercialNo+"') "
|
|
|
+ where = where + " and (p.CreateUserId = '" + this.User.Id + "' or s.CommercialNo='" + registerUser.CommercialNo + "') "
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
var paylist []paymentinfo.PaymentinfoList
|
|
|
svc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
total := svc.GetPaymentinfoList(page.CurrentPage, page.Size, orderby, asc, &paylist, where)
|
|
|
@@ -222,7 +220,6 @@ func (this *PaymentInfoController) UpdateAmount() {
|
|
|
}
|
|
|
_, err := svc.UpdateEntityByIdCols(id, &model, cols)
|
|
|
|
|
|
-
|
|
|
if err == nil {
|
|
|
errinfo.Message = "修改成功!"
|
|
|
errinfo.Code = 0
|
|
|
@@ -238,8 +235,8 @@ func (this *PaymentInfoController) UpdateAmount() {
|
|
|
|
|
|
type BillInfoSure struct {
|
|
|
SupplierEntity supplier.OilSupplier
|
|
|
- DataInfos [2]DataInfo
|
|
|
- AmountList [2]float64
|
|
|
+ DataInfos [2]DataInfo
|
|
|
+ AmountList [2]float64
|
|
|
}
|
|
|
|
|
|
// @Title 获取实体
|
|
|
@@ -251,10 +248,10 @@ func (this *PaymentInfoController) GetBillInfo() {
|
|
|
supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
|
|
|
var corporateInfo register.OilCorporateInfo
|
|
|
- regSvc.GetEntity(&corporateInfo, "UserId='"+ this.User.Id +"'")
|
|
|
+ regSvc.GetEntity(&corporateInfo, "UserId='"+this.User.Id+"'")
|
|
|
|
|
|
var supplierEntity supplier.OilSupplier
|
|
|
- supplierSvc.GetEntity(&supplierEntity, "CommercialNo='"+ corporateInfo.CommercialNo +"'")
|
|
|
+ supplierSvc.GetEntity(&supplierEntity, "CommercialNo='"+corporateInfo.CommercialNo+"'")
|
|
|
|
|
|
billInfoSure := new(BillInfoSure)
|
|
|
billInfoSure.SupplierEntity = supplierEntity
|
|
|
@@ -262,7 +259,7 @@ func (this *PaymentInfoController) GetBillInfo() {
|
|
|
page := this.GetPageInfoForm()
|
|
|
|
|
|
orderby := "p.Id"
|
|
|
- where := "p.SupplierId='"+ strconv.Itoa(supplierEntity.Id) +"' and p.IsPay='0' "
|
|
|
+ where := "p.SupplierId='" + strconv.Itoa(supplierEntity.Id) + "' and p.IsPay='0' "
|
|
|
var paylist []paymentinfo.PaymentinfoList
|
|
|
svc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
total := svc.GetPaymentinfoList(page.CurrentPage, page.Size, orderby, " ASC", &paylist, where)
|
|
|
@@ -274,12 +271,12 @@ func (this *PaymentInfoController) GetBillInfo() {
|
|
|
datainfo.ItemsPerPage = page.Size
|
|
|
amount1 := 0.0
|
|
|
for _, payItem := range paylist {
|
|
|
- tmpAmount, _ := strconv.ParseFloat( payItem.Amount, 64 )
|
|
|
+ tmpAmount, _ := strconv.ParseFloat(payItem.Amount, 64)
|
|
|
amount1 += tmpAmount
|
|
|
}
|
|
|
|
|
|
orderby2 := "p.Id"
|
|
|
- where2 := "p.SupplierId='"+ strconv.Itoa(supplierEntity.Id) +"' and p.IsPay='1' "
|
|
|
+ where2 := "p.SupplierId='" + strconv.Itoa(supplierEntity.Id) + "' and p.IsPay='1' "
|
|
|
var paylist2 []paymentinfo.PaymentinfoList
|
|
|
svc2 := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
total2 := svc2.GetPaymentinfoList(page.CurrentPage, page.Size, orderby2, " ASC", &paylist2, where2)
|
|
|
@@ -291,7 +288,7 @@ func (this *PaymentInfoController) GetBillInfo() {
|
|
|
datainfo2.ItemsPerPage = page.Size
|
|
|
amount2 := 0.0
|
|
|
for _, payItem := range paylist2 {
|
|
|
- tmpAmount, _ := strconv.ParseFloat( payItem.Amount, 64 )
|
|
|
+ tmpAmount, _ := strconv.ParseFloat(payItem.Amount, 64)
|
|
|
amount2 += tmpAmount
|
|
|
}
|
|
|
|
|
|
@@ -304,10 +301,10 @@ func (this *PaymentInfoController) GetBillInfo() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
type BillSure struct {
|
|
|
Ids string `json:"ids"`
|
|
|
}
|
|
|
+
|
|
|
// @Title 确认缴费单
|
|
|
// @Description 确认缴费单
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
@@ -377,7 +374,7 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
|
|
|
svc.DBE.Query(sql)
|
|
|
|
|
|
for _, payItem := range paymentInfos {
|
|
|
- if payItem.PayType == "1" {//准入
|
|
|
+ if payItem.PayType == "1" { //准入
|
|
|
var certentity suppliercert.OilSupplierCert
|
|
|
certentity.Status = suppliercert.STOREING_STATUS
|
|
|
certentity.Step = 5
|
|
|
@@ -387,41 +384,41 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
|
|
|
}
|
|
|
svc.UpdateEntityByIdCols(strconv.Itoa(payItem.SupplierCertId), &certentity, cols)
|
|
|
|
|
|
- } else if payItem.PayType == "2" {//年审
|
|
|
+ } else if payItem.PayType == "2" { //年审
|
|
|
//TODO: 修改年审时间
|
|
|
annuasvc := annualaudit.GetOilAnnualAuditService(utils.DBE)
|
|
|
- var annualentities []annualaudit.OilAnnualAudit
|
|
|
- annwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+ " and CerId = "+utils.ToStr(payItem.SupplierCertId) +" and Status = '6'"
|
|
|
+ var annualentities []annualaudit.OilAnnualAudit
|
|
|
+ annwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and CerId = " + utils.ToStr(payItem.SupplierCertId) + " and Status = '6'"
|
|
|
svc.GetEntitysByWhere(OilAnnualAuditName, annwhere, &annualentities)
|
|
|
- if len(annualentities) >0 {
|
|
|
+ if len(annualentities) > 0 {
|
|
|
//更新年审表时间
|
|
|
- var annmodel annualaudit.OilAnnualAudit
|
|
|
+ var annmodel annualaudit.OilAnnualAudit
|
|
|
annmodel.Status = suppliercert.ALL_PASE_STATUS
|
|
|
annmodel.ApplyTime = annualentities[0].ApplyTime.AddDate(1, 0, 0)
|
|
|
- annuasvc.UpdateEntityBywheretbl(OilAnnualAuditName,&annmodel,[]string{"ApplyTime", "Status"},annwhere)
|
|
|
+ annuasvc.UpdateEntityBywheretbl(OilAnnualAuditName, &annmodel, []string{"ApplyTime", "Status"}, annwhere)
|
|
|
//更新准入表时间
|
|
|
var certmodel suppliercert.OilSupplierCert
|
|
|
certmodel.ApplyTime = annualentities[0].ApplyTime.AddDate(1, 0, 0)
|
|
|
svc.UpdateEntityByIdCols(strconv.Itoa(payItem.SupplierCertId), &certmodel, []string{"ApplyTime"})
|
|
|
}
|
|
|
- } else if payItem.PayType == "3" {//增项
|
|
|
+ } else if payItem.PayType == "3" { //增项
|
|
|
appsvc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
|
//更新准入项表
|
|
|
- appendwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+ " and SupplierCertId = "+utils.ToStr(payItem.SupplierCertId)+" and Type = '2'"
|
|
|
+ appendwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and SupplierCertId = " + utils.ToStr(payItem.SupplierCertId) + " and Type = '2'"
|
|
|
var appendsubmodel suppliercertsub.OilSupplierCertSub
|
|
|
appendsubmodel.Type = "3"
|
|
|
appsvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &appendsubmodel, []string{"Type"}, appendwhere)
|
|
|
//更新资质表
|
|
|
- appendfilewhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+" and SupType = 2"
|
|
|
+ appendfilewhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and SupType = 2"
|
|
|
var appendsubfilemodel supplierfile.OilSupplierFile
|
|
|
appendsubfilemodel.SupType = 3
|
|
|
appsvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &appendsubfilemodel, []string{"SupType"}, appendfilewhere)
|
|
|
//更新增项表
|
|
|
- appdwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+ " and SupplierCertId = "+utils.ToStr(payItem.SupplierCertId)+" and Status = '6'"
|
|
|
+ appdwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId) + " and SupplierCertId = " + utils.ToStr(payItem.SupplierCertId) + " and Status = '6'"
|
|
|
var appendmodel suppliercertappend.OilSupplierCertAppend
|
|
|
appendmodel.Status = suppliercert.ALL_PASE_STATUS
|
|
|
- appsvc.UpdateEntityBywheretbl(OilSupplierCertAppendName,&appendmodel,[]string{"Status"},appdwhere)
|
|
|
- }
|
|
|
+ appsvc.UpdateEntityBywheretbl(OilSupplierCertAppendName, &appendmodel, []string{"Status"}, appdwhere)
|
|
|
+ }
|
|
|
}
|
|
|
//记录对账日志
|
|
|
paymentBankInfo := new(paymentbankinfo.OilPaymentBankInfo)
|
|
|
@@ -445,7 +442,6 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 对账后有未更改状态的,再次确认缴费单--回调
|
|
|
// @Description 确认缴费单
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
@@ -474,7 +470,7 @@ func (this *PaymentInfoController) ReceiveMoneyAgainList() {
|
|
|
sqlList := " 1=1 and Id in (" + strIds + ") and IsPay = '1'"
|
|
|
var paymentInfo paymentinfo.OilPaymentInfo
|
|
|
utils.DBE.Find(&paymentInfo, sqlList)
|
|
|
- if paymentInfo.PayType == "1" {//准入
|
|
|
+ if paymentInfo.PayType == "1" { //准入
|
|
|
var certentity suppliercert.OilSupplierCert
|
|
|
certentity.Status = suppliercert.STOREING_STATUS
|
|
|
certentity.Step = 5
|
|
|
@@ -484,10 +480,10 @@ func (this *PaymentInfoController) ReceiveMoneyAgainList() {
|
|
|
}
|
|
|
svc.UpdateEntityByIdCols(strconv.Itoa(paymentInfo.SupplierCertId), &certentity, cols)
|
|
|
|
|
|
- } else if paymentInfo.PayType == "2" {//年审
|
|
|
+ } else if paymentInfo.PayType == "2" { //年审
|
|
|
//TODO: 修改年审时间
|
|
|
|
|
|
- } else if paymentInfo.PayType == "3" {//增项
|
|
|
+ } else if paymentInfo.PayType == "3" { //增项
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -514,7 +510,6 @@ func (this *PaymentInfoController) ReceiveMoneyAgainList() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 对账
|
|
|
// @Description 对账
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
@@ -529,13 +524,13 @@ func (this *PaymentInfoController) CheckMoneyList() {
|
|
|
checkRet := new(bankapi.BillCheckMoneyRet)
|
|
|
|
|
|
paymentWhere := "1=1 and IsPay='2' "
|
|
|
- paymentWhere += " and PayDate >= '"+checkMoneyParams.StartTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
- paymentWhere += " and PayDate <= '"+checkMoneyParams.EndTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
+ paymentWhere += " and PayDate >= '" + checkMoneyParams.StartTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
+ paymentWhere += " and PayDate <= '" + checkMoneyParams.EndTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
svc.GetEntities(&(checkRet.PaymentInfos), paymentWhere)
|
|
|
|
|
|
bankWhere := "1=1"
|
|
|
- bankWhere += " and PayDate >= '"+checkMoneyParams.StartTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
- bankWhere += " and PayDate <= '"+checkMoneyParams.EndTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
+ bankWhere += " and PayDate >= '" + checkMoneyParams.StartTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
+ bankWhere += " and PayDate <= '" + checkMoneyParams.EndTime.Format("2006-01-02 15:04:05") + "'"
|
|
|
svc.GetEntities(&(checkRet.PaymentBankInfos), bankWhere)
|
|
|
|
|
|
var datainfo DataInfo
|
|
|
@@ -544,3 +539,49 @@ func (this *PaymentInfoController) CheckMoneyList() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
+// @Title 删除单条信息
|
|
|
+// @Description
|
|
|
+// @Success 200 {object} ErrorInfo
|
|
|
+// @Failure 403 :id 为空
|
|
|
+// @router /delete/:Id [delete]
|
|
|
+func (this *PaymentInfoController) DeleteEntity() {
|
|
|
+ Id := this.Ctx.Input.Param(":Id")
|
|
|
+ var errinfo ErrorInfo
|
|
|
+ if Id == "" {
|
|
|
+ errinfo.Message = "操作失败!请求信息不完整"
|
|
|
+ errinfo.Code = -2
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var model paymentinfo.OilPaymentInfo
|
|
|
+ svc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
+ svc.GetEntityById(Id, &model)
|
|
|
+ where := "Id=" + Id
|
|
|
+ err := svc.DeleteEntityBytbl(OilPaymentInfoName, where)
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ errinfo.Message = "删除失败!"
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ var cert suppliercert.OilSupplierCert
|
|
|
+ cert.Status = suppliercert.STOREING_STATUS
|
|
|
+ cols := []string{"Status"}
|
|
|
+ where := "Id=" + strconv.Itoa(model.SupplierCertId)
|
|
|
+ svc.UpdateEntityBywheretbl(OilSupplierCertName, &cert, cols, where)
|
|
|
+ errinfo.Message = "删除成功"
|
|
|
+ errinfo.Code = 0
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ } else {
|
|
|
+ errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ }
|
|
|
+}
|