forked from free-lancers/electricity_bill_calc_service
		
	fix(enduser):修正终端用户表计抄表过程中的错误。
This commit is contained in:
		@@ -16,7 +16,7 @@ import (
 | 
			
		||||
 | 
			
		||||
func InitializeEndUserController(router *gin.Engine) {
 | 
			
		||||
	router.GET("/report/:rid/submeter", security.EnterpriseAuthorize, fetchEndUserInReport)
 | 
			
		||||
	router.GET("/report/:rid/meter/template", security.EnterpriseAuthorize, downloadEndUserRegisterTemplate)
 | 
			
		||||
	router.GET("/report/:rid/meter/template", downloadEndUserRegisterTemplate)
 | 
			
		||||
	router.POST("/report/:rid/meter/batch", security.EnterpriseAuthorize, uploadEndUserRegisterTemplate)
 | 
			
		||||
	router.PUT("/report/:rid/submeter/:pid/:mid", security.EnterpriseAuthorize, modifyEndUserRegisterRecord)
 | 
			
		||||
}
 | 
			
		||||
@@ -49,9 +49,6 @@ func fetchEndUserInReport(c *gin.Context) {
 | 
			
		||||
func downloadEndUserRegisterTemplate(c *gin.Context) {
 | 
			
		||||
	result := response.NewResult(c)
 | 
			
		||||
	requestReportId := c.Param("rid")
 | 
			
		||||
	if !ensureReportBelongs(c, result, requestReportId) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	users, err := service.EndUserService.AllEndUserRecord(requestReportId)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		result.NotFound(err.Error())
 | 
			
		||||
 
 | 
			
		||||
@@ -75,8 +75,8 @@ func (t *MeterNonPVExcelTemplateGenerator) WriteMeterData(meters []model.EndUser
 | 
			
		||||
				meter.MeterId,
 | 
			
		||||
				meter.Ratio,
 | 
			
		||||
				meter.LastPeriodOverall,
 | 
			
		||||
				nil,
 | 
			
		||||
				nil,
 | 
			
		||||
				"0",
 | 
			
		||||
				"0",
 | 
			
		||||
			},
 | 
			
		||||
			excelize.RowOpts{Height: 15},
 | 
			
		||||
		); err != nil {
 | 
			
		||||
 
 | 
			
		||||
@@ -84,17 +84,17 @@ func (t *MeterPVExcelTemplateGenerator) WriteMeterData(meters []model.EndUserDet
 | 
			
		||||
				meter.MeterId,
 | 
			
		||||
				meter.Ratio,
 | 
			
		||||
				meter.LastPeriodOverall,
 | 
			
		||||
				nil,
 | 
			
		||||
				"0",
 | 
			
		||||
				meter.LastPeriodCritical,
 | 
			
		||||
				nil,
 | 
			
		||||
				"0",
 | 
			
		||||
				meter.LastPeriodPeak,
 | 
			
		||||
				nil,
 | 
			
		||||
				"0",
 | 
			
		||||
				meter.LastPeriodValley,
 | 
			
		||||
				nil,
 | 
			
		||||
				nil,
 | 
			
		||||
				nil,
 | 
			
		||||
				nil,
 | 
			
		||||
				nil,
 | 
			
		||||
				"0",
 | 
			
		||||
				"0",
 | 
			
		||||
				"0",
 | 
			
		||||
				"0",
 | 
			
		||||
				"0",
 | 
			
		||||
			},
 | 
			
		||||
			excelize.RowOpts{Height: 15},
 | 
			
		||||
		); err != nil {
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ func (_EndUserService) SearchEndUserRecord(reportId, keyword string, page int) (
 | 
			
		||||
		Limit(config.ServiceSettings.ItemsPageSize, startItem).
 | 
			
		||||
		Asc("seq").
 | 
			
		||||
		Find(&endUsers)
 | 
			
		||||
	cache.CacheSearch(endUsers, []string{"end_user", "report", "park"}, "end_user_detail", conditions...)
 | 
			
		||||
	cache.CacheSearch(endUsers, []string{"end_user_detail", "report", "park"}, "end_user_detail", conditions...)
 | 
			
		||||
	return endUsers, total, err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user