作者 yangfu

fix: 配置读取修改

deployment: db脚本更新

fix: 设备状态查询修改

fix: 设备状态查询修改

fix: 设备状态查询修改

fix: 班组成员搜索修改,单位换算列表
  1 +POSTGRESQL_DB_NAME = allied_creation_test
  2 +POSTGRESQL_HOST = 114.55.200.59
  3 +POSTGRESQL_PORT = 31543
  4 +POSTGRESQL_USER = postgres
  5 +POSTGRESQL_PASSWORD = eagle1010
  6 +DISABLE_SQL_GENERATE_COMMENT = false
  7 +SERVICE_ENV = test
  8 +HTTP_PORT = 8081
  9 +ENABLE_KAFKA_LOG11 = true
  10 +HTTPS_PORT = 8143
  11 +ALLIED_CREATION_USER_HOST = http://allied-creation-user-test.fjmaimaimai.com
  12 +MANUFACTURE_DEFAULT_COMPANYID = 23
  13 +MANUFACTURE_DEFAULT_ORGID = 487
  14 +MANUFACTURE_DEFAULT_WORKSHOPID = 28
@@ -4,4 +4,19 @@ ALTER TABLE manufacture.product_calendar ADD COLUMN break_time_periods jsonb; @@ -4,4 +4,19 @@ ALTER TABLE manufacture.product_calendar ADD COLUMN break_time_periods jsonb;
4 4
5 -- 表product_attendance_record 增加字段 product_date 5 -- 表product_attendance_record 增加字段 product_date
6 alter table manufacture.product_attendance_record add COLUMN product_date timestamptz; 6 alter table manufacture.product_attendance_record add COLUMN product_date timestamptz;
7 -update manufacture.product_attendance_record set product_date = sign_in where product_date is null ;  
  7 +update manufacture.product_attendance_record set product_date = sign_in where product_date is null ;
  8 +
  9 +
  10 +INSERT INTO "users"."menu"("menu_id", "parent_id", "menu_name", "code", "access_code", "menu_type", "icon", "sort", "remark", "category", "parent_path", "is_publish", "enable_status", "link") VALUES (260, 174, '监控中心', 'BUSINESS_ALLIED-MANUFACTURING_MONITORING-CENTER', '', 'catalog', '', 5, '', '7', '38,174', 1, 0, NULL);
  11 +
  12 +INSERT INTO "users"."menu"("menu_id", "parent_id", "menu_name", "code", "access_code", "menu_type", "icon", "sort", "remark", "category", "parent_path", "is_publish", "enable_status", "link") VALUES (261, 260, '生产设备监控', 'BUSINESS_ALLIED-MANUFACTURING_MONITORING-CENTER_DEVICE-MONITOR', '', 'menu', '', 1, '', '7', '38,174,233,244', 1, 2, NULL);
  13 +
  14 +INSERT INTO "users"."menu"("menu_id", "parent_id", "menu_name", "code", "access_code", "menu_type", "icon", "sort", "remark", "category", "parent_path", "is_publish", "enable_status", "link") VALUES (262, 260, '生产管理看板', 'BUSINESS_ALLIED-MANUFACTURING_MONITORING-CENTER_PRODUCTION-MONITOR', '', 'menu', '', 2, '', '7', '38,174,260', 1, 2, NULL);
  15 +
  16 +INSERT INTO "users"."menu"("menu_id", "parent_id", "menu_name", "code", "access_code", "menu_type", "icon", "sort", "remark", "category", "parent_path", "is_publish", "enable_status", "link") VALUES (263, 224, '新增工时', 'BUSINESS_ALLIED-MANUFACTURING_PRODUCTION_MAN-HOUR_ADD', '', 'button', '', 1, '', '7', '38,174,223,224', 1, 2, NULL);
  17 +
  18 +INSERT INTO "users"."menu"("menu_id", "parent_id", "menu_name", "code", "access_code", "menu_type", "icon", "sort", "remark", "category", "parent_path", "is_publish", "enable_status", "link") VALUES (264, 174, '大屏看板', 'BUSINESS_ALLIED-MANUFACTURING_LARGE-SCREEN-SIGNAGE', '', 'catalog', '', 6, '', '7', '38,174', 1, 2, NULL);
  19 +
  20 +INSERT INTO "users"."menu"("menu_id", "parent_id", "menu_name", "code", "access_code", "menu_type", "icon", "sort", "remark", "category", "parent_path", "is_publish", "enable_status", "link") VALUES (265, 264, '生产管理看板', 'BUSINESS_ALLIED-MANUFACTURING_LARGE-SCREEN-SIGNAGE_PRODUCTION', '', 'menu', 'https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20220517/object/1652752760_w66QpzZTfxsmhbM5mmBrHjpytcydMNs2.png', 1, '', '7', '38,174,264', 1, 2, NULL);
  21 +
  22 +INSERT INTO "users"."menu"("menu_id", "parent_id", "menu_name", "code", "access_code", "menu_type", "icon", "sort", "remark", "category", "parent_path", "is_publish", "enable_status", "link") VALUES (266, 264, '设备监控看板', 'BUSINESS_ALLIED-MANUFACTURING_LARGE-SCREEN-SIGNAGE_DEVICE', '', 'menu', 'https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20220517/object/1652753144_XsBEXcRxJscRHCzQmxeseTAEQXTH7A7Z.png', 2, '', '7', '38,174,264', 1, 2, NULL);
@@ -18,11 +18,6 @@ import ( @@ -18,11 +18,6 @@ import (
18 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego" 18 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
19 ) 19 )
20 20
21 -//func init(){  
22 -// constant.Configurator = utils.BeegoAppConfigurator{}  
23 -// web.LoadAppConfig("ini","config/app.conf")  
24 -//}  
25 -  
26 func main() { 21 func main() {
27 defer func() { 22 defer func() {
28 if r := recover(); r != nil { 23 if r := recover(); r != nil {
@@ -21,6 +21,8 @@ type ProductGroupEmployeesDto struct { @@ -21,6 +21,8 @@ type ProductGroupEmployeesDto struct {
21 // 工作位置键值 (车间ID+'.'+生产线ID+'.'+工段ID) 21 // 工作位置键值 (车间ID+'.'+生产线ID+'.'+工段ID)
22 //WorkStationId string `json:"workStationId,omitempty"` 22 //WorkStationId string `json:"workStationId,omitempty"`
23 UserNamePinyin string `json:"pinyin"` 23 UserNamePinyin string `json:"pinyin"`
  24 + // 在线的
  25 + Online bool `json:"online"`
24 } 26 }
25 27
26 func NewProductGroupEmployeesDto(group *domain.ProductGroup) []*ProductGroupEmployeesDto { 28 func NewProductGroupEmployeesDto(group *domain.ProductGroup) []*ProductGroupEmployeesDto {
@@ -73,12 +75,14 @@ func (d *ProductGroupEmployeesDtos) LoadDto(groups ...*domain.ProductGroup) { @@ -73,12 +75,14 @@ func (d *ProductGroupEmployeesDtos) LoadDto(groups ...*domain.ProductGroup) {
73 75
74 func (d *ProductGroupEmployeesDtos) LoadDtoV2(list []*domain.ProductAttendanceRecord, mapGroupUser map[string]*domain.User, keyFunc func(int) string) { 76 func (d *ProductGroupEmployeesDtos) LoadDtoV2(list []*domain.ProductAttendanceRecord, mapGroupUser map[string]*domain.User, keyFunc func(int) string) {
75 var mapUser = make(map[int]int) 77 var mapUser = make(map[int]int)
  78 + // 打卡的用户
76 for _, v := range list { 79 for _, v := range list {
77 item := &ProductGroupEmployeesDto{} 80 item := &ProductGroupEmployeesDto{}
78 item.UserId = v.ProductWorker.UserId 81 item.UserId = v.ProductWorker.UserId
79 item.UserName = v.ProductWorker.UserName 82 item.UserName = v.ProductWorker.UserName
80 item.ProductGroupId = 0 83 item.ProductGroupId = 0
81 item.GroupName = "" 84 item.GroupName = ""
  85 + item.Online = true
82 if v, ok := mapGroupUser[keyFunc(item.UserId)]; ok { 86 if v, ok := mapGroupUser[keyFunc(item.UserId)]; ok {
83 item.GroupName = v.GroupName 87 item.GroupName = v.GroupName
84 item.ProductGroupId = v.GroupId 88 item.ProductGroupId = v.GroupId
@@ -89,9 +93,21 @@ func (d *ProductGroupEmployeesDtos) LoadDtoV2(list []*domain.ProductAttendanceRe @@ -89,9 +93,21 @@ func (d *ProductGroupEmployeesDtos) LoadDtoV2(list []*domain.ProductAttendanceRe
89 } 93 }
90 if _, ok := mapUser[item.UserId]; ok { 94 if _, ok := mapUser[item.UserId]; ok {
91 continue 95 continue
92 - } else {  
93 - mapUser[item.UserId] = item.UserId  
94 } 96 }
  97 + mapUser[item.UserId] = item.UserId
  98 + d.Append(item)
  99 + }
  100 + // 未打卡的用户
  101 + for _, v := range mapGroupUser {
  102 + if _, ok := mapUser[v.UserId]; ok {
  103 + continue
  104 + }
  105 + item := &ProductGroupEmployeesDto{}
  106 + item.UserId = v.UserId
  107 + item.UserName = v.UserName
  108 + item.ProductGroupId = v.GroupId
  109 + item.GroupName = v.GroupName
  110 + mapUser[item.UserId] = item.UserId
95 d.Append(item) 111 d.Append(item)
96 } 112 }
97 } 113 }
@@ -18,6 +18,8 @@ type SearchMaterialsQuery struct { @@ -18,6 +18,8 @@ type SearchMaterialsQuery struct {
18 LineId int `cname:"生产线ID" json:"lineId,omitempty"` 18 LineId int `cname:"生产线ID" json:"lineId,omitempty"`
19 // 工段ID 19 // 工段ID
20 SectionId int `json:"sectionId,omitempty"` 20 SectionId int `json:"sectionId,omitempty"`
  21 + // 智能称重标识 0:全部 1:是 2:否
  22 + IntelligentWeighingFlag int `cname:"智能称重标识" json:"intelligentWeighingFlag"`
21 } 23 }
22 24
23 func (listProductGroupQuery *SearchMaterialsQuery) Valid(validation *validation.Validation) { 25 func (listProductGroupQuery *SearchMaterialsQuery) Valid(validation *validation.Validation) {
@@ -5,7 +5,8 @@ import ( @@ -5,7 +5,8 @@ import (
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
6 ) 6 )
7 7
8 -var Configurator utils.Configurator = utils.EnvConfigurator{} //utils.NewConfig("ini","config/app_test.conf") 8 +//var Configurator utils.Configurator = utils.NewConfig("ini","config/app_test.conf")
  9 +var Configurator utils.Configurator = utils.EnvConfigurator{}
9 10
10 var SERVICE_NAME = "allied-creation-manufacture" 11 var SERVICE_NAME = "allied-creation-manufacture"
11 var SERVICE_ENV = "dev" 12 var SERVICE_ENV = "dev"
@@ -224,6 +224,17 @@ func (d *DeviceRunningRecordInfo) HourDeviceStatusDetail(endTime int) map[string @@ -224,6 +224,17 @@ func (d *DeviceRunningRecordInfo) HourDeviceStatusDetail(endTime int) map[string
224 on = append(on, s) 224 on = append(on, s)
225 break 225 break
226 case 3: 226 case 3:
  227 + if len(s) == 2 && s[1]-s[0] <= 5 {
  228 + last := len(on) - 1
  229 + if last >= 0 && len(on[last]) == 2 {
  230 + if on[last][1]+1 == s[0] { // [56,79] [80,80] => [56,80]
  231 + on[last][1] = s[1]
  232 + break
  233 + }
  234 + }
  235 + on = append(on, s)
  236 + break
  237 + }
227 off = append(off, s) 238 off = append(off, s)
228 break 239 break
229 } 240 }
@@ -86,6 +86,7 @@ func (controller *UnitConversionController) SearchMaterial() { @@ -86,6 +86,7 @@ func (controller *UnitConversionController) SearchMaterial() {
86 operateInfo := ParseOperateInfo(controller.BaseController) 86 operateInfo := ParseOperateInfo(controller.BaseController)
87 cmd.OrgId = operateInfo.OrgId 87 cmd.OrgId = operateInfo.OrgId
88 cmd.CompanyId = operateInfo.CompanyId 88 cmd.CompanyId = operateInfo.CompanyId
  89 + cmd.IntelligentWeighingFlag = 1
89 _, data, err := unitConversionService.SearchMaterial(ParseOperateInfo(controller.BaseController), cmd) 90 _, data, err := unitConversionService.SearchMaterial(ParseOperateInfo(controller.BaseController), cmd)
90 controller.Response(data, err) 91 controller.Response(data, err)
91 } 92 }