Explorar o código

feature(优化):项目新增统计使用备案时间字段

ZZH-wl %!s(int64=2) %!d(string=hai) anos
pai
achega
7e4ad19376

+ 3 - 3
opms_parent/app/service/home/home.go

@@ -143,7 +143,7 @@ func (s *HomeService) getNumStatisticsData(id int64, params *map[string]interfac
 		return gconv.String(count), err
 
 	case 10005: //当月新增项目数量(维度:月)
-		count, err := businessDao.DataScope(s.Ctx, "sale_id").WhereGTE(businessDao.C.CreatedTime, monthStart).WhereLTE(businessDao.C.CreatedTime, monthEnd).CountColumn("id")
+		count, err := businessDao.DataScope(s.Ctx, "sale_id").WhereGTE(businessDao.C.FilingTime, monthStart).WhereLTE(businessDao.C.FilingTime, monthEnd).CountColumn("id")
 		return gconv.String(count), err
 
 	case 10006: //当月新增合同数量(维度:月)
@@ -215,12 +215,12 @@ func (s *HomeService) QueryWechatHomeNumReportData(req *home.SearchWechatNumRepo
 
 	if req.ViewInterval == "week" {
 		customerDao = customerDao.WhereGTE("created_time", weekStart).WhereLTE("created_time", weekEnd)
-		businessDao = businessDao.WhereGTE("created_time", weekStart).WhereLTE("created_time", weekEnd)
+		businessDao = businessDao.WhereGTE("filing_time", weekStart).WhereLTE("filing_time", weekEnd)
 		taskHandleDao = taskHandleDao.WhereGTE("created_time", weekStart).WhereLTE("created_time", weekEnd)
 	}
 	if req.ViewInterval == "month" {
 		customerDao = customerDao.WhereGTE("created_time", monthStart).WhereLTE("created_time", monthEnd)
-		businessDao = businessDao.WhereGTE("created_time", monthStart).WhereLTE("created_time", monthEnd)
+		businessDao = businessDao.WhereGTE("filing_time", monthStart).WhereLTE("filing_time", monthEnd)
 		taskHandleDao = taskHandleDao.WhereGTE("created_time", monthStart).WhereLTE("created_time", monthEnd)
 	}
 	taskHandleDao = taskHandleDao.Where(platDao.PlatTaskHandle.C.TaskStatus, "10").

+ 1 - 0
opms_parent/app/service/proj/business.go

@@ -196,6 +196,7 @@ func (p *businessService) Create(req *model.AddProjBusinessReq) (err error) {
 	businessData.CustRegion = customer.CustRegion
 	businessData.DeptId = p.GetCxtUserDeptId()
 	service.SetCreatedInfo(businessData, p.GetCxtUserId(), p.GetCxtUserName())
+	businessData.FilingTime = businessData.CreatedTime
 	// 事务
 	err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
 		// 添加项目