123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- package service
- import (
- "encoding/json"
- "fmt"
- "log"
- "testing"
- . "app.yhyue.com/moapp/jybase/common"
- . "bp.jydev.jianyu360.cn/CRM/networkManage/api/common"
- "bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/types"
- )
- //go test -test.run=TestAddCustomService -fs=../../etc/crmapplication.yaml -lf=../../etc/logs.yaml -df=../../etc/db.yaml -pf=../../etc/push.yaml
- func TestAddOrUpdate(t *testing.T) {
- InitConf()
- defer Catch()
- res1 := Network.AddOrUpdate(&types.AddOrUpdateReq{
- PositionId: 943,
- Company_name: "王传进的89",
- Contact_person: "王传进",
- Contact_phone: "15037870765",
- Type: "middleman",
- Introduce_owner_id: "5aebc2c37a624e8bacc40c1802a57041",
- Introduce_owner_name: "北京影业(北京)有限公司",
- Introduce_project_id: "5aebc2c37a624e8bacc40c1802a57041,北京物业服务",
- })
- log.Println(res1)
- return
- //类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
- for _, v := range []string{"firstparty", "supplier", "adiffb", "middleman", "agency"} {
- text := ""
- switch v {
- case "firstparty":
- text = "甲方"
- case "supplier":
- text = "供应商"
- case "adiffb":
- text = "同甲异业"
- case "middleman":
- text = "中间人"
- case "agency":
- text = "招标代理机构"
- }
- text += "_2"
- res := Network.AddOrUpdate(&types.AddOrUpdateReq{
- PositionId: 943,
- Company_id: "112233445566",
- Company_name: "王传进的" + text,
- Contact_person: "王传进",
- Contact_phone: "15037870765",
- Introduce_owner_id: "11,22,33",
- Introduce_owner_name: "aa,bb,cc",
- Introduce_project_id: "44,55,66",
- Introduce_project_name: "dd,ee,ff",
- Type: "middleman",
- })
- log.Println(res)
- }
- }
- func TestAssociate(t *testing.T) {
- InitConf()
- //log.Println(NetworkCom.GetEntTagSeat(2))
- //类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 middleman_owner:中间人-业主 middleman_project:中间人-项目 agency:招标代理机构
- //
- res := Network.Associate(&types.AssociateReq{
- //EntName: "深圳市光明区马田街道市政管理和建设工程事务中心",
- //EntAccountId: 64,
- Name: "北京",
- Type: "middleman",
- })
- log.Println(res.Data)
- }
- func TestNetWorkList(t *testing.T) {
- InitConf()
- //类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
- res := Network.List(&types.NetWorkListReq{
- EntAccountId: 64,
- UserId: "1205591997",
- //PositionId: 1205591997,
- //PositionId: 1205592003,
- PositionId: 935,
- Current_page: 1,
- Page_size: 10,
- //PositionId: 935,
- //Order_amount: -1,
- // Monitorcount_start: 1,
- // Monitorcount_end: 1,
- //Monitor: 1,
- //Project_matchme: 1,
- //Starttime: "2024-04-23",
- //Endtime: "2024-04-23",
- //Type: "middleman",
- //Name: "新疆",
- })
- for k, v := range res.Data.(map[string]interface{}) {
- if k == "list" {
- continue
- }
- log.Println(k, v)
- }
- for _, v := range res.Data.(map[string]interface{})["list"].([]*map[string]interface{}) {
- log.Println(v)
- }
- }
- func TestAllProject(t *testing.T) {
- InitConf()
- res := Network.AllProject(&types.AllprojectReq{
- EntAccountId: 64,
- PositionId: 935,
- //PositionId: 1205591997, //刘苗
- //PositionId: 1205592003,//刘亚丽
- //Id: "009c313ef8e740e59d57432aea777102",
- //Type: "firstparty",
- })
- b, _ := json.Marshal(res.Data)
- log.Println(string(b))
- }
- func TestOwner(t *testing.T) {
- InitConf()
- ownerService := &OwnerService{
- Intermediary: "30157",
- PositionId: 1205591997,
- PageIndex: 1,
- PageSize: 100,
- }
- data := ownerService.OwnerlList()
- b, _ := json.Marshal(data)
- log.Println(string(b))
- }
- func TestProjectHistory(t *testing.T) {
- InitConf()
- data := GetData3("2", "128a81f9facb4aefb817244dc2c0e655", "北京城市之光生态环境有限公司")
- for _, v := range data {
- log.Println(fmt.Sprintf("%+v", v))
- }
- }
- func TestInitNetwork(t *testing.T) {
- InitConf()
- inw := InitNetwork{
- PositionId: 935,
- EntId: 221,
- DeptId: 498,
- UserId: 195,
- EntName: "安徽公共资源交易集团项目管理有限公司",
- BusinessType: "",
- }
- inw.Init()
- }
|