|
@@ -59,9 +59,13 @@
|
|
|
|
|
|
<option value="file1">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go (100.0%)</option>
|
|
|
|
|
|
+<<<<<<< HEAD
|
|
|
<option value="file2">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go (27.6%)</option>
|
|
|
|
|
|
<option value="file3">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go (88.1%)</option>
|
|
|
+=======
|
|
|
+ <option value="file2">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go (93.5%)</option>
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
|
|
|
</select>
|
|
|
</div>
|
|
@@ -115,7 +119,11 @@ func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) <span
|
|
|
"ent_name": in.EntName,
|
|
|
}
|
|
|
ok1 := entity.BaseMysql.Update(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{"user_id": in.UserId, "appid": in.Appid}, data)
|
|
|
+<<<<<<< HEAD
|
|
|
if ok1 </span><span class="cov8" title="1">{
|
|
|
+=======
|
|
|
+ if ok1 </span><span class="cov1" title="1">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
return true, ""
|
|
|
}</span> else<span class="cov0" title="0"> {
|
|
|
log.Println(fmt.Sprintf("认证修改失败:入参:%v:%v,", in.UserId, data))
|
|
@@ -188,36 +196,65 @@ type EntClaimService struct {
|
|
|
}
|
|
|
|
|
|
// NewEntClaimSrv 创建一个EntClaimSrv实例
|
|
|
+<<<<<<< HEAD
|
|
|
func NewEntClaimSrv(conn *entity.Conn) *EntClaimService <span class="cov8" title="1">{
|
|
|
+=======
|
|
|
+func NewEntClaimSrv(conn *entity.Conn) *EntClaimService <span class="cov1" title="1">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
return &EntClaimService{
|
|
|
conn,
|
|
|
}
|
|
|
}</span>
|
|
|
|
|
|
// Claim 认领
|
|
|
+<<<<<<< HEAD
|
|
|
func (e *EntClaimService) Claim(data *entity.EntClaim) bool <span class="cov8" title="1">{
|
|
|
return e.BaseMysql.Insert(entity.TableDomainEntClaim, common.StructToMapMore(data)) > 0
|
|
|
}</span>
|
|
|
|
|
|
// Unclaimed // 取消认领
|
|
|
func (e *EntClaimService) Unclaimed(id, userId int) bool <span class="cov0" title="0">{
|
|
|
+=======
|
|
|
+func (e *EntClaimService) Claim(data *entity.EntClaim) bool <span class="cov6" title="2">{
|
|
|
+ if e.IsClaimed(data.UserId, data.AppId, data.EntId, data.Type) </span><span class="cov0" title="0">{
|
|
|
+ return true
|
|
|
+ }</span>
|
|
|
+ <span class="cov6" title="2">return e.BaseMysql.Insert(entity.TableDomainEntClaim, common.StructToMapMore(data)) > 0</span>
|
|
|
+}
|
|
|
+
|
|
|
+// Unclaimed // 取消认领
|
|
|
+func (e *EntClaimService) Unclaimed(id, userId int) bool <span class="cov10" title="3">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
query := map[string]interface{}{
|
|
|
"id": id,
|
|
|
}
|
|
|
// 1. 查询该条数据
|
|
|
rs := e.BaseMysql.FindOne(entity.TableDomainEntClaim, query, "user_id", "")
|
|
|
+<<<<<<< HEAD
|
|
|
if rs == nil || len(*rs) == 0 </span><span class="cov0" title="0">{
|
|
|
+=======
|
|
|
+ if rs == nil || len(*rs) == 0 </span><span class="cov1" title="1">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
logx.Errorf("取消认领:无效的id %v", id)
|
|
|
return false
|
|
|
}</span>
|
|
|
// 2. 存在则判断是否是该用户的
|
|
|
+<<<<<<< HEAD
|
|
|
<span class="cov0" title="0">rsUerId := common.IntAll((*rs)["user_id"])
|
|
|
if rsUerId != userId </span><span class="cov0" title="0">{
|
|
|
+=======
|
|
|
+ <span class="cov6" title="2">rsUerId := common.IntAll((*rs)["user_id"])
|
|
|
+ if rsUerId != userId </span><span class="cov1" title="1">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
logx.Errorf("取消认领:id[%v]与用户id[%v]不匹配 ", id, userId)
|
|
|
return false
|
|
|
}</span>
|
|
|
// 3. 取消认领
|
|
|
+<<<<<<< HEAD
|
|
|
<span class="cov0" title="0">update := map[string]interface{}{
|
|
|
+=======
|
|
|
+ <span class="cov1" title="1">update := map[string]interface{}{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
"status": entity.StatusUnClaimed,
|
|
|
"update_time": date.NowFormat(date.Date_Full_Layout),
|
|
|
}
|
|
@@ -225,7 +262,11 @@ func (e *EntClaimService) Unclaimed(id, userId int) bool <span class="cov0" titl
|
|
|
}
|
|
|
|
|
|
// IsClaimed 是否认领
|
|
|
+<<<<<<< HEAD
|
|
|
func (e *EntClaimService) IsClaimed(userId int, appId string, entId int, typeCode int) bool <span class="cov0" title="0">{
|
|
|
+=======
|
|
|
+func (e *EntClaimService) IsClaimed(userId int, appId string, entId string, typeCode int) bool <span class="cov10" title="3">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
query := map[string]interface{}{
|
|
|
"user_id": userId,
|
|
|
"type": typeCode,
|
|
@@ -236,7 +277,11 @@ func (e *EntClaimService) IsClaimed(userId int, appId string, entId int, typeCod
|
|
|
}</span>
|
|
|
|
|
|
// DistributorList 关注的经销商列表
|
|
|
+<<<<<<< HEAD
|
|
|
func (e *EntClaimService) DistributorList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov8" title="1">{
|
|
|
+=======
|
|
|
+func (e *EntClaimService) DistributorList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov6" title="2">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
|
|
|
query := map[string]interface{}{
|
|
|
"user_id": userId,
|
|
@@ -247,14 +292,22 @@ func (e *EntClaimService) DistributorList(userId int, appId string, page int, pa
|
|
|
field := "id,appid,user_id,ent_id,ent_name,address,create_time"
|
|
|
order := "create_time desc"
|
|
|
total := e.BaseMysql.Count(entity.TableDomainEntClaim, query)
|
|
|
+<<<<<<< HEAD
|
|
|
if total == 0 </span><span class="cov8" title="1">{
|
|
|
+=======
|
|
|
+ if total == 0 </span><span class="cov6" title="2">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
return nil, 0
|
|
|
}</span>
|
|
|
<span class="cov0" title="0">return e.BaseMysql.Find(entity.TableDomainEntClaim, query, field, order, (page-1)*pageSize, pageSize), int(total)</span>
|
|
|
}
|
|
|
|
|
|
// InstitutionList 我关注的医疗机构列表
|
|
|
+<<<<<<< HEAD
|
|
|
func (e *EntClaimService) InstitutionList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov0" title="0">{
|
|
|
+=======
|
|
|
+func (e *EntClaimService) InstitutionList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov6" title="2">{
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
query := map[string]interface{}{
|
|
|
"user_id": userId,
|
|
|
"appid": appId,
|
|
@@ -264,6 +317,7 @@ func (e *EntClaimService) InstitutionList(userId int, appId string, page int, pa
|
|
|
field := "id,appid,user_id,ent_id,ent_name,address,create_time"
|
|
|
order := "create_time desc"
|
|
|
total := e.BaseMysql.Count(entity.TableDomainEntClaim, query)
|
|
|
+<<<<<<< HEAD
|
|
|
if total == 0 </span><span class="cov0" title="0">{
|
|
|
return nil, 0
|
|
|
}</span>
|
|
@@ -450,6 +504,12 @@ func EncodeId(sid string) string <span class="cov0" title="0">{
|
|
|
return ""
|
|
|
}</span>
|
|
|
<span class="cov0" title="0">return encrypt.EncodeArticleId2ByCheck(sid)</span>
|
|
|
+=======
|
|
|
+ if total == 0 </span><span class="cov1" title="1">{
|
|
|
+ return nil, 0
|
|
|
+ }</span>
|
|
|
+ <span class="cov1" title="1">return e.BaseMysql.Find(entity.TableDomainEntClaim, query, field, order, (page-1)*pageSize, pageSize), int(total)</span>
|
|
|
+>>>>>>> 10627a5dbc739e87e4aa15f75c91adb5de38af2d
|
|
|
}
|
|
|
</pre>
|
|
|
|