Merge remote-tracking branch 'origin/main'

This commit is contained in:
cwchen 2025-01-24 17:02:03 +08:00
commit cc1e9f025a
8 changed files with 40 additions and 22 deletions

View File

@ -85,4 +85,6 @@ public interface CarSupMapper {
* @return
*/
List<CarSupVo> getContractSupList(CarSupVo data);
int getUserBySup(CarSupVo data);
}

View File

@ -325,10 +325,6 @@ public class CarCarServiceImpl implements CarCarService {
@Override
public ServerResponse deleteCarData(CarCarVo data) {
try{
int nums=mapper.getUserBySup(data);
if(nums>0){
return ServerResponse.createBySuccessMsg("供应商下存在车辆信息不允许删除!");
}
int num=mapper.deleteCarData(data);
uploadService.deleteFileByTableId(data.getId(),"car_supplier_info");
if(num>0){

View File

@ -96,6 +96,10 @@ public class CarSupServiceImpl implements CarSupService{
@Override
public ServerResponse deleteCarSup(CarSupVo data) {
try{
int nums=mapper.getUserBySup(data);
if(nums>0){
return ServerResponse.createErroe("供应商下存在车辆信息不允许删除!");
}
int num=mapper.deleteCarSup(data);
if(num>0){
return ServerResponse.createSuccess("删除成功","删除成功");
@ -103,7 +107,7 @@ public class CarSupServiceImpl implements CarSupService{
}catch (Exception e){
log.error(e.toString(),e);
}
return ServerResponse.createErroe("修改失败");
return ServerResponse.createErroe("删除失败");
}
@Override

View File

@ -80,7 +80,7 @@
from car_plan_out_details cpod
left join car_plan_out cpo on cpod.out_id=cpo.id
left join car_supplier cs on cpod.sup_id=cs.id
left join car_plan_details cpd on cpd.apply_id=cpod.apply_id and cpd.model_id
left join car_plan_details cpd on cpd.apply_id=cpod.apply_id and cpd.model_id=cpod.model_id
LEFT JOIN car_ma_type_info cmti on cmti.id=cpod.model_id
left join car_plan_apply cpa on cpa.id =cpod.apply_id
left join car_supplier_info csi on csi.id= cpod.car_id

View File

@ -82,21 +82,24 @@
left join car_slt_plan csp on csp.plan_id=cpas.apply_id
left join bm_project pro on pro.bid_id=cpa.pro_id
where cpa.status_type=1
GROUP BY pro.bmname
) info on pro.bmname=info.bmname
left join(
SELECT distinct pro_id
FROM car_plan_apply
WHERE status_type=1
) cp on cp.pro_id=pro.bid_id
where cp.pro_id is not null
<if test="year!=null and year!=''">
and DATE_FORMAT(cpa.create_time,'%Y')=YEAR(CURDATE())
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and DATE_FORMAT(cpa.create_time,'%Y-%m-%d')
between DATE_FORMAT(#{startTime},'%Y-%m-%d') and DATE_FORMAT(#{endTime},'%Y-%m-%d')
</if>
GROUP BY pro.bmname
) info on pro.bmname=info.bmname
left join(
SELECT distinct pro_id
FROM car_plan_apply cpa
WHERE status_type=1
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and DATE_FORMAT(cpa.create_time,'%Y-%m-%d')
between DATE_FORMAT(#{startTime},'%Y-%m-%d') and DATE_FORMAT(#{endTime},'%Y-%m-%d')
</if>
) cp on cp.pro_id=pro.bid_id
where cp.pro_id is not null
GROUP BY pro.bmname
</select>
@ -121,6 +124,10 @@
<if test="proName!=null and proName!=''">
and pro.name like concat('%',#{proName},'%')
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and DATE_FORMAT(cpa.create_time,'%Y-%m-%d')
between DATE_FORMAT(#{startTime},'%Y-%m-%d') and DATE_FORMAT(#{endTime},'%Y-%m-%d')
</if>
GROUP BY cpa.pro_id
</select>
<select id="getSltPageListByPro" resultType="com.bonus.gzcar.business.backstage.entity.CarBalanceVo">
@ -142,6 +149,10 @@
<if test="code!=null and code!=''">
and cpa.`code` like concat('%',#{code},'%')
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and DATE_FORMAT(cpa.create_time,'%Y-%m-%d')
between DATE_FORMAT(#{startTime},'%Y-%m-%d') and DATE_FORMAT(#{endTime},'%Y-%m-%d')
</if>
GROUP BY cpa.id
order by cpa.create_time desc
</select>

View File

@ -90,4 +90,9 @@
and ccr.type=#{type}
</if>
</select>
<select id="getUserBySup" resultType="java.lang.Integer">
select count(1)
from car_supplier_info
where is_active=1 and sup_id=#{id}
</select>
</mapper>

View File

@ -11,13 +11,10 @@
#{creator},now(),#{updater},now())
</insert>
<update id="updateTypeData">
update car_ma_type set name=#{name}
update car_ma_type set name=#{name} ,remark=#{remark}
<if test="unit!=null and unit!=''">
,unit_name=#{unit}
</if>
<if test="remark!=null and remark!=''">
,remark=#{remark}
</if>
where id=#{id}
</update>
<update id="updateTypeStatus">

View File

@ -212,7 +212,10 @@
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,
cpod.car_num carNum,cpod.use_day planDay
cpod.car_num carNum,cpod.use_day planDay,cpod.car_id carId,
cpod.start_address startAddress, cpod.end_address endAddress,
cpod.jc_gls jcGls, cpod.gls, cpod.jc_price jcMoney,
cpod.dc_money dcMoney, cpod.dc_unit dcUnit
from car_plan_out_details cpod
left join car_plan_details cpd on cpod.apply_id=cpd.apply_id and cpd.model_id=cpod.model_id
left join car_plan_apply_sup cpas on cpd.apply_id=cpas.apply_id