新增报表接口

yun-zuoyi
钮海涛 6 years ago
parent 4146126284
commit 5f3f973c3e

@ -35,8 +35,7 @@ public class ExportProject extends BaseAPS {
@Column(name="LINK_ID") @Column(name="LINK_ID")
@ApiParam(value ="数据连接对象") @ApiParam(value ="数据连接对象")
@FieldAnnotation(property = false) @FieldAnnotation(relation = "Link", notEmpty = true)
@JsonIgnore
private Long linkId; private Long linkId;
public DataLink getLink() { public DataLink getLink() {

@ -34,7 +34,7 @@ public class ImportProject extends BaseAPS {
@Column(name="LINK_ID") @Column(name="LINK_ID")
@ApiParam(value ="数据连接对象") @ApiParam(value ="数据连接对象")
@FieldAnnotation(property = false) @FieldAnnotation(relation = "Link", notEmpty = true)
private Long linkId; private Long linkId;
public DataLink getLink() { public DataLink getLink() {

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean; package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS; import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -27,17 +28,21 @@ import java.util.Date;
public class OvertimeCalendar extends BaseAPS { public class OvertimeCalendar extends BaseAPS {
@Column(name="RES_CODES") @Column(name="RES_CODES")
@ApiParam(value ="资源代码") @ApiParam(value ="资源代码")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.MULTI_OBJECT, typeName = "Resource", notEmpty = true)
private String resCodes; private String resCodes;
@Column(name="START") @Column(name="START")
@ApiParam(value ="开始时间") @ApiParam(value ="开始时间")
@FieldAnnotation(notEmpty = true)
private Date start; private Date start;
@Column(name="END") @Column(name="END")
@ApiParam(value ="结束时间") @ApiParam(value ="结束时间")
@FieldAnnotation(notEmpty = true)
private Date end; private Date end;
@Column(name="TYPE") @Column(name="TYPE")
@ApiParam(value ="类型") @ApiParam(value ="类型")
@FieldAnnotation(defaultValue = "ENABLE")
private ApsEnumUtil.CALENDAR_TYPE type; private ApsEnumUtil.CALENDAR_TYPE type;
} }

@ -52,7 +52,7 @@ public class DateDuration {
* 0 * 0
* @return * @return
*/ */
public boolean Valid() { public boolean valid() {
return this.bValid; return this.bValid;
} }
@ -124,7 +124,7 @@ public class DateDuration {
return strExtraString.toString(); return strExtraString.toString();
} }
public void Divide(double val) { public void divide(double val) {
if (val < PRECISION) { if (val < PRECISION) {
return; return;
} }
@ -165,7 +165,7 @@ public class DateDuration {
return; return;
} }
if (!ValueValid()) { if (!valueValid()) {
this.time = 0; this.time = 0;
this.rate = 0.0f; this.rate = 0.0f;
this.bValid = false; this.bValid = false;
@ -173,42 +173,35 @@ public class DateDuration {
} }
ArrayList<EV_STRING> lst = new ArrayList<EV_STRING>(); ArrayList<EV_STRING> lst = new ArrayList<EV_STRING>();
Decompound(lst); decompound(lst);
boolean oFlg = lst.size() == 1; boolean oFlg = lst.size() == 1;
for (EV_STRING evs : lst) { for (EV_STRING evs : lst) {
if (evs.type == EV_STRING_TYPE.EVS_GOOD) if (evs.type == EV_STRING_TYPE.EVS_GOOD) {
{ AbstractMap.SimpleEntry<Boolean, Integer> extraTime = transTimeEach(evs.value);
AbstractMap.SimpleEntry<Boolean, Integer> extraTime = TransTime_Each(evs.value); if (extraTime.getKey() || !oFlg) {
if (extraTime.getKey() || !oFlg)
{
this.time += extraTime.getValue(); this.time += extraTime.getValue();
} } else {
else
{
this.time += extraTime.getValue() * 1; this.time += extraTime.getValue() * 1;
} }
} }
else else {
{ AbstractMap.SimpleEntry<Boolean, Double> extraPer = transRateEach(evs.value);
AbstractMap.SimpleEntry<Boolean, Double> extraPer = TransRate_Each(evs.value); if (extraPer.getKey()) {
if (extraPer.getKey())
{
this.rate = extraPer.getValue(); this.rate = extraPer.getValue();
} }
} }
} }
if (this.time < 0) if (this.time < 0) {
{
this.time = 0; this.time = 0;
this.rate = 0.0f; this.rate = 0.0f;
this.bValid = false; this.bValid = false;
} }
} }
private boolean ValueValid() { private boolean valueValid() {
for (char ch : this.value.toCharArray()) { for (char ch : this.value.toCharArray()) {
if (ch <= 'z' && ch >= 'a') { if (ch <= 'z' && ch >= 'a') {
ch -= 32; ch -= 32;
@ -232,61 +225,46 @@ public class DateDuration {
|| ch == 'M' || ch == 'S' || ch == '+'||ch == '-'||ch == 'P'); || ch == 'M' || ch == 'S' || ch == '+'||ch == '-'||ch == 'P');
} }
private void Decompound(ArrayList<EV_STRING> lst) { private void decompound(ArrayList<EV_STRING> lst) {
int len = this.value.length(); int len = this.value.length();
int iStr = 0; int iStr = 0;
EV_STRING evs = new EV_STRING(); EV_STRING evs = new EV_STRING();
evs.type = EV_STRING_TYPE.EVS_GOOD; evs.type = EV_STRING_TYPE.EVS_GOOD;
while(iStr < len) while(iStr < len) {
{
char ch = this.value.charAt(iStr); char ch = this.value.charAt(iStr);
if (ch == '+') if (ch == '+') {
{
lst.add(evs.clone()); lst.add(evs.clone());
evs.value = ""; evs.value = "";
evs.type = EV_STRING_TYPE.EVS_GOOD; evs.type = EV_STRING_TYPE.EVS_GOOD;
iStr++; iStr++;
continue; continue;
} } else if (ch == '-') {
else if (ch == '-')
{
int iPre = iStr; int iPre = iStr;
if (iPre != 0) if (iPre != 0) {
{
iPre--; iPre--;
char cp = this.value.charAt(iPre); char cp = this.value.charAt(iPre);
if (!(cp == 'D' || cp == 'H' if (!(cp == 'D' || cp == 'H'
|| cp == 'M' || cp == 'S')) || cp == 'M' || cp == 'S')) {
{
evs.value = evs.value + 'S'; evs.value = evs.value + 'S';
} }
} }
} } else if (ch == 'P') {
else if (ch == 'P')
{
int iTempIndex = 0; int iTempIndex = 0;
StringBuffer temp1 = new StringBuffer(); StringBuffer temp1 = new StringBuffer();
StringBuffer temp2 = new StringBuffer(); StringBuffer temp2 = new StringBuffer();
int iTemp = evs.value.length() - 1; int iTemp = evs.value.length() - 1;
for (;iTemp >= 0;iTemp--) for (;iTemp >= 0;iTemp--) {
{
char cTemp = evs.value.charAt(iTemp); char cTemp = evs.value.charAt(iTemp);
if (cTemp == 'D' || cTemp == 'H' if (cTemp == 'D' || cTemp == 'H'
|| cTemp == 'M' || cTemp == 'S') || cTemp == 'M' || cTemp == 'S') {
{
iTempIndex++; iTempIndex++;
} } if (iTempIndex >= 2) {
if (iTempIndex >= 2)
{
temp1.insert(0,cTemp); temp1.insert(0,cTemp);
} } else {
else
{
temp2.insert(0,cTemp); temp2.insert(0,cTemp);
} }
} }
if (!temp1.toString().isEmpty()) if (!temp1.toString().isEmpty()) {
{
EV_STRING evs1 = new EV_STRING(); EV_STRING evs1 = new EV_STRING();
evs1.type = EV_STRING_TYPE.EVS_GOOD; evs1.type = EV_STRING_TYPE.EVS_GOOD;
evs1.value = temp1.toString(); evs1.value = temp1.toString();
@ -296,12 +274,10 @@ public class DateDuration {
evs.type = EV_STRING_TYPE.EVS_HAVE_P; evs.type = EV_STRING_TYPE.EVS_HAVE_P;
evs.value = evs.value + ch; evs.value = evs.value + ch;
iStr++; iStr++;
if (iStr != len) if (iStr != len) {
{
char cp = this.value.charAt(iStr); char cp = this.value.charAt(iStr);
if (cp == 'D' || cp == 'H' if (cp == 'D' || cp == 'H'
|| cp == 'M' || cp == 'S') || cp == 'M' || cp == 'S') {
{
evs.value = evs.value + cp; evs.value = evs.value + cp;
iStr++; iStr++;
} }
@ -315,13 +291,12 @@ public class DateDuration {
evs.value = evs.value + ch; evs.value = evs.value + ch;
iStr++; iStr++;
} }
if (!evs.value.isEmpty()) if (!evs.value.isEmpty()) {
{
lst.add(evs); lst.add(evs);
} }
} }
private AbstractMap.SimpleEntry<Boolean, Integer> TransTime_Each(String extraValue) { private AbstractMap.SimpleEntry<Boolean, Integer> transTimeEach(String extraValue) {
if (extraValue.isEmpty()) if (extraValue.isEmpty())
return new AbstractMap.SimpleEntry<Boolean, Integer>(false, 0); return new AbstractMap.SimpleEntry<Boolean, Integer>(false, 0);
@ -330,16 +305,13 @@ public class DateDuration {
boolean flg = false; boolean flg = false;
for (int i = 0; i < extraValue.length(); i++) { for (int i = 0; i < extraValue.length(); i++) {
char ch = extraValue.charAt(i); char ch = extraValue.charAt(i);
int rate = TimeUnit(ch); int rate = timeUnit(ch);
if (rate > 0) if (rate > 0) {
{
double iC = Double.parseDouble(temp.toString()); double iC = Double.parseDouble(temp.toString());
extraTime += (int)(iC*rate); extraTime += (int)(iC*rate);
temp.setLength(0); temp.setLength(0);
flg = true; flg = true;
} } else {
else
{
temp.append(ch); temp.append(ch);
} }
} }
@ -347,7 +319,7 @@ public class DateDuration {
extraTime += Double.parseDouble(temp.toString()); extraTime += Double.parseDouble(temp.toString());
return new AbstractMap.SimpleEntry<Boolean, Integer>(flg, extraTime); return new AbstractMap.SimpleEntry<Boolean, Integer>(flg, extraTime);
} }
private AbstractMap.SimpleEntry<Boolean, Double> TransRate_Each(String extraValue) { private AbstractMap.SimpleEntry<Boolean, Double> transRateEach(String extraValue) {
if (extraValue.isEmpty()) if (extraValue.isEmpty())
return new AbstractMap.SimpleEntry<Boolean, Double>(false, 0.0); return new AbstractMap.SimpleEntry<Boolean, Double>(false, 0.0);
@ -356,8 +328,7 @@ public class DateDuration {
boolean flg = false; boolean flg = false;
for (int i = 0; i < extraValue.length(); i++) { for (int i = 0; i < extraValue.length(); i++) {
char ch = extraValue.charAt(i); char ch = extraValue.charAt(i);
switch(ch) switch(ch) {
{
case 'D': extraPer = flg ? (1 / Double.parseDouble(temp.toString())) * 86400 : Double.parseDouble(temp.toString()) * 86400; return new AbstractMap.SimpleEntry<Boolean, Double>(true, extraPer); case 'D': extraPer = flg ? (1 / Double.parseDouble(temp.toString())) * 86400 : Double.parseDouble(temp.toString()) * 86400; return new AbstractMap.SimpleEntry<Boolean, Double>(true, extraPer);
case 'H': extraPer = flg ? (1 / Double.parseDouble(temp.toString())) * 3600: Double.parseDouble(temp.toString()) * 3600; return new AbstractMap.SimpleEntry<Boolean, Double>(true, extraPer); case 'H': extraPer = flg ? (1 / Double.parseDouble(temp.toString())) * 3600: Double.parseDouble(temp.toString()) * 3600; return new AbstractMap.SimpleEntry<Boolean, Double>(true, extraPer);
case 'M': extraPer = flg ? (1 / Double.parseDouble(temp.toString())) * 60 : Double.parseDouble(temp.toString()) * 60; return new AbstractMap.SimpleEntry<Boolean, Double>(true, extraPer); case 'M': extraPer = flg ? (1 / Double.parseDouble(temp.toString())) * 60 : Double.parseDouble(temp.toString()) * 60; return new AbstractMap.SimpleEntry<Boolean, Double>(true, extraPer);
@ -366,12 +337,11 @@ public class DateDuration {
default : temp.append(ch); default : temp.append(ch);
} }
} }
return new AbstractMap.SimpleEntry<Boolean, Double>(true, extraPer); return new AbstractMap.SimpleEntry<>(true, extraPer);
} }
private int TimeUnit(char ch) { private int timeUnit(char ch) {
switch(ch) switch(ch) {
{
case 'D': return 86400; case 'D': return 86400;
case 'H': return 3600; case 'H': return 3600;
case 'M': return 60; case 'M': return 60;

@ -1,11 +1,20 @@
package cn.estsh.i3plus.pojo.aps.model; package cn.estsh.i3plus.pojo.aps.model;
import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.base.common.Pager;
import io.swagger.annotations.Api;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-11-22
* @Modify:
**/
@Data @Data
@Api("表格分页查询参数")
public class APSPager extends Pager { public class APSPager extends Pager {
public static class SortData { public static class SortData {
// 排序对象 // 排序对象

@ -0,0 +1,25 @@
package cn.estsh.i3plus.pojo.aps.model;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
import io.swagger.annotations.Api;
import lombok.Data;
import java.util.Date;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-11-22
* @Modify:
**/
@Data
@Api("报表分页查询参数")
public class ReportPager extends Pager {
private String filter; // 物料筛选条件
private Date begin; // 统计开始时间
private Date end; // 统计结束时间
private ApsEnumUtil.MATERIAL_REPORT_TYPE type;
private ApsEnumUtil.REPORT_TIME_SPAN span; // 统计时间间隔
}

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Class name="ExportProject"> <Class name="ExportProject">
<Relation field="Link" name="DataLink" type="MULTI_TO_ONE"> <Relation field="Link" name="DataLink" type="MULTI_TO_ONE" owner="false">
</Relation> </Relation>
<Relation field="Details" name="ExportDetail" reverse="Project" type="ONE_TO_MULTI" owner="true"> <Relation field="Details" name="ExportDetail" reverse="Project" type="ONE_TO_MULTI" owner="true">
</Relation> </Relation>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Class name="ImportProject"> <Class name="ImportProject">
<Relation field="Link" name="DataLink" type="MULTI_TO_ONE"> <Relation field="Link" name="DataLink" type="MULTI_TO_ONE" owner="false">
</Relation> </Relation>
<Relation field="Details" name="ImportDetail" reverse="Project" type="ONE_TO_MULTI" owner="true"> <Relation field="Details" name="ImportDetail" reverse="Project" type="ONE_TO_MULTI" owner="true">
</Relation> </Relation>

@ -80,6 +80,61 @@ public class ApsEnumUtil {
} }
/** /**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum MATERIAL_REPORT_TYPE {
PRODUCE("PRODUCE", "生产"),
PURCHASE("PURCHASE", "采购"),
INVENTORY("INVENTORY", "库存");
private String value;
private String description;
MATERIAL_REPORT_TYPE(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum REPORT_TIME_SPAN {
ONE_HOUR("ONE_HOUR", "1小时"),
EIGHT_HOUR("EIGHT_HOUR", "8小时"),
TWELVE_HOUR("TWELVE_HOUR", "12小时"),
ONE_DAY("ONE_DAY", "一天"),
ONE_WEEK("ONE_WEEK", "一周"),
ONE_MONTH("ONE_MONTH", "一月");
private String value;
private String description;
REPORT_TIME_SPAN(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
}
/**
* *
*/ */
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
@ -618,7 +673,6 @@ public class ApsEnumUtil {
MIN_OPERATION_REMAIN_TIME("MIN_OPERATION_REMAIN_TIME", "最小工序宽裕时间"), MIN_OPERATION_REMAIN_TIME("MIN_OPERATION_REMAIN_TIME", "最小工序宽裕时间"),
WORK_LET("WORK_LET", "工作最晚结束时刻"), WORK_LET("WORK_LET", "工作最晚结束时刻"),
WORK_EST("WORK_EST", "工作最早开始时刻"), WORK_EST("WORK_EST", "工作最早开始时刻"),
INVENTORY_RELA("INVENTORY_RELA", "订单物品库存量相对值"),
FIRST_WORK_BEGIN("FIRST_WORK_BEGIN", "订单首工作上次开始时刻"), FIRST_WORK_BEGIN("FIRST_WORK_BEGIN", "订单首工作上次开始时刻"),
HAVE_HIGH_WORK("HAVE_HIGH_WORK", "订单中含有高级别工作"), HAVE_HIGH_WORK("HAVE_HIGH_WORK", "订单中含有高级别工作"),
WORK_RESOURCE_SIZE("WORK_RESOURCE_SIZE", "工作的可用资源数"), WORK_RESOURCE_SIZE("WORK_RESOURCE_SIZE", "工作的可用资源数"),

Loading…
Cancel
Save