优化车辆计划模块下载导出
This commit is contained in:
parent
3c1e23edef
commit
0010505e18
|
|
@ -1,6 +1,5 @@
|
|||
package com.bonus.gzcar.business.backstage.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.gzcar.business.backstage.entity.*;
|
||||
import com.bonus.gzcar.business.backstage.service.DispatchCarService;
|
||||
import com.bonus.gzcar.business.utils.ExportExcelUtil;
|
||||
|
|
@ -37,23 +36,17 @@ public class DispatchCarController {
|
|||
/**
|
||||
* 分页查询工程统计信息
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getProStatisticsList")
|
||||
@DecryptAndVerify(decryptedClass = DispatchCarVo.class)
|
||||
public PageInfo<DispatchCarVo> getProStatisticsList(EncryptedReq<DispatchCarVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<DispatchCarVo> list = service.getProStatisticsList(dto.getData());
|
||||
;
|
||||
List<DispatchCarVo> list = service.getProStatisticsList(dto.getData());;
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*
|
||||
* @param response
|
||||
* @param dto
|
||||
*/
|
||||
@PostMapping("export")
|
||||
public void export(HttpServletResponse response, @RequestBody DispatchCarVo dto) {
|
||||
|
|
@ -65,12 +58,8 @@ public class DispatchCarController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工程统计查询
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getProStatisticsDetails")
|
||||
@DecryptAndVerify(decryptedClass = DispatchCarVo.class)
|
||||
|
|
@ -80,16 +69,12 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 查询需求计划集合-按照工程
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getNeedPlanList")
|
||||
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
|
||||
public PageInfo<CarNeedPlanVo> getNeedPlanList(EncryptedReq<CarNeedPlanVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<CarNeedPlanVo> list = service.getNeedPlanList(dto.getData());
|
||||
;
|
||||
List<CarNeedPlanVo> list = service.getNeedPlanList(dto.getData());;
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
|
|
@ -101,9 +86,6 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 导出 工程需求计划
|
||||
*
|
||||
* @param response
|
||||
* @param dto
|
||||
*/
|
||||
@PostMapping("export2")
|
||||
public void export2(HttpServletResponse response, @RequestBody CarNeedPlanVo dto) {
|
||||
|
|
@ -128,9 +110,6 @@ public class DispatchCarController {
|
|||
/**
|
||||
* 供应商重新分配
|
||||
* 计划下拉选
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getPlanList")
|
||||
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
|
||||
|
|
@ -142,9 +121,6 @@ public class DispatchCarController {
|
|||
/**
|
||||
* 供应商分配
|
||||
* 前查询-需求计划申请明细
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getPlanDetails")
|
||||
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
|
||||
|
|
@ -157,9 +133,6 @@ public class DispatchCarController {
|
|||
* 添加供应商 分配
|
||||
* (重新分配)
|
||||
* type 1 火车 2 type=2吊车
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("addPlanSupInfo")
|
||||
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
|
||||
|
|
@ -169,9 +142,6 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 查询待审核-批次
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getAuditList")
|
||||
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||
|
|
@ -181,9 +151,6 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 车辆配送审核
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("dispatchAudit")
|
||||
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||
|
|
@ -193,9 +160,6 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 查询计划修改记录
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getUpdateList")
|
||||
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||
|
|
@ -205,9 +169,6 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 查询计划修改记录
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getRecordList")
|
||||
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||
|
|
@ -217,9 +178,6 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 查询计划修改记录
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getRecordDetailsList")
|
||||
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||
|
|
@ -229,9 +187,6 @@ public class DispatchCarController {
|
|||
|
||||
/**
|
||||
* 删除派车分配数据
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("deleteData")
|
||||
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public class CarNeedPlanExport3Vo extends ParentVo {
|
|||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 合同id
|
||||
*/
|
||||
|
|
@ -27,21 +28,21 @@ public class CarNeedPlanExport3Vo extends ParentVo {
|
|||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@Excel(name = "需求计划编号", width = 10.0, orderNum = "2")
|
||||
@Excel(name = "需求计划编号", width = 16.0, orderNum = "2")
|
||||
private String code;
|
||||
/**
|
||||
* 类型 1车辆 2吊车
|
||||
*/
|
||||
private int type;
|
||||
@Excel(name = "车辆类型", width = 10.0, orderNum = "1")
|
||||
@Excel(name = "车辆类型", width = 12.0, orderNum = "15")
|
||||
private String typeName;
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@Excel(name = "申请人", width = 10.0, orderNum = "4")
|
||||
@Excel(name = "申请人", width = 12.0, orderNum = "4")
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "申请时间", width = 10.0, orderNum = "5")
|
||||
@Excel(name = "申请时间", width = 12.0, orderNum = "5")
|
||||
private String appLyTime;
|
||||
/**
|
||||
* 工程id
|
||||
|
|
@ -50,6 +51,7 @@ public class CarNeedPlanExport3Vo extends ParentVo {
|
|||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称", width = 26, orderNum = "1")
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
|
|
@ -115,9 +117,6 @@ public class CarNeedPlanExport3Vo extends ParentVo {
|
|||
@Excel(name = "待派车数量", width = 10.0, orderNum = "9")
|
||||
private int noDispatchNum;
|
||||
|
||||
/**
|
||||
* 删除的类型id
|
||||
*/
|
||||
private String delIds;
|
||||
|
||||
private List<AuditRecordVo> recordList;
|
||||
|
|
@ -130,13 +129,32 @@ public class CarNeedPlanExport3Vo extends ParentVo {
|
|||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
@Excel(name = "已指派供应商", width = 10.0, orderNum = "10")
|
||||
@Excel(name = "已指派供应商", width = 20.0, orderNum = "10")
|
||||
private String supName;
|
||||
/**
|
||||
* 发货日期
|
||||
*/
|
||||
@Excel(name = "最新派车日期", width = 10.0, orderNum = "11")
|
||||
@Excel(name = "最新派车日期", width = 16.0, orderNum = "11")
|
||||
private String dispatchDay;
|
||||
|
||||
|
||||
/**
|
||||
* 派车备注
|
||||
*/
|
||||
@Excel(name = "派车备注", width = 30, orderNum = "14")
|
||||
private String outRemark;
|
||||
|
||||
/**
|
||||
* 派车车辆牌号
|
||||
*/
|
||||
@Excel(name = "派车车牌号", width = 14, orderNum = "13")
|
||||
private String outCarNo;
|
||||
|
||||
/**
|
||||
* 派车型号
|
||||
*/
|
||||
@Excel(name = "派车车型", width = 20, orderNum = "12")
|
||||
private String outCarModel;
|
||||
/**
|
||||
* 是否发车
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -167,6 +167,24 @@ public class CarNeedPlanVo extends ParentVo {
|
|||
*/
|
||||
private String outTime;
|
||||
|
||||
/**
|
||||
* 派车备注
|
||||
*/
|
||||
@Excel(name = "派车备注", width = 20, orderNum = "11")
|
||||
private String outRemark;
|
||||
|
||||
/**
|
||||
* 派车车辆牌号
|
||||
*/
|
||||
@Excel(name = "派车车牌号", width = 10, orderNum = "10")
|
||||
private String outCarNo;
|
||||
|
||||
/**
|
||||
* 派车型号
|
||||
*/
|
||||
@Excel(name = "派车车型", width = 20, orderNum = "9")
|
||||
private String outCarModel;
|
||||
|
||||
private String carLength;
|
||||
private String carWidth;
|
||||
private String carHeight;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.bonus.gzcar.business.backstage.service;
|
||||
|
||||
import cn.afterturn.easypoi.cache.manager.IFileLoader;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.gzcar.business.backstage.entity.*;
|
||||
import com.bonus.gzcar.business.backstage.mapper.DispatchCarMapper;
|
||||
|
|
@ -10,7 +9,6 @@ import com.bonus.gzcar.business.system.service.AuditRecordService;
|
|||
import com.bonus.gzcar.business.system.service.FileUploadService;
|
||||
import com.bonus.gzcar.business.utils.ListHelpUtil;
|
||||
import com.bonus.gzcar.manager.common.util.DateTimeHelper;
|
||||
import com.bonus.gzcar.manager.common.util.RedisService;
|
||||
import com.bonus.gzcar.manager.common.util.StringHelper;
|
||||
import com.bonus.gzcar.manager.common.util.UserUtil;
|
||||
import com.bonus.gzcar.manager.security.entity.SelfUserEntity;
|
||||
|
|
@ -18,13 +16,11 @@ import com.bonus.gzcar.manager.webResult.AjaxResult;
|
|||
import com.bonus.gzcar.manager.webResult.ServerResponse;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import tk.mybatis.mapper.genid.GenId;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
|
@ -42,8 +38,10 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
|
||||
@Autowired
|
||||
private DispatchCarMapper mapper;
|
||||
|
||||
@Autowired
|
||||
private AuditRecordService recordService;
|
||||
|
||||
@Autowired
|
||||
private FileUploadService uploadService;
|
||||
|
||||
|
|
@ -82,9 +80,6 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getProStatisticsDetails(DispatchCarVo data) {
|
||||
|
|
@ -180,9 +175,6 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
|
||||
/**
|
||||
* 查询 计划 车辆详情
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getPlanDetails(CarNeedPlanVo data) {
|
||||
|
|
@ -197,9 +189,6 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
|
||||
/**
|
||||
* 供应商 数据信息
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse addPlanSupInfo(CarNeedPlanVo data) {
|
||||
|
|
@ -261,7 +250,10 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
public ServerResponse dispatchAudit(CarPlanOutVo data) {
|
||||
try {
|
||||
SelfUserEntity loginUser = UserUtil.getLoginUser();
|
||||
String roleName = loginUser.getRoleName();
|
||||
String roleName = null;
|
||||
if (loginUser != null) {
|
||||
roleName = loginUser.getRoleName();
|
||||
}
|
||||
String status = data.getStatus(); // 前端传入:2=驳回,其它=通过
|
||||
String remark = data.getRemark();
|
||||
CarNeedPlanVo carNeedPlanVo = mapper.getPlanInfo(data);
|
||||
|
|
@ -327,8 +319,7 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
}
|
||||
|
||||
private boolean isSecondLevelApprover(String roleName) {
|
||||
return "雷治明".equals(roleName) || "黄廉飞".equals(roleName)
|
||||
|| "刘晓".equals(roleName) || "张杰".equals(roleName);
|
||||
return "雷治明".equals(roleName) || "黄廉飞".equals(roleName) || "刘晓".equals(roleName) || "张杰".equals(roleName);
|
||||
}
|
||||
|
||||
private boolean isThirdLevelApprover(String roleName) {
|
||||
|
|
@ -336,10 +327,6 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getAuditList(CarPlanOutVo data) {
|
||||
try {
|
||||
|
|
@ -353,9 +340,6 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
|
||||
/**
|
||||
* 查询批次修改记录
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getUpdateList(CarPlanOutVo data) {
|
||||
|
|
@ -370,9 +354,6 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
|
||||
/**
|
||||
* 修改记录查询
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getRecordList(CarPlanOutVo data) {
|
||||
|
|
@ -421,7 +402,7 @@ public class DispatchCarServiceImpl implements DispatchCarService {
|
|||
try {
|
||||
//查询是否有派车录入数据
|
||||
List<CarPlanOutVo> list = mapper.getData(data);
|
||||
if (list.size() > 0) {
|
||||
if (!list.isEmpty()) {
|
||||
res = "已存在派车录入数据,不可删除派车分配数据";
|
||||
throw new RuntimeException("");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,18 +7,23 @@
|
|||
replace into car_plan_apply_sup(
|
||||
apply_id,sup_id ,contract_id)values (#{id},#{supId},#{contractId})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteOutData">
|
||||
delete from car_plan_out where apply_id=#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOutDetails">
|
||||
delete from car_plan_out_details where apply_id=#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOutDataRecord">
|
||||
delete from car_plan_out_record where apply_id=#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOutDetailsRecord">
|
||||
delete from car_plan_out_details_record where apply_id=#{id}
|
||||
</delete>
|
||||
|
||||
<select id="getSupPlanData" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||
SELECT apply_id id,sup_id supId,contract_id contractId
|
||||
FROM car_plan_apply_sup
|
||||
|
|
@ -33,13 +38,16 @@
|
|||
update car_plan_apply set dispatch_num=#{dispatchNum},dispatch_day=#{dispatchDay},dispatch_status=#{status}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<!--修改计划状态-->
|
||||
<update id="updatePlanInfo">
|
||||
update car_plan_apply SET dispatch_status=#{status} where id=#{id}
|
||||
</update>
|
||||
|
||||
<update id="updatePlanData">
|
||||
update car_plan_apply SET dispatch_status=5 where id=#{id}
|
||||
</update>
|
||||
|
||||
<!--查询工程统计-->
|
||||
<select id="getProStatisticsList" resultType="com.bonus.gzcar.business.backstage.entity.DispatchCarVo">
|
||||
select cpa.pro_id proId,pro.`name` proName ,count(1) planNum ,
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
</if>
|
||||
ORDER BY cpa.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getProTypeNum" resultType="java.lang.Integer">
|
||||
<if test='type==1'>
|
||||
select count(1) num
|
||||
|
|
@ -87,6 +96,7 @@
|
|||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getLastDay" resultType="java.lang.String">
|
||||
select dispatch_day
|
||||
from car_plan_apply
|
||||
|
|
@ -95,6 +105,7 @@
|
|||
limit 1
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getProStatisticsDetails" resultType="com.bonus.gzcar.business.backstage.entity.DispatchCarVo">
|
||||
select count(1) planNum ,sum(cpa.need_num) needNum,sum(cpa.dispatch_num) dispatchNum,
|
||||
sum(cpa.need_num)-sum(cpa.dispatch_num) noDispatchNum,cpa.pro_id proId
|
||||
|
|
@ -107,35 +118,42 @@
|
|||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--查询 需要量-->
|
||||
<select id="getNeedPlanList" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||
select cpa.id, cpa.code, cpa.type , cpa.pro_id proId, cpa.project_part projectPart, cpa.project_content projectContent,
|
||||
cpa.need_time needTime, cpa.creator,DATE_FORMAT(cpa.create_time,'%Y-%m-%d') appLyTime,pro.name proName,
|
||||
cpa.remark, cpa.updater, cpa.update_time updateTime,cpa.dispatch_day dispatchDay ,
|
||||
if(cpa.type=1,'运输车辆','吊车') typeName ,cpas.sup_id supId ,IFNULL(cs.name,'-') supName,
|
||||
need_num needNum, dispatch_num dispatchNum,need_num-dispatch_num noDispatchNum,
|
||||
cpa.apply_type applyType, cpa.status_type statusType,cpa.user_name userName,
|
||||
if(cpa.dispatch_status=0,'待审核',if(dispatch_num>0,'已派车','待派车')) statusName
|
||||
from car_plan_apply cpa
|
||||
left join bm_project pro on pro.id=cpa.pro_id
|
||||
left join car_plan_apply_sup cpas on cpa.id=cpas.apply_id
|
||||
left join car_supplier cs on cs.id=cpas.sup_id
|
||||
where cpa.status_type=1 and cpa.pro_id=#{proId}
|
||||
<if test="code!=null and code!=''">
|
||||
AND cpa.code like concat('%',#{code},'%')
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
<if test='status=="2"'>
|
||||
AND cpa.dispatch_status=0
|
||||
select
|
||||
cpa.id, cpa.code, cpa.type, cpa.pro_id proId, cpa.project_part projectPart, cpa.project_content projectContent,
|
||||
cpa.need_time needTime, cpa.creator, DATE_FORMAT(cpa.create_time,'%Y-%m-%d') appLyTime, pro.name proName,
|
||||
cpa.remark, cpa.updater, cpa.update_time updateTime,cpa.dispatch_day dispatchDay,
|
||||
if(cpa.type=1,'运输车辆','吊车') typeName, cpas.sup_id supId ,IFNULL(cs.name,'-') supName,
|
||||
need_num needNum, dispatch_num dispatchNum, need_num-dispatch_num noDispatchNum,
|
||||
cpa.apply_type applyType, cpa.status_type statusType, cpa.user_name userName,
|
||||
if(cpa.dispatch_status=0,'待审核',if(dispatch_num>0,'已派车','待派车')) statusName,
|
||||
cpod.remark as outRemark, cpod.car_num as outCarNo, cmt.`name` as outCarModel
|
||||
from
|
||||
car_plan_apply cpa
|
||||
left join bm_project pro on pro.id = cpa.pro_id
|
||||
left join car_plan_apply_sup cpas on cpa.id = cpas.apply_id
|
||||
left join car_supplier cs on cs.id = cpas.sup_id
|
||||
LEFT JOIN car_plan_out_details cpod ON cpa.id = cpod.apply_id
|
||||
LEFT JOIN car_ma_type cmt ON cpod.model_id = cmt.id
|
||||
where
|
||||
cpa.status_type = 1 and cpa.pro_id = #{proId}
|
||||
<if test="code != null and code != ''">
|
||||
AND cpa.code like concat('%',#{code},'%')
|
||||
</if>
|
||||
<if test="status != null and status!=''">
|
||||
<if test='status == "2"'>
|
||||
AND cpa.dispatch_status=0
|
||||
</if>
|
||||
<if test='status=="0"'>
|
||||
AND dispatch_num=0
|
||||
<if test='status == "0"'>
|
||||
AND dispatch_num=0
|
||||
</if>
|
||||
<if test='status=="1"'>
|
||||
AND dispatch_num>0 and cpa.status!=1
|
||||
<if test='status == "1"'>
|
||||
AND dispatch_num > 0 and cpa.status != 1
|
||||
</if>
|
||||
</if>
|
||||
order by cpa.create_time desc
|
||||
</if>
|
||||
order by cpa.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getNeedPlanById" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||
|
|
@ -170,6 +188,7 @@
|
|||
where cpa.status_type = 1
|
||||
and cpa.id = #{id}
|
||||
</select>
|
||||
|
||||
<!--计划-->
|
||||
<select id="getPlanList" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||
select cpa.id, cpa.code,cpas.sup_id supId,cpas.contract_id contractId,cpa.type
|
||||
|
|
@ -180,6 +199,7 @@
|
|||
and cpa.pro_id =#{proId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--查询供应商计划信息-->
|
||||
<select id="getPlanDetails" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanDetailVo">
|
||||
select cpd.id, cpd.apply_id planId ,cpd.model_id modelId,cpd.need_day needDay,cpd.need_num needNum,
|
||||
|
|
@ -188,6 +208,7 @@
|
|||
LEFT JOIN car_ma_type_info cmti on cpd.model_id=cmti.id
|
||||
where apply_id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="getContractSupInfo" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanDetailVo">
|
||||
select cpd.model_id modelId ,cct.model_id,cmti.name,cmti.model
|
||||
from car_plan_details cpd
|
||||
|
|
@ -198,43 +219,51 @@
|
|||
where cpd.apply_id=#{id} and cct.model_id is null
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getAuditList" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVo">
|
||||
select id,status,type
|
||||
FROM car_plan_out
|
||||
WHERE status=0 AND apply_id=#{planId}
|
||||
</select>
|
||||
|
||||
<select id="getAuditListNew" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVo">
|
||||
select id,status,type
|
||||
FROM car_plan_out
|
||||
WHERE apply_id=#{planId} AND (status=0 or status=1)
|
||||
</select>
|
||||
|
||||
<select id="getPlanInfo" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||
select dispatch_num dispatchNum,id,need_num needNum
|
||||
FROM car_plan_apply
|
||||
where id=#{planId}
|
||||
select dispatch_num dispatchNum,id,need_num needNum
|
||||
FROM car_plan_apply
|
||||
where id=#{planId}
|
||||
</select>
|
||||
|
||||
<select id="getCarPlanOut" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVo">
|
||||
select dispatch_num dispatchNum,out_time outDay,status
|
||||
from car_plan_out
|
||||
where id=#{id}
|
||||
</select>
|
||||
|
||||
<!--查询修改记录数据-->
|
||||
<select id="getUpdateList" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVo">
|
||||
select id,out_id outId,apply_id planId
|
||||
FROM car_plan_out_record
|
||||
where apply_id=#{planId} and out_id=#{outId}
|
||||
</select>
|
||||
|
||||
<select id="getDispatchCarData" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVo">
|
||||
select cpo.id,cpo.apply_id planId,cpo.sup_id supId,cpo.out_time outDay,cs.name supName,
|
||||
cpo.status,cpo.creator,cpo.create_time createTime,
|
||||
cpo.manager,cpo.remark,cpo.dispatch_num dispatchNum,
|
||||
cpo.money,cpo.contract_id contractId,cpo.type,cpo.out_id outId
|
||||
from car_plan_out_record cpo
|
||||
left join car_supplier cs on cs.id=cpo.sup_id
|
||||
where cpo.id=#{id}
|
||||
select cpo.id, cpo.apply_id planId, cpo.sup_id supId, cpo.out_time outDay, cs.name supName,
|
||||
cpo.status, cpo.creator, cpo.create_time createTime,
|
||||
cpo.manager, cpo.remark, cpo.dispatch_num dispatchNum,
|
||||
cpo.money, cpo.contract_id contractId, cpo.type, cpo.out_id outId
|
||||
from
|
||||
car_plan_out_record cpo
|
||||
left join car_supplier cs on cs.id=cpo.sup_id
|
||||
where
|
||||
cpo.id = #{id}
|
||||
</select>
|
||||
<select id="getDispatchCarDetailsList"
|
||||
resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVoDetailsVo">
|
||||
|
||||
<select id="getDispatchCarDetailsList" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVoDetailsVo">
|
||||
select cpod.id, cpod.out_id outId, cpod.apply_id planId,
|
||||
cpod. model_id modelId, cpod.plan_type, cpod.contract_id contractId,
|
||||
cpod.sup_id supId, cpod.car_id carId,cpod.goods_name goodsName, cpod.gls,
|
||||
|
|
@ -256,8 +285,8 @@
|
|||
LEFT JOIN car_contract_type cct on cct.model_id=cpd.model_id and cct.sup_id=cpas.sup_id and cpas.contract_id=cct.contract_id
|
||||
where cpod.rel_id=#{id}
|
||||
</select>
|
||||
<select id="getDispatchCarListData"
|
||||
resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanDetailVo">
|
||||
|
||||
<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,
|
||||
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
|
||||
|
|
@ -268,11 +297,13 @@
|
|||
LEFT JOIN car_contract_type cct on cct.model_id=cpd.model_id and cct.sup_id=cpas.sup_id and cpas.contract_id=cct.contract_id
|
||||
where cpod.rel_id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="validateSltNum" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from car_slt_plan
|
||||
where plan_id=#{planId}
|
||||
</select>
|
||||
|
||||
<select id="getPlanDispayNum" resultType="java.lang.Integer">
|
||||
select dispatch_num dispatchNum
|
||||
FROM car_plan_apply
|
||||
|
|
|
|||
Loading…
Reference in New Issue