首页接口修改
This commit is contained in:
parent
93d3133e14
commit
d498d9e069
|
|
@ -16,6 +16,7 @@ import com.bonus.gzcar.business.backstage.service.HomeIndexService;
|
|||
import com.bonus.gzcar.manager.annotation.DecryptAndVerify;
|
||||
import com.bonus.gzcar.manager.core.entity.EncryptedReq;
|
||||
import com.bonus.gzcar.manager.webResult.ServerResponse;
|
||||
import com.bonus.gzcar.manager.webResult.StringUtils;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -226,6 +227,18 @@ public class HomeIndexController {
|
|||
final int[] num = {1};
|
||||
list.forEach(vo -> {
|
||||
vo.setSerialNum(num[0]);
|
||||
if(vo.getTypeName() == 2 && StringUtils.isNotEmpty(vo.getRemark())){ // 吊车
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String[] remarkArr = vo.getRemark().split("@");
|
||||
sb.append(vo.getPlanDay()).append("天").append(" 单价:¥");
|
||||
if(Objects.equals(vo.getIsDayOrMonth(),"1")){
|
||||
sb.append(vo.getDayPrice()).append("(元/日/台)");
|
||||
}else if(Objects.equals(vo.getIsDayOrMonth(),"2")){
|
||||
sb.append(vo.getMonthPrice()).append("(元/月/台)");
|
||||
}
|
||||
sb.append("\t\n").append(remarkArr[0]).append("\t\n").append(remarkArr[1]);
|
||||
vo.setRemark(sb.toString());
|
||||
}
|
||||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("派车详情", "派车详情", ExcelType.XSSF);
|
||||
|
|
|
|||
|
|
@ -18,17 +18,19 @@ public class HomeDispatchDetailVo {
|
|||
private int serialNum;
|
||||
/**车辆类型 1.车辆 2.吊车*/
|
||||
private int typeName;
|
||||
/**需求计划id*/
|
||||
private Long planId;
|
||||
/**名称*/
|
||||
@Excel(name = "名称", width = 20.0, orderNum = "1")
|
||||
private String name;
|
||||
/**规格*/
|
||||
@Excel(name = "规格", width = 20.0, orderNum = "2")
|
||||
@Excel(name = "规格", width = 10.0, orderNum = "2")
|
||||
private String model;
|
||||
/**单位*/
|
||||
@Excel(name = "单位", width = 20.0, orderNum = "3")
|
||||
@Excel(name = "单位", width = 10.0, orderNum = "3")
|
||||
private String unit;
|
||||
/**说明(根据车辆/吊车自动生成)*/
|
||||
@Excel(name = "说明", width = 20.0, orderNum = "4")
|
||||
@Excel(name = "说明", width = 50.0, orderNum = "4")
|
||||
private String remark;
|
||||
/**金额*/
|
||||
@Excel(name = "金额", width = 20.0, orderNum = "5")
|
||||
|
|
@ -49,4 +51,13 @@ public class HomeDispatchDetailVo {
|
|||
@Excel(name = "派车日期", width = 20.0, orderNum = "10")
|
||||
private String dispatchDay;
|
||||
|
||||
/**是否月租 1.日结 2.月租*/
|
||||
private String isDayOrMonth;
|
||||
/**日租单价*/
|
||||
private double dayPrice;
|
||||
/**月租单价*/
|
||||
private double monthPrice;
|
||||
/**使用天数*/
|
||||
private int planDay;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,4 +47,6 @@ public class HomePlanDetailVo {
|
|||
/**所属分公司*/
|
||||
@Excel(name = "所属分公司", width = 20.0, orderNum = "9")
|
||||
private String companyName;
|
||||
/**派车数量*/
|
||||
private int dispatchNum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
if (CollectionUtils.isNotEmpty(carNumList)) {
|
||||
int carNum = 0, noDispatchCarNum = 0;
|
||||
for (Map<String, Integer> map : carNumList) {
|
||||
Integer needNum = map.get("needNum");
|
||||
Integer dispatchNum = map.get("dispatchNum");
|
||||
carNum += needNum;
|
||||
int needNum = Integer.parseInt(String.valueOf(map.get("needNum")));
|
||||
int dispatchNum = Integer.parseInt(String.valueOf(map.get("dispatchNum")));
|
||||
carNum += dispatchNum;
|
||||
noDispatchCarNum += (needNum - dispatchNum);
|
||||
}
|
||||
dataList.add(0, carNum);
|
||||
|
|
@ -85,9 +85,9 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
if (CollectionUtils.isNotEmpty(carNumList)) {
|
||||
int craneNum = 0, noDispatchCraneNum = 0;
|
||||
for (Map<String, Integer> map : carNumList) {
|
||||
Integer needNum = map.get("needNum");
|
||||
Integer dispatchNum = map.get("dispatchNum");
|
||||
craneNum += needNum;
|
||||
int needNum = Integer.parseInt(String.valueOf(map.get("needNum")));
|
||||
int dispatchNum = Integer.parseInt(String.valueOf(map.get("dispatchNum")));
|
||||
craneNum += dispatchNum;
|
||||
noDispatchCraneNum += (needNum - dispatchNum);
|
||||
}
|
||||
dataList.add(0, craneNum);
|
||||
|
|
@ -104,9 +104,10 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
IndexVo indexVo = mapper.getPayMoney(dto);
|
||||
if(StringHelper.isEmpty(indexVo.getMoney())){
|
||||
indexVo.setMoney("0");
|
||||
indexVo.setNum("0");
|
||||
}
|
||||
dataList.add(0, indexVo != null ? Double.parseDouble(indexVo.getMoney()) : 0);
|
||||
dataList.add(1, indexVo != null ? Integer.parseInt(indexVo.getNum()) : 0);
|
||||
dataList.add(0, Double.parseDouble(indexVo.getMoney()));
|
||||
dataList.add(1, Integer.parseInt(indexVo.getNum()));
|
||||
return dataList;
|
||||
});
|
||||
Future<List<Object>> future6 = testTaskExecutor.submit(() -> {
|
||||
|
|
@ -114,10 +115,11 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
IndexVo indexVo = mapper.getNoPayMoney(dto);
|
||||
if(StringHelper.isEmpty(indexVo.getMoney())){
|
||||
indexVo.setMoney("0");
|
||||
indexVo.setNum("0");
|
||||
}
|
||||
List<Object> dataList = new ArrayList<>(2);
|
||||
dataList.add(0, indexVo != null ? Double.parseDouble(indexVo.getMoney()) : 0);
|
||||
dataList.add(1, indexVo != null ? Integer.parseInt(indexVo.getNum()) : 0);
|
||||
dataList.add(0, Double.parseDouble(indexVo.getMoney()));
|
||||
dataList.add(1, Integer.parseInt(indexVo.getNum()));
|
||||
return dataList;
|
||||
});
|
||||
fList = future.get();
|
||||
|
|
@ -413,7 +415,6 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
}
|
||||
needNum += viewVo.getNeedNum();
|
||||
dispatchNum += viewVo.getDispatchNum();
|
||||
// 金额待计算
|
||||
}
|
||||
vo.setPlanNum(list.size());
|
||||
vo.setCarNum(carNum);
|
||||
|
|
@ -438,10 +439,11 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
for (HomePlanDetailVo vo : list) {
|
||||
if (vo.getTypeName() == 1) {
|
||||
vo.setCraneNum(0);
|
||||
vo.setCarNum(vo.getDispatchNum());
|
||||
} else {
|
||||
vo.setCarNum(0);
|
||||
vo.setCraneNum(vo.getDispatchNum());
|
||||
}
|
||||
// 金额待计算
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
|
|||
|
|
@ -47,8 +47,15 @@
|
|||
|
||||
<!--数据预览-运输车量/吊车量-->
|
||||
<select id="getCarNumList" resultType="java.util.Map">
|
||||
SELECT cpa.need_num AS needNum,dispatch_num AS dispatchNum
|
||||
SELECT cpa.need_num AS needNum,IFNULL(a.dispatchNum,0) AS dispatchNum
|
||||
FROM car_plan_apply cpa
|
||||
LEFT JOIN (
|
||||
SELECT cpo.apply_id AS apply_id,
|
||||
SUM(ANY_VALUE(cpo.dispatch_num)) AS dispatchNum
|
||||
FROM car_plan_out cpo
|
||||
WHERE cpo.type = #{type} AND cpo.status = '1'
|
||||
GROUP BY cpo.apply_id
|
||||
) a ON cpa.id = a.apply_id
|
||||
<where>
|
||||
<if test="params.startTime!=null and params.startTime!='' and params.endTime!=null and params.endTime!=''">
|
||||
AND DATE_FORMAT(cpa.create_time,'%Y-%m-%d') BETWEEN #{params.startTime} AND #{params.endTime}
|
||||
|
|
@ -72,9 +79,16 @@
|
|||
SELECT bp.name AS proName,
|
||||
cpa.pro_id AS proId,
|
||||
cpa.need_num AS applyNum,
|
||||
cpa.dispatch_num AS dispatchNum
|
||||
IFNULL(a.dispatchNum,0) AS dispatchNum
|
||||
FROM car_plan_apply cpa
|
||||
LEFT JOIN bm_project bp ON cpa.pro_id = bp.bid_id
|
||||
LEFT JOIN (
|
||||
SELECT cpo.apply_id AS apply_id,
|
||||
SUM(ANY_VALUE(cpo.dispatch_num)) AS dispatchNum
|
||||
FROM car_plan_out cpo
|
||||
WHERE cpo.status = '1'
|
||||
GROUP BY cpo.apply_id
|
||||
) a ON cpa.id = a.apply_id
|
||||
<where>
|
||||
AND cpa.`status` = '2' AND cpa.status_type = '1'
|
||||
</where>
|
||||
|
|
@ -197,25 +211,24 @@
|
|||
cpa.need_num AS needNum,
|
||||
cpa.type AS typeName,
|
||||
bp.bmname AS companyName,
|
||||
cpa.dispatch_num AS carNum,
|
||||
cpa.dispatch_num AS craneNum,
|
||||
CASE WHEN cpa.dispatch_num = 0 THEN '1'
|
||||
WHEN cpa.dispatch_num > 0 THEN '2'
|
||||
END AS dispatchStatus,
|
||||
IFNULL( cpo.dispatch_num,0) dispatch_num,IFNULL(cpo.money,0) money,
|
||||
cs.name AS supName,
|
||||
cpa.code,
|
||||
if(csp.id is null,'未支付','已支付') payStatus
|
||||
IFNULL( cpo.dispatch_num,0) AS dispatchNum,
|
||||
IFNULL(cpo.money,0) AS money,
|
||||
CASE WHEN IFNULL( cpo.dispatch_num,0) = 0 THEN '1'
|
||||
WHEN IFNULL( cpo.dispatch_num,0) > 0 THEN '2'
|
||||
END AS dispatchStatus,
|
||||
cs.name AS supName,
|
||||
cpa.code,
|
||||
if(csp.id is null,'待付款','已付款') payStatus
|
||||
FROM car_plan_apply cpa
|
||||
LEFT JOIN car_slt_plan csp on csp.plan_id=cpa.id
|
||||
LEFT JOIN bm_project bp ON cpa.pro_id = bp.bid_id
|
||||
LEFT JOIN car_plan_apply_sup cpas ON cpa.id = cpas.apply_id
|
||||
LEFT JOIN car_supplier cs ON cpas.sup_id = cs.id
|
||||
left join(
|
||||
SELECT sum(dispatch_num) dispatch_num,sum(money) money,cpo.apply_id
|
||||
FROM car_plan_out cpo
|
||||
where cpo.status=1
|
||||
GROUP BY cpo.apply_id
|
||||
SELECT sum(dispatch_num) dispatch_num,sum(money) money,cpo.apply_id
|
||||
FROM car_plan_out cpo
|
||||
where cpo.status = '1'
|
||||
GROUP BY cpo.apply_id
|
||||
)cpo on cpo.apply_id=cpa.id
|
||||
<where>
|
||||
<if test="yearMonth!=null and yearMonth!=''">
|
||||
|
|
@ -239,6 +252,14 @@
|
|||
<if test="code!=null and code!=''">
|
||||
AND INSTR(cpa.code,#{code}) > 0
|
||||
</if>
|
||||
<if test="dispatchStatus!='0' and dispatchStatus!='' and dispatchStatus!=null">
|
||||
AND (CASE WHEN IFNULL( cpo.dispatch_num,0) = 0 THEN '1'
|
||||
WHEN IFNULL( cpo.dispatch_num,0) > 0 THEN '2'
|
||||
END = #{dispatchStatus})
|
||||
</if>
|
||||
<if test="payStatus!='0' and payStatus!='' and payStatus!=null">
|
||||
AND (IF(csp.id is null,'2','1') = #{payStatus})
|
||||
</if>
|
||||
AND cpa.`status` = '2' AND cpa.status_type = '1'
|
||||
</where>
|
||||
</select>
|
||||
|
|
@ -248,9 +269,16 @@
|
|||
resultType="com.bonus.gzcar.business.backstage.entity.HomeProPlanDataViewVo">
|
||||
SELECT cpa.id AS planId,
|
||||
cpa.type,
|
||||
cpa.dispatch_num AS dispatchNum,
|
||||
IFNULL(a.dispatchNum,0) AS dispatchNum,
|
||||
cpa.need_num AS needNum
|
||||
FROM car_plan_apply cpa
|
||||
LEFT JOIN (
|
||||
SELECT cpo.apply_id AS apply_id,
|
||||
SUM(ANY_VALUE(cpo.dispatch_num)) AS dispatchNum
|
||||
FROM car_plan_out cpo
|
||||
WHERE cpo.status = '1'
|
||||
GROUP BY cpo.apply_id
|
||||
) a ON cpa.id = a.apply_id
|
||||
<where>
|
||||
AND cpa.pro_id = #{proId}
|
||||
AND cpa.`status` = '2' AND cpa.status_type = '1'
|
||||
|
|
@ -272,7 +300,9 @@
|
|||
cpod.es_cost money, cpod.car_out_id carOutId,cmti.model,cmti.type,cmti.name,cpod.car_num carNum,csi.ton,
|
||||
day_or_m isDayOrMonth,cpod.remark,cpd.need_day needDay,
|
||||
cpa.code planCode,cpa.pro_id proId,
|
||||
if(csp.id is null,'未支付','已支付') payStatus
|
||||
if(csp.id is null,'待付款','已付款') payStatus,
|
||||
cpa.id AS planId,
|
||||
cpa.type AS typeName
|
||||
from car_plan_out_details cpod
|
||||
LEFT JOIN car_plan_out cpo on cpod.out_id=cpo.id
|
||||
left join car_plan_details cpd on cpd.apply_id=cpod.apply_id and cpd.model_id=cpod.model_id
|
||||
|
|
@ -302,7 +332,9 @@
|
|||
<if test="proName!=null and proName!=''">
|
||||
and pro.`name` like concat('%',#{proName},'%')
|
||||
</if>
|
||||
|
||||
<if test="payStatus!='0' and payStatus!='' and payStatus!=null">
|
||||
AND (IF(csp.id is null,'2','1') = #{payStatus})
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPayMoney" resultType="com.bonus.gzcar.business.backstage.entity.IndexVo">
|
||||
SELECT count(csp.plan_id) num,sum(csp.money) money
|
||||
|
|
|
|||
Loading…
Reference in New Issue