BUG修改

This commit is contained in:
haozq 2025-01-23 18:53:37 +08:00
parent 9b81ae07eb
commit 57906dc1a3
13 changed files with 181 additions and 22 deletions

View File

@ -10,6 +10,7 @@ import com.bonus.gzcar.business.system.entity.AuditRecordVo;
import com.bonus.gzcar.business.system.entity.FileUploadVo;
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.StringHelper;
import com.bonus.gzcar.manager.webResult.ServerResponse;
import lombok.extern.slf4j.Slf4j;
@ -88,16 +89,41 @@ public class AppServiceImpl implements AppService{
List<FileUploadVo> fileList = new ArrayList<>(fileList3);
if(planType==1){
List<FileUploadVo> carImage=uploadService.getFileList(vo.getCarId(),"car_supplier_info","");
if(ListHelpUtil.isNotEmpty(carImage)){
carImage.forEach(obj->{
if(!"6".equals(obj.getType())){
fileList.add(obj);
}
});
}
List<FileUploadVo> fileList2=uploadService.getFileList(vo.getDriverUserId(),"car_driver_info","");
fileList.addAll(carImage);
fileList.addAll(fileList2);
if(ListHelpUtil.isNotEmpty(fileList2)){
fileList2.forEach(obj->{
if(!"6".equals(obj.getType())){
fileList.add(obj);
}
});
}
}else{
List<FileUploadVo> carImage=uploadService.getFileList(vo.getDriverUserId(),"car_supplier_info","");
if(ListHelpUtil.isNotEmpty(carImage)){
carImage.forEach(obj->{
if("2".equals(obj.getType()) || "3".equals(obj.getType())){
fileList.add(obj);
}
});
}
if(StringHelper.isNotEmpty(vo.getOperaUserId())){
List<FileUploadVo> fileList1=uploadService.getFileList(vo.getOperaUserId(),"car_supplier_info","");
fileList.addAll(fileList1);
if(ListHelpUtil.isNotEmpty(carImage)){
fileList1.forEach(obj->{
if("2".equals(obj.getType()) || "3".equals(obj.getType()) || "6".equals(obj.getType())){
fileList.add(obj);
}
});
}
}
fileList.addAll(carImage);
}
vo.setFileList(fileList);
vo.setFileNum(fileList.size());
@ -137,7 +163,7 @@ public class AppServiceImpl implements AppService{
if(StringHelper.isEmpty(id) || "undefined".equals(id)){
return ServerResponse.createErroe("id不能为空");
}
uploadService.uploadImageOne(file,id,"car_plan_out","到货确认单");
uploadService.uploadImageOne(file,id+"-dh","car_plan_out","到货确认单");
return ServerResponse.createBySuccessMsg("上传成功");
}catch (Exception e){
log.error(e.toString(),e);

View File

@ -139,6 +139,18 @@ public class SupDispatchCarController {
return service.getDispatchCarData(dto.getData());
}
/**
*
* @param dto
* @return
*/
@PostMapping("getDispatchCarData2")
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
public ServerResponse getDispatchCarData2(EncryptedReq<CarPlanOutVo> dto) {
return service.getDispatchCarData2(dto.getData());
}
/**
* 修改-派车信息-非供应商

View File

@ -26,6 +26,7 @@ public class CarBalanceExport2Vo extends ParentVo {
/**
* 需求计划数量
*/
@Excel(name = "需求计划数量", width = 10.0, orderNum = "2")
private int planNum;
/**
* 工程数量
@ -69,7 +70,7 @@ public class CarBalanceExport2Vo extends ParentVo {
/**
* 计划id
*/
@Excel(name = "需求计划数量", width = 10.0, orderNum = "2")
private String planId;
/**
* 计划编码

View File

@ -142,4 +142,20 @@ public interface DispatchCarMapper {
* @return
*/
int getPlanDispayNum(CarNeedPlanVo data);
CarNeedPlanVo getSupPlanData(CarNeedPlanVo data);
/**
* 删除历史发货的
* @param data
*/
void deleteOutData(CarNeedPlanVo data);
void deleteOutDetails(CarNeedPlanVo data);
void deleteOutDataRecord(CarNeedPlanVo data);
void deleteOutDetailsRecord(CarNeedPlanVo data);
}

View File

@ -127,4 +127,11 @@ public interface SupDispatchCarMapper {
* @return
*/
Integer validateSltNum(CarPlanOutVo outVo);
/**
* 查询结算数据
* @param outVo
* @return
*/
int getSltNumByPlan(CarPlanOutVo outVo);
}

View File

@ -199,8 +199,6 @@ public class DispatchCarServiceImpl implements DispatchCarService{
if( dispatNum>0){
return ServerResponse.createErroe("该计划已派车、不允许重新分配");
}
//吊车需要验证 供应商合同型号
if(2==data.getType()){
List<CarNeedPlanDetailVo> detailVos=mapper.getContractSupInfo(data);
@ -210,6 +208,15 @@ public class DispatchCarServiceImpl implements DispatchCarService{
}
}
CarNeedPlanVo hisData=mapper.getSupPlanData(data);
if(hisData!=null){
String supId=hisData.getSupId();
String contractId=hisData.getContractId();
if(!supId.equals(data.getSupId()) || !contractId.equals(data.getContractId())){
deleteData(data);
}
}
int num= mapper.addPlanSupInfo(data);
if(num>0){
return ServerResponse.createBySuccessMsg("分配成功");
@ -220,6 +227,13 @@ public class DispatchCarServiceImpl implements DispatchCarService{
return ServerResponse.createErroe("分配失败");
}
public void deleteData(CarNeedPlanVo data){
mapper.deleteOutData(data);
mapper.deleteOutDetails(data);
mapper.deleteOutDataRecord(data);
mapper.deleteOutDetailsRecord(data);
}
/**
* 车辆配送=-审核
* @param data

View File

@ -79,4 +79,11 @@ public interface SupDispatchCarService {
* @return
*/
ServerResponse uploadFile(HttpServletRequest request, MultipartFile[] files);
/**
* 包含确认单的
* @param data
* @return
*/
ServerResponse getDispatchCarData2(CarPlanOutVo data);
}

View File

@ -215,8 +215,16 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService{
}
}
String userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId().toString();
CarPlanOutVo outVo = JSON.parseObject(params, CarPlanOutVo.class);
int sltNum=mapper.getSltNumByPlan(outVo);
if(sltNum>0){
return ServerResponse.createErroe("当前计划已结算,不允许修改");
}
int planType=outVo.getPlanType();
outVo.setUpdater(userId);
List<CarPlanOutVoDetailsVo> detailsVoList=outVo.getDetailsVoList();
@ -331,7 +339,7 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService{
list=mapper.getOutPageList(data);
for (CarNeedPlanVo carNeedPlanVo:list){
if(carNeedPlanVo.getFileNum()>0){
List<FileUploadVo> fileList= uploadService.getFileList(carNeedPlanVo.getId(),"car_plan_out","到货确认单");
List<FileUploadVo> fileList= uploadService.getFileList(carNeedPlanVo.getId()+"-dh","car_plan_out","到货确认单");
carNeedPlanVo.setFileList(fileList);
}
}
@ -357,7 +365,7 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService{
}
JSONObject json=JSON.parseObject(params);
params=json.get("id").toString();
uploadService.uploadImage(files,params,"car_plan_out","到货确认单");
uploadService.uploadImage(files,params+"-dh","car_plan_out","到货确认单");
return ServerResponse.createBySuccessMsg("上传成功");
}catch (Exception e){
log.error(e.toString());
@ -365,6 +373,39 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService{
return ServerResponse.createErroe("上传失败");
}
@Override
public ServerResponse getDispatchCarData2(CarPlanOutVo data) {
try{
CarPlanOutVo vo=mapper.getDispatchCarData(data);
if(vo!=null){
List<FileUploadVo> fileList=uploadService.getFileList(data.getId(),"car_plan_out","");
List<FileUploadVo> fileList0=uploadService.getFileList(data.getId()+"-dh","car_plan_out","");
if(ListHelpUtil.isNotEmpty(fileList0) && ListHelpUtil.isNotEmpty(fileList)){
fileList.addAll(fileList0);
}
vo.setFileList(fileList);
List<CarPlanOutVoDetailsVo> list=mapper.getDispatchCarDetailsList(data);
for (CarPlanOutVoDetailsVo detailsVo:list){
List<FileUploadVo> fileList2=uploadService.getFileList(detailsVo.getId(),"car_plan_out_details","");
detailsVo.setFileList(fileList2);
List<FileUploadVo> carImage=uploadService.getFileList(detailsVo.getCarId(),"car_supplier_info","");
detailsVo.setCarImage(carImage);
List<FileUploadVo> driverUserImage=uploadService.getFileList(detailsVo.getDriverUserId(),"car_driver_info","");
detailsVo.setDriverUserImage(driverUserImage);
List<FileUploadVo> operaImage=uploadService.getFileList(detailsVo.getOperaUserId(),"car_driver_info","");
detailsVo.setOperaImage(operaImage);
}
List<AuditRecordVo> record= recordService.getRecordList("out-"+data.getId());
vo.setRecordList(record);
vo.setDetailsVoList(list);
}
return ServerResponse.createSuccess("查询成功",vo);
}catch (Exception e){
log.error(e.toString(),e);
}
return ServerResponse.createSuccess("查询失败",new CarPlanOutVo());
}
@Override
public ServerResponse getDispatchCarListData(CarPlanOutVo data) {
List<CarNeedPlanDetailVo> list=new ArrayList<>();

View File

@ -90,7 +90,7 @@ public class AuditRecordService {
return mapper.getUpTimes(id,statusType);
}
}else{
return mapper.getUpTimes(id,statusType);
return mapper.getUpTimes(id,1);
}
}

View File

@ -78,6 +78,7 @@
day_or_m isDayOrMonth,cpod.remark,cpd.need_day needDay,csi.type carType ,csi.brand,
cpa.code planCode,cpa.pro_id proId,cs.`name` supName
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_ma_type_info cmti on cmti.id=cpod.model_id
@ -85,7 +86,7 @@
left join car_supplier_info csi on csi.id= cpod.car_id
where 1=1
<if test="planId!=null and planId!=''">
and cpod.apply_id=#{planId}
and cpod.apply_id=#{planId} and cpo.`status`=1
</if>
<if test="outId!=null and outId!=''">
and cpod.id=#{outId}

View File

@ -41,7 +41,7 @@
<select id="getProNum" resultType="java.lang.Integer">
SELECT count(distinct cpa.pro_id) num
from car_plan_apply_sup cpas
left join car_plan_apply cpa on cpa.id=cpas.apply_id
left join car_plan_apply cpa on cpa.id=cpas.apply_id
</select>
<select id="getNeedPlan" resultType="java.lang.Integer">
SELECT count( cpas.apply_id) num
@ -84,8 +84,12 @@
where cpa.status_type=1
GROUP BY pro.bmname
) info on pro.bmname=info.bmname
left join car_plan_apply cpa on pro.bid_id=cpa.pro_id
where cpa.id is not null
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>
@ -101,13 +105,17 @@
sum(cpa.need_num)-sum(cpa.dispatch_num) dpcNum ,IFNULL(sum(cpo.money),0) money ,IFNULL(sum(csp.money),0) payMoney ,
IFNULL(sum(cpo.money),0)-IFNULL(sum(csp.money),0) noPayMoney
from car_plan_apply cpa
left join car_plan_out cpo on cpo.apply_id=cpa.id AND cpo.status=1
LEFT JOIN(
SELECT sum(money) money,apply_id
from car_plan_out cpo
where cpo.status=1
GROUP BY apply_id
) cpo on cpo.apply_id=cpa.id
LEFT JOIN (
SELECT sum(money) money,csd.out_id id,csd.slt_id
SELECT sum(money) money,csd.plan_id id,csd.slt_id
from car_slt_details csd
GROUP BY csd.out_id
) csp on csp.id=cpo.id
GROUP BY csd.plan_id
) csp on csp.id=cpa.id
left join bm_project pro on pro.bid_id=cpa.pro_id
WHERE pro.bmname=#{bmname} and cpa.status_type=1
<if test="proName!=null and proName!=''">

View File

@ -7,6 +7,24 @@
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
WHERE apply_id=#{id}
</select>
<update id="updateDispatchData">
update car_plan_out set status=#{status} where id=#{id}
</update>
@ -79,6 +97,7 @@
sum(cpa.need_num)-sum(cpa.dispatch_num) noDispatchNum,cpa.pro_id proId
from car_plan_apply cpa
<where>
cpa.status_type=1
<if test="proId!=null and proId!=''">
and cpa.pro_id =#{proId}
</if>
@ -113,13 +132,14 @@
AND dispatch_num>0 and cpa.status!=1
</if>
</if>
order by cpa.create_time desc
</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
from car_plan_apply cpa
left join car_plan_apply_sup cpas on cpa.id=cpas.apply_id
where cpa.status_type=1 and dispatch_status!=2 and cpas.apply_id is not null and cpa.dispatch_num=0
where cpa.status_type=1 and dispatch_status!=1 and cpas.apply_id is not null and cpa.dispatch_num=0
<if test="proId!=null and proId!=''">
and cpa.pro_id =#{proId}
</if>
@ -218,4 +238,5 @@
where id=#{id}
</select>
</mapper>

View File

@ -238,7 +238,7 @@
SELECT count(1) num ,own_id id,type from bm_file_upload
where model_table='car_plan_out' AND type='到货确认单'
GROUP BY own_id
)file on file.id=cpo.id
)file on file.id=concat(cpo.id,'-dh')
where 1=1 and cpo.status=1
<if test="keyWord!=null and keyWord!=''">
and (
@ -250,5 +250,10 @@
</if>
order by cpo.create_time desc
</select>
<select id="getSltNumByPlan" resultType="java.lang.Integer">
select count(1)
from car_slt_plan
where plan_id=#{planId}
</select>
</mapper>