Merge remote-tracking branch 'origin/master'
commit
a165813130
@ -0,0 +1,53 @@
|
||||
package com.op.device.config;
|
||||
|
||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
|
||||
import com.op.common.core.domain.R;
|
||||
import com.op.common.datasource.creator.DynamicDatasourceCreator;
|
||||
import com.op.system.api.RemoteUserService;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 初始化动态数据源
|
||||
*
|
||||
* @ClassName: DynamicDatasource
|
||||
* @Description: TODO
|
||||
* @author shichangzhou
|
||||
* @date 2023年4月19日 下午1:01:30
|
||||
*/
|
||||
@Component
|
||||
public class DynamicDatasource {
|
||||
|
||||
@Resource
|
||||
private DynamicDatasourceCreator dynamicDatasourceCreator;
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// 加载sf-cloud库的sys_datasource
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserId(1L);
|
||||
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
||||
List<Map<String, String>> dateSources = dateSources0.getData();
|
||||
for (Map<String, String> dateSource : dateSources) {
|
||||
DataSourceProperty sdp = new DataSourceProperty();
|
||||
sdp.setUrl(dateSource.get("url"));
|
||||
sdp.setUsername(dateSource.get("userName"));
|
||||
sdp.setPassword(dateSource.get("password"));
|
||||
sdp.setDriverClassName(dateSource.get("driveClassName"));
|
||||
sdp.setPoolName(dateSource.get("poolName"));// 这是数据源的key
|
||||
sdp.setLazy(false);
|
||||
dynamicDatasourceCreator.createDynamicDataSource(sdp);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
package com.op.mes.domain;
|
||||
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 小时产量
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public class MesHourReport extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String productCode;//产品编码
|
||||
private String productName;//产品名称
|
||||
private String quantity;//数量
|
||||
private String unit;//单位
|
||||
private String hourName;
|
||||
private String productDateStart;
|
||||
private String productDateEnd;
|
||||
private String ymdh;
|
||||
private String equCode;
|
||||
private String equName;
|
||||
private String orderCode;
|
||||
private String workorderCode;
|
||||
private List<String> hourNames;
|
||||
private String equCodeHour;
|
||||
|
||||
public String getEquCodeHour() {
|
||||
return equCodeHour;
|
||||
}
|
||||
|
||||
public void setEquCodeHour(String equCodeHour) {
|
||||
this.equCodeHour = equCodeHour;
|
||||
}
|
||||
|
||||
public List<String> getHourNames() {
|
||||
return hourNames;
|
||||
}
|
||||
|
||||
public void setHourNames(List<String> hourNames) {
|
||||
this.hourNames = hourNames;
|
||||
}
|
||||
|
||||
public String getOrderCode() {
|
||||
return orderCode;
|
||||
}
|
||||
|
||||
public void setOrderCode(String orderCode) {
|
||||
this.orderCode = orderCode;
|
||||
}
|
||||
|
||||
public String getWorkorderCode() {
|
||||
return workorderCode;
|
||||
}
|
||||
|
||||
public void setWorkorderCode(String workorderCode) {
|
||||
this.workorderCode = workorderCode;
|
||||
}
|
||||
|
||||
public String getYmdh() {
|
||||
return ymdh;
|
||||
}
|
||||
|
||||
public void setYmdh(String ymdh) {
|
||||
this.ymdh = ymdh;
|
||||
}
|
||||
|
||||
public String getEquCode() {
|
||||
return equCode;
|
||||
}
|
||||
|
||||
public void setEquCode(String equCode) {
|
||||
this.equCode = equCode;
|
||||
}
|
||||
|
||||
public String getEquName() {
|
||||
return equName;
|
||||
}
|
||||
|
||||
public void setEquName(String equName) {
|
||||
this.equName = equName;
|
||||
}
|
||||
|
||||
public String getProductDateStart() {
|
||||
return productDateStart;
|
||||
}
|
||||
|
||||
public void setProductDateStart(String productDateStart) {
|
||||
this.productDateStart = productDateStart;
|
||||
}
|
||||
|
||||
public String getProductDateEnd() {
|
||||
return productDateEnd;
|
||||
}
|
||||
|
||||
public void setProductDateEnd(String productDateEnd) {
|
||||
this.productDateEnd = productDateEnd;
|
||||
}
|
||||
|
||||
public String getProductCode() {
|
||||
return productCode;
|
||||
}
|
||||
|
||||
public void setProductCode(String productCode) {
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(String quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getHourName() {
|
||||
return hourName;
|
||||
}
|
||||
|
||||
public void setHourName(String hourName) {
|
||||
this.hourName = hourName;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue