Commit 4af74697 by 高晓磊

运输公司备案&调价申请趋势图

parent 806b63c9
...@@ -24,17 +24,17 @@ public class DateTimeUtils { ...@@ -24,17 +24,17 @@ public class DateTimeUtils {
/** /**
* 初始化日期类型 * 初始化日期类型
*/ */
static{ static {
format1 = new SimpleDateFormat("yyyy年MM月dd日"); format1 = new SimpleDateFormat("yyyy年MM月dd日");
format2 = new SimpleDateFormat("yyyy/MM/dd"); format2 = new SimpleDateFormat("yyyy/MM/dd");
} }
public static String getFormart1DateString(Date date){ public static String getFormart1DateString(Date date) {
String dateString = format1.format(date); String dateString = format1.format(date);
return dateString; return dateString;
} }
public static String getFormart2DateString(Date date){ public static String getFormart2DateString(Date date) {
String dateString = format2.format(date); String dateString = format2.format(date);
return dateString; return dateString;
} }
...@@ -187,15 +187,14 @@ public class DateTimeUtils { ...@@ -187,15 +187,14 @@ public class DateTimeUtils {
/** /**
* 获取某年第一天第一秒日期 eg 2021-01-01 00:00:00 * 获取某年第一天第一秒日期 eg 2021-01-01 00:00:00
* *
* @param year * @param year 年份
* 年份
* @return Date * @return Date
*/ */
public static Date getYearStart(int year) { public static Date getYearStart(int year) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.clear(); calendar.clear();
calendar.set(Calendar.YEAR, year); calendar.set(Calendar.YEAR, year);
calendar.set(year, Calendar.JANUARY,1, 0, 0, 0); calendar.set(year, Calendar.JANUARY, 1, 0, 0, 0);
return calendar.getTime(); return calendar.getTime();
} }
...@@ -203,20 +202,18 @@ public class DateTimeUtils { ...@@ -203,20 +202,18 @@ public class DateTimeUtils {
/** /**
* 获取某年最后一天最后一秒日期 eg 2021-12-31 23:59:59 * 获取某年最后一天最后一秒日期 eg 2021-12-31 23:59:59
* *
* @param year * @param year 年份
* 年份
* @return Date * @return Date
*/ */
public static Date getYearEnd(int year) { public static Date getYearEnd(int year) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.clear(); calendar.clear();
calendar.set(Calendar.YEAR, year); calendar.set(Calendar.YEAR, year);
calendar.set(year, Calendar.DECEMBER,31, 23, 59, 59); calendar.set(year, Calendar.DECEMBER, 31, 23, 59, 59);
return calendar.getTime(); return calendar.getTime();
} }
/** /**
* 获取月初第一秒 eg 2021-04-01 00:00:00 * 获取月初第一秒 eg 2021-04-01 00:00:00
* *
...@@ -230,7 +227,7 @@ public class DateTimeUtils { ...@@ -230,7 +227,7 @@ public class DateTimeUtils {
//获取到本月起始日 //获取到本月起始日
int actualMinimum = calendar.getActualMinimum(Calendar.DAY_OF_MONTH); int actualMinimum = calendar.getActualMinimum(Calendar.DAY_OF_MONTH);
//设置本月起始日的年月日时分秒格式 //设置本月起始日的年月日时分秒格式
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),actualMinimum, 0, 0, 0); calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), actualMinimum, 0, 0, 0);
return calendar.getTime(); return calendar.getTime();
} }
...@@ -245,10 +242,41 @@ public class DateTimeUtils { ...@@ -245,10 +242,41 @@ public class DateTimeUtils {
calendar.setTime(date); calendar.setTime(date);
//获取到本月结束日 //获取到本月结束日
int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),actualMaximum,23,59,59); calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), actualMaximum, 23, 59, 59);
return calendar.getTime(); return calendar.getTime();
} }
/**获得当天0点时间
*
* @return
*/
public static Date getStartDateTimeOfDay(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
return cal.getTime();
}
/**获得当天23时59分59秒的时间
*
* @return
*/
public static Date getEndDateTimeOfDay(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.SECOND, 59);
cal.set(Calendar.MINUTE, 59);
return cal.getTime();
}
/** /**
* 对日期做月份加减 * 对日期做月份加减
* *
...@@ -282,6 +310,7 @@ public class DateTimeUtils { ...@@ -282,6 +310,7 @@ public class DateTimeUtils {
* eg: now = new Date 2021-04-16 * eg: now = new Date 2021-04-16
* isLtNowYear(2020-12-31) true * isLtNowYear(2020-12-31) true
* isLtNowYear(2021-01-01) false * isLtNowYear(2021-01-01) false
*
* @return Boolean * @return Boolean
*/ */
public static Boolean isLtNowYear(Date date) { public static Boolean isLtNowYear(Date date) {
...@@ -291,13 +320,15 @@ public class DateTimeUtils { ...@@ -291,13 +320,15 @@ public class DateTimeUtils {
cal2.setTime(new Date()); cal2.setTime(new Date());
return cal1.get(Calendar.YEAR) < cal2.get(Calendar.YEAR); return cal1.get(Calendar.YEAR) < cal2.get(Calendar.YEAR);
} }
/** /**
* 判断2个日期是否同年 * 判断2个日期是否同年
* eg: isSameYear(2020-12-31,2021-01-01) false * eg: isSameYear(2020-12-31,2021-01-01) false
* isSameYear(2020-01-01,2020-12-31) true * isSameYear(2020-01-01,2020-12-31) true
*
* @return Boolean * @return Boolean
*/ */
public static Boolean isSameYear(Date startDate , Date endDate) { public static Boolean isSameYear(Date startDate, Date endDate) {
Calendar cal1 = Calendar.getInstance(); Calendar cal1 = Calendar.getInstance();
cal1.setTime(startDate); cal1.setTime(startDate);
Calendar cal2 = Calendar.getInstance(); Calendar cal2 = Calendar.getInstance();
...@@ -310,9 +341,10 @@ public class DateTimeUtils { ...@@ -310,9 +341,10 @@ public class DateTimeUtils {
* eg: isSameMonth(2020-12-31,2021-01-01) false * eg: isSameMonth(2020-12-31,2021-01-01) false
* isSameMonth(2020-12-31,2020-12-01) true * isSameMonth(2020-12-31,2020-12-01) true
* isSameMonth(2020-12-31,2021-12-01) true * isSameMonth(2020-12-31,2021-12-01) true
*
* @return Boolean * @return Boolean
*/ */
public static Boolean isSameMonth(Date startDate , Date endDate) { public static Boolean isSameMonth(Date startDate, Date endDate) {
Calendar cal1 = Calendar.getInstance(); Calendar cal1 = Calendar.getInstance();
cal1.setTime(startDate); cal1.setTime(startDate);
Calendar cal2 = Calendar.getInstance(); Calendar cal2 = Calendar.getInstance();
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<m:desc></m:desc> <m:desc></m:desc>
</m:field> </m:field>
<m:field> <m:field>
<m:name>createUser.name</m:name> <m:name>createUser.username</m:name>
<m:title>创建人</m:title> <m:title>创建人</m:title>
<m:type>string</m:type> <m:type>string</m:type>
<m:ref/> <m:ref/>
......
...@@ -3,8 +3,11 @@ package com.xyst.dinas.price.dao; ...@@ -3,8 +3,11 @@ package com.xyst.dinas.price.dao;
import com.beecode.bap.attachment.common.Page; import com.beecode.bap.attachment.common.Page;
import com.beecode.bcp.type.KObject; import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.dao.BaseDao; import com.beecode.inz.basis.dao.BaseDao;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartReturnEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartSearchEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity; import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity;
import com.xyst.dinas.price.entity.StationDinasTypePriceDetail; import com.xyst.dinas.price.entity.StationDinasTypePriceDetail;
import org.springframework.lang.NonNull;
import java.util.*; import java.util.*;
...@@ -26,9 +29,22 @@ public interface PriceAdjustmentDao extends BaseDao { ...@@ -26,9 +29,22 @@ public interface PriceAdjustmentDao extends BaseDao {
List<KObject> getByStationId(UUID id); List<KObject> getByStationId(UUID id);
List<KObject> getNewDetailsByStation(UUID id); ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(@NonNull UUID id);
ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(UUID id);
void deleteById(UUID id); void deleteById(UUID id);
List<PriceAdjustmentEchartReturnEntity> getDetailsByFilter(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity);
/**
* 将未生效的改成已生效
* @param date
*/
void updateToStart(Date date);
/**
* 将已生效的改成以失效
* @param date
*/
void updateToEnd(Date date);
} }
package com.xyst.dinas.price.entity;
import java.util.List;
import java.util.UUID;
public class PriceAdjustmentEchartReturnEntity {
private UUID dinasTypeId;
private String dinasTypeName;
private UUID regionalCompanyId;
private String regionalCompanyName;
private List<StationDetailEntity> stationDetails;
public UUID getDinasTypeId() {
return dinasTypeId;
}
public void setDinasTypeId(UUID dinasTypeId) {
this.dinasTypeId = dinasTypeId;
}
public String getDinasTypeName() {
return dinasTypeName;
}
public void setDinasTypeName(String dinasTypeName) {
this.dinasTypeName = dinasTypeName;
}
public UUID getRegionalCompanyId() {
return regionalCompanyId;
}
public void setRegionalCompanyId(UUID regionalCompanyId) {
this.regionalCompanyId = regionalCompanyId;
}
public String getRegionalCompanyName() {
return regionalCompanyName;
}
public void setRegionalCompanyName(String regionalCompanyName) {
this.regionalCompanyName = regionalCompanyName;
}
public List<StationDetailEntity> getStationDetails() {
return stationDetails;
}
public void setStationDetails(List<StationDetailEntity> stationDetails) {
this.stationDetails = stationDetails;
}
}
package com.xyst.dinas.price.entity;
import java.util.List;
import java.util.UUID;
public class StationDetailEntity {
private UUID stationId;
private String stationName;
private List<TimeValue> timeValues;
public UUID getStationId() {
return stationId;
}
public void setStationId(UUID stationId) {
this.stationId = stationId;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public List<TimeValue> getTimeValues() {
return timeValues;
}
public void setTimeValues(List<TimeValue> timeValues) {
this.timeValues = timeValues;
}
}
\ No newline at end of file
package com.xyst.dinas.price.entity;
import java.util.Date;
import java.util.UUID;
public class TimeValue {
private UUID id;
private Date time;
private Double value;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public Double getValue() {
return value;
}
public void setValue(Double value) {
this.value = value;
}
}
...@@ -8,13 +8,16 @@ import com.beecode.bcp.type.KClass; ...@@ -8,13 +8,16 @@ import com.beecode.bcp.type.KClass;
import com.beecode.bcp.type.KObject; import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.internal.dao.AbstractBaseDao; import com.beecode.inz.basis.internal.dao.AbstractBaseDao;
import com.beecode.inz.common.BaseConstants; import com.beecode.inz.common.BaseConstants;
import com.beecode.inz.common.util.DateTimeUtils;
import com.xyst.dinas.biz.dao.DinasTypeDao; import com.xyst.dinas.biz.dao.DinasTypeDao;
import com.xyst.dinas.price.constant.PriceAdjustmentConstant; import com.xyst.dinas.price.constant.PriceAdjustmentConstant;
import com.xyst.dinas.price.dao.PriceAdjustmentDao; import com.xyst.dinas.price.dao.PriceAdjustmentDao;
import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity; import com.xyst.dinas.price.entity.*;
import com.xyst.dinas.price.entity.StationDinasTypePriceDetail; import com.xyst.dinas.price.enumeration.PriceAdjustmentAdjustmentStatusEnum;
import org.apache.commons.lang3.time.DateUtils;
import org.hibernate.criterion.*; import org.hibernate.criterion.*;
import org.hibernate.query.Query; import org.hibernate.query.Query;
import org.hibernate.transform.Transformers;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateTemplate; import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -44,33 +47,33 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju ...@@ -44,33 +47,33 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju
KClass bean = Amino.getStaticMetadataContext().getBean(PriceAdjustmentConstant.ENTITY, KClass.class); KClass bean = Amino.getStaticMetadataContext().getBean(PriceAdjustmentConstant.ENTITY, KClass.class);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName()); DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false)); detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false));
if(!CollectionUtils.isEmpty(priceAdjustmentSearchEntity.getStationIds())){ if (!CollectionUtils.isEmpty(priceAdjustmentSearchEntity.getStationIds())) {
detachedCriteria.add(Restrictions.in("station.id", priceAdjustmentSearchEntity.getStationIds())); detachedCriteria.add(Restrictions.in("station.id", priceAdjustmentSearchEntity.getStationIds()));
} }
if(null!=priceAdjustmentSearchEntity.getAdjustmentStartDate()){ if (null != priceAdjustmentSearchEntity.getAdjustmentStartDate()) {
detachedCriteria.add(Restrictions.ge("adjustmentDate", priceAdjustmentSearchEntity.getAdjustmentStartDate())); detachedCriteria.add(Restrictions.ge("adjustmentDate", priceAdjustmentSearchEntity.getAdjustmentStartDate()));
} }
if(null!=priceAdjustmentSearchEntity.getAdjustmentEndDate()){ if (null != priceAdjustmentSearchEntity.getAdjustmentEndDate()) {
detachedCriteria.add(Restrictions.le("adjustmentDate", priceAdjustmentSearchEntity.getAdjustmentEndDate())); detachedCriteria.add(Restrictions.le("adjustmentDate", priceAdjustmentSearchEntity.getAdjustmentEndDate()));
} }
if(null!=priceAdjustmentSearchEntity.getApplyStartDate()){ if (null != priceAdjustmentSearchEntity.getApplyStartDate()) {
detachedCriteria.add(Restrictions.ge("applyDate", priceAdjustmentSearchEntity.getApplyStartDate())); detachedCriteria.add(Restrictions.ge("applyDate", priceAdjustmentSearchEntity.getApplyStartDate()));
} }
if(null!=priceAdjustmentSearchEntity.getApplyEndDate()){ if (null != priceAdjustmentSearchEntity.getApplyEndDate()) {
detachedCriteria.add(Restrictions.le("applyDate", priceAdjustmentSearchEntity.getApplyEndDate())); detachedCriteria.add(Restrictions.le("applyDate", priceAdjustmentSearchEntity.getApplyEndDate()));
} }
if(!CollectionUtils.isEmpty(priceAdjustmentSearchEntity.getRegionalCompanyIds())){ if (!CollectionUtils.isEmpty(priceAdjustmentSearchEntity.getRegionalCompanyIds())) {
detachedCriteria.add(Restrictions.in("regionalCompany.id", priceAdjustmentSearchEntity.getRegionalCompanyIds())); detachedCriteria.add(Restrictions.in("regionalCompany.id", priceAdjustmentSearchEntity.getRegionalCompanyIds()));
} }
if(null!=priceAdjustmentSearchEntity.getApplyStatus()){ if (null != priceAdjustmentSearchEntity.getApplyStatus()) {
detachedCriteria.add(Restrictions.in("applyStatus", priceAdjustmentSearchEntity.getApplyStatus())); detachedCriteria.add(Restrictions.in("applyStatus", priceAdjustmentSearchEntity.getApplyStatus()));
} }
detachedCriteria.addOrder(Order.desc(BaseConstants.CREATE_TIME)); detachedCriteria.addOrder(Order.desc(BaseConstants.CREATE_TIME));
int offset = priceAdjustmentSearchEntity.getPageSize() * (priceAdjustmentSearchEntity.getPageNo() - 1); int offset = priceAdjustmentSearchEntity.getPageSize() * (priceAdjustmentSearchEntity.getPageNo() - 1);
priceAdjustmentSearchEntity.setTotal(template.findByCriteria(detachedCriteria).size()); priceAdjustmentSearchEntity.setTotal(template.findByCriteria(detachedCriteria).size());
List<KObject> list = (List<KObject>) template.findByCriteria(detachedCriteria,offset,priceAdjustmentSearchEntity.getPageSize()); List<KObject> list = (List<KObject>) template.findByCriteria(detachedCriteria, offset, priceAdjustmentSearchEntity.getPageSize());
priceAdjustmentSearchEntity.setDatas(list); priceAdjustmentSearchEntity.setDatas(list);
return priceAdjustmentSearchEntity; return priceAdjustmentSearchEntity;
} }
...@@ -82,9 +85,9 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju ...@@ -82,9 +85,9 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju
detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false)); detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false));
detachedCriteria.add(Restrictions.in("station.id", id)); detachedCriteria.add(Restrictions.in("station.id", id));
detachedCriteria.add(Restrictions.eq("applyStatus", BizProcessState.DONE_WITH_AGREE.getValue())); detachedCriteria.add(Restrictions.eq("applyStatus", BizProcessState.DONE_WITH_AGREE.getValue()));
detachedCriteria.add(Restrictions.eq("adjustmentStatus",1 )); detachedCriteria.add(Restrictions.eq("adjustmentStatus", PriceAdjustmentAdjustmentStatusEnum.PROCESSING.getValue()));
detachedCriteria.addOrder(Order.desc("adjustmentDate")); detachedCriteria.addOrder(Order.desc("adjustmentDate"));
List<KObject> byCriteria = (List<KObject>)template.findByCriteria(detachedCriteria, 0, 1); List<KObject> byCriteria = (List<KObject>) template.findByCriteria(detachedCriteria, 0, 1);
return byCriteria; return byCriteria;
} }
...@@ -95,53 +98,43 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju ...@@ -95,53 +98,43 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName()); DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false)); detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false));
detachedCriteria.add(Restrictions.in("station.id", id)); detachedCriteria.add(Restrictions.in("station.id", id));
detachedCriteria.add(Restrictions.in("applyStatus",BizProcessState.IN_PROCESS.getValue(),BizProcessState.DONE_WITH_REJECT.getValue() )); detachedCriteria.add(Restrictions.in("applyStatus", BizProcessState.IN_PROCESS.getValue(), BizProcessState.DONE_WITH_REJECT.getValue()));
detachedCriteria.addOrder(Order.desc("adjustmentDate")); detachedCriteria.addOrder(Order.desc("adjustmentDate"));
List<KObject> byCriteria = (List<KObject>)template.findByCriteria(detachedCriteria, 0, 1); List<KObject> byCriteria = (List<KObject>) template.findByCriteria(detachedCriteria, 0, 1);
return byCriteria; return byCriteria;
} }
@Override @Override
public List<KObject> getNewDetailsByStation(UUID id) { public ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(UUID id) {
KClass bean = Amino.getStaticMetadataContext().getBean(PriceAdjustmentConstant.ENTITY, KClass.class); List<KObject> byStation = dinasTypeDao.getByStation(id);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName()); List<UUID> dinasTypeIds = new ArrayList<>();
detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false)); for (KObject kObject : byStation) {
detachedCriteria.add(Restrictions.in("station.id", id)); dinasTypeIds.add(kObject.getUuid("id"));
detachedCriteria.add(Restrictions.in("applyStatus",2));
detachedCriteria.addOrder(Order.desc("adjustmentDate"));
List<KObject> byCriteria = (List<KObject>)template.findByCriteria(detachedCriteria, 0, 1);
if(CollectionUtils.isEmpty(byCriteria)){
return null;
} }
return byCriteria; if (CollectionUtils.isEmpty(dinasTypeIds)) {
return null;
} }
@Override KClass bean = Amino.getStaticMetadataContext().getBean(PriceAdjustmentConstant.DETAIL_ENTITY, KClass.class);
public ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(UUID id) {
KClass bean = Amino.getStaticMetadataContext().getBean(PriceAdjustmentConstant.ENTITY, KClass.class);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName()); DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false)); detachedCriteria.add(Restrictions.eq(BaseConstants.DEL, false));
detachedCriteria.add(Restrictions.in("station.id", id)); detachedCriteria.createAlias("master", "master");
detachedCriteria.add(Restrictions.in("applyStatus",2)); detachedCriteria.add(Restrictions.in("master.applyStatus", BizProcessState.DONE_WITH_AGREE.getValue()));
detachedCriteria.add(Restrictions.in("master.adjustmentStatus", PriceAdjustmentAdjustmentStatusEnum.PROCESSING.getValue()));
detachedCriteria.add(Restrictions.in("dinasType.id", dinasTypeIds));
detachedCriteria.add(Restrictions.isNull("adjustmentEndDate"));
detachedCriteria.addOrder(Order.desc("adjustmentDate")); detachedCriteria.addOrder(Order.desc("adjustmentDate"));
List<KObject> byCriteria = (List<KObject>)template.findByCriteria(detachedCriteria, 0, 1); List<KObject> byCriteria = (List<KObject>) template.findByCriteria(detachedCriteria);
if(CollectionUtils.isEmpty(byCriteria)){ if (CollectionUtils.isEmpty(byCriteria)) {
return null;
}
KObject kObject1 = byCriteria.get(0);
KObject dinasTypeDetails = kObject1.get("dinasTypeDetails");
if(null ==dinasTypeDetails){
return null; return null;
} }
KObject[] kObjects = dinasTypeDetails.toArray();
ArrayList<StationDinasTypePriceDetail> objects = new ArrayList<>(); ArrayList<StationDinasTypePriceDetail> objects = new ArrayList<>();
for (KObject kObject : kObjects) { for (KObject kObject : byCriteria) {
StationDinasTypePriceDetail stationDinasTypePriceDetail = new StationDinasTypePriceDetail( StationDinasTypePriceDetail stationDinasTypePriceDetail = new StationDinasTypePriceDetail(
kObject1.get("station").getUuid("id"), id,
kObject.get("dinasType").getUuid("id"), kObject.get("dinasType").getUuid("id"),
kObject.getBigDecimal("dinasPrice"), kObject.getBigDecimal("dinasPrice"),
kObject1.getDate("adjustmentDate") kObject.getDate("adjustmentDate")
); );
objects.add(stationDinasTypePriceDetail); objects.add(stationDinasTypePriceDetail);
} }
...@@ -156,16 +149,156 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju ...@@ -156,16 +149,156 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju
template.update(kobject); template.update(kobject);
} }
@Override
public List<PriceAdjustmentEchartReturnEntity> getDetailsByFilter(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity) {
KClass bean = Amino.getStaticMetadataContext().getBean(PriceAdjustmentConstant.DETAIL_ENTITY, KClass.class);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
detachedCriteria.add(Restrictions.eq("master." + BaseConstants.DEL, false))
.add(Restrictions.in("master.applyStatus", BizProcessState.DONE_WITH_AGREE.getValue()))
.add(Restrictions.eq("adjustmentStatus", PriceAdjustmentAdjustmentStatusEnum.PROCESSING.getValue()))
.createAlias("master", "master")
.createAlias("master.station", "station")
.createAlias("master.regionalCompany", "regionalCompany")
.createAlias("dinasType", "dinasType")
.setProjection(Projections.projectionList()
.add(Projections.alias(Projections.property("station.id"), "stationId"))
.add(Projections.alias(Projections.property("station.stationName"), "stationName"))
.add(Projections.alias(Projections.property("regionalCompany.id"), "regionalCompanyId"))
.add(Projections.alias(Projections.property("regionalCompany.name"), "regionalCompanyName"))
.add(Projections.alias(Projections.property("dinasType.id"), "dinasTypeId"))
.add(Projections.alias(Projections.property("dinasType.dinasTypeName"), "dinasTypeName"))
.add(Projections.alias(Projections.property("adjustmentDate"), "date"))
.add(Projections.alias(Projections.property("id"), "adjustmentId"))
.add(Projections.alias(Projections.property("dinasPrice"), "value")));
if (null != priceAdjustmentEchartSearchEntity.getAdjustmentEndDate()) {
detachedCriteria.add(Restrictions.le("adjustmentDate", priceAdjustmentEchartSearchEntity.getAdjustmentEndDate()));
}
if (null != priceAdjustmentEchartSearchEntity.getAdjustmentStartDate()) {
detachedCriteria.add(
Restrictions.or(
Restrictions.ge("adjustmentEndDate", priceAdjustmentEchartSearchEntity.getAdjustmentStartDate()),Restrictions.isNull("adjustmentEndDate")));
}
if (!CollectionUtils.isEmpty(priceAdjustmentEchartSearchEntity.getRegionalCompanyIds())) {
detachedCriteria.add(Restrictions.in("regionalCompany.id", priceAdjustmentEchartSearchEntity.getRegionalCompanyIds()));
}
if (!CollectionUtils.isEmpty(priceAdjustmentEchartSearchEntity.getStationIds())) {
detachedCriteria.add(Restrictions.in("station.id", priceAdjustmentEchartSearchEntity.getStationIds()));
}
detachedCriteria.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
List<HashMap<String, Object>> byCriteria = (List<HashMap<String, Object>>) template.findByCriteria(detachedCriteria);
List<PriceAdjustmentEchartReturnEntity> priceAdjustmentEchartReturnEntities = getPriceAdjustmentEchartReturnEntities(byCriteria, priceAdjustmentEchartSearchEntity.getAdjustmentStartDate(), priceAdjustmentEchartSearchEntity.getAdjustmentEndDate());
return priceAdjustmentEchartReturnEntities;
}
@Override
public void updateToStart(Date date) {
}
@Override
public void updateToEnd(Date date) {
//先查询出当前即将生效的记录.获取到砂石类型与之前没有结束的砂石类型比较. 如果有相同的砂石类型,则将非该记录下的砂石类型结束
Date endDateTimeOfDay = DateTimeUtils.getEndDateTimeOfDay(date);
Date startDateTimeOfDay = DateTimeUtils.getStartDateTimeOfDay(date);
}
private List<UUID> getLastPriceByDateAndStatus(Date date) {
//获取
return null;
}
private List<UUID> getNoOverPrice(Date date) {
return null;
}
private List<PriceAdjustmentEchartReturnEntity> getPriceAdjustmentEchartReturnEntities(List<HashMap<String, Object>> byCriteria, Date adjustmentStartDate, Date adjustmentEndDate) {
PriceAdjustmentEchartReturnEntity priceAdjustmentEchartReturnEntity;
List<PriceAdjustmentEchartReturnEntity> priceAdjustmentEchartReturnEntities = new ArrayList<>();
HashMap<String, PriceAdjustmentEchartReturnEntity> priceAdjustmentEchartReturnHashMap = new HashMap<>();
StationDetailEntity stationDetailEntity;
HashMap<String, StationDetailEntity> stationDetail = new HashMap<>();
List<TimeValue> priceAdjustmentList;
TimeValue priceAdjustment;
for (HashMap<String, Object> byCriterion : byCriteria) {
Object dinasTypeId = byCriterion.get("dinasTypeId");
Object stationId = byCriterion.get("stationId");
Object adjustmentId = byCriterion.get("adjustmentId");
priceAdjustment = new TimeValue();
if (!priceAdjustmentEchartReturnHashMap.containsKey(dinasTypeId.toString())) {
priceAdjustmentEchartReturnEntity = new PriceAdjustmentEchartReturnEntity();
priceAdjustmentEchartReturnEntity.setDinasTypeId(UUID.fromString(dinasTypeId.toString()));
priceAdjustmentEchartReturnEntity.setDinasTypeName(byCriterion.get("dinasTypeName").toString());
priceAdjustmentEchartReturnEntity.setRegionalCompanyId(UUID.fromString(byCriterion.get("regionalCompanyId").toString()));
priceAdjustmentEchartReturnEntity.setRegionalCompanyName(byCriterion.get("regionalCompanyName").toString());
priceAdjustmentEchartReturnEntity.setStationDetails(new ArrayList<>());
priceAdjustmentEchartReturnHashMap.put(dinasTypeId.toString(), priceAdjustmentEchartReturnEntity);
priceAdjustmentEchartReturnEntities.add(priceAdjustmentEchartReturnEntity);
} else {
priceAdjustmentEchartReturnEntity = priceAdjustmentEchartReturnHashMap.get(dinasTypeId.toString());
}
stationDetailEntity = getStationDetailEntity(priceAdjustmentEchartReturnEntity, stationDetail, byCriterion, stationId);
priceAdjustmentList = stationDetailEntity.getTimeValues();
Object o = byCriterion.get("date");
Object value = byCriterion.get("value");
priceAdjustment.setId(UUID.fromString(adjustmentId.toString()));
Date o1 = (Date) o;
if (!o1.before(adjustmentStartDate) && null != adjustmentStartDate) {
o1 = adjustmentStartDate;
}
if (o1.after(adjustmentEndDate) && null != adjustmentStartDate) {
o1 = adjustmentEndDate;
}
priceAdjustment.setTime(o1);
priceAdjustment.setValue(Double.valueOf(value.toString()));
priceAdjustmentList.add(priceAdjustment);
}
return priceAdjustmentEchartReturnEntities;
}
private StationDetailEntity getStationDetailEntity(PriceAdjustmentEchartReturnEntity priceAdjustmentEchartReturnEntity, HashMap<String, StationDetailEntity> stationDetail, HashMap<String, Object> byCriterion, Object stationId) {
List<StationDetailEntity> stationDetailEntityList;
StationDetailEntity stationDetailEntity;
if (!stationDetail.containsKey(stationId + priceAdjustmentEchartReturnEntity.getDinasTypeId().toString())) {
stationDetailEntityList = new ArrayList<>();
stationDetailEntity = new StationDetailEntity();
stationDetailEntity.setStationId(UUID.fromString(stationId.toString()));
stationDetailEntity.setStationName(byCriterion.get("stationName").toString());
stationDetail.put(stationId + priceAdjustmentEchartReturnEntity.getDinasTypeId().toString(), stationDetailEntity);
stationDetailEntityList.add(stationDetailEntity);
List<StationDetailEntity> stationDetails = priceAdjustmentEchartReturnEntity.getStationDetails();
stationDetailEntity.setTimeValues(new ArrayList<>());
stationDetails.add(stationDetailEntity);
} else {
stationDetailEntity = stationDetail.get(stationId + priceAdjustmentEchartReturnEntity.getDinasTypeId().toString());
}
return stationDetailEntity;
}
@Override @Override
public void modify(KObject kobject) { public void modify(KObject kobject) {
KObject id = load(kobject.getUuid("id")); KObject id = load(kobject.getUuid("id"));
kobject.set(BaseConstants.CREATOR,id.get(BaseConstants.CREATOR)); kobject.set(BaseConstants.CREATOR, id.get(BaseConstants.CREATOR));
kobject.set(BaseConstants.CREATE_TIME,id.getDate(BaseConstants.CREATE_TIME)); kobject.set(BaseConstants.CREATE_TIME, id.getDate(BaseConstants.CREATE_TIME));
KObject staff = AminoContextHolder.getContext().getStaff(); KObject staff = AminoContextHolder.getContext().getStaff();
kobject.set("regionalCompany", dinasTypeDao.getCurrentLoginRegionalCompany()); kobject.set("regionalCompany", dinasTypeDao.getCurrentLoginRegionalCompany());
kobject.set("modifyTime",new Date()); kobject.set("modifyTime", new Date());
kobject.set(BaseConstants.MODIFIER,staff); kobject.set(BaseConstants.MODIFIER, staff);
kobject.set(BaseConstants.DEL,false); kobject.set(BaseConstants.DEL, false);
template.merge(kobject); template.merge(kobject);
} }
...@@ -175,7 +308,7 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju ...@@ -175,7 +308,7 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju
{ {
Query query = session.createQuery("delete from " + PriceAdjustmentConstant.DETAIL_ENTITY + Query query = session.createQuery("delete from " + PriceAdjustmentConstant.DETAIL_ENTITY +
" as a where a.master.id = :priceAdjustmentId "); " as a where a.master.id = :priceAdjustmentId ");
query.setParameter("priceAdjustmentId",priceAdjustmentId); query.setParameter("priceAdjustmentId", priceAdjustmentId);
return query.executeUpdate(); return query.executeUpdate();
} }
); );
...@@ -184,22 +317,22 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju ...@@ -184,22 +317,22 @@ public class PriceAdjustmentDaoImpl extends AbstractBaseDao implements PriceAdju
@Override @Override
public UUID creteDetails(KObject insertDetailKobject) { public UUID creteDetails(KObject insertDetailKobject) {
insertDetailKobject.set("id",UUID.randomUUID()); insertDetailKobject.set("id", UUID.randomUUID());
return ((UUID)template.save(DETAIL_ENTITY,insertDetailKobject)); return ((UUID) template.save(DETAIL_ENTITY, insertDetailKobject));
} }
@Override @Override
public UUID create(KObject kObject) { public UUID create(KObject kObject) {
KObject staff = AminoContextHolder.getContext().getStaff(); KObject staff = AminoContextHolder.getContext().getStaff();
if(null==kObject.getUuid("id")){ if (null == kObject.getUuid("id")) {
kObject.set("id",UUID.randomUUID()); kObject.set("id", UUID.randomUUID());
} }
kObject.set("regionalCompany", dinasTypeDao.getCurrentLoginRegionalCompany()); kObject.set("regionalCompany", dinasTypeDao.getCurrentLoginRegionalCompany());
kObject.set(BaseConstants.CREATOR,staff); kObject.set(BaseConstants.CREATOR, staff);
kObject.set(BaseConstants.CREATE_TIME, new Date()); kObject.set(BaseConstants.CREATE_TIME, new Date());
kObject.set("del",false); kObject.set("del", false);
return ((UUID)template.save(kObject)); return ((UUID) template.save(kObject));
} }
/** /**
......
...@@ -3,6 +3,7 @@ package com.xyst.dinas.price.internal.service; ...@@ -3,6 +3,7 @@ package com.xyst.dinas.price.internal.service;
import com.beecode.bap.attachment.common.Page; import com.beecode.bap.attachment.common.Page;
import com.beecode.bcp.type.KObject; import com.beecode.bcp.type.KObject;
import com.xyst.dinas.price.dao.PriceAdjustmentDao; import com.xyst.dinas.price.dao.PriceAdjustmentDao;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartReturnEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartSearchEntity; import com.xyst.dinas.price.entity.PriceAdjustmentEchartSearchEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity; import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity;
import com.xyst.dinas.price.entity.StationDinasTypePriceDetail; import com.xyst.dinas.price.entity.StationDinasTypePriceDetail;
...@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
...@@ -22,7 +23,6 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService { ...@@ -22,7 +23,6 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService {
@Autowired @Autowired
private PriceAdjustmentDao priceAdjustmentDao; private PriceAdjustmentDao priceAdjustmentDao;
@Override @Override
public Page<KObject> queryByPaging(PriceAdjustmentSearchEntity<KObject> priceAdjustmentSearchEntity) throws Exception { public Page<KObject> queryByPaging(PriceAdjustmentSearchEntity<KObject> priceAdjustmentSearchEntity) throws Exception {
if(priceAdjustmentSearchEntity.getPageNo()==0||priceAdjustmentSearchEntity.getPageSize()==0) { if(priceAdjustmentSearchEntity.getPageNo()==0||priceAdjustmentSearchEntity.getPageSize()==0) {
...@@ -41,10 +41,6 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService { ...@@ -41,10 +41,6 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService {
return kObjects; return kObjects;
} }
@Override
public List<KObject> getNewDetailsByStation(UUID id) {
return priceAdjustmentDao.getNewDetailsByStation(id);
}
@Override @Override
public ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(UUID id) { public ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(UUID id) {
...@@ -68,10 +64,17 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService { ...@@ -68,10 +64,17 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService {
} }
@Override @Override
public List<HashMap<String, Object>> getChartLine(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity) { public List<PriceAdjustmentEchartReturnEntity> getChartLine(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity) {
return null; return priceAdjustmentDao.getDetailsByFilter(priceAdjustmentEchartSearchEntity);
} }
@Override
public void updatePriceAdjustmentStatus() {
//先结束旧的
priceAdjustmentDao.updateToEnd(new Date());
//再开始新的
priceAdjustmentDao.updateToStart(new Date());
}
@Override @Override
public UUID addPriceAdjustment(KObject kObject) { public UUID addPriceAdjustment(KObject kObject) {
...@@ -83,18 +86,8 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService { ...@@ -83,18 +86,8 @@ public class PriceAdjustmentServiceImpl implements PriceAdjustmentService {
return priceAdjustmentDao.load(id); return priceAdjustmentDao.load(id);
} }
@Override @Override
public void update(KObject kobject) { public void update(KObject kobject) {
priceAdjustmentDao.modify(kobject); priceAdjustmentDao.modify(kobject);
} }
private void deleteDetailByMasterId(UUID stationId) {
priceAdjustmentDao.deleteDetailByMasterId(stationId);
}
} }
package com.xyst.dinas.price.service; package com.xyst.dinas.price.service;
import com.beecode.bcp.type.KObject; import com.beecode.bcp.type.KObject;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartReturnEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartSearchEntity; import com.xyst.dinas.price.entity.PriceAdjustmentEchartSearchEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity; import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity;
import com.xyst.dinas.price.entity.StationDinasTypePriceDetail; import com.xyst.dinas.price.entity.StationDinasTypePriceDetail;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
...@@ -23,8 +23,6 @@ public interface PriceAdjustmentService { ...@@ -23,8 +23,6 @@ public interface PriceAdjustmentService {
List<KObject> getNewByStations(List<UUID> ids); List<KObject> getNewByStations(List<UUID> ids);
List<KObject> getNewDetailsByStation(UUID id);
ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(UUID id); ArrayList<StationDinasTypePriceDetail> getNewDetailListByStation(UUID id);
KObject validateByStationId(UUID id); KObject validateByStationId(UUID id);
...@@ -32,5 +30,11 @@ public interface PriceAdjustmentService { ...@@ -32,5 +30,11 @@ public interface PriceAdjustmentService {
void deleteById(UUID id); void deleteById(UUID id);
List<HashMap<String, Object>> getChartLine(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity); List<PriceAdjustmentEchartReturnEntity> getChartLine(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity);
/**
* 修改今日砂价的生效状态,如果调整日期为今天,则生效并填充上一次的结束时间
*/
void updatePriceAdjustmentStatus();
} }
package com.xyst.dinas.price.task;
import com.beecode.amino.metadata.context.ApplicationMetadataContext;
import com.beecode.amino.metadata.runtime.ServiceInitializer;
import com.beecode.bap.scheduler.entity.ScheduleDetail;
import com.beecode.bap.scheduler.entity.TaskDetail;
import com.beecode.bap.scheduler.service.ScheduleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.PostConstruct;
import java.util.Optional;
public class PriceAdjustmentStatusSchedule implements ServiceInitializer {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ScheduleService scheduleService;
/**
* 砂价到期生效
*/
private final String PRICE_ADJUSTMENT_STATUS_TASK = "PriceAdjustmentStatusTask";
@Override
public void init(ApplicationMetadataContext applicationMetadataContext) {
Optional<ScheduleDetail> byName = scheduleService.findByName(PRICE_ADJUSTMENT_STATUS_TASK);
if(byName.isPresent()){
scheduleService.removeTask(PRICE_ADJUSTMENT_STATUS_TASK);
}
TaskDetail taskDetail = new TaskDetail(PRICE_ADJUSTMENT_STATUS_TASK, PriceAdjustmentStatusTask.class.getName());
//应该每晚一次 避免跑偏 4小时执行一次
scheduleService.scheduleTask(taskDetail, "0 0 0/4 * * ? *");
logger.info("砂价到期生效任务初始化成功!");
}
@PostConstruct
public void init(){
init(null);
}
}
package com.xyst.dinas.price.task;
import com.beecode.amino.core.Amino;
import com.beecode.bap.scheduler.core.Task;
import com.beecode.bap.scheduler.core.TaskContext;
import com.xyst.dinas.price.service.PriceAdjustmentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author scol
*/
public class PriceAdjustmentStatusTask implements Task {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private PriceAdjustmentService priceAdjustmentService;
@Override
public void execute(TaskContext taskContext) {
logger.info("开始修改采砂许可证状态");
if(priceAdjustmentService ==null){
priceAdjustmentService = Amino.getApplicationContext().getBean(PriceAdjustmentService.class);
}
priceAdjustmentService.updatePriceAdjustmentStatus();
logger.info("修改采砂许可证状态结束");
}
}
...@@ -9,6 +9,7 @@ import com.beecode.inz.basis.team.pojo.ResponseObj; ...@@ -9,6 +9,7 @@ import com.beecode.inz.basis.team.pojo.ResponseObj;
import com.beecode.inz.common.BaseConstants; import com.beecode.inz.common.BaseConstants;
import com.xyst.dinas.biz.service.DinasTypeService; import com.xyst.dinas.biz.service.DinasTypeService;
import com.xyst.dinas.price.constant.PriceAdjustmentConstant; import com.xyst.dinas.price.constant.PriceAdjustmentConstant;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartReturnEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentEchartSearchEntity; import com.xyst.dinas.price.entity.PriceAdjustmentEchartSearchEntity;
import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity; import com.xyst.dinas.price.entity.PriceAdjustmentSearchEntity;
import com.xyst.dinas.price.service.PriceAdjustmentService; import com.xyst.dinas.price.service.PriceAdjustmentService;
...@@ -16,7 +17,6 @@ import org.apache.commons.lang3.StringUtils; ...@@ -16,7 +17,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
...@@ -182,12 +182,12 @@ public class PriceAdjustmentController { ...@@ -182,12 +182,12 @@ public class PriceAdjustmentController {
/** /**
* 获取最新的砂石价格 * 获取最新的砂石价格
* @param ids id * @param priceAdjustmentEchartSearchEntity id
* @return 获取成功 * @return 获取成功
*/ */
@GetMapping("getChartLine") @GetMapping("getChartLine")
public ResponseObj getChartLine(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity) { public ResponseObj getChartLine(PriceAdjustmentEchartSearchEntity priceAdjustmentEchartSearchEntity) {
List<HashMap<String,Object>> priceAdjustment = priceAdjustmentService.getChartLine(priceAdjustmentEchartSearchEntity); List<PriceAdjustmentEchartReturnEntity> priceAdjustment = priceAdjustmentService.getChartLine(priceAdjustmentEchartSearchEntity);
return ResponseObj.success("获取成功", priceAdjustment); return ResponseObj.success("获取成功", priceAdjustment);
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>4ca2af62-944a-4383-be3f-d853e72226a1</id>
<name>com.xyst.dinas.transport.bill.TransportDriver$sequence</name>
<title>运输司机备案$sequence</title>
<description>运输司机备案</description>
<define>bcp.sequence</define>
<define-version>1.0</define-version>
<content>
<m:sequence>
<m:start-with>0</m:start-with>
<m:increment>1</m:increment>
<m:max>99999</m:max>
<m:min>0</m:min>
<m:cycle>true</m:cycle>
<m:cache-size>10</m:cache-size>
</m:sequence>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>a6ef5e18-5662-4408-8e75-f2d0ef6aaa7d</id>
<name>com.xyst.dinas.transport.bill.TransportDriver$serial</name>
<title>运输司机备案$serial</title>
<description>运输司机备案</description>
<define>bcp.serial</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.transport.datamodel.TransportDriver</dependency>
<dependency>com.xyst.dinas.transport.bill.TransportDriver$sequence</dependency>
<content>
<m:serial>
<m:input>com.xyst.dinas.transport.datamodel.TransportDriver</m:input>
<m:functionLibrarys/>
<m:segments>
<m:literal>
<m:value>TD</m:value>
</m:literal>
<m:sequence>
<m:length>5</m:length>
<m:pad-direction>left</m:pad-direction>
<m:pad-string>0</m:pad-string>
<m:key>com.xyst.dinas.transport.bill.TransportDriver$serial</m:key>
<m:sequenceName>com.xyst.dinas.transport.bill.TransportDriver$sequence</m:sequenceName>
</m:sequence>
</m:segments>
</m:serial>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>88ec7509-2535-4983-b579-52513862e7db</id>
<name>com.xyst.dinas.transport.bill.TransportDriver</name>
<title>运输司机管理</title>
<description>运输司机管理</description>
<define>bcp.biz.Biztype</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.transport.bill.TransportDriver$serial</dependency>
<dependency>com.xyst.dinas.transport.datamodel.TransportDriver</dependency>
<dependency>com.beecode.bap.biztrait.BasicBillBiztrait</dependency>
<content>
<m:biztype>
<m:type>com.xyst.dinas.transport.datamodel.TransportDriver</m:type>
<m:inheritances>
<m:inheritance>
<m:biztrait>com.beecode.bap.biztrait.BasicBillBiztrait</m:biztrait>
<m:config type="xml">
<m:content>&lt;billBasictraitConfig&gt;&lt;formulas/&gt;&lt;parents&gt;&lt;parent&gt;&lt;billCodeConfig&gt;&lt;serialName&gt;com.xyst.dinas.transport.bill.TransportDriver$serial&lt;/serialName&gt;&lt;buildTime&gt;add&lt;/buildTime&gt;&lt;/billCodeConfig&gt;&lt;/parent&gt;&lt;parent&gt;&lt;workflowConfig&gt;&lt;workflow&gt;&lt;/workflow&gt;&lt;/workflowConfig&gt;&lt;/parent&gt;&lt;parent&gt;&lt;printConfig&gt;&lt;templates/&gt;&lt;/printConfig&gt;&lt;/parent&gt;&lt;/parents&gt;&lt;functionLibrarys/&gt;&lt;/billBasictraitConfig&gt;</m:content>
</m:config>
</m:inheritance>
</m:inheritances>
<m:methodAuthorityItems/>
</m:biztype>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-type">
<specification>1.0</specification>
<id>46c69fca-1494-4c8b-bbc7-141baa6d5355</id>
<name>com.xyst.dinas.transport.datamodel.TransportDriver</name>
<title>运输司机备案</title>
<description>运输司机备案</description>
<define>bcp.type.Class</define>
<define-version>1.0</define-version>
<dependency>bcp.type.constraint.StringLength</dependency>
<dependency>com.beecode.inz.common.datamodel.BaseInfo</dependency>
<dependency>com.beecode.bap.staff.datamodel.Staff</dependency>
<dependency>com.xyst.dinas.biz.datamodel.xystOrganization</dependency>
<dependency>com.beecode.bap.biztrait.datamodel.BasicBillRequirement</dependency>
<content>
<m:class>
<m:parents>
<m:parent>com.beecode.bap.biztrait.datamodel.BasicBillRequirement</m:parent>
<m:parent>com.beecode.inz.common.datamodel.BaseInfo</m:parent>
</m:parents>
<m:attributes>
<m:attribute>
<m:annotations/>
<m:id>6e0054f1-5138-46d7-9103-9afde9cb1ece</m:id>
<m:name>regionalCompany</m:name>
<m:title>区域公司</m:title>
<m:type>com.xyst.dinas.biz.datamodel.xystOrganization</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>f5b3ce64-981b-49d8-b3e5-0cf7f6767b5f</m:id>
<m:name>driverName</m:name>
<m:title>司机姓名</m:title>
<m:type>string</m:type>
<m:description>场站名称</m:description>
<m:default/>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>a505f0f9-a1f7-4669-8a72-0329b60173e0</m:id>
<m:name>transportCompany</m:name>
<m:title>所属运输公司</m:title>
<m:type>com.xyst.dinas.transport.datamodel.TransportCompany</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>20f48778-d620-4573-919c-b3e00855f790</m:id>
<m:name>idCard</m:name>
<m:title>身份证号</m:title>
<m:type>string</m:type>
<m:description>身份证号</m:description>
<m:default/>
</m:attribute>
<m:attribute>
<m:id>f121b681-5ad7-4f8a-9dda-269b352e1fd4</m:id>
<m:name>contactDetails</m:name>
<m:title>联系方式</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
</m:attributes>
</m:class>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-query">
<specification>1.0</specification>
<id>8ee05a1e-fd46-458a-8b68-08df8d50db33</id>
<name>com.xyst.dinas.transport.query.TransportDriver</name>
<title>运输司机备案</title>
<description>运输司机备案</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.transport.datamodel.TransportDriver</dependency>
<content>
<m:query>
<m:type>com.xyst.dinas.transport.datamodel.TransportDriver</m:type>
<m:dataProcessor></m:dataProcessor>
<m:innerScenes>
<m:innerScene>
<m:id>e093c44a-a807-40bf-85a9-e5256cb7e887</m:id>
<m:title>全部</m:title>
<m:javaImplement>com.beecode.inz.common.scene.CommonAllScene</m:javaImplement>
<m:defaultExecute></m:defaultExecute>
<m:hide></m:hide>
</m:innerScene>
<m:innerScene>
<m:id>4e6b04c8-170b-458e-92e4-f31449d469f8</m:id>
<m:title>已废弃</m:title>
<m:javaImplement>com.beecode.inz.common.scene.DefaultDiscardScene</m:javaImplement>
<m:defaultExecute></m:defaultExecute>
<m:hide></m:hide>
</m:innerScene>
<m:innerScene>
<m:id>c1a2bc7f-5267-412b-a011-929d8e6a76cc</m:id>
<m:title>权限过滤</m:title>
<m:javaImplement>com.xyst.dinas.biz.scene.XystDinasCommonAllScene</m:javaImplement>
<m:defaultExecute>true</m:defaultExecute>
<m:hide>true</m:hide>
</m:innerScene>
</m:innerScenes>
<m:fields>
<m:field>
<m:name>regionalCompany.id</m:name>
<m:title>区域公司</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.xyst.dinas.biz.datamodel.xystOrganization</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>regionalCompany.name</m:name>
<m:title>区域公司name</m:title>
<m:type>string</m:type>
<m:ref>
<m:name>com.xyst.dinas.biz.datamodel.xystOrganization</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>id</m:name>
<m:title>id</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>driverName</m:name>
<m:title>司机姓名</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>idCard</m:name>
<m:title>身份证号</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>contactDetails</m:name>
<m:title>联系方式</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>createTime</m:name>
<m:title>创建时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>creator.name</m:name>
<m:title>创建人</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>modifyTime</m:name>
<m:title>修改时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>modifier.name</m:name>
<m:title>修改人</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>discard</m:name>
<m:title>废弃</m:title>
<m:type>boolean</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>del</m:name>
<m:title>删除</m:title>
<m:type>boolean</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
</m:fields>
</m:query>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping
http://www.hibernate.org/xsd/hibernate-mapping/hibernate-mapping-4.0.xsd">
<class entity-name="com.xyst.dinas.transport.datamodel.TransportDriver" table="xyst_dinas_transport_driver" optimistic-lock="version">
<tuplizer entity-mode="dynamic-map" class="com.beecode.bcp.store.hibernate.KObjectEntityTuplizer" />
<id name="id" type="uuid-binary" column="id" length="16">
<generator class="assigned" />
</id>
<version name="version" type="int" column="version"/>
<property name="createTime" type="timestamp" not-null="false">
<column name="create_time"/>
</property>
<many-to-one name="creator" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
<column name="creator_id" not-null="false"/>
</many-to-one>
<property name="modifyTime" type="timestamp" not-null="false">
<column name="modify_time"/>
</property>
<many-to-one name="modifier" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
<column name="modifier_id" not-null="false"/>
</many-to-one>
<property name="billState" type="nstring" not-null="false">
<column name="bill_state" length="100"/>
</property>
<many-to-one name="bizProcess" entity-name="com.beecode.bap.workflow.datamodel.BizProcess" fetch="select">
<column name="biz_process_id" not-null="false"/>
</many-to-one>
<property name="billCode" type="nstring" not-null="false">
<column name="bill_code" length="200"/>
</property>
<property name="discard" type="boolean" not-null="false">
<column name="discard"/>
</property>
<property name="del" type="boolean" not-null="false">
<column name="del"/>
</property>
<property name="approveState" type="integer" not-null="false">
<column name="approve_state"/>
</property>
<many-to-one name="regionalCompany" entity-name="com.xyst.dinas.biz.datamodel.xystOrganization" fetch="select">
<column name="regional_company" not-null="false">
<comment>所属组织机构</comment>
</column>
</many-to-one>
<property name="driverName" type="nstring" not-null="true">
<column name="driver_name" length="13">
<comment>司机姓名</comment>
</column>
</property>
<property name="idCard" type="nstring" not-null="false">
<column name="id_card" length="100">
<comment>身份证号</comment>
</column>
</property>
<property name="contactDetails" type="nstring" not-null="false">
<column name="contact_details" length="100">
<comment>联系方式</comment>
</column>
</property>
</class>
</hibernate-mapping>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment