|
|
@@ -15,13 +15,17 @@ type ParamSetController struct {
|
|
|
}
|
|
|
|
|
|
type ParamSerModel struct {
|
|
|
- IsInvestigate bool `json:"isInvestigate"`
|
|
|
- IsHse bool `json:"IsHse"`
|
|
|
- IsGetBarCode bool `json:"isGetBarCode"`
|
|
|
- SAddLimitMonth string `json:"sAddLimitMonth"`
|
|
|
- AppendApplyNums string `json:"appendApplyNums"`
|
|
|
- SFlupLastDay int `json:"sFlupLastDay"`
|
|
|
- STestFrontDay int `json:"sTestFrontDay"`
|
|
|
+ IsInvestigate bool `json:"isInvestigate"`
|
|
|
+ IsHse bool `json:"IsHse"`
|
|
|
+ IsGetBarCode bool `json:"isGetBarCode"`
|
|
|
+ SAddLimitMonth int `json:"sAddLimitMonth"`
|
|
|
+ AppendApplyNums int `json:"appendApplyNums"`
|
|
|
+ SFlupLastDay int `json:"sFlupLastDay"`
|
|
|
+ STestFrontDay int `json:"sTestFrontDay"`
|
|
|
+ PermitPayStartDay int `json:"permitPayStartDay"`
|
|
|
+ PermitPayEndDay int `json:"permitPayEndDay"`
|
|
|
+ PermitAnnualHeadMonth int `json:"permitAnnualHeadMonth"`
|
|
|
+ PermitAnnualAfterMonth int `json:"permitAnnualAfterMonth"`
|
|
|
}
|
|
|
type ParamModel struct {
|
|
|
// 每次新增变量参数时在这继续添加即可
|
|
|
@@ -49,7 +53,9 @@ func (this *ParamSetController) ParamSetPost() {
|
|
|
cols := []string{
|
|
|
"Parametercontent",
|
|
|
}
|
|
|
- where := "Categoryid='GFGL1' and Parameterid='paramset' and Parametercode="
|
|
|
+ where := "Parameterid='paramset' and Parametercode="
|
|
|
+
|
|
|
+ whereGFGL := "Categoryid='GFGL1' and " + where
|
|
|
|
|
|
// 是否需要现场考察报告
|
|
|
var sisInvestigate string
|
|
|
@@ -59,7 +65,7 @@ func (this *ParamSetController) ParamSetPost() {
|
|
|
sisInvestigate = "false"
|
|
|
}
|
|
|
var isInvEntity baseparameter.Base_Parameter
|
|
|
- svc.GetEntity(&isInvEntity, where+"'isInvestigate'")
|
|
|
+ svc.GetEntity(&isInvEntity, whereGFGL+"'isInvestigate'")
|
|
|
if isInvEntity.Id > 0 {
|
|
|
isInvEntity.Parametercontent = sisInvestigate
|
|
|
isInvEntity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
@@ -75,7 +81,7 @@ func (this *ParamSetController) ParamSetPost() {
|
|
|
isAllow = "false"
|
|
|
}
|
|
|
var isHse baseparameter.Base_Parameter
|
|
|
- svc.GetEntity(&isHse, where + " 'isHse'")
|
|
|
+ svc.GetEntity(&isHse, whereGFGL+" 'isHse'")
|
|
|
if isHse.Id > 0 {
|
|
|
isHse.Parametercontent = isAllow
|
|
|
isHse.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
@@ -86,12 +92,9 @@ func (this *ParamSetController) ParamSetPost() {
|
|
|
|
|
|
// 增项申请时间间隔
|
|
|
var lmEntity baseparameter.Base_Parameter
|
|
|
- svc.GetEntity(&lmEntity, where+"'sAddLimitMonth'")
|
|
|
+ svc.GetEntity(&lmEntity, whereGFGL+"'sAddLimitMonth'")
|
|
|
if lmEntity.Id > 0 {
|
|
|
- if model.SAddLimitMonth == "" {
|
|
|
- model.SAddLimitMonth = "0"
|
|
|
- }
|
|
|
- lmEntity.Parametercontent = model.SAddLimitMonth
|
|
|
+ lmEntity.Parametercontent = strconv.Itoa(model.SAddLimitMonth)
|
|
|
lmEntity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
lmEntity.Modifiedby = this.User.Realname
|
|
|
svc.UpdateEntityByIdCols(lmEntity.Id, lmEntity, cols)
|
|
|
@@ -99,17 +102,53 @@ func (this *ParamSetController) ParamSetPost() {
|
|
|
|
|
|
// 增项申请次数 每年
|
|
|
var applyNumEntity baseparameter.Base_Parameter
|
|
|
- svc.GetEntity(&applyNumEntity, where+"'appendApplyNums'")
|
|
|
+ svc.GetEntity(&applyNumEntity, whereGFGL+"'appendApplyNums'")
|
|
|
if applyNumEntity.Id > 0 {
|
|
|
- if model.AppendApplyNums == "" {
|
|
|
- model.AppendApplyNums = "2"
|
|
|
- }
|
|
|
- applyNumEntity.Parametercontent = model.AppendApplyNums
|
|
|
+ applyNumEntity.Parametercontent = strconv.Itoa(model.AppendApplyNums)
|
|
|
applyNumEntity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
applyNumEntity.Modifiedby = this.User.Realname
|
|
|
svc.UpdateEntityByIdCols(applyNumEntity.Id, applyNumEntity, cols)
|
|
|
}
|
|
|
|
|
|
+ // 年审时间限制
|
|
|
+ var annualAuditHeadEntity baseparameter.Base_Parameter
|
|
|
+ svc.GetEntity(&annualAuditHeadEntity, whereGFGL+"'permitAnnualHeadMonth'")
|
|
|
+ if applyNumEntity.Id > 0 {
|
|
|
+ annualAuditHeadEntity.Parametercontent = strconv.Itoa(model.PermitAnnualHeadMonth)
|
|
|
+ annualAuditHeadEntity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ annualAuditHeadEntity.Modifiedby = this.User.Realname
|
|
|
+ svc.UpdateEntityByIdCols(annualAuditHeadEntity.Id, annualAuditHeadEntity, cols)
|
|
|
+ }
|
|
|
+ var annualAuditAfterEntity baseparameter.Base_Parameter
|
|
|
+ svc.GetEntity(&annualAuditAfterEntity, whereGFGL+"'permitAnnualAfterMonth'")
|
|
|
+ if applyNumEntity.Id > 0 {
|
|
|
+ annualAuditAfterEntity.Parametercontent = strconv.Itoa(model.PermitAnnualAfterMonth)
|
|
|
+ annualAuditAfterEntity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ annualAuditAfterEntity.Modifiedby = this.User.Realname
|
|
|
+ svc.UpdateEntityByIdCols(annualAuditAfterEntity.Id, annualAuditAfterEntity, cols)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 交费时间限制
|
|
|
+ wherePayCheck := "Categoryid='PAYCHECK' and " + where
|
|
|
+ var payCheckStartEntity baseparameter.Base_Parameter
|
|
|
+ svc.GetEntity(&payCheckStartEntity, wherePayCheck+"'permitPayStartDay'")
|
|
|
+ if payCheckStartEntity.Id > 0 {
|
|
|
+ payCheckStartEntity.Parametercontent = strconv.Itoa(model.PermitPayStartDay)
|
|
|
+ applyNumEntity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ applyNumEntity.Modifiedby = this.User.Realname
|
|
|
+ applyNumEntity.Modifiedon = time.Now()
|
|
|
+ svc.UpdateEntityByIdCols(payCheckStartEntity.Id, payCheckStartEntity, cols)
|
|
|
+ }
|
|
|
+ var payCheckEndEntity baseparameter.Base_Parameter
|
|
|
+ svc.GetEntity(&payCheckEndEntity, wherePayCheck+"'permitPayEndDay'")
|
|
|
+ if payCheckEndEntity.Id > 0 {
|
|
|
+ payCheckEndEntity.Parametercontent = strconv.Itoa(model.PermitPayEndDay)
|
|
|
+ applyNumEntity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ applyNumEntity.Modifiedby = this.User.Realname
|
|
|
+ applyNumEntity.Modifiedon = time.Now()
|
|
|
+ svc.UpdateEntityByIdCols(payCheckEndEntity.Id, payCheckEndEntity, cols)
|
|
|
+ }
|
|
|
+
|
|
|
//_, err := svc.InsertEntity(¶mEntityList)
|
|
|
var errInfo ErrorInfo
|
|
|
errInfo.Message = utils.AlertProcess("参数设置成功!")
|
|
|
@@ -123,10 +162,15 @@ func (this *ParamSetController) ParamSetPost() {
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
|
// @router /getparamset [get]
|
|
|
func (this *ParamSetController) ParamsetCheck() {
|
|
|
- var paramentitylist []baseparameter.Base_Parameter
|
|
|
+ var paramEntityList []baseparameter.Base_Parameter
|
|
|
svc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
- paramentitylist = svc.GetBaseparameterbyid("GFGL1", "paramset")
|
|
|
- this.Data["json"] = ¶mentitylist
|
|
|
+ paramEntityList = svc.GetBaseparameterbyid("GFGL1", "paramset")
|
|
|
+
|
|
|
+ paramEntityList2 := svc.GetBaseparameterbyid("PAYCHECK", "paramset") // 交费日期限制也拿进来一起维护
|
|
|
+ for _, item := range paramEntityList2 {
|
|
|
+ paramEntityList = append(paramEntityList, item)
|
|
|
+ }
|
|
|
+ this.Data["json"] = ¶mEntityList
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|