修改导出
This commit is contained in:
parent
ba244a9517
commit
29652bcad6
|
|
@ -43,6 +43,8 @@ public class CarBalanceController {
|
|||
@GetMapping("getSupPageList")
|
||||
@DecryptAndVerify(decryptedClass = CarBalanceVo.class)
|
||||
public PageInfo<CarBalanceVo> getSupPageList(EncryptedReq<CarBalanceVo> dto) {
|
||||
String supId=service.getSupId();
|
||||
dto.getData().setSupId(supId);
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<CarBalanceVo> list = service.getSupPageList(dto.getData());
|
||||
return new PageInfo<>(list);
|
||||
|
|
@ -121,6 +123,8 @@ public class CarBalanceController {
|
|||
@GetMapping("getBalanceData")
|
||||
@DecryptAndVerify(decryptedClass = CarBalancePlanVo.class)
|
||||
public PageInfo<CarBalancePlanVo> getBalanceData(EncryptedReq<CarBalancePlanVo> dto) {
|
||||
String supId=service.getSupId();
|
||||
dto.getData().setSupId(supId);
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<CarBalancePlanVo> list = service.getBalanceData(dto.getData());
|
||||
return new PageInfo<>(list);
|
||||
|
|
@ -150,6 +154,20 @@ public class CarBalanceController {
|
|||
return service.getBalanceDataDetails(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param response
|
||||
* @param dto
|
||||
*/
|
||||
@PostMapping("exportBalanceData")
|
||||
public void exportBalanceData(HttpServletResponse response, @RequestBody ExportBalanceDataVo dto) {
|
||||
try {
|
||||
List<ExportBalanceDataVo> list = service.getExportBalanceData(dto);
|
||||
ExportExcelUtil.export(response, "付款单详情", ExportBalanceDataVo.class, list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 结算审核
|
||||
* @param dto
|
||||
|
|
|
|||
|
|
@ -132,5 +132,7 @@ public class CarBalanceVo extends ParentVo {
|
|||
*/
|
||||
private String typeName;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,9 @@ public class CarContractSupCarVo {
|
|||
* 删除出入场数据id
|
||||
*/
|
||||
private String delOutId;
|
||||
|
||||
/**
|
||||
* 吨位
|
||||
*/
|
||||
private String ton;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -164,5 +164,10 @@ public class CarSltApplyDetailsVo {
|
|||
|
||||
private String useAddress;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,4 +66,9 @@ public class CarSltPlanVo {
|
|||
*/
|
||||
private String supName;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
package com.bonus.gzcar.business.backstage.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.bonus.gzcar.business.system.entity.ParentVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ExportBalanceDataVo {
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
|
||||
@Excel(name = "类型", width = 10.0, orderNum = "1")
|
||||
private String type;
|
||||
/**
|
||||
* 分包单位
|
||||
*/
|
||||
@Excel(name = "分包单位", width = 30.0, orderNum = "3")
|
||||
private String supName;
|
||||
|
||||
@Excel(name = "工程名称", width = 30.0, orderNum = "5")
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@Excel(name = "申请人", width = 10.0, orderNum = "7")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 计划编码
|
||||
*/
|
||||
@Excel(name = "计划编码", width = 20.0, orderNum = "9",mergeVertical = true)
|
||||
private String planCode;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@Excel(name = "审核状态", width = 10.0, orderNum = "11",mergeVertical = true)
|
||||
private String auditStatus;
|
||||
/**
|
||||
* 派车数量
|
||||
*/
|
||||
// @Excel(name = "派车数量", width = 10.0, orderNum = "13",mergeVertical = true)
|
||||
// private String num;
|
||||
|
||||
@Excel(name = "总金额", width = 10.0, orderNum = "15",mergeVertical = true)
|
||||
private BigDecimal allMoney;
|
||||
|
||||
|
||||
@Excel(name = "车牌号", width = 10.0, orderNum = "17")
|
||||
private String carNum;
|
||||
|
||||
@Excel(name = "起始地", width = 20.0, orderNum = "19")
|
||||
private String startAddress;
|
||||
/**
|
||||
* 目的地
|
||||
*/
|
||||
@Excel(name = "目的地", width = 20.0, orderNum = "21")
|
||||
private String endAddress;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
@Excel(name = "申请金额", width = 10.0, orderNum = "23")
|
||||
private BigDecimal money;
|
||||
|
||||
@Excel(name = "公里数/天数", width = 10.0, orderNum = "25")
|
||||
private String days;
|
||||
|
||||
/**
|
||||
* 公里数
|
||||
*/
|
||||
private String gls;
|
||||
/**
|
||||
* 使用天数
|
||||
*/
|
||||
|
||||
private String day;
|
||||
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
|
||||
/**
|
||||
* 用车数量
|
||||
*/
|
||||
private String planNum;
|
||||
/**
|
||||
* 结算id
|
||||
*/
|
||||
private String sltId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "申请时间", width = 10.0, orderNum = "27")
|
||||
private String createTime;
|
||||
|
||||
@Excel(name = "备注", width = 10.0, orderNum = "29")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
@ -182,5 +182,29 @@ public interface CarBalanceMapper {
|
|||
*/
|
||||
int deleteSltData(CarSltApplyVo dto);
|
||||
|
||||
/**
|
||||
* 修改计划状态
|
||||
* @param data
|
||||
*/
|
||||
void updatePlanStatus(CarSltApplyVo data);
|
||||
|
||||
/**
|
||||
* 修改详情状态
|
||||
* @param data
|
||||
*/
|
||||
void updateDetailsStatus(CarSltApplyVo data);
|
||||
|
||||
/**
|
||||
* 查询分包商信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<String> getSupId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 查询导出数据
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<ExportBalanceDataVo> getExportBalanceData(ExportBalanceDataVo dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.gzcar.business.backstage.entity.CarBalanceVo;
|
|||
import lombok.Data;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -34,7 +35,7 @@ public interface CarStatisticsMapper {
|
|||
* 金额统计
|
||||
* @return
|
||||
*/
|
||||
List<String> getMoney();
|
||||
List<BigDecimal> getMoney();
|
||||
|
||||
/**
|
||||
* 分公司结算统计
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.gzcar.business.backstage.mapper;
|
|||
|
||||
import com.bonus.gzcar.business.backstage.entity.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -217,4 +218,18 @@ public interface DispatchCarMapper {
|
|||
* @return
|
||||
*/
|
||||
List<ExportCarNeedPlanVo> getExportList(CarNeedPlanVo dto);
|
||||
|
||||
/**
|
||||
* 查询派车数量
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
String getOutCarNum(@Param("planId") String planId);
|
||||
|
||||
/**
|
||||
* 修改派车数量
|
||||
* @param outNum
|
||||
* @param planId
|
||||
*/
|
||||
void updateCarNum(@Param("carNum") String outNum,@Param("planId") String planId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,4 +105,17 @@ public interface CarBalanceService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse<String> delBalanceData(CarSltApplyVo dto);
|
||||
|
||||
/**
|
||||
* 获取supId
|
||||
* @return
|
||||
*/
|
||||
String getSupId();
|
||||
|
||||
/**
|
||||
* 导出申请
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<ExportBalanceDataVo> getExportBalanceData(ExportBalanceDataVo dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.bonus.gzcar.manager.common.util.UserUtil;
|
|||
import com.bonus.gzcar.manager.webResult.ServerResponse;
|
||||
import com.bonus.gzcar.manager.webResult.StringUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -130,7 +131,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
//待审核
|
||||
data.setAuditStatus("-1");
|
||||
//待下个节点审核
|
||||
data.setAuditType("-1");
|
||||
data.setAuditType("-1");
|
||||
int num = mapper.addBalanceData(data);
|
||||
if (num > 0) {
|
||||
uploadService.uploadImage(files, data.getId(), "car_slt_apply", "结算附件");
|
||||
|
|
@ -141,7 +142,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
List<CarSltApplyDetailsVo> detailsVoList = data.getDetailsList();
|
||||
int sucNum = mapper.addBalanceDetailsData(data, detailsVoList);
|
||||
if (sucNum == detailsVoList.size()) {
|
||||
return ServerResponse.createBySuccessMsg("结算成功");
|
||||
return ServerResponse.createBySuccessMsg("新增成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -150,7 +151,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
|
||||
}
|
||||
return ServerResponse.createErroe("新增结算失败");
|
||||
return ServerResponse.createErroe("新增失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -160,6 +161,8 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
data.setAuditStatus("1");
|
||||
data.setAuditType("1");
|
||||
mapper.updateStatus(data);
|
||||
mapper.updatePlanStatus(data);
|
||||
mapper.updateDetailsStatus(data);
|
||||
CarSltAuditVo carSltAuditVo = new CarSltAuditVo(data.getId(),"0", DateTimeHelper.getNowTime(),userId,"0","","发起结算申请");
|
||||
mapper.insertCarSltAudit(carSltAuditVo);
|
||||
return ServerResponse.createSuccess("提交成功");
|
||||
|
|
@ -191,6 +194,8 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
data.setAuditStatus(nextStatus);
|
||||
data.setAuditType(nextType);
|
||||
mapper.updateStatus(data);
|
||||
mapper.updatePlanStatus(data);
|
||||
mapper.updateDetailsStatus(data);
|
||||
return ServerResponse.createSuccess("审核成功");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(), e);
|
||||
|
|
@ -247,6 +252,36 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
return ServerResponse.createErroe("删除失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSupId() {
|
||||
try{
|
||||
String userId = Objects.requireNonNull(UserUtil.getLoginUser()).getUserId().toString();
|
||||
List<String> supId=mapper.getSupId(userId);
|
||||
if(ListHelpUtil.isEmpty(supId)){
|
||||
return null;
|
||||
}
|
||||
return supId.get(0);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出申请信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ExportBalanceDataVo> getExportBalanceData(ExportBalanceDataVo dto) {
|
||||
try{
|
||||
return mapper.getExportBalanceData(dto);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下一个节点
|
||||
* @param auditType
|
||||
|
|
@ -336,7 +371,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
List<CarSltApplyDetailsVo> detailsVoList = data.getDetailsList();
|
||||
int sucNum = mapper.addBalanceDetailsData(data, detailsVoList);
|
||||
if (sucNum == detailsVoList.size()) {
|
||||
return ServerResponse.createBySuccessMsg("结算成功");
|
||||
return ServerResponse.createBySuccessMsg("修改成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -345,7 +380,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createErroe("新增结算失败");
|
||||
return ServerResponse.createErroe("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -404,6 +439,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
*/
|
||||
public void sltMoney(CarSltApplyVo data,boolean isUpdate){
|
||||
try{
|
||||
Map<String,Integer> planCarMap= Maps.newHashMap();
|
||||
List<CarSltPlanVo> planList=data.getPlanList();
|
||||
Map<String, List<CarSltApplyDetailsVo>> outList = new HashMap<>();
|
||||
List<CarSltApplyDetailsVo> detailsVoList = data.getDetailsList();
|
||||
|
|
@ -425,7 +461,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
List<CarSltApplyDetailsVo> detailList = entry.getValue();
|
||||
CarPlanOutVo carplanOut=mapper.getCarPlanOutVo(outId);
|
||||
//计算金额然后进行修改
|
||||
getContractMoney(detailList,Integer.parseInt(planVo.getType()),carplanOut,isUpdate);
|
||||
getContractMoney(detailList,Integer.parseInt(planVo.getType()),carplanOut,isUpdate,planCarMap);
|
||||
BigDecimal planMoney = new BigDecimal(carplanOut.getMoney());
|
||||
|
||||
CarSltApplyDetailsVo details=detailList.get(0);
|
||||
|
|
@ -441,6 +477,11 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
for (CarSltPlanVo carSltPlanVo : planList) {
|
||||
BigDecimal allPlanMoney=map.get(carSltPlanVo.getPlanId());
|
||||
carSltPlanVo.setExeMoney(allPlanMoney.toString());
|
||||
Integer carNum=planCarMap.get(carSltPlanVo.getPlanId());
|
||||
if(carNum==null){
|
||||
carNum=0;
|
||||
}
|
||||
mapper.updateCarNum(carSltPlanVo.getPlanId(),carNum);
|
||||
}
|
||||
// 实际金额
|
||||
data.setExeMoney(allMoney.toString());
|
||||
|
|
@ -507,7 +548,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
* @param outVo
|
||||
* @return
|
||||
*/
|
||||
private void getContractMoney(List<CarSltApplyDetailsVo> list, int planType, CarPlanOutVo outVo,boolean isUpdate) {
|
||||
private void getContractMoney(List<CarSltApplyDetailsVo> list, int planType, CarPlanOutVo outVo,boolean isUpdate, Map<String,Integer> planCarMap) {
|
||||
BigDecimal allMoney = new BigDecimal(0);
|
||||
for (CarSltApplyDetailsVo vo : list) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
|
@ -660,7 +701,13 @@ public class CarBalanceServiceImpl implements CarBalanceService {
|
|||
if(isUpdate){
|
||||
outVo.setYgMoney("");
|
||||
}
|
||||
mapper.updateCarNum(outVo.getPlanId(),list.size());
|
||||
Integer carNum=planCarMap.get(outVo.getPlanId());
|
||||
if(carNum==null){
|
||||
carNum=list.size();
|
||||
}else {
|
||||
carNum=carNum+ list.size();
|
||||
}
|
||||
planCarMap.put(outVo.getPlanId(),carNum);
|
||||
mapper.updatePlanOut(outVo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,15 +51,13 @@ public class CarStatisticsServiceImpl implements CarStatisticsService{
|
|||
map.put("needPlan",integerIsNull(needPlan));
|
||||
Integer supNum=mapper.getSupNum();
|
||||
map.put("supNum",integerIsNull(supNum));
|
||||
List<String> list=mapper.getMoney();
|
||||
List<BigDecimal> list=mapper.getMoney();
|
||||
if (ListHelpUtil.isNotEmpty(list)){
|
||||
String money=list.get(0);
|
||||
String payMoney=list.get(1);
|
||||
BigDecimal moneys=new BigDecimal(money);
|
||||
BigDecimal payMoneys=new BigDecimal(payMoney);
|
||||
BigDecimal noPayMoney=moneys.subtract(payMoneys);
|
||||
map.put("money",money);
|
||||
map.put("payMoney",payMoney);
|
||||
BigDecimal money=list.get(0);
|
||||
BigDecimal payMoney=list.get(1);
|
||||
BigDecimal noPayMoney=money.subtract(payMoney);
|
||||
map.put("money",money.toString());
|
||||
map.put("payMoney",payMoney.toString());
|
||||
map.put("noPayMoney",noPayMoney.toString());
|
||||
}else{
|
||||
map.put("money",0);
|
||||
|
|
|
|||
|
|
@ -145,7 +145,13 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
@Override
|
||||
public List<CarNeedPlanVo> getNeedPlanList(CarNeedPlanVo data) {
|
||||
try {
|
||||
return mapper.getNeedPlanList(data);
|
||||
List<CarNeedPlanVo> list= mapper.getNeedPlanList(data);
|
||||
//数据纠正
|
||||
for (CarNeedPlanVo listVo : list) {
|
||||
String outNum=mapper.getOutCarNum(listVo.getId());
|
||||
mapper.updateCarNum(outNum,listVo.getId());
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
|
|
@ -292,10 +298,11 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
// 分管领导通过后,如果没有其他待审核记录,状态置为2(待调度),否则0(继续审核)
|
||||
carNeedPlanVo.setStatus(ListHelpUtil.isEmpty(auditList) ? 2 : 0);
|
||||
}
|
||||
// 更新计划信息
|
||||
mapper.updateCarPlanInfo(carNeedPlanVo);
|
||||
}
|
||||
|
||||
// 更新计划信息
|
||||
mapper.updateCarPlanInfo(carNeedPlanVo);
|
||||
|
||||
|
||||
// 写操作记录
|
||||
String uptime = recordService.getUpTimes("out-" + data.getId(), Integer.parseInt(targetStatus));
|
||||
|
|
|
|||
|
|
@ -47,4 +47,6 @@ public class ParentVo {
|
|||
*/
|
||||
private List<FileUploadVo> fileList;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,16 +27,16 @@
|
|||
</insert>
|
||||
<insert id="addSltPlanInfo" >
|
||||
insert into car_slt_plan
|
||||
( slt_id, plan_id, sup_id, money, car_num, type, pro_id ,yg_money)values
|
||||
( slt_id, plan_id, sup_id, money, car_num, type, pro_id ,yg_money,audit_status)values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{param.id},#{item.planId},#{item.supId},#{item.exeMoney},#{item.carNum},#{item.type},#{item.proId},#{item.money})
|
||||
(#{param.id},#{item.planId},#{item.supId},#{item.exeMoney},#{item.carNum},#{item.type},#{item.proId},#{item.money},#{param.auditStatus})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="addBalanceDetailsData">
|
||||
insert into car_slt_details
|
||||
( slt_id, plan_id, sup_id, out_id, money, type, pro_id,yg_money,out_detail_id )values
|
||||
( slt_id, plan_id, sup_id, out_id, money, type, pro_id,yg_money,out_detail_id,audit_status )values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{param.id},#{item.planId},#{item.supId},#{item.outId},#{item.cost},#{item.type},#{item.proId},#{item.money},#{item.outDetailId})
|
||||
(#{param.id},#{item.planId},#{item.supId},#{item.outId},#{item.cost},#{item.type},#{item.proId},#{item.money},#{item.outDetailId},#{param.auditStatus})
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
|
@ -79,6 +79,14 @@
|
|||
update car_slt_apply set audit_type=#{auditType},audit_status=#{auditStatus}
|
||||
where id=#{id}
|
||||
</update>
|
||||
<update id="updatePlanStatus">
|
||||
update car_slt_plan set audit_status=#{auditStatus}
|
||||
where slt_id=#{id}
|
||||
</update>
|
||||
<update id="updateDetailsStatus">
|
||||
update car_slt_details set audit_status=#{auditStatus}
|
||||
where slt_id=#{id}
|
||||
</update>
|
||||
|
||||
<!--查询 供应商集合-->
|
||||
<select id="getSupPageList" resultType="com.bonus.gzcar.business.backstage.entity.CarBalanceVo">
|
||||
|
|
@ -105,6 +113,9 @@
|
|||
<if test="keyWord!=null and keyWord!=''">
|
||||
and cs.name like concat('%',#{keyWord},'%')
|
||||
</if>
|
||||
<if test="supId!=null and supId!=''">
|
||||
and cpo.sup_id =#{supId}
|
||||
</if>
|
||||
GROUP BY
|
||||
cpo.sup_id
|
||||
</select>
|
||||
|
|
@ -117,11 +128,11 @@
|
|||
cpa.dispatch_day lastDay,cpa.user_name userName
|
||||
FROM car_plan_apply cpa
|
||||
LEFT JOIN car_slt_plan csp on csp.plan_id=cpa.id
|
||||
left join car_plan_out cpo on cpa.id=cpo.apply_id AND cpo.status=2
|
||||
left join car_plan_out cpo on cpa.id=cpo.apply_id
|
||||
left join car_plan_apply_sup cpas on cpas.apply_id=cpa.id
|
||||
left join car_supplier cs on cpas.sup_id=cs.id
|
||||
left join bm_project pro on pro.id=cpa.pro_id
|
||||
where cpa.dispatch_num>0 and cpas.sup_id=#{supId} and csp.id is null
|
||||
where cpa.dispatch_num>0 and cpas.sup_id=#{supId} and csp.id is null AND cpo.status=2
|
||||
<if test="code!=null and code!=''">
|
||||
and cpa.`code` like concat('%',#{code},'%')
|
||||
</if>
|
||||
|
|
@ -235,6 +246,9 @@
|
|||
left join car_supplier cs on cs.id=csa.sup_id
|
||||
left join pm_user pu on pu.ID=csa.creator
|
||||
<where>
|
||||
<if test="supId!=null and supId!=''">
|
||||
and csa.sup_id=#{supId}
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
csa.audit_status=#{status}
|
||||
</if>
|
||||
|
|
@ -258,11 +272,19 @@
|
|||
left join bm_project pro on pro.id=cpa.pro_id
|
||||
<where>
|
||||
csp.slt_id=#{id}
|
||||
<if test="code!=null and code!=''">
|
||||
cpa.code like concat('%',#{code},'%')
|
||||
<!-- 计划编码模糊查询:处理cpa.code为NULL的情况,避免查询失效 -->
|
||||
<if test="code != null and code != ''">
|
||||
and cpa.code like concat('%', #{code}, '%')
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
pro.name like concat('%',#{proName},'%')
|
||||
<!-- 项目名称模糊查询:处理pro.name为NULL的情况,避免查询失效 -->
|
||||
<if test="proName != null and proName != ''">
|
||||
and pro.name like concat('%', #{proName}, '%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
pro.name like concat('%', #{keyWord}, '%')
|
||||
or cpa.code like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY cpa.create_time desc
|
||||
|
|
@ -276,7 +298,7 @@
|
|||
where csa.id=#{id}
|
||||
</select>
|
||||
<select id="getSltPlanList" resultType="com.bonus.gzcar.business.backstage.entity.CarSltPlanVo">
|
||||
select csp.id,csp.plan_id planId,csp.money,csp.yg_money ygMoney,csp.sup_id supId ,pro.name proName,
|
||||
select csp.id,csp.plan_id planId,csp.money,csp.yg_money ygMoney,csp.sup_id supId ,pro.name proName,cpa.pro_id proId,
|
||||
csp.slt_id sltId,
|
||||
cpa.need_num needNum,detail.num carNum,cpa.code code,
|
||||
cs.name supName ,csp.type
|
||||
|
|
@ -327,6 +349,54 @@
|
|||
|
||||
|
||||
</select>
|
||||
<select id="getSupId" resultType="java.lang.String">
|
||||
select sup_id
|
||||
from car_supplier_user
|
||||
WHERE user_id=#{userId}
|
||||
</select>
|
||||
<select id="getExportBalanceData"
|
||||
resultType="com.bonus.gzcar.business.backstage.entity.ExportBalanceDataVo">
|
||||
SELECT
|
||||
csp.id,
|
||||
IF(csp.type=1,'运输车辆','吊车') AS type,
|
||||
csp.car_num AS num,
|
||||
csp.pro_id,
|
||||
csp.money allMoney,
|
||||
plan.code AS planCode,
|
||||
pro.NAME AS proName,
|
||||
cs.`name` AS supName,
|
||||
cpod.start_address AS startAddress,
|
||||
cpod.end_address AS endAddress,
|
||||
IF(csp.type=1,cpod.gls,cpod.days) AS days,
|
||||
cpod.car_num AS carNum,csd.money,
|
||||
-- 核心修改:新增已驳回状态,按 0=已通过、1=待审核、2=已驳回 匹配(可根据实际值调整)
|
||||
CASE csp.audit_status
|
||||
WHEN 0 THEN '已通过'
|
||||
WHEN 1 THEN '待审核'
|
||||
WHEN 2 THEN '已驳回'
|
||||
ELSE '待提交'
|
||||
END AS auditStatus,
|
||||
pu.`NAME` AS userName,
|
||||
cpod.remark,
|
||||
csa.create_time createTime
|
||||
from car_slt_apply csa
|
||||
left join car_slt_plan csp on csa.id=csp.slt_id
|
||||
LEFT JOIN car_supplier cs on cs.id=csp.sup_id
|
||||
left join car_plan_apply plan on plan.id=csp.plan_id
|
||||
left join bm_project pro on pro.id=csp.pro_id
|
||||
left join car_slt_details csd on csd.plan_id=csp.plan_id
|
||||
left join car_plan_out_details cpod on cpod.id=csd.out_detail_id
|
||||
left join pm_user pu on pu.id=csa.creator
|
||||
<where>
|
||||
<if test="auditStatus!=null and auditStatus!=''">
|
||||
csp.audit_status=#{auditStatus}
|
||||
</if>
|
||||
<if test="sltId!=null and sltId!=''">
|
||||
csp.slt_id=#{sltId}
|
||||
</if>
|
||||
</where>
|
||||
order by csa.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -253,7 +253,7 @@
|
|||
cct.gls_ks glsKs, cct.gls_js glsJs, cct.gl_price glPrice, cct.gl_xf glXf, cct.gl_sj_price glSjPrice,
|
||||
cct.day_price dayPrice, cct.month_price monthPrice, cct.dc_xf dcXf, cct.day_sj_price daySjPrice,
|
||||
cct.month_sj_price monthSjPrice, cct.day_to_month dayToMonth, cct.is_driver_set isDriverSet,
|
||||
cct.is_out_set isOutSet, cct.remark remark,cct.rel_id relId,cmti.`name`,cmti.model
|
||||
cct.is_out_set isOutSet, cct.remark remark,cct.rel_id relId,cmti.`name`,cmti.model,cct.ton
|
||||
from car_contract_type cct
|
||||
left join car_ma_type_info cmti on cct.model_id=cmti.id
|
||||
WHERE cct.contract_id=#{id} and cct.sup_id=#{supId}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,10 @@
|
|||
csd.out_id id,
|
||||
csd.slt_id
|
||||
FROM car_slt_details csd
|
||||
where csd.audit_status=0
|
||||
GROUP BY csd.out_id
|
||||
) csp ON csp.id = cpo.id
|
||||
LEFT JOIN car_slt_apply csa ON csa.id = csp.slt_id
|
||||
LEFT JOIN car_slt_apply csa ON csa.id = csp.slt_id and csa.audit_status=0
|
||||
LEFT JOIN car_plan_apply cpa ON cpo.apply_id = cpa.id
|
||||
LEFT JOIN car_supplier cs ON cpo.sup_id = cs.id
|
||||
LEFT JOIN bm_project pro ON pro.id = cpa.pro_id
|
||||
|
|
@ -75,13 +76,14 @@
|
|||
where CURRENT_DATE() BETWEEN cs.start_time and cs.end_time
|
||||
</select>
|
||||
|
||||
<select id="getMoney" resultType="java.lang.String">
|
||||
SELECT IFNULL(SUM(money),0) money
|
||||
<select id="getMoney" resultType="java.math.BigDecimal">
|
||||
SELECT ROUND(IFNULL(SUM(money), 0), 2) AS money
|
||||
FROM car_plan_out
|
||||
where status=2
|
||||
UNION all
|
||||
SELECT IFNULL(SUM(money),0)
|
||||
WHERE status = 2
|
||||
UNION ALL
|
||||
SELECT ROUND(IFNULL(SUM(money), 0), 2) AS money
|
||||
FROM car_slt_plan csp
|
||||
WHERE csp.audit_status = 0
|
||||
</select>
|
||||
<select id="getSltPageListByCompany" resultType="com.bonus.gzcar.business.backstage.entity.CarBalanceVo">
|
||||
SELECT
|
||||
|
|
@ -121,7 +123,7 @@
|
|||
WHERE cpo.status = 2
|
||||
GROUP BY cpo.apply_id
|
||||
) cpo ON cpo.apply_id = cpas.apply_id
|
||||
LEFT JOIN car_slt_plan csp ON csp.plan_id = cpas.apply_id
|
||||
LEFT JOIN car_slt_plan csp ON csp.plan_id = cpas.apply_id and csp.audit_status=0
|
||||
LEFT JOIN bm_project pro ON pro.id = cpa.pro_id
|
||||
WHERE cpa.status_type = 1
|
||||
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
||||
|
|
@ -168,6 +170,7 @@
|
|||
csd.plan_id id,
|
||||
csd.slt_id
|
||||
FROM car_slt_details csd
|
||||
WHERE csd.audit_status=0
|
||||
GROUP BY csd.plan_id
|
||||
) csp on csp.id=cpa.id
|
||||
LEFT JOIN bm_project pro on pro.id=cpa.pro_id
|
||||
|
|
@ -208,6 +211,7 @@
|
|||
csd.out_id id,
|
||||
csd.slt_id
|
||||
FROM car_slt_details csd
|
||||
where csd.audit_status=0
|
||||
GROUP BY csd.out_id
|
||||
) csp ON csp.id = cpo.id
|
||||
LEFT JOIN car_supplier cs ON cpo.sup_id = cs.id
|
||||
|
|
@ -262,7 +266,7 @@
|
|||
select IFNULL(SUM(money),0)
|
||||
from car_slt_plan csp
|
||||
left join car_plan_apply cpa on cpa.id=csp.plan_id
|
||||
where 1=1
|
||||
where 1=1 and csp.audit_status=0
|
||||
<if test="year!=null and year!=''">
|
||||
and DATE_FORMAT(cpa.create_time,'%Y')=YEAR(CURDATE())
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@
|
|||
<update id="updatePlanData">
|
||||
update car_plan_apply SET dispatch_status=5 where id=#{id}
|
||||
</update>
|
||||
<update id="updateCarNum">
|
||||
update car_plan_apply set dispatch_num=#{carNum} where id=#{planId}
|
||||
</update>
|
||||
|
||||
<!--查询工程统计-->
|
||||
<select id="getProStatisticsList" resultType="com.bonus.gzcar.business.backstage.entity.DispatchCarVo">
|
||||
|
|
@ -339,6 +342,11 @@
|
|||
|
||||
order by cpa.create_time desc
|
||||
</select>
|
||||
<select id="getOutCarNum" resultType="java.lang.String">
|
||||
select count(1)
|
||||
from car_plan_out_details
|
||||
where apply_id=#{planId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteData">
|
||||
delete from car_plan_apply_sup where apply_id= #{id}
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@
|
|||
</select>
|
||||
<select id="getDispatchCarListData"
|
||||
resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanDetailVo">
|
||||
select distinct cpd.id, cpd.apply_id planId ,cpd.model_id modelId,cpd.need_day needDay,cpd.need_num needNum,
|
||||
select distinct cpd.id, cpd.apply_id planId ,cpd.model_id modelId,IFNULL(cpd.need_day,"") needDay,cpd.need_num needNum,
|
||||
cpd.remark,cpd.plan_type planType,cmti.type,cmti.name,cmti.model ,cmti.unit,cpas.sup_id supId,
|
||||
cct.is_out_set isOutSet,cct.is_driver_set isDriverSet,cpas.contract_id contractId,cpd.model_id modelId
|
||||
from car_plan_out_details cpod
|
||||
|
|
|
|||
Loading…
Reference in New Issue