问题修改,功能开发
This commit is contained in:
parent
3e8403de35
commit
e2a645b3df
|
|
@ -184,7 +184,8 @@ public class SupDispatchCarController {
|
||||||
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
|
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
|
||||||
public PageInfo<CarNeedPlanVo> getOutPageList(EncryptedReq<CarNeedPlanVo> dto) {
|
public PageInfo<CarNeedPlanVo> getOutPageList(EncryptedReq<CarNeedPlanVo> dto) {
|
||||||
String userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId().toString();
|
String userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId().toString();
|
||||||
dto.getData().setCreator(userId);dto.getData().setUserId(userId);
|
dto.getData().setCreator(userId);
|
||||||
|
dto.getData().setUserId(userId);
|
||||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||||
List<CarNeedPlanVo> list = service.getOutPageList(dto.getData());;
|
List<CarNeedPlanVo> list = service.getOutPageList(dto.getData());;
|
||||||
return new PageInfo<>(list);
|
return new PageInfo<>(list);
|
||||||
|
|
@ -487,4 +488,15 @@ public class SupDispatchCarController {
|
||||||
return service.deleteData(dto.getData());
|
return service.deleteData(dto.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除确认单附件
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("deleteFile")
|
||||||
|
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||||
|
public ServerResponse deleteFile(EncryptedReq<CarPlanOutVo> dto) {
|
||||||
|
return service.deleteFile(dto.getData());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,4 +198,11 @@ public interface SupDispatchCarMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CarPlanOutVoDetailsVo> getListDetails(CarPlanOutVo bean1);
|
List<CarPlanOutVoDetailsVo> getListDetails(CarPlanOutVo bean1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除文件
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteFile(CarPlanOutVo data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,4 +93,11 @@ public interface SupDispatchCarService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ServerResponse deleteData(CarPlanOutVo data);
|
ServerResponse deleteData(CarPlanOutVo data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除文件
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServerResponse deleteFile(CarPlanOutVo data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -627,5 +627,20 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServerResponse deleteFile(CarPlanOutVo data) {
|
||||||
|
try {
|
||||||
|
int res = mapper.deleteFile(data);
|
||||||
|
if (res > 0){
|
||||||
|
return ServerResponse.createSuccess("删除成功", "删除成功");
|
||||||
|
} else {
|
||||||
|
return ServerResponse.createErroe("删除失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
return ServerResponse.createErroe("删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@
|
||||||
and cdi.is_white=#{isWhiteList}
|
and cdi.is_white=#{isWhiteList}
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY cdi.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRePlan" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
<select id="getRePlan" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,12 @@
|
||||||
where apply_id = #{outId}
|
where apply_id = #{outId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteFile">
|
||||||
|
delete
|
||||||
|
from bm_file_upload
|
||||||
|
where id = #{delFileId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="getPlanListBySup" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
<select id="getPlanListBySup" 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,
|
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, bpt.`NAME` as proType,
|
cpa.need_time needTime, cpa.creator,DATE_FORMAT(cpa.create_time,'%Y-%m-%d') appLyTime,pro.name proName, bpt.`NAME` as proType,
|
||||||
|
|
@ -180,26 +186,41 @@
|
||||||
ORDER BY cpa.create_time desc
|
ORDER BY cpa.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getDetailsList" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanDetailVo">
|
<select id="getDetailsList" 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 - IFNULL( outData.num, 0 ) needNum,
|
select cpd.id,
|
||||||
cpd.remark,cpd.plan_type planType,cmti.type,cmti.name,cmti.model ,cmti.unit,cpas.sup_id supId,
|
cpd.apply_id planId,
|
||||||
cct.is_out_set isOutSet,cct.is_driver_set isDriverSet,cpas.contract_id contractId,cpd.model_id modelId
|
cpd.model_id modelId,
|
||||||
|
cpd.need_day needDay,
|
||||||
|
cpd.need_num - IFNULL(outData.num, 0) 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_details cpd
|
from car_plan_details cpd
|
||||||
LEFT JOIN car_plan_apply cpa on cpa.id=cpd.apply_id
|
LEFT JOIN car_plan_apply cpa on cpa.id = cpd.apply_id
|
||||||
left join car_plan_out cpo on cpo.apply_id=cpd.apply_id
|
left join car_plan_out cpo on cpo.apply_id = cpd.apply_id
|
||||||
left join car_plan_out_details cpod on cpod.apply_id=cpo.apply_id and cpd.model_id=cpod.model_id
|
left join car_plan_out_details cpod on cpod.apply_id = cpo.apply_id and cpd.model_id = cpod.model_id
|
||||||
left join car_plan_apply_sup cpas on cpd.apply_id=cpas.apply_id
|
left join car_plan_apply_sup cpas on cpd.apply_id = cpas.apply_id
|
||||||
LEFT JOIN car_ma_type_info cmti on cpd.model_id=cmti.id
|
LEFT JOIN car_ma_type_info cmti on cpd.model_id = cmti.id
|
||||||
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
|
LEFT JOIN car_contract_type cct on cct.model_id = cpd.model_id and cct.sup_id = cpas.sup_id and
|
||||||
LEFT JOIN ( SELECT
|
cpas.contract_id = cct.contract_id
|
||||||
sum( cpo.dispatch_num ) num,
|
LEFT JOIN (SELECT a.*,
|
||||||
cpod.model_id as modelId,
|
cpod.model_id as modelId
|
||||||
cpo.apply_id
|
FROM (SELECT cpo.apply_id,
|
||||||
FROM
|
SUM(cpo.dispatch_num) num
|
||||||
car_plan_out cpo
|
FROM car_plan_out cpo
|
||||||
LEFT JOIN car_plan_out_details cpod on cpod.out_id=cpo.id and cpod.apply_id=cpo.apply_id
|
GROUP BY cpo.apply_id) a
|
||||||
GROUP BY
|
LEFT JOIN car_plan_out_details cpod on cpod.apply_id = a.apply_id
|
||||||
cpo.apply_id,cpod.model_id ) outData ON outData.apply_id = cpa.id and outData.modelId=cpd.model_id
|
GROUP BY a.apply_id, cpod.model_id) outData
|
||||||
where cpd.apply_id=#{id} and cpa.need_num>IFNULL(cpa.dispatch_num,0)
|
ON outData.apply_id = cpa.id and outData.modelId = cpd.model_id
|
||||||
|
where cpd.apply_id = #{id}
|
||||||
|
and cpa.need_num > IFNULL(cpa.dispatch_num, 0)
|
||||||
GROUP BY cpd.id
|
GROUP BY cpd.id
|
||||||
</select>
|
</select>
|
||||||
<select id="getContractPriceList" resultType="com.bonus.gzcar.business.backstage.entity.PriceVo">
|
<select id="getContractPriceList" resultType="com.bonus.gzcar.business.backstage.entity.PriceVo">
|
||||||
|
|
@ -284,7 +305,7 @@
|
||||||
</select>
|
</select>
|
||||||
<!--到货确认单分页查询-->
|
<!--到货确认单分页查询-->
|
||||||
<select id="getOutPageList" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
<select id="getOutPageList" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
|
||||||
select cpo.id,cpo.apply_id planId,cpa.code ,cpa.user_name userName ,
|
select cpo.id,cpo.type,cpo.apply_id planId,cpa.code ,cpa.user_name userName ,
|
||||||
cpa.create_time applyTime ,cpa.remark,cpo.out_time outTime ,cpo.dispatch_num dispatchNum,cpo.status,
|
cpa.create_time applyTime ,cpa.remark,cpo.out_time outTime ,cpo.dispatch_num dispatchNum,cpo.status,
|
||||||
IFNULL(file.num ,0) fileNum,pro.name proName
|
IFNULL(file.num ,0) fileNum,pro.name proName
|
||||||
FROM car_plan_out cpo
|
FROM car_plan_out cpo
|
||||||
|
|
@ -295,13 +316,14 @@
|
||||||
where model_table='car_plan_out' AND type='到货确认单'
|
where model_table='car_plan_out' AND type='到货确认单'
|
||||||
GROUP BY own_id
|
GROUP BY own_id
|
||||||
)file on file.id=concat(cpo.id,'-dh')
|
)file on file.id=concat(cpo.id,'-dh')
|
||||||
where 1=1 and cpo.status=1
|
where 1=1 and cpo.status=2
|
||||||
<if test="keyWord!=null and keyWord!=''">
|
<if test="keyWord!=null and keyWord!=''">
|
||||||
and (
|
and (
|
||||||
cpa.code like concat('%',#{keyWord},'%') or
|
cpa.code like concat('%',#{keyWord},'%') or
|
||||||
cpa.remark like concat('%',#{keyWord},'%') or
|
cpa.remark like concat('%',#{keyWord},'%') or
|
||||||
pro.name like concat('%',#{keyWord},'%') or
|
pro.name like concat('%',#{keyWord},'%') or
|
||||||
cpa.user_name like concat('%',#{keyWord},'%')
|
cpa.user_name like concat('%',#{keyWord},'%') or
|
||||||
|
pro.name like concat('%',#{keyWord},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
order by cpo.create_time desc
|
order by cpo.create_time desc
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue