Merge remote-tracking branch 'origin/main'
# Conflicts: # src/main/java/com/bonus/gzcar/business/backstage/mapper/HomeIndexMapper.java # src/main/resources/mappers/business/backstage/HomeIndexMapper.xml
This commit is contained in:
commit
24d5e757b3
|
|
@ -12,6 +12,8 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.gzcar.business.backstage.entity.BackParamsDto;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomeDispatchDetailVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomePlanDetailVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomeProDetailVo;
|
||||
import com.bonus.gzcar.business.backstage.service.HomeIndexService;
|
||||
import com.bonus.gzcar.manager.annotation.DecryptAndVerify;
|
||||
|
|
@ -128,4 +130,50 @@ public class HomeIndexController {
|
|||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "首页-二级页面-需求计划详情")
|
||||
@GetMapping("getPlanDetails")
|
||||
@DecryptAndVerify(decryptedClass = BackParamsDto.class)
|
||||
public PageInfo<HomePlanDetailVo> getPlanDetails(EncryptedReq<BackParamsDto> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<HomePlanDetailVo> list = service.getPlanDetails(dto.getData());;
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "首页-二级页面-需求计划详情导出")
|
||||
@PostMapping("exportPlanDetails")
|
||||
public void exportPlanDetails(HttpServletResponse response, @RequestBody BackParamsDto dto) {
|
||||
try {
|
||||
List<HomePlanDetailVo> list = service.getPlanDetails(dto);
|
||||
final int[] num = {1};
|
||||
list.forEach(vo -> {
|
||||
vo.setSerialNum(num[0]);
|
||||
if(Objects.equals(vo.getDispatchStatus(),"1")){
|
||||
vo.setDispatchStatus("未派车");
|
||||
}else if(Objects.equals(vo.getDispatchStatus(),"2")){
|
||||
vo.setDispatchStatus("已派车");
|
||||
}
|
||||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("需求计划详情", "需求计划详情", ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, HomePlanDetailVo.class, list);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("需求计划详情" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "首页-二级页面-派车详情")
|
||||
@GetMapping("getDispatchDetails")
|
||||
@DecryptAndVerify(decryptedClass = BackParamsDto.class)
|
||||
public PageInfo<HomeDispatchDetailVo> getDispatchDetails(EncryptedReq<BackParamsDto> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<HomeDispatchDetailVo> list = service.getDispatchDetails(dto.getData());;
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.gzcar.business.backstage.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:HomeProDetailVo
|
||||
* @author:cwchen
|
||||
* @date:2025-01-16-16:34
|
||||
* @version:1.0
|
||||
* @description:首页-派车详情-vo
|
||||
*/
|
||||
@Data
|
||||
public class HomeDispatchDetailVo {
|
||||
|
||||
/**序号*/
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private int serialNum;
|
||||
/**车辆类型 1.车辆 2.吊车*/
|
||||
private int type;
|
||||
/**名称*/
|
||||
@Excel(name = "名称", width = 20.0, orderNum = "1")
|
||||
private String name;
|
||||
/**规格*/
|
||||
@Excel(name = "规格", width = 20.0, orderNum = "2")
|
||||
private String model;
|
||||
/**单位*/
|
||||
@Excel(name = "单位", width = 20.0, orderNum = "3")
|
||||
private String unit;
|
||||
/**说明(根据车辆/吊车自动生成)*/
|
||||
@Excel(name = "说明", width = 20.0, orderNum = "4")
|
||||
private String remark;
|
||||
/**金额*/
|
||||
@Excel(name = "金额", width = 20.0, orderNum = "5")
|
||||
private double money;
|
||||
/**付款状态*/
|
||||
@Excel(name = "付款状态", width = 20.0, orderNum = "6")
|
||||
private String payStatus;
|
||||
/**需求计划编号*/
|
||||
@Excel(name = "需求计划编号", width = 20.0, orderNum = "7")
|
||||
private String code;
|
||||
/**工程名称*/
|
||||
@Excel(name = "工程名称", width = 20.0, orderNum = "8")
|
||||
private String proName;
|
||||
/**供应商*/
|
||||
@Excel(name = "供应商", width = 20.0, orderNum = "9")
|
||||
private String supName;
|
||||
/**派车日期*/
|
||||
@Excel(name = "派车日期", width = 20.0, orderNum = "10")
|
||||
private String dispatchDay;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.gzcar.business.backstage.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:HomeProDetailVo
|
||||
* @author:cwchen
|
||||
* @date:2025-01-16-16:34
|
||||
* @version:1.0
|
||||
* @description:首页-需求计划详情-vo
|
||||
*/
|
||||
@Data
|
||||
public class HomePlanDetailVo {
|
||||
|
||||
/**序号*/
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private int serialNum;
|
||||
/**车辆类型 1.车辆 2.吊车*/
|
||||
private int typeName;
|
||||
/**计划id*/
|
||||
private Long planId;
|
||||
/**需求计划编号*/
|
||||
@Excel(name = "需求计划编号", width = 20.0, orderNum = "1")
|
||||
private String code;
|
||||
/**工程名称*/
|
||||
@Excel(name = "工程名称", width = 20.0, orderNum = "2")
|
||||
private String proName;
|
||||
/**派车状态*/
|
||||
@Excel(name = "派车状态", width = 20.0, orderNum = "3")
|
||||
private String dispatchStatus;
|
||||
/**车辆数量*/
|
||||
@Excel(name = "车辆数量", width = 20.0, orderNum = "4")
|
||||
private int carNum;
|
||||
/**吊车数量*/
|
||||
@Excel(name = "吊车数量", width = 20.0, orderNum = "5")
|
||||
private int craneNum;
|
||||
/**待派车数量*/
|
||||
@Excel(name = "金额", width = 20.0, orderNum = "6")
|
||||
private double money;
|
||||
/**供应商*/
|
||||
@Excel(name = "供应商", width = 20.0, orderNum = "7")
|
||||
private String supName;
|
||||
/**付款状态*/
|
||||
@Excel(name = "付款状态", width = 20.0, orderNum = "8")
|
||||
private String payStatus;
|
||||
/**所属分公司*/
|
||||
@Excel(name = "所属分公司", width = 20.0, orderNum = "9")
|
||||
private String companyName;
|
||||
}
|
||||
|
|
@ -108,16 +108,20 @@ public interface HomeIndexMapper {
|
|||
List<HomeProDetailVo> getProDetails(BackParamsDto dto);
|
||||
|
||||
/**
|
||||
* 查询支付金额及计划条数
|
||||
* 首页-二级页面-需求计划详情
|
||||
* @param dto
|
||||
* @return
|
||||
* @return List<HomePlanDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2025/1/17 12:48
|
||||
*/
|
||||
IndexVo getPayMoney(BackParamsDto dto);
|
||||
List<HomePlanDetailVo> getPlanDetails(BackParamsDto dto);
|
||||
|
||||
/**
|
||||
* 查询未支付计划 z0
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
* @return List<HomeDispatchDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2025/1/17 14:18
|
||||
*/
|
||||
IndexVo getNoPayMoney(BackParamsDto dto);
|
||||
List<HomeDispatchDetailVo> getDispatchDetails(BackParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.gzcar.business.backstage.service;
|
||||
|
||||
import com.bonus.gzcar.business.backstage.entity.BackParamsDto;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomeDispatchDetailVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomePlanDetailVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomeProDetailVo;
|
||||
import com.bonus.gzcar.manager.webResult.ServerResponse;
|
||||
|
||||
|
|
@ -87,5 +89,21 @@ public interface HomeIndexService {
|
|||
*/
|
||||
List<HomeProDetailVo> getProDetails(BackParamsDto data);
|
||||
|
||||
/**
|
||||
* 首页-二级页面-需求计划详情
|
||||
* @param data
|
||||
* @return List<HomePlanDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2025/1/17 12:47
|
||||
*/
|
||||
List<HomePlanDetailVo> getPlanDetails(BackParamsDto data);
|
||||
|
||||
/**
|
||||
* 首页-二级页面-派车详情
|
||||
* @param data
|
||||
* @return List<HomeDispatchDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2025/1/17 14:17
|
||||
*/
|
||||
List<HomeDispatchDetailVo> getDispatchDetails(BackParamsDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,11 +324,11 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
|
||||
@Override
|
||||
public ServerResponse getCompanyData(BackParamsDto dto) {
|
||||
List<Map<String,String>> list = new ArrayList<>();
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getCompanyData(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createSuccess(list);
|
||||
}
|
||||
|
|
@ -336,7 +336,7 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
@Override
|
||||
public List<HomeProDetailVo> getProDetails(BackParamsDto dto) {
|
||||
List<HomeProDetailVo> list = new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(dto.getYear()) && StringUtils.isNotEmpty(dto.getMonth())){
|
||||
if (StringUtils.isNotEmpty(dto.getYear()) && StringUtils.isNotEmpty(dto.getMonth())) {
|
||||
dto.setYearMonth(dto.getYear() + "-" + dto.getMonth());
|
||||
}
|
||||
try {
|
||||
|
|
@ -346,7 +346,47 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
// 金额待计算
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HomePlanDetailVo> getPlanDetails(BackParamsDto dto) {
|
||||
List<HomePlanDetailVo> list = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(dto.getYear()) && StringUtils.isNotEmpty(dto.getMonth())) {
|
||||
dto.setYearMonth(dto.getYear() + "-" + dto.getMonth());
|
||||
}
|
||||
try {
|
||||
list = mapper.getPlanDetails(dto);
|
||||
for (HomePlanDetailVo vo : list) {
|
||||
if (vo.getTypeName() == 1) {
|
||||
vo.setCraneNum(0);
|
||||
} else {
|
||||
vo.setCarNum(0);
|
||||
}
|
||||
// 金额待计算
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HomeDispatchDetailVo> getDispatchDetails(BackParamsDto dto) {
|
||||
List<HomeDispatchDetailVo> list = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(dto.getYear()) && StringUtils.isNotEmpty(dto.getMonth())) {
|
||||
dto.setYearMonth(dto.getYear() + "-" + dto.getMonth());
|
||||
}
|
||||
try {
|
||||
list = mapper.getDispatchDetails(dto);
|
||||
for (HomeDispatchDetailVo vo : list) {
|
||||
|
||||
// 金额待计算
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,6 +137,12 @@
|
|||
<if test="month!=null and month!=''">
|
||||
AND DATE_FORMAT(cpa.create_time,'%m') = #{month}
|
||||
</if>
|
||||
<if test="companyId!=null and companyId!=''">
|
||||
AND INSTR(bp.bmname,#{companyId}) > 0
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
AND INSTR(bp.name,#{proName}) > 0
|
||||
</if>
|
||||
AND cpa.`status` = '2' AND cpa.status_type = '1'
|
||||
</where>
|
||||
GROUP BY cpa.pro_id
|
||||
|
|
@ -146,19 +152,53 @@
|
|||
ELSE '1' END = #{dispatchStatus})
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPayMoney" resultType="com.bonus.gzcar.business.backstage.entity.IndexVo">
|
||||
SELECT count(csp.plan_id) num,sum(csp.money) money
|
||||
from car_slt_plan csp
|
||||
left join car_slt_apply sla on csp.slt_id=sla.id
|
||||
<!--首页-二级页面-需求计划详情-->
|
||||
<select id="getPlanDetails" resultType="com.bonus.gzcar.business.backstage.entity.HomePlanDetailVo">
|
||||
SELECT cpa.id AS planId,
|
||||
cpa.pro_id AS proId,
|
||||
bp.name AS proName,
|
||||
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,
|
||||
cs.name AS supName,
|
||||
cpa.code
|
||||
FROM car_plan_apply cpa
|
||||
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
|
||||
<where>
|
||||
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
||||
AND DATE_FORMAT(sla.create_time,'%Y-%m-%d') BETWEEN #{params.startTime} AND #{params.endTime}
|
||||
<if test="yearMonth!=null and yearMonth!=''">
|
||||
AND DATE_FORMAT(cpa.create_time,'%Y-%m') = #{yearMonth}
|
||||
</if>
|
||||
<if test="year!=null and year!=''">
|
||||
AND DATE_FORMAT(cpa.create_time,'%Y') = #{year}
|
||||
</if>
|
||||
<if test="month!=null and month!=''">
|
||||
AND DATE_FORMAT(cpa.create_time,'%m') = #{month}
|
||||
</if>
|
||||
<if test="companyId!=null and companyId!=''">
|
||||
AND INSTR(bp.bmname,#{companyId}) > 0
|
||||
</if>
|
||||
<if test="supName!=null and supName!=''">
|
||||
AND INSTR(cs.name,#{supName}) > 0
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
AND INSTR(bp.name,#{proName}) > 0
|
||||
</if>
|
||||
<if test="code!=null and code!=''">
|
||||
AND INSTR(cpa.code,#{code}) > 0
|
||||
</if>
|
||||
AND cpa.`status` = '2' AND cpa.status_type = '1'
|
||||
</where>
|
||||
</select>
|
||||
<select id="getNoPayMoney" resultType="com.bonus.gzcar.business.backstage.entity.IndexVo">
|
||||
|
||||
<!--首页-二级页面-派车详情-->
|
||||
<select id="getDispatchDetails"
|
||||
resultType="com.bonus.gzcar.business.backstage.entity.HomeDispatchDetailVo">
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue