陈少旭 3 月之前
父節點
當前提交
c3713fc976
共有 3 個文件被更改,包括 87 次插入9 次删除
  1. 16 9
      controllers/admin_api_controllers/custom_api_controller.go
  2. 62 0
      models/custom.go
  3. 9 0
      service/custom_service.go

+ 16 - 9
controllers/admin_api_controllers/custom_api_controller.go 查看文件

@@ -161,7 +161,7 @@ func (this *CustomAPIController) DeleteCustom() {
161 161
 func (this *CustomAPIController) ModifyCustom() {
162 162
 	id, _ := this.GetInt64("id")
163 163
 	module, _ := this.GetInt64("module")
164
-	custom, _ := service.FindCustomInfoByID(id)
164
+	custom, _ := service.FindCustomInfoByIDTwo(id)
165 165
 	switch module {
166 166
 	case 1: //编辑基本信息
167 167
 		name := this.GetString("name")
@@ -175,7 +175,6 @@ func (this *CustomAPIController) ModifyCustom() {
175 175
 		address := this.GetString("address")
176 176
 		client_remark := this.GetString("client_remark")
177 177
 		topline_time := this.GetString("topline_time")
178
-
179 178
 		custom.CustomType = customType
180 179
 		custom.Salesperson = salesperson
181 180
 		custom.SignTime = signTime
@@ -189,7 +188,7 @@ func (this *CustomAPIController) ModifyCustom() {
189 188
 		custom.Mtime = time.Now().Unix()
190 189
 		custom.ClientRemark = client_remark
191 190
 		custom.ToplineTime = topline_time
192
-		err := service.UpdateCustom(custom)
191
+		err := service.UpdateCustomTwo(custom)
193 192
 		if err != nil {
194 193
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
195 194
 			return
@@ -210,7 +209,7 @@ func (this *CustomAPIController) ModifyCustom() {
210 209
 		custom.ImplementRemark = implementRemark
211 210
 		custom.ID = id
212 211
 		custom.Mtime = time.Now().Unix()
213
-		err := service.UpdateCustom(custom)
212
+		err := service.UpdateCustomTwo(custom)
214 213
 		if err != nil {
215 214
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
216 215
 			return
@@ -230,7 +229,7 @@ func (this *CustomAPIController) ModifyCustom() {
230 229
 		custom.LisContact = lisContact
231 230
 		custom.ID = id
232 231
 		custom.Mtime = time.Now().Unix()
233
-		err := service.UpdateCustom(custom)
232
+		err := service.UpdateCustomTwo(custom)
234 233
 		if err != nil {
235 234
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
236 235
 			return
@@ -250,7 +249,7 @@ func (this *CustomAPIController) ModifyCustom() {
250 249
 		custom.YbRemark = ybRemark
251 250
 		custom.ID = id
252 251
 		custom.Mtime = time.Now().Unix()
253
-		err := service.UpdateCustom(custom)
252
+		err := service.UpdateCustomTwo(custom)
254 253
 		if err != nil {
255 254
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
256 255
 			return
@@ -271,7 +270,7 @@ func (this *CustomAPIController) ModifyCustom() {
271 270
 		custom.QcRemark = qcRemark
272 271
 		custom.ID = id
273 272
 		custom.Mtime = time.Now().Unix()
274
-		err := service.UpdateCustom(custom)
273
+		err := service.UpdateCustomTwo(custom)
275 274
 		if err != nil {
276 275
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
277 276
 			return
@@ -286,7 +285,7 @@ func (this *CustomAPIController) ModifyCustom() {
286 285
 		custom.Remark = remark
287 286
 		custom.ID = id
288 287
 		custom.Mtime = time.Now().Unix()
289
-		err := service.UpdateCustom(custom)
288
+		err := service.UpdateCustomTwo(custom)
290 289
 		if err != nil {
291 290
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
292 291
 			return
@@ -337,7 +336,7 @@ func (this *CustomAPIController) ModifyCustom() {
337 336
 
338 337
 		custom.ID = id
339 338
 		custom.Mtime = time.Now().Unix()
340
-		err := service.UpdateCustom(custom)
339
+		err := service.UpdateCustomTwo(custom)
341 340
 		if err != nil {
342 341
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
343 342
 			return
@@ -618,6 +617,8 @@ func (this *CustomAPIController) CreateContractInfo() {
618 617
 	code := this.GetString("code")
619 618
 	name := this.GetString("name")
620 619
 	sumamt := this.GetString("sumamt")
620
+	custom_name := this.GetString("custom_name")
621
+
621 622
 	start_time := this.GetString("start_time")
622 623
 	end_time := this.GetString("end_time")
623 624
 	signing_person := this.GetString("signing_person")
@@ -638,6 +639,7 @@ func (this *CustomAPIController) CreateContractInfo() {
638 639
 		SigningPerson: signing_person,
639 640
 		WordFileUrl:   wordFileURL,
640 641
 		PdfFileUrl:    pdfFileURL,
642
+		CustomName:    custom_name,
641 643
 		Remark:        remark,
642 644
 		Ctime:         ctime,
643 645
 		Mtime:         mtime,
@@ -897,6 +899,9 @@ func (this *CustomAPIController) EditDemandInfo() {
897 899
 	demandStatus, _ := this.GetInt64("demand_status")
898 900
 	demandCreator := this.GetString("demand_creator")
899 901
 	demandCreateDate := this.GetString("demand_create_date")
902
+	demandFinishDate := this.GetString("demand_finish_date")
903
+	demandDetail := this.GetString("demand_detail")
904
+
900 905
 	demandDirector := this.GetString("demand_director")
901 906
 	cd, _ := service.FindChargeDemandInfo(id)
902 907
 	cd.DemandType = demandType
@@ -904,7 +909,9 @@ func (this *CustomAPIController) EditDemandInfo() {
904 909
 	cd.DemandStatus = demandStatus
905 910
 	cd.DemandCreator = demandCreator
906 911
 	cd.DemandCreateDate = demandCreateDate
912
+	cd.DemandFinishDate = demandFinishDate
907 913
 	cd.DemandDirector = demandDirector
914
+	cd.DemandDetail = demandDetail
908 915
 	cd.Mtime = time.Now().Unix()
909 916
 	err := service.SaveChargeDemand(&cd)
910 917
 	if err != nil {

+ 62 - 0
models/custom.go 查看文件

@@ -124,6 +124,67 @@ func (KyyChargeCustom) TableName() string {
124 124
 	return "kyy_charge_custom"
125 125
 }
126 126
 
127
+type KyyChargeCustomThree struct {
128
+	ID                            int64  `gorm:"column:id" json:"id" form:"id"`
129
+	Name                          string `gorm:"column:name" json:"name" form:"name"`
130
+	XtOrgId                       int64  `gorm:"column:xt_org_id" json:"xt_org_id" form:"xt_org_id"`
131
+	Status                        int64  `gorm:"column:status" json:"status" form:"status"`
132
+	Ctime                         int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
133
+	Mtime                         int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
134
+	Creator                       int64  `gorm:"column:creator" json:"creator" form:"creator"`
135
+	Modifier                      int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
136
+	CustomType                    int64  `gorm:"column:custom_type" json:"custom_type" form:"custom_type"`
137
+	Salesperson                   string `gorm:"column:salesperson" json:"salesperson" form:"salesperson"`
138
+	SignTime                      string `gorm:"column:sign_time" json:"sign_time" form:"sign_time"`
139
+	ContractPrice                 string `gorm:"column:contract_price" json:"contract_price" form:"contract_price"`
140
+	SoftwarePrice                 string `gorm:"column:software_price" json:"software_price" form:"software_price"`
141
+	HardwarePrice                 string `gorm:"column:hardware_price" json:"hardware_price" form:"hardware_price"`
142
+	YearCostPrice                 string `gorm:"column:year_cost_price" json:"year_cost_price" form:"year_cost_price"`
143
+	Address                       string `gorm:"column:address" json:"address" form:"address"`
144
+	IsImplement                   int64  `gorm:"column:is_implement" json:"is_implement" form:"is_implement"`
145
+	LisStatus                     int64  `gorm:"column:lis_status" json:"lis_status" form:"lis_status"`
146
+	LisContact                    string `gorm:"column:lis_contact" json:"lis_contact" form:"lis_contact"`
147
+	LisTime                       string `gorm:"column:lis_time" json:"lis_time" form:"lis_time"`
148
+	LisRemark                     string `gorm:"column:lis_remark" json:"lis_remark" form:"lis_remark"`
149
+	QcStatus                      int64  `gorm:"column:qc_status" json:"qc_status" form:"qc_status"`
150
+	YbStatus                      int64  `gorm:"column:yb_status" json:"yb_status" form:"yb_status"`
151
+	Remark                        string `gorm:"column:remark" json:"remark" form:"remark"`
152
+	WeightScaleStatus             int64  `gorm:"column:weight_scale_status" json:"weight_scale_status" form:"weight_scale_status"`
153
+	WeightScaleBrand              string `gorm:"column:weight_scale_brand" json:"weight_scale_brand" form:"weight_scale_brand"`
154
+	WeightScaleRemark             string `gorm:"column:weight_scale_remark" json:"weight_scale_remark" form:"weight_scale_remark"`
155
+	SphygmomanometerStatus        int64  `gorm:"column:sphygmomanometer_status" json:"sphygmomanometer_status" form:"sphygmomanometer_status"`
156
+	SphygmomanometerBrand         string `gorm:"column:sphygmomanometer_brand" json:"sphygmomanometer_brand" form:"sphygmomanometer_brand"`
157
+	SphygmomanometerRemark        string `gorm:"column:sphygmomanometer_remark" json:"sphygmomanometer_remark" form:"sphygmomanometer_remark"`
158
+	ScannerStatus                 int64  `gorm:"column:scanner_status" json:"scanner_status" form:"scanner_status"`
159
+	ScannerBrand                  string `gorm:"column:scanner_brand" json:"scanner_brand" form:"scanner_brand"`
160
+	ScannerRemark                 string `gorm:"column:scanner_remark" json:"scanner_remark" form:"scanner_remark"`
161
+	FacialRecognitionDeviceStatus int64  `gorm:"column:facial_recognition_device_status" json:"facial_recognition_device_status" form:"facial_recognition_device_status"`
162
+	FacialRecognitionDeviceBrand  string `gorm:"column:facial_recognition_device_brand" json:"facial_recognition_device_brand" form:"facial_recognition_device_brand"`
163
+	FacialRecognitionDeviceRemark string `gorm:"column:facial_recognition_device_remark" json:"facial_recognition_device_remark" form:"facial_recognition_device_remark"`
164
+	PrinterStatus                 int64  `gorm:"column:printer_status" json:"printer_status" form:"printer_status"`
165
+	PrinterBrand                  string `gorm:"column:printer_brand" json:"printer_brand" form:"printer_brand"`
166
+	PrinterRemark                 string `gorm:"column:printer_remark" json:"printer_remark" form:"printer_remark"`
167
+	HardwareRemark                string `gorm:"column:hardware_remark" json:"hardware_remark" form:"hardware_remark"`
168
+	ImplementTime                 string `gorm:"column:implement_time" json:"implement_time" form:"implement_time"`
169
+	ImplementPerson               string `gorm:"column:implement_person" json:"implement_person" form:"implement_person"`
170
+	ImplementRemark               string `gorm:"column:implement_remark" json:"implement_remark" form:"implement_remark"`
171
+	YbTime                        string `gorm:"column:yb_time" json:"yb_time" form:"yb_time"`
172
+	YbPerson                      string `gorm:"column:yb_person" json:"yb_person" form:"yb_person"`
173
+	YbRemark                      string `gorm:"column:yb_remark" json:"yb_remark" form:"yb_remark"`
174
+	QcTime                        string `gorm:"column:qc_time" json:"qc_time" form:"qc_time"`
175
+	QcPerson                      string `gorm:"column:qc_person" json:"qc_person" form:"qc_person"`
176
+	QcRemark                      string `gorm:"column:qc_remark" json:"qc_remark" form:"qc_remark"`
177
+	ClientRemark                  string `gorm:"column:client_remark" json:"client_remark" form:"client_remark"`
178
+	ToplineTime                   string `gorm:"column:topline_time" json:"topline_time" form:"topline_time"`
179
+
180
+	IsCheck     int64  `gorm:"column:is_check" json:"is_check" form:"is_check"`
181
+	CheckPerson string `gorm:"column:check_person" json:"check_person" form:"check_person"`
182
+}
183
+
184
+func (KyyChargeCustomThree) TableName() string {
185
+	return "kyy_charge_custom"
186
+}
187
+
127 188
 type KyyChargePaymentCollection struct {
128 189
 	ID                      int64  `gorm:"column:id" json:"id" form:"id"`
129 190
 	XtOrgId                 int64  `gorm:"column:xt_org_id" json:"xt_org_id" form:"xt_org_id"`
@@ -191,6 +252,7 @@ type KyyChargeContract struct {
191 252
 	Modifier      int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
192 253
 	IsCheck       int64  `gorm:"column:is_check" json:"is_check" form:"is_check"`
193 254
 	Status        int64  `gorm:"column:status" json:"status" form:"status"`
255
+	SigningTime   string `gorm:"column:signing_time" json:"signing_time" form:"signing_time"`
194 256
 }
195 257
 
196 258
 func (KyyChargeContract) TableName() string {

+ 9 - 0
service/custom_service.go 查看文件

@@ -63,10 +63,19 @@ func FindCustomInfoByID(id int64) (admin models.KyyChargeCustom, err error) {
63 63
 	return
64 64
 }
65 65
 
66
+func FindCustomInfoByIDTwo(id int64) (admin models.KyyChargeCustomThree, err error) {
67
+	err = ChargeReadDB().Model(&models.KyyChargeCustomThree{}).
68
+		Where("id = ? AND status = 1", id).First(&admin).Error
69
+	return
70
+}
66 71
 func UpdateCustom(custom models.KyyChargeCustom) (err error) {
67 72
 	err = ChargeWriteDB().Save(&custom).Error
68 73
 	return
69 74
 }
75
+func UpdateCustomTwo(custom models.KyyChargeCustomThree) (err error) {
76
+	err = ChargeWriteDB().Save(&custom).Error
77
+	return
78
+}
70 79
 
71 80
 func CreateChargePaymentCollection(cpc *models.KyyChargePaymentCollection) (err error) {
72 81
 	err = ChargeWriteDB().Save(&cpc).Error