作者 yangfu

fix: 配置读取修改

deployment: db脚本更新

fix: 设备状态查询修改

fix: 设备状态查询修改

fix: 设备状态查询修改

fix: 班组成员搜索修改,单位换算列表
POSTGRESQL_DB_NAME = allied_creation_test
POSTGRESQL_HOST = 114.55.200.59
POSTGRESQL_PORT = 31543
POSTGRESQL_USER = postgres
POSTGRESQL_PASSWORD = eagle1010
DISABLE_SQL_GENERATE_COMMENT = false
SERVICE_ENV = test
HTTP_PORT = 8081
ENABLE_KAFKA_LOG11 = true
HTTPS_PORT = 8143
ALLIED_CREATION_USER_HOST = http://allied-creation-user-test.fjmaimaimai.com
MANUFACTURE_DEFAULT_COMPANYID = 23
MANUFACTURE_DEFAULT_ORGID = 487
MANUFACTURE_DEFAULT_WORKSHOPID = 28
... ...
... ... @@ -5,3 +5,18 @@ ALTER TABLE manufacture.product_calendar ADD COLUMN break_time_periods jsonb;
-- 表product_attendance_record 增加字段 product_date
alter table manufacture.product_attendance_record add COLUMN product_date timestamptz;
update manufacture.product_attendance_record set product_date = sign_in where product_date is null ;
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);
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);
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);
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);
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);
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);
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);
\ No newline at end of file
... ...
... ... @@ -18,11 +18,6 @@ import (
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
)
//func init(){
// constant.Configurator = utils.BeegoAppConfigurator{}
// web.LoadAppConfig("ini","config/app.conf")
//}
func main() {
defer func() {
if r := recover(); r != nil {
... ...
... ... @@ -21,6 +21,8 @@ type ProductGroupEmployeesDto struct {
// 工作位置键值 (车间ID+'.'+生产线ID+'.'+工段ID)
//WorkStationId string `json:"workStationId,omitempty"`
UserNamePinyin string `json:"pinyin"`
// 在线的
Online bool `json:"online"`
}
func NewProductGroupEmployeesDto(group *domain.ProductGroup) []*ProductGroupEmployeesDto {
... ... @@ -73,12 +75,14 @@ func (d *ProductGroupEmployeesDtos) LoadDto(groups ...*domain.ProductGroup) {
func (d *ProductGroupEmployeesDtos) LoadDtoV2(list []*domain.ProductAttendanceRecord, mapGroupUser map[string]*domain.User, keyFunc func(int) string) {
var mapUser = make(map[int]int)
// 打卡的用户
for _, v := range list {
item := &ProductGroupEmployeesDto{}
item.UserId = v.ProductWorker.UserId
item.UserName = v.ProductWorker.UserName
item.ProductGroupId = 0
item.GroupName = ""
item.Online = true
if v, ok := mapGroupUser[keyFunc(item.UserId)]; ok {
item.GroupName = v.GroupName
item.ProductGroupId = v.GroupId
... ... @@ -89,9 +93,21 @@ func (d *ProductGroupEmployeesDtos) LoadDtoV2(list []*domain.ProductAttendanceRe
}
if _, ok := mapUser[item.UserId]; ok {
continue
} else {
}
mapUser[item.UserId] = item.UserId
d.Append(item)
}
// 未打卡的用户
for _, v := range mapGroupUser {
if _, ok := mapUser[v.UserId]; ok {
continue
}
item := &ProductGroupEmployeesDto{}
item.UserId = v.UserId
item.UserName = v.UserName
item.ProductGroupId = v.GroupId
item.GroupName = v.GroupName
mapUser[item.UserId] = item.UserId
d.Append(item)
}
}
... ...
... ... @@ -18,6 +18,8 @@ type SearchMaterialsQuery struct {
LineId int `cname:"生产线ID" json:"lineId,omitempty"`
// 工段ID
SectionId int `json:"sectionId,omitempty"`
// 智能称重标识 0:全部 1:是 2:否
IntelligentWeighingFlag int `cname:"智能称重标识" json:"intelligentWeighingFlag"`
}
func (listProductGroupQuery *SearchMaterialsQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -5,7 +5,8 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
)
var Configurator utils.Configurator = utils.EnvConfigurator{} //utils.NewConfig("ini","config/app_test.conf")
//var Configurator utils.Configurator = utils.NewConfig("ini","config/app_test.conf")
var Configurator utils.Configurator = utils.EnvConfigurator{}
var SERVICE_NAME = "allied-creation-manufacture"
var SERVICE_ENV = "dev"
... ...
... ... @@ -224,6 +224,17 @@ func (d *DeviceRunningRecordInfo) HourDeviceStatusDetail(endTime int) map[string
on = append(on, s)
break
case 3:
if len(s) == 2 && s[1]-s[0] <= 5 {
last := len(on) - 1
if last >= 0 && len(on[last]) == 2 {
if on[last][1]+1 == s[0] { // [56,79] [80,80] => [56,80]
on[last][1] = s[1]
break
}
}
on = append(on, s)
break
}
off = append(off, s)
break
}
... ...
... ... @@ -86,6 +86,7 @@ func (controller *UnitConversionController) SearchMaterial() {
operateInfo := ParseOperateInfo(controller.BaseController)
cmd.OrgId = operateInfo.OrgId
cmd.CompanyId = operateInfo.CompanyId
cmd.IntelligentWeighingFlag = 1
_, data, err := unitConversionService.SearchMaterial(ParseOperateInfo(controller.BaseController), cmd)
controller.Response(data, err)
}
... ...