Init
This commit is contained in:
BIN
app/.DS_Store
vendored
Normal file
BIN
app/.DS_Store
vendored
Normal file
Binary file not shown.
@ -25,7 +25,8 @@ type (
|
|||||||
// RepairDetailInfo 详细信息
|
// RepairDetailInfo 详细信息
|
||||||
RepairDetailInfo struct {
|
RepairDetailInfo struct {
|
||||||
*RepairInfo
|
*RepairInfo
|
||||||
Details []*model2.WorkRepairDetail `json:"details"`
|
//Details []*model2.WorkRepairDetail `json:"details"`
|
||||||
|
Work *InstanceDetailInfo `json:"work"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -64,26 +65,58 @@ func (c *Repair) List(orderNo, equipmentCode, equipmentTitle string, page, pageS
|
|||||||
|
|
||||||
// Detail 详细信息
|
// Detail 详细信息
|
||||||
func (c *Repair) Detail(id uint64) (*RepairDetailInfo, error) {
|
func (c *Repair) Detail(id uint64) (*RepairDetailInfo, error) {
|
||||||
|
|
||||||
repair, err := model.NewWorkRepair().Detail(id)
|
repair, err := model.NewWorkRepair().Detail(id)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
details := make([]*model2.WorkRepairDetail, 0)
|
work := new(InstanceDetailInfo)
|
||||||
|
|
||||||
if err = model2.Find(model.NewWorkRepairDetail().WorkRepairDetail, &details, &model2.ModelWhereOrder{
|
mWorkInstance := model.NewWorkInstance()
|
||||||
Where: model2.NewWhere("repair_id", id),
|
// 基本信息
|
||||||
Order: model2.NewOrder("id", model2.OrderModeToAsc),
|
if work.WorkInstanceInfo, err = mWorkInstance.Detail(repair.WorkID); err != nil {
|
||||||
}); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
mWorkInstance.SetID(work.WorkInstanceInfo.ID)
|
||||||
|
work.CommonIDString = basic.CommonIDString{
|
||||||
|
ID: mWorkInstance.GetEncodeID(),
|
||||||
|
}
|
||||||
|
work.EquipmentID = (&model2.Model{ID: work.WorkInstanceInfo.EquipmentID}).GetEncodeID()
|
||||||
|
work.ScheduleID = (&model2.Model{ID: work.WorkInstanceInfo.ScheduleID}).GetEncodeID()
|
||||||
|
// 位置信息
|
||||||
|
mWorkInstance.Distribution = work.WorkInstanceInfo.Distribution
|
||||||
|
|
||||||
|
work.Distribution = mWorkInstance.GetDistributionAttribute()
|
||||||
|
// 内修才有数据
|
||||||
|
if work.WorkInstanceInfo.Kind == model2.WorkInstanceKindForWithin {
|
||||||
|
// 器材信息
|
||||||
|
materials := make([]*model.WorkMaterialInfo, 0)
|
||||||
|
|
||||||
|
if materials, err = model.NewWorkMaterial().Materials(id); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// 采购信息
|
||||||
|
purchases := make([]*model.WorkPurchaseInfo, 0)
|
||||||
|
|
||||||
|
if purchases, err = model.NewWorkPurchase().Purchases(id); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
work.Within = struct {
|
||||||
|
Material []*model.WorkMaterialInfo `json:"material"`
|
||||||
|
Purchase []*model.WorkPurchaseInfo `json:"purchase"`
|
||||||
|
}{Material: materials, Purchase: purchases}
|
||||||
|
} else if work.WorkInstanceInfo.Kind == model2.WorkInstanceKindForOutside {
|
||||||
|
work.Outside = struct {
|
||||||
|
SupplierName string `json:"supplier_name"`
|
||||||
|
}{SupplierName: work.WorkInstanceInfo.SupplierName}
|
||||||
|
}
|
||||||
return &RepairDetailInfo{
|
return &RepairDetailInfo{
|
||||||
RepairInfo: &RepairInfo{
|
RepairInfo: &RepairInfo{
|
||||||
CommonIDString: basic.CommonIDString{ID: repair.GetEncodeID()},
|
CommonIDString: basic.CommonIDString{ID: repair.GetEncodeID()},
|
||||||
WorkRepairInfo: repair,
|
WorkRepairInfo: repair,
|
||||||
},
|
},
|
||||||
Details: details,
|
Work: work,
|
||||||
|
//Details: details,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
#CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ArmedPolice.exe main.go
|
#CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ArmedPolice.exe main.go
|
||||||
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -x -v -ldflags "-s -w" -o ArmedPolice.exe main.go
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -x -v -ldflags "-s -w" -o ArmedPolice.exe main.go
|
@ -30,7 +30,6 @@ engine:
|
|||||||
complex: false
|
complex: false
|
||||||
# MYSQL 配置
|
# MYSQL 配置
|
||||||
mysql:
|
mysql:
|
||||||
# host: 47.96.31.6
|
|
||||||
host: 192.168.0.188
|
host: 192.168.0.188
|
||||||
# host: 127.0.0.1
|
# host: 127.0.0.1
|
||||||
port: 3306
|
port: 3306
|
||||||
|
@ -134,7 +134,7 @@ func (this *Router) registerAPI() {
|
|||||||
_api := new(api.Role)
|
_api := new(api.Role)
|
||||||
roleV1.GET("/list", _api.List)
|
roleV1.GET("/list", _api.List)
|
||||||
roleV1.POST("/add", _api.Add)
|
roleV1.POST("/add", _api.Add)
|
||||||
roleV1.POST("/menu", _api.Edit)
|
roleV1.POST("/edit", _api.Edit)
|
||||||
roleV1.POST("/delete", _api.Delete)
|
roleV1.POST("/delete", _api.Delete)
|
||||||
roleV1.POST("/menus", _api.Menu)
|
roleV1.POST("/menus", _api.Menu)
|
||||||
roleV1.POST("/menu/bind", _api.MenuBind)
|
roleV1.POST("/menu/bind", _api.MenuBind)
|
||||||
|
Reference in New Issue
Block a user