|
@@ -6,10 +6,7 @@ import com.slibra.business.domain.*;
|
|
|
import com.slibra.business.mapper.*;
|
|
|
import com.slibra.business.req.ChatReq;
|
|
|
import com.slibra.business.req.WorkOrderReq;
|
|
|
-import com.slibra.business.res.SmartAdd;
|
|
|
-import com.slibra.business.res.WorkOrderRes;
|
|
|
-import com.slibra.business.res.XinyiDailyFeeSimple;
|
|
|
-import com.slibra.business.res.XinyiIndustrySimple;
|
|
|
+import com.slibra.business.res.*;
|
|
|
import com.slibra.business.service.IFrontService;
|
|
|
import com.slibra.common.DecimalUtils;
|
|
|
import com.slibra.common.core.domain.TXinyiDaily;
|
|
@@ -432,6 +429,65 @@ public class FrontServiceImpl implements IFrontService {
|
|
|
return build;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, List<ChartBasic>> smartAddCharList(int type) {
|
|
|
+ //日期兜底处理
|
|
|
+ Date nowDate = DateUtils.getNowDate();
|
|
|
+ Date dayBefore7 = DateUtils.plusDate(-3, nowDate);
|
|
|
+ //先用日期获取当天和前一天的数据,如果获取不到,则提示错误信息
|
|
|
+ String nowDateStr = DateUtils.parseDateToStr(DateUtils.YYYYMMDD_TS, nowDate);
|
|
|
+ String dayBefore3Str = DateUtils.parseDateToStr(DateUtils.YYYYMMDD_TS, dayBefore7);
|
|
|
+ //返回的对象
|
|
|
+ Map<String, List<ChartBasic>> result = new HashMap<>();
|
|
|
+ List<ChartBasic> list = new ArrayList<>();
|
|
|
+ //先判断类型,然后根据不同类型,查询不同的数据
|
|
|
+ if(BusinessEnum.SmartAddMedicineReqEnum.JSLL.getCode() == type){
|
|
|
+ //查询仪表即可
|
|
|
+ list = this.xinyiIndustryMapper.selectJSLByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.YB.getCode(), list);
|
|
|
+ }else if(BusinessEnum.SmartAddMedicineReqEnum.HY_1_XSY.getCode() == type){
|
|
|
+ //查询化验室
|
|
|
+ list = this.xinyiRobotMapper.selectXSY1ByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.HY.getCode(), list);
|
|
|
+ //查询预测
|
|
|
+ list = this.xinyiForecastComparisonMapper.selectOneValAndTimeByDate(BusinessEnum.BigModelForecastEnum.XSY1.getCode());//SQL中处理日期 否则索引失效
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.YC.getCode(), list);
|
|
|
+ }else if(BusinessEnum.SmartAddMedicineReqEnum.HY_2_XSY.getCode() == type){
|
|
|
+ //查询化验室
|
|
|
+ list = this.xinyiRobotMapper.selectXSY2ByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.HY.getCode(), list);
|
|
|
+ //查询预测
|
|
|
+ list = this.xinyiForecastComparisonMapper.selectOneValAndTimeByDate(BusinessEnum.BigModelForecastEnum.XSY2.getCode());//SQL中处理日期 否则索引失效
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.YC.getCode(), list);
|
|
|
+ }else if(BusinessEnum.SmartAddMedicineReqEnum.QY_1_AD.getCode() == type){
|
|
|
+ //查询化验室
|
|
|
+ list = this.xinyiRobotMapper.selectAD1ByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.HY.getCode(), list);
|
|
|
+ }else if(BusinessEnum.SmartAddMedicineReqEnum.QY_2_AD.getCode() == type){
|
|
|
+ //查询化验室
|
|
|
+ list = this.xinyiRobotMapper.selectAD2ByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.HY.getCode(), list);
|
|
|
+ }else if(BusinessEnum.SmartAddMedicineReqEnum.JSCOD.getCode() == type){
|
|
|
+ //查询仪表即可
|
|
|
+ list = this.xinyiIndustryMapper.selectJsCodByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.YB.getCode(), list);
|
|
|
+ //查询化验室
|
|
|
+ list = this.xinyiRobotMapper.selectCodByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.HY.getCode(), list);
|
|
|
+ }else if(BusinessEnum.SmartAddMedicineReqEnum.JSTN.getCode() == type){
|
|
|
+ //查询仪表即可
|
|
|
+ list = this.xinyiIndustryMapper.selectJsTnByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.YB.getCode(), list);
|
|
|
+ }else if(BusinessEnum.SmartAddMedicineReqEnum.TYTJL.getCode() == type){
|
|
|
+ //查询仪表即可
|
|
|
+ list = this.xinyiIndustryMapper.selectTytzjlByDate(dayBefore3Str, nowDateStr);
|
|
|
+ result.put(BusinessEnum.DataSourceEnum.YB.getCode(), list);
|
|
|
+ }else{
|
|
|
+ log.info("暂不支持的类型~~~");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
private void buildIndustryData(TXinyiIndustry industry, WorkOrderRes workOrderRes, WorkOrderReq workOrderReq) {
|
|
|
if(workOrderReq.getJsSlq())
|
|
|
workOrderRes.setJsSlq(DecimalUtils.getAbsAndScale(industry.getJsSlq(), 2));
|