|
@@ -81,7 +81,7 @@ func (this *PaymentInfoController) GetBillList() {
|
|
|
|
|
|
|
|
var supplierEntity supplier.OilSupplier
|
|
var supplierEntity supplier.OilSupplier
|
|
|
supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
- supplierWhere := "1=1 and CommercialNo='" + icbcBillQueryParam.CommercialNo + "'"
|
|
|
|
|
|
|
+ supplierWhere := "1=1 and IsPay=1 and CommercialNo='" + icbcBillQueryParam.CommercialNo + "'"
|
|
|
supplierSvc.DBE.Where(supplierWhere).Get(&supplierEntity)
|
|
supplierSvc.DBE.Where(supplierWhere).Get(&supplierEntity)
|
|
|
|
|
|
|
|
var billList []paymentinfo.OilPaymentInfo
|
|
var billList []paymentinfo.OilPaymentInfo
|
|
@@ -265,9 +265,9 @@ func (this *PaymentInfoController) SureEntity() {
|
|
|
|
|
|
|
|
sql := "update OilPaymentInfo set IsPay = 1, "
|
|
sql := "update OilPaymentInfo set IsPay = 1, "
|
|
|
sql += "SureBatchNo='" + strconv.FormatInt(time.Now().UnixNano(), 10) + "' "
|
|
sql += "SureBatchNo='" + strconv.FormatInt(time.Now().UnixNano(), 10) + "' "
|
|
|
- /*sql += "ModifiedOn='" + time.Now().String() + "', "
|
|
|
|
|
|
|
+ sql += "ModifiedOn='" + time.Now().Format("2006-01-02 15:04:05") + "', "
|
|
|
sql += "ModifiedBy='" + this.User.Realname + "', "
|
|
sql += "ModifiedBy='" + this.User.Realname + "', "
|
|
|
- sql += "ModifiedUserId='" + this.User.Id + "' "*/
|
|
|
|
|
|
|
+ sql += "ModifiedUserId='" + this.User.Id + "' "
|
|
|
sql += " where id in (" + strIds + ") and IsPay = 0"
|
|
sql += " where id in (" + strIds + ") and IsPay = 0"
|
|
|
svc.DBE.Query(sql)
|
|
svc.DBE.Query(sql)
|
|
|
|
|
|
|
@@ -277,3 +277,58 @@ func (this *PaymentInfoController) SureEntity() {
|
|
|
this.Data["json"] = &errinfo
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// @Title 确认缴费单
|
|
|
|
|
+// @Description 确认缴费单
|
|
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
|
|
+// @router /receive-money-bill-list [post]
|
|
|
|
|
+func (this *PaymentInfoController) ReceiveMoneyBillList() {
|
|
|
|
|
+ var errinfo ErrorInfo
|
|
|
|
|
+ svc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
|
|
+ var billParams bankapi.BillReceiveMoneyParams
|
|
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
|
|
+ json.Unmarshal(jsonBlob, &billParams)
|
|
|
|
|
+
|
|
|
|
|
+ strIds := strings.Trim(billParams.Ids, ",")
|
|
|
|
|
+ sqlList := " where id in (" + strIds + ") and IsPay = 1"
|
|
|
|
|
+ var paymentInfos []paymentinfo.OilPaymentInfo
|
|
|
|
|
+ svc.GetEntities(paymentInfos, sqlList)
|
|
|
|
|
+
|
|
|
|
|
+ t := time.Now()
|
|
|
|
|
+ sql := "update OilPaymentInfo set IsPay = 2, "
|
|
|
|
|
+ sql += "BankName='" + billParams.BankName + "', "
|
|
|
|
|
+ sql += "BankSerialNum='" + billParams.BankSerialNum + "', "
|
|
|
|
|
+ sql += "PayDate='" + billParams.PayDate.Format("2006-01-02 15:04:05") + "', "
|
|
|
|
|
+ sql += "PayMode='" + billParams.PayMode + "', "
|
|
|
|
|
+ sql += "ModifiedOn='" + t.Format("2006-01-02 15:04:05") + "', "
|
|
|
|
|
+ sql += "ModifiedBy='" + this.User.Realname + "', "
|
|
|
|
|
+ sql += "ModifiedUserId='" + this.User.Id + "' "
|
|
|
|
|
+ sql += " where id in (" + strIds + ") and IsPay = 1"
|
|
|
|
|
+ svc.DBE.Query(sql)
|
|
|
|
|
+
|
|
|
|
|
+ for _, payItem := range paymentInfos {
|
|
|
|
|
+ if payItem.PayType == "1" {//准入
|
|
|
|
|
+ var certentity suppliercert.OilSupplierCert
|
|
|
|
|
+ certentity.Status = suppliercert.STOREING_STATUS
|
|
|
|
|
+ certentity.Step = 5
|
|
|
|
|
+ cols := []string{
|
|
|
|
|
+ "Status",
|
|
|
|
|
+ "Step",
|
|
|
|
|
+ }
|
|
|
|
|
+ svc.UpdateEntityByIdCols(strconv.Itoa(payItem.SupplierCertId), &certentity, cols)
|
|
|
|
|
+
|
|
|
|
|
+ } else if payItem.PayType == "2" {//年审
|
|
|
|
|
+ //TODO: 修改年审时间
|
|
|
|
|
+
|
|
|
|
|
+ } else if payItem.PayType == "3" {//增项
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //记录对账日志
|
|
|
|
|
+ //TODO: 记录对账日志
|
|
|
|
|
+
|
|
|
|
|
+ errinfo.Message = "修改成功!"
|
|
|
|
|
+ errinfo.Code = 0
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|