增加首页卡片的布局设置字段layoutConfig;lincense去掉原版文字
| | |
| | | param.put("detail", userInfo.getDetail()); |
| | | try { |
| | | TokenInfo accessToken = SecureUtil.createJWT(param, "audience", "issuser", "access_token"); |
| | | return authInfo.set("tenant_id", user.getTenantId()).set("user_id", Func.toStr(user.getId())).set("dept_id", user.getDeptId()).set("post_id", user.getPostId()).set("role_id", user.getRoleId()).set("oauth_id", userInfo.getOauthId()).set("account", user.getAccount()).set("user_name", user.getAccount()).set("nick_name", user.getRealName()).set("role_name", Func.join(userInfo.getRoles())).set("avatar", Func.toStr(user.getAvatar(), "")).set("access_token", accessToken.getToken()).set(RefreshTokenGranter.GRANT_TYPE, createRefreshToken(userInfo).getToken()).set("token_type", "bearer").set("expires_in", Integer.valueOf(accessToken.getExpire())).set("detail", userInfo.getDetail()).set("license", "powered by bladex"); |
| | | return authInfo.set("tenant_id", user.getTenantId()).set("user_id", Func.toStr(user.getId())).set("dept_id", user.getDeptId()).set("post_id", user.getPostId()).set("role_id", user.getRoleId()).set("oauth_id", userInfo.getOauthId()).set("account", user.getAccount()).set("user_name", user.getAccount()).set("nick_name", user.getRealName()).set("role_name", Func.join(userInfo.getRoles())).set("avatar", Func.toStr(user.getAvatar(), "")).set("access_token", accessToken.getToken()).set(RefreshTokenGranter.GRANT_TYPE, createRefreshToken(userInfo).getToken()).set("token_type", "bearer").set("expires_in", Integer.valueOf(accessToken.getExpire())).set("detail", userInfo.getDetail()).set("license", "powered by qianwen"); |
| | | } catch (Exception ex) { |
| | | return authInfo.set("error_code", 401).set("error_description", ex.getMessage()); |
| | | } |
| | |
| | | @GetResource({"/listDatapointsByWorkstationId"}) |
| | | @ApiOperation("æ ¹æ®å·¥ä½idè·åæ°æ®ç¹") |
| | | public R<WorkstationDatapointsVO> listDatapointsByWorkstationId(@RequestParam Long workstationId) { |
| | | WorkstationDatapointsVO v = new WorkstationDatapointsVO(); |
| | | v.setDpHead("myhead"); |
| | | //return R.data(v); |
| | | return R.data(workstationDatapointsService.getDatapoints(workstationId)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("ä¿å工使°æ®ç¹é
ç½®") |
| | | public R<Boolean> saveDatapoints(@RequestBody WorkstationDatapointsSubmitVO datapoints) { |
| | | //return R.data(true); |
| | | |
| | | try { |
| | | workstationDatapointsService.submit(datapoints); |
| | | }catch(Exception e) { |
| | | return R.data(false); |
| | | //R.fail(null). |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | return R.data(true); |
| | | } |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.nio.charset.Charset; |
| | | import java.util.List; |
| | | |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | | import com.qianwen.smartman.common.mqtt.MqttMessageSender; |
| | | import com.qianwen.smartman.modules.cps.entity.CollectDeviceType; |
| | | import com.qianwen.smartman.modules.cps.entity.WorkstationAppMapping; |
| | | import com.qianwen.smartman.modules.cps.entity.Workstation; |
| | | import com.qianwen.smartman.modules.cps.entity.WorkstationDatapoints; |
| | | import com.qianwen.smartman.modules.cps.mapper.CollectDeviceTypeMapper; |
| | | import com.qianwen.smartman.modules.cps.mapper.WorkstationAppMappingMapper; |
| | | import com.qianwen.smartman.modules.cps.mapper.WorkstationDatapointsMapper; |
| | | import com.qianwen.smartman.modules.cps.mapper.WorkstationMapper; |
| | | import com.qianwen.smartman.modules.cps.vo.WorkstationDatapointsSubmitVO; |
| | | import com.qianwen.smartman.modules.cps.vo.WorkstationDatapointsVO; |
| | | |
| | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | @Autowired |
| | | private CollectDeviceTypeMapper typeMapper; |
| | | |
| | | //@Autowired |
| | | //private JdbcTemplate jdbcTemplate; |
| | | |
| | | @Autowired |
| | | private WorkstationAppMappingMapper mpmapper; |
| | | |
| | | @Autowired |
| | | private MqttMessageSender mqttSender; |
| | | |
| | | private final String WORKSTATION_APP_MAPPING_CHANGED_TOPIC = "mdc/workstation_app_mapping_changed"; |
| | | @Autowired |
| | | private WorkstationMapper workstationMapper; |
| | | /** |
| | | * mqtt topicï¼ç¨äºéç¥collectåºç¨ï¼æ°æ®ç¹æ¹å |
| | | */ |
| | | private final String WORKSTATION_DATAPOINT_CHANGED_TOPIC = "mdc/workstation_datapoint_changed"; |
| | | /** |
| | | * æ°å¢æè
ä¿®æ¹å·¥ä½ç¹ä½é
ç½® |
| | | * @param tplVO |
| | |
| | | @Transactional |
| | | public void submit(WorkstationDatapointsSubmitVO dpVO) { |
| | | |
| | | |
| | | Workstation usingWorkstation = appIdUsingWorkstation(dpVO.getAppId(),dpVO.getWorkstationId()); |
| | | if(usingWorkstation != null) { |
| | | //appIdè¢«ä½¿ç¨ |
| | | String err = "åºç¨ID被å ç¨ï¼å·¥ä½åç§°+ç¼å·:"+usingWorkstation.getName()+"-"+usingWorkstation.getCode(); |
| | | throw new ServiceException(err); |
| | | } |
| | | |
| | | WorkstationDatapoints dp = this.baseMapper.selectOne(Wrappers.<WorkstationDatapoints>lambdaQuery().eq(WorkstationDatapoints::getWorkstationId, dpVO.getWorkstationId())); |
| | | |
| | | if (dp == null) { |
| | | //æ°å¢ |
| | | dp = new WorkstationDatapoints(); |
| | |
| | | |
| | | saveOrUpdate(dp); |
| | | |
| | | /* |
| | | WorkstationAppMapping appMap = mpmapper.selectById(dpVO.getWorkstationId()); |
| | | if(appMap == null) { |
| | | appMap = new WorkstationAppMapping(); |
| | |
| | | }else { |
| | | appMap.setAppId(dpVO.getAppId()); |
| | | mpmapper.updateById(appMap); |
| | | } |
| | | }*/ |
| | | |
| | | mqttSender.sendMessage(WORKSTATION_APP_MAPPING_CHANGED_TOPIC, dpVO.getWorkstationId()+""); |
| | | //åéåæ´æ¶æ¯ |
| | | JSONObject payloadObj = new JSONObject(); |
| | | payloadObj.put("appId", dpVO.getAppId()); |
| | | payloadObj.put("workstationId", dpVO.getWorkstationId()); |
| | | mqttSender.sendMessage(WORKSTATION_DATAPOINT_CHANGED_TOPIC, payloadObj.toJSONString()); |
| | | } |
| | | |
| | | /** |
| | | * appIdæ¯å¦è¢«å
¶ä»å·¥ä½ä½¿ç¨ï¼å¦æä½¿ç¨è¿å使ç¨ç工使°æ® |
| | | * @param appId |
| | | * @param workstationId |
| | | * @return 使ç¨è¯¥appIdçå·¥ä½ |
| | | */ |
| | | Workstation appIdUsingWorkstation(String appId,long workstationId) { |
| | | //long cnt = baseMapper.selectCount(Wrappers.<WorkstationDatapoints>lambdaQuery().ne(WorkstationDatapoints::getWorkstationId, workstationId).eq(WorkstationDatapoints::getAppId, appId)); |
| | | //return cnt > 0; |
| | | List<WorkstationDatapoints> dpList = baseMapper.selectList(Wrappers.<WorkstationDatapoints>lambdaQuery().ne(WorkstationDatapoints::getWorkstationId, workstationId).eq(WorkstationDatapoints::getAppId, appId)); |
| | | |
| | | if(dpList.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | Workstation ws = workstationMapper.selectById(dpList.get(0).getWorkstationId()); |
| | | return ws; |
| | | } |
| | | /** |
| | | * è·å工使°æ®ç¹é
ç½® |
| | | * @param workstationId |
| | |
| | | import com.qianwen.smartman.modules.cps.convert.WorkstationConvert; |
| | | import com.qianwen.smartman.modules.cps.convert.WorkstationWorkbenchConvert; |
| | | import com.qianwen.smartman.modules.cps.dto.CodeMapDTO; |
| | | import com.qianwen.smartman.modules.cps.dto.WorkstationCreateMessageDTO; |
| | | import com.qianwen.smartman.modules.cps.dto.WorkstationRealTimeStatusDTO; |
| | | import com.qianwen.smartman.modules.cps.dto.WorkstationWcsDmpDTO; |
| | | import com.qianwen.smartman.modules.cps.entity.CommonGroup; |
| | |
| | | private final Integer FTP_CORRELATION_DIRECTORY = 1; |
| | | private final Integer FTP_SAME_DIRECTORY = 2; |
| | | |
| | | /* |
| | | public WorkstationServiceImpl(final IMachineService machineService, final IWorkstationOfMachineService workstationOfMachineService, final IWorkstationWcsService workstationWcsService, final ICommonGroupOfItemService commonGroupOfItemService, final ICommonGroupService commonGroupService, final ICalendarService calendarService, final WorkstationMapper workstationMapper, final OssBuilder ossBuilder, final IDmpVariablesService dmpVariablesService, final ITransferDirectoryService transferDirectoryService, final ITransferDirectoryGroupService transferDirectoryGroupService, final IWorkstationWorkbenchService workbenchService, final IDncWsRelationTdService wsRelationTdService, final IDncFixedSpaceService dncFixedSpaceService,final IWorkstationDynamicCollectService dynamicCollectService) { |
| | | this.machineService = machineService; |
| | | this.workstationOfMachineService = workstationOfMachineService; |
| | | this.workstationWcsService = workstationWcsService; |
| | | this.commonGroupOfItemService = commonGroupOfItemService; |
| | | this.commonGroupService = commonGroupService; |
| | | this.calendarService = calendarService; |
| | | this.workstationMapper = workstationMapper; |
| | | this.ossBuilder = ossBuilder; |
| | | this.dmpVariablesService = dmpVariablesService; |
| | | this.transferDirectoryService = transferDirectoryService; |
| | | this.transferDirectoryGroupService = transferDirectoryGroupService; |
| | | this.workbenchService = workbenchService; |
| | | this.wsRelationTdService = wsRelationTdService; |
| | | this.dncFixedSpaceService = dncFixedSpaceService; |
| | | //this.workstationProducer = workstationProducer; |
| | | this.dynamicCollectService = dynamicCollectService; |
| | | } |
| | | */ |
| | | |
| | | public static Long getTimeDifference(LocalDateTime startTime, LocalDateTime endTime) { |
| | | if (Func.isEmpty(startTime)) { |
| | |
| | | |
| | | @ApiModel(value = "WorkbenchCard", description = "å·¥ä½å°å¡ç") |
| | | @TableName("blade_workbench_card") |
| | | |
| | | public class WorkbenchCard extends TenantEntity { |
| | | private static final long serialVersionUID = 1; |
| | | @ApiModelProperty("å·¥ä½å°ID") |
| | |
| | | private String apiResource; |
| | | @ApiModelProperty("ææ¬å
容") |
| | | private String textContent; |
| | | |
| | | @ApiModelProperty("å¸å±è®¾ç½®") |
| | | private String layoutConfig; |
| | | public void setWorkbenchId(final Long workbenchId) { |
| | | this.workbenchId = workbenchId; |
| | | } |
| | |
| | | public String toString() { |
| | | return "WorkbenchCard(workbenchId=" + getWorkbenchId() + ", cardLength=" + getCardLength() + ", cardWide=" + getCardWide() + ", xCoordinate=" + getXCoordinate() + ", yCoordinate=" + getYCoordinate() + ", cardKey=" + getCardKey() + ", apiResource=" + getApiResource() + ", textContent=" + getTextContent() + ")"; |
| | | } |
| | | |
| | | /* |
| | | public boolean equals(final Object o) { |
| | | if (o == this) { |
| | | return true; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | */ |
| | | protected boolean canEqual(final Object other) { |
| | | return other instanceof WorkbenchCard; |
| | | } |
| | | |
| | | /* |
| | | public int hashCode() { |
| | | int result = super.hashCode(); |
| | | Object $workbenchId = getWorkbenchId(); |
| | |
| | | Object $textContent = getTextContent(); |
| | | return (result8 * 59) + ($textContent == null ? 43 : $textContent.hashCode()); |
| | | } |
| | | |
| | | */ |
| | | public Long getWorkbenchId() { |
| | | return this.workbenchId; |
| | | } |
| | |
| | | public String getTextContent() { |
| | | return this.textContent; |
| | | } |
| | | |
| | | public String getLayoutConfig() { |
| | | return layoutConfig; |
| | | } |
| | | |
| | | public void setLayoutConfig(String layoutConfig) { |
| | | this.layoutConfig = layoutConfig; |
| | | } |
| | | |
| | | public String getxCoordinate() { |
| | | return xCoordinate; |
| | | } |
| | | |
| | | public void setxCoordinate(String xCoordinate) { |
| | | this.xCoordinate = xCoordinate; |
| | | } |
| | | |
| | | public String getyCoordinate() { |
| | | return yCoordinate; |
| | | } |
| | | |
| | | public void setyCoordinate(String yCoordinate) { |
| | | this.yCoordinate = yCoordinate; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("ææ¬å
容") |
| | | private String textContent; |
| | | |
| | | @ApiModelProperty("å¸å±è®¾ç½®") |
| | | private String layoutConfig; |
| | | |
| | | public void setWorkbenchId(final Long workbenchId) { |
| | | this.workbenchId = workbenchId; |
| | | } |
| | |
| | | public void setTextContent(final String textContent) { |
| | | this.textContent = textContent; |
| | | } |
| | | |
| | | /* |
| | | public boolean equals(final Object o) { |
| | | if (o == this) { |
| | | return true; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | */ |
| | | protected boolean canEqual(final Object other) { |
| | | return other instanceof WorkbenchCardAddVO; |
| | | } |
| | | |
| | | /* |
| | | public int hashCode() { |
| | | |
| | | Object $workbenchId = getWorkbenchId(); |
| | | int result = (1 * 59) + ($workbenchId == null ? 43 : $workbenchId.hashCode()); |
| | | Object $cardLength = getCardLength(); |
| | |
| | | Object $textContent = getTextContent(); |
| | | return (result7 * 59) + ($textContent == null ? 43 : $textContent.hashCode()); |
| | | } |
| | | */ |
| | | |
| | | public String toString() { |
| | | return "WorkbenchCardAddVO(workbenchId=" + getWorkbenchId() + ", cardLength=" + getCardLength() + ", cardWide=" + getCardWide() + ", xCoordinate=" + getXCoordinate() + ", yCoordinate=" + getYCoordinate() + ", cardKey=" + getCardKey() + ", apiResource=" + getApiResource() + ", textContent=" + getTextContent() + ")"; |
| | |
| | | public String getTextContent() { |
| | | return this.textContent; |
| | | } |
| | | |
| | | public String getxCoordinate() { |
| | | return xCoordinate; |
| | | } |
| | | |
| | | public void setxCoordinate(String xCoordinate) { |
| | | this.xCoordinate = xCoordinate; |
| | | } |
| | | |
| | | public String getyCoordinate() { |
| | | return yCoordinate; |
| | | } |
| | | |
| | | public void setyCoordinate(String yCoordinate) { |
| | | this.yCoordinate = yCoordinate; |
| | | } |
| | | |
| | | public String getLayoutConfig() { |
| | | return layoutConfig; |
| | | } |
| | | |
| | | public void setLayoutConfig(String layoutConfig) { |
| | | this.layoutConfig = layoutConfig; |
| | | } |
| | | |
| | | } |
| | |
| | | private String apiResource; |
| | | @ApiModelProperty("ææ¬å
容") |
| | | private String textContent; |
| | | |
| | | @ApiModelProperty("å¸å±è®¾ç½®") |
| | | private String layoutConfig; |
| | | public void setWorkbenchId(final Long workbenchId) { |
| | | this.workbenchId = workbenchId; |
| | | } |
| | |
| | | public void setTextContent(final String textContent) { |
| | | this.textContent = textContent; |
| | | } |
| | | |
| | | /* |
| | | public boolean equals(final Object o) { |
| | | if (o == this) { |
| | | return true; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | */ |
| | | protected boolean canEqual(final Object other) { |
| | | return other instanceof WorkbenchCardVO; |
| | | } |
| | | |
| | | /* |
| | | public int hashCode() { |
| | | Object $workbenchId = getWorkbenchId(); |
| | | int result = (1 * 59) + ($workbenchId == null ? 43 : $workbenchId.hashCode()); |
| | |
| | | Object $textContent = getTextContent(); |
| | | return (result7 * 59) + ($textContent == null ? 43 : $textContent.hashCode()); |
| | | } |
| | | */ |
| | | |
| | | public String toString() { |
| | | return "WorkbenchCardVO(workbenchId=" + getWorkbenchId() + ", cardLength=" + getCardLength() + ", cardWide=" + getCardWide() + ", xCoordinate=" + getXCoordinate() + ", yCoordinate=" + getYCoordinate() + ", cardKey=" + getCardKey() + ", apiResource=" + getApiResource() + ", textContent=" + getTextContent() + ")"; |
| | |
| | | public String getTextContent() { |
| | | return this.textContent; |
| | | } |
| | | |
| | | public String getxCoordinate() { |
| | | return xCoordinate; |
| | | } |
| | | |
| | | public void setxCoordinate(String xCoordinate) { |
| | | this.xCoordinate = xCoordinate; |
| | | } |
| | | |
| | | public String getyCoordinate() { |
| | | return yCoordinate; |
| | | } |
| | | |
| | | public void setyCoordinate(String yCoordinate) { |
| | | this.yCoordinate = yCoordinate; |
| | | } |
| | | |
| | | public String getLayoutConfig() { |
| | | return layoutConfig; |
| | | } |
| | | |
| | | public void setLayoutConfig(String layoutConfig) { |
| | | this.layoutConfig = layoutConfig; |
| | | } |
| | | |
| | | } |