作者 yangfu

增加多组织机构过滤

正在显示 32 个修改的文件 包含 135 行增加44 行删除
... ... @@ -17,7 +17,9 @@ type SearchDeviceQuery struct {
// 当前公司
CompanyId int `cname:"当前公司" json:"companyId,omitempty" valid:"Required"`
// 当前登录的组织
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty" valid:"Required"`
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty"`
// 匹配多个组织
InOrgIds []int `cname:"匹配多个组织" json:"inOrgIds,omitempty" valid:"Required"`
// 页码
PageNumber int `cname:"页码" json:"pageNumber,omitempty"`
// 页数
... ...
... ... @@ -316,8 +316,6 @@ func (deviceService *DeviceService) UpdateDevice(cmd *command.UpdateDeviceComman
// 返回设备服务列表
func (deviceService *DeviceService) SearchDevice(operateInfo *domain.OperateInfo, listDeviceQuery *query.SearchDeviceQuery) (int64, interface{}, error) {
listDeviceQuery.OrgId = operateInfo.OrgId
listDeviceQuery.CompanyId = operateInfo.CompanyId
if err := listDeviceQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ...
... ... @@ -17,7 +17,9 @@ type SearchProductQuery struct {
// 当前公司
CompanyId int `cname:"当前公司" json:"companyId,omitempty" valid:"Required"`
// 当前登录的组织
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty" valid:"Required"`
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty"`
// 匹配多个组织
InOrgIds []int `cname:"匹配多个组织" json:"inOrgIds,omitempty" valid:"Required"`
// 页码
PageNumber int `cname:"页码" json:"pageNumber,omitempty"`
// 页数
... ...
... ... @@ -298,8 +298,6 @@ func (productService *ProductService) UpdateProduct(updateProductCommand *comman
// 返回产品服务列表
func (productService *ProductService) SearchProduct(operateInfo *domain.OperateInfo, listProductQuery *query.SearchProductQuery) (int64, interface{}, error) {
listProductQuery.OrgId = operateInfo.OrgId
listProductQuery.CompanyId = operateInfo.CompanyId
if err := listProductQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ...
... ... @@ -17,7 +17,9 @@ type SearchProductCalendarQuery struct {
// 当前公司
CompanyId int `cname:"当前公司" json:"companyId,omitempty" valid:"Required"`
// 当前登录的组织
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty" valid:"Required"`
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty"`
// 匹配多个组织
InOrgIds []int `cname:"匹配多个组织" json:"inOrgIds,omitempty" valid:"Required"`
// 页码
PageNumber int `cname:"页码" json:"pageNumber,omitempty"`
// 页数
... ...
... ... @@ -323,8 +323,6 @@ func (productCalendarService *ProductCalendarService) UpdateProductCalendar(cmd
// 返回工厂日历服务列表
func (productCalendarService *ProductCalendarService) SearchProductCalendar(operateInfo *domain.OperateInfo, listProductCalendarQuery *query.SearchProductCalendarQuery) (int64, interface{}, error) {
listProductCalendarQuery.OrgId = operateInfo.OrgId
listProductCalendarQuery.CompanyId = operateInfo.CompanyId
if err := listProductCalendarQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ...
... ... @@ -16,7 +16,9 @@ type SearchProductGroupQuery struct {
// 当前公司
CompanyId int `cname:"当前公司" json:"companyId,omitempty" valid:"Required"`
// 当前登录的组织
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty" valid:"Required"`
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty"`
// 匹配多个组织
InOrgIds []int `cname:"匹配多个组织" json:"inOrgIds,omitempty" valid:"Required"`
// 页码
PageNumber int `cname:"页码" json:"pageNumber,omitempty"`
// 页数
... ...
... ... @@ -324,8 +324,6 @@ func (productGroupService *ProductGroupService) UpdateProductGroup(cmd *command.
// 返回生产班组服务列表
func (productGroupService *ProductGroupService) SearchProductGroup(operateInfo *domain.OperateInfo, q *query.SearchProductGroupQuery) (int64, interface{}, error) {
q.OrgId = operateInfo.OrgId
q.CompanyId = operateInfo.CompanyId
if err := q.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ...
... ... @@ -26,11 +26,19 @@ type ProductJobDto struct {
//// 负责人 (用户对象)
//Principal *domain.User `json:"principal,omitempty"`
*domain.WorkStation
// 组织名称
//OrgName string `json:"orgName"`
// 权限标识 (当前登录组织匹配为true,否则false)
//AuthFlag bool `json:"authFlag"`
}
func (m *ProductJobDto) LoadDto(job *domain.ProductJob) {
m.ProductJobId = job.ProductJobId
m.JobName = job.JobName
m.ProcessName = job.ProcessName
m.WorkStation = job.WorkStation
func (d *ProductJobDto) LoadDto(job *domain.ProductJob, orgId int) {
d.ProductJobId = job.ProductJobId
d.JobName = job.JobName
d.ProcessName = job.ProcessName
d.WorkStation = job.WorkStation
//d.AuthFlag = domain.CheckOrgAuth(orgId, job.OrgId)
//if job.Ext != nil {
// d.OrgName = job.Ext.OrgName
//}
}
... ...
... ... @@ -17,7 +17,9 @@ type SearchProductJobQuery struct {
// 当前公司
CompanyId int `cname:"当前公司" json:"companyId,omitempty" valid:"Required"`
// 当前登录的组织
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty" valid:"Required"`
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty" `
// 匹配多个组织
InOrgIds []int `cname:"匹配多个组织" json:"inOrgIds,omitempty" `
// 页码
PageNumber int `cname:"页码" json:"pageNumber,omitempty"`
// 页数
... ...
... ... @@ -95,7 +95,7 @@ func (productJobService *ProductJobService) GetProductJob(getProductJobQuery *qu
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
newJobDto := &dto.ProductJobDto{}
newJobDto.LoadDto(productJob)
newJobDto.LoadDto(productJob, 0)
return newJobDto, nil
}
... ... @@ -280,8 +280,6 @@ func (productJobService *ProductJobService) UpdateProductJob(cmd *command.Update
// 搜索工位服务列表
func (productJobService *ProductJobService) SearchProductJob(operateInfo *domain.OperateInfo, listProductJobQuery *query.SearchProductJobQuery) (int64, interface{}, error) {
listProductJobQuery.OrgId = operateInfo.OrgId
listProductJobQuery.CompanyId = operateInfo.CompanyId
if err := listProductJobQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ... @@ -312,7 +310,7 @@ func (productJobService *ProductJobService) SearchProductJob(operateInfo *domain
for i := range productJobs {
item := productJobs[i]
newJobDto := &dto.ProductJobDto{}
newJobDto.LoadDto(item)
newJobDto.LoadDto(item, operateInfo.OrgId)
result = append(result, newJobDto)
}
return count, result, nil
... ...
... ... @@ -17,7 +17,9 @@ type SearchUnitConversionQuery struct {
// 当前公司
CompanyId int `cname:"当前公司" json:"companyId,omitempty" valid:"Required"`
// 当前登录的组织
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty" valid:"Required"`
OrgId int `cname:"当前登录的组织" json:"orgId,omitempty"`
// 匹配多个组织
InOrgIds []int `cname:"匹配多个组织" json:"inOrgIds,omitempty" valid:"Required"`
// 页码
PageNumber int `cname:"页码" json:"pageNumber,omitempty"`
// 页数
... ...
... ... @@ -275,8 +275,6 @@ func (unitConversionService *UnitConversionService) UpdateUnitConversion(cmd *co
// 返回单位换算服务列表
func (unitConversionService *UnitConversionService) SearchUnitConversion(operateInfo *domain.OperateInfo, listUnitConversionQuery *query.SearchUnitConversionQuery) (int64, interface{}, error) {
listUnitConversionQuery.OrgId = operateInfo.OrgId
listUnitConversionQuery.CompanyId = operateInfo.CompanyId
if err := listUnitConversionQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ...
... ... @@ -31,6 +31,7 @@ const CUSTOMER_ACCOUNT_DELIMITER = ","
const HeaderCompanyId = "companyId"
const HeaderUserId = "userId"
const HeaderOrgId = "orgId"
const HeaderOrgIds = "orgIds"
func init() {
if os.Getenv("LOG_LEVEL") != "" {
... ...
... ... @@ -46,6 +46,8 @@ type OperateInfo struct {
OrgId int
// 菜单模块
MenuCode string
// 匹配多个组织
OrgIds []int
}
func NewCheckOptions(optUser, org int) OperateInfo {
... ...
... ... @@ -143,6 +143,9 @@ func (repository *DeviceRepository) FindOne(queryOptions map[string]interface{})
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
query.SetWhereByQueryOption("device_code = ?", "deviceCode")
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ... @@ -165,6 +168,9 @@ func (repository *DeviceRepository) Find(queryOptions map[string]interface{}) (i
query.SetOrderDirect("device_id", "DESC")
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
if v, ok := queryOptions["inOrgIds"]; ok && len(v.([]int)) > 0 {
query.Where(`org_id in (?)`, pg.In(v))
}
query.SetWhereByQueryOption("device_code = ?", "deviceCode")
query.SetWhereByQueryOption("device_status = ?", "deviceStatus")
if v, ok := queryOptions["deviceName"]; ok && len(v.(string)) > 0 {
... ...
... ... @@ -148,6 +148,9 @@ func (repository *ProductAttendanceRecordRepository) FindOne(queryOptions map[st
productAttendanceRecordModel := new(models.ProductAttendanceRecord)
query := sqlbuilder.BuildQuery(tx.Model(productAttendanceRecordModel), queryOptions)
query.SetWhereByQueryOption("product_attendance_record.product_attendance_record_id = ?", "productAttendanceRecordId")
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ...
... ... @@ -133,6 +133,9 @@ func (repository *ProductCalendarRepository) FindOne(queryOptions map[string]int
productCalendarModel := new(models.ProductCalendar)
query := sqlbuilder.BuildQuery(tx.Model(productCalendarModel), queryOptions)
query.SetWhereByQueryOption("product_calendar.product_calendar_id = ?", "productCalendarId")
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ... @@ -153,6 +156,9 @@ func (repository *ProductCalendarRepository) Find(queryOptions map[string]interf
query := sqlbuilder.BuildQuery(tx.Model(&productCalendarModels), queryOptions)
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
if v, ok := queryOptions["inOrgIds"]; ok && len(v.([]int)) > 0 {
query.Where(`org_id in (?)`, pg.In(v))
}
query.SetWhereByQueryOption("work_station->>'workStationId'=?", "workStationId")
query.SetWhereByQueryOption("work_on & ? >0", "workOn")
if v, ok := queryOptions["workshopName"]; ok && len(v.(string)) > 0 {
... ...
... ... @@ -127,7 +127,9 @@ func (repository *ProductGroupRepository) FindOne(queryOptions map[string]interf
query.SetWhereByQueryOption("work_station->>'workStationId'=?", "workStationId")
query.SetWhereByQueryOption("work_station->>'workshopId'='?'", "workshopId")
query.SetWhereByQueryOption("work_station->>'lineId'='?'", "lineId")
query.AllWithDeleted()
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ... @@ -146,6 +148,11 @@ func (repository *ProductGroupRepository) Find(queryOptions map[string]interface
var productGroupModels []*models.ProductGroup
productGroups := make([]*domain.ProductGroup, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productGroupModels), queryOptions)
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
if v, ok := queryOptions["inOrgIds"]; ok && len(v.([]int)) > 0 {
query.Where(`org_id in (?)`, pg.In(v))
}
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_group_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
... ...
... ... @@ -122,7 +122,9 @@ func (repository *ProductJobRepository) FindOne(queryOptions map[string]interfac
query.SetWhereByQueryOption("org_id = ?", "orgId")
query.SetWhereByQueryOption("job_name=?", "jobName")
query.SetWhereByQueryOption("work_station->>'workStationId'=?", "workStationId")
query.AllWithDeleted()
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ... @@ -144,6 +146,9 @@ func (repository *ProductJobRepository) Find(queryOptions map[string]interface{}
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
if v, ok := queryOptions["inOrgIds"]; ok && len(v.([]int)) > 0 {
query.Where(`org_id in (?)`, pg.In(v))
}
query.SetWhereByQueryOption("work_station->>'workStationId'=?", "workStationId")
query.SetWhereByQueryOption("work_station->>'workshopId'='?'", "workshopId")
... ...
... ... @@ -158,6 +158,9 @@ func (repository *ProductPlanRepository) FindOne(queryOptions map[string]interfa
productPlanModel := new(models.ProductPlan)
query := sqlbuilder.BuildQuery(tx.Model(productPlanModel), queryOptions)
query.SetWhereByQueryOption("product_plan.product_plan_id = ?", "productPlanId")
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ...
... ... @@ -128,6 +128,9 @@ func (repository *ProductRecordRepository) FindOne(queryOptions map[string]inter
productRecordModel := new(models.ProductRecord)
query := sqlbuilder.BuildQuery(tx.Model(productRecordModel), queryOptions)
query.SetWhereByQueryOption("product_record.product_record_id = ?", "productRecordId")
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ...
... ... @@ -125,7 +125,9 @@ func (repository *ProductRepository) FindOne(queryOptions map[string]interface{}
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
query.SetWhereByQueryOption("product_code = ?", "productCode")
query.AllWithDeleted()
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ... @@ -146,6 +148,9 @@ func (repository *ProductRepository) Find(queryOptions map[string]interface{}) (
query := sqlbuilder.BuildQuery(tx.Model(&productModels), queryOptions)
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
if v, ok := queryOptions["inOrgIds"]; ok && len(v.([]int)) > 0 {
query.Where(`org_id in (?)`, pg.In(v))
}
if v, ok := queryOptions["productName"]; ok && len(v.(string)) > 0 {
query.Where(fmt.Sprintf(`product_name like '%%%v%%'`, v))
}
... ...
... ... @@ -123,6 +123,9 @@ func (repository *UnitConversionRepository) FindOne(queryOptions map[string]inte
unitConversionModel := new(models.UnitConversion)
query := sqlbuilder.BuildQuery(tx.Model(unitConversionModel), queryOptions)
query.SetWhereByQueryOption("unit_conversion.unit_conversion_id = ?", "unitConversionId")
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ... @@ -143,6 +146,9 @@ func (repository *UnitConversionRepository) Find(queryOptions map[string]interfa
query := sqlbuilder.BuildQuery(tx.Model(&unitConversionModels), queryOptions)
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
if v, ok := queryOptions["inOrgIds"]; ok && len(v.([]int)) > 0 {
query.Where(`org_id in (?)`, pg.In(v))
}
query.SetWhereByQueryOption("intelligent_weighing_flag = ?", "intelligentWeighingFlag")
if v, ok := queryOptions["materialName"]; ok && len(v.(string)) > 0 {
query.Where(fmt.Sprintf(`material->>'materialName' like '%%%v%%'`, v))
... ...
... ... @@ -112,11 +112,13 @@ func (repository *WorkshopRepository) FindOne(queryOptions map[string]interface{
tx := repository.transactionContext.PgTx
workshopModel := new(models.Workshop)
query := sqlbuilder.BuildQuery(tx.Model(workshopModel), queryOptions)
query.AllWithDeleted()
query.SetWhereByQueryOption("workshop_id = ?", "workshopId")
query.SetWhereByQueryOption("company_id = ?", "companyId")
query.SetWhereByQueryOption("org_id = ?", "orgId")
query.SetWhereByQueryOption("workshop_name=?", "workshopName")
if v, ok := queryOptions["includeDeleted"]; ok && v.(bool) {
query.AllWithDeleted()
}
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ...
... ... @@ -8,6 +8,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
"strconv"
"strings"
)
func ResponseGrid(c beego.BaseController, total int64, data interface{}, err error) {
... ... @@ -45,6 +46,15 @@ func ParseOperateInfo(c beego.BaseController) *domain.OperateInfo {
opt.UserId = header(c, constant.HeaderUserId)
opt.CompanyId = header(c, constant.HeaderCompanyId)
opt.OrgId = header(c, constant.HeaderOrgId)
orgIdList := c.Ctx.Input.Header(constant.HeaderOrgIds)
splitOrgIdList := strings.Split(orgIdList, constant.CUSTOMER_ACCOUNT_DELIMITER)
for i := range splitOrgIdList {
orgId, _ := strconv.Atoi(splitOrgIdList[i])
if orgId == 0 {
continue
}
opt.OrgIds = append(opt.OrgIds, orgId)
}
// 默认公司组织
//if opt.CompanyId == 0 {
// opt.CompanyId = 1
... ...
... ... @@ -70,9 +70,13 @@ func (controller *DeviceController) ListDevice() {
func (controller *DeviceController) SearchDevice() {
deviceService := service.NewDeviceService(nil)
listDeviceQuery := &query.SearchDeviceQuery{}
Must(controller.Unmarshal(listDeviceQuery))
total, data, err := deviceService.SearchDevice(ParseOperateInfo(controller.BaseController), listDeviceQuery)
cmd := &query.SearchDeviceQuery{}
Must(controller.Unmarshal(cmd))
operateInfo := ParseOperateInfo(controller.BaseController)
//cmd.OrgId = operateInfo.OrgId
cmd.CompanyId = operateInfo.CompanyId
cmd.InOrgIds = operateInfo.OrgIds
total, data, err := deviceService.SearchDevice(ParseOperateInfo(controller.BaseController), cmd)
ResponseGrid(controller.BaseController, total, data, err)
}
... ...
... ... @@ -71,6 +71,10 @@ func (controller *ProductCalendarController) SearchProductCalendar() {
productCalendarService := service.NewProductCalendarService(nil)
cmd := &query.SearchProductCalendarQuery{}
Must(controller.Unmarshal(cmd))
operateInfo := ParseOperateInfo(controller.BaseController)
//cmd.OrgId = operateInfo.OrgId
cmd.CompanyId = operateInfo.CompanyId
cmd.InOrgIds = operateInfo.OrgIds
total, data, err := productCalendarService.SearchProductCalendar(ParseOperateInfo(controller.BaseController), cmd)
ResponseGrid(controller.BaseController, total, data, err)
}
... ...
... ... @@ -73,9 +73,13 @@ func (controller *ProductController) ListProduct() {
func (controller *ProductController) SearchProduct() {
productService := service.NewProductService(nil)
listProductQuery := &query.SearchProductQuery{}
Must(controller.Unmarshal(listProductQuery))
total, data, err := productService.SearchProduct(ParseOperateInfo(controller.BaseController), listProductQuery)
cmd := &query.SearchProductQuery{}
Must(controller.Unmarshal(cmd))
operateInfo := ParseOperateInfo(controller.BaseController)
//cmd.OrgId = operateInfo.OrgId
cmd.CompanyId = operateInfo.CompanyId
cmd.InOrgIds = operateInfo.OrgIds
total, data, err := productService.SearchProduct(ParseOperateInfo(controller.BaseController), cmd)
ResponseGrid(controller.BaseController, total, data, err)
}
... ...
... ... @@ -69,8 +69,12 @@ func (controller *ProductGroupController) ListProductGroup() {
func (controller *ProductGroupController) SearchProductGroup() {
productGroupService := service.NewProductGroupService(nil)
listProductGroupQuery := &query.SearchProductGroupQuery{}
Must(controller.Unmarshal(listProductGroupQuery))
total, data, err := productGroupService.SearchProductGroup(ParseOperateInfo(controller.BaseController), listProductGroupQuery)
cmd := &query.SearchProductGroupQuery{}
Must(controller.Unmarshal(cmd))
operateInfo := ParseOperateInfo(controller.BaseController)
//cmd.OrgId = operateInfo.OrgId
cmd.CompanyId = operateInfo.CompanyId
cmd.InOrgIds = operateInfo.OrgIds
total, data, err := productGroupService.SearchProductGroup(ParseOperateInfo(controller.BaseController), cmd)
ResponseGrid(controller.BaseController, total, data, err)
}
... ...
... ... @@ -69,8 +69,12 @@ func (controller *ProductJobController) ListProductJob() {
func (controller *ProductJobController) SearchProductJob() {
productJobService := service.NewProductJobService(nil)
listProductJobQuery := &query.SearchProductJobQuery{}
Must(controller.Unmarshal(listProductJobQuery))
total, data, err := productJobService.SearchProductJob(ParseOperateInfo(controller.BaseController), listProductJobQuery)
cmd := &query.SearchProductJobQuery{}
Must(controller.Unmarshal(cmd))
operateInfo := ParseOperateInfo(controller.BaseController)
cmd.OrgId = operateInfo.OrgId
cmd.CompanyId = operateInfo.CompanyId
//cmd.InOrgIds = operateInfo.OrgIds
total, data, err := productJobService.SearchProductJob(operateInfo, cmd)
ResponseGrid(controller.BaseController, total, data, err)
}
... ...
... ... @@ -69,8 +69,12 @@ func (controller *UnitConversionController) ListUnitConversion() {
func (controller *UnitConversionController) SearchUnitConversion() {
unitConversionService := service.NewUnitConversionService(nil)
listUnitConversionQuery := &query.SearchUnitConversionQuery{}
Must(controller.Unmarshal(listUnitConversionQuery))
total, data, err := unitConversionService.SearchUnitConversion(ParseOperateInfo(controller.BaseController), listUnitConversionQuery)
cmd := &query.SearchUnitConversionQuery{}
Must(controller.Unmarshal(cmd))
operateInfo := ParseOperateInfo(controller.BaseController)
//cmd.OrgId = operateInfo.OrgId
cmd.CompanyId = operateInfo.CompanyId
cmd.InOrgIds = operateInfo.OrgIds
total, data, err := unitConversionService.SearchUnitConversion(ParseOperateInfo(controller.BaseController), cmd)
ResponseGrid(controller.BaseController, total, data, err)
}
... ...