结算统计修改
This commit is contained in:
parent
cf4c6c29f5
commit
0336c2765c
|
|
@ -13,13 +13,17 @@ import com.bonus.gzcar.manager.webResult.ServerResponse;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
|
@ -130,10 +134,8 @@ public class AppController{
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("getOutPageList")
|
||||
@DecryptAndVerify(decryptedClass = CarPlanOutVo.class)
|
||||
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
|
||||
public PageInfo<CarNeedPlanVo> getOutPageList(EncryptedReq<CarNeedPlanVo> dto) {
|
||||
String userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId().toString();
|
||||
dto.getData().setCreator(userId);dto.getData().setUserId(userId);
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<CarNeedPlanVo> list = supDispatchCarService.getOutPageList(dto.getData());;
|
||||
return new PageInfo<>(list);
|
||||
|
|
@ -156,6 +158,10 @@ public class AppController{
|
|||
public ServerResponse uploadFile(EncryptedReq<CarPlanOutVo> dto) {
|
||||
return service.uploadFile(dto.getData());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "APP文件上传")
|
||||
@PostMapping("appUploadFile")
|
||||
public ServerResponse appUploadFile(@RequestParam(value = "file") MultipartFile file,HttpServletRequest request){
|
||||
return service.appUploadFile(file,request);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ public class AppPlanVo extends ParentVo {
|
|||
*/
|
||||
private String projectContent;
|
||||
|
||||
private String supName;
|
||||
|
||||
private String needDay;
|
||||
|
||||
private String remark;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ import com.bonus.gzcar.business.app.entity.AppPlanVo;
|
|||
import com.bonus.gzcar.business.backstage.entity.CarCarVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.CarPlanOutVo;
|
||||
import com.bonus.gzcar.manager.webResult.ServerResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -53,4 +55,12 @@ public interface AppService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse uploadFile(CarPlanOutVo data);
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
* @param file
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
ServerResponse appUploadFile(MultipartFile file, HttpServletRequest request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ import com.bonus.gzcar.manager.webResult.ServerResponse;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -134,4 +136,20 @@ public class AppServiceImpl implements AppService{
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse appUploadFile(MultipartFile file, HttpServletRequest request) {
|
||||
try{
|
||||
String id=request.getParameter("id");
|
||||
if(StringHelper.isEmpty(id) || "undefined".equals(id)){
|
||||
return ServerResponse.createErroe("id不能为空");
|
||||
}
|
||||
uploadService.uploadImageOne(file,id,"car_plan_out","到货确认单");
|
||||
return ServerResponse.createBySuccessMsg("上传成功");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,10 @@ public class CarBalanceVo extends ParentVo {
|
|||
* 待排车数量
|
||||
*/
|
||||
private String dpcNum;
|
||||
|
||||
/**
|
||||
* 计划类型
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
package com.bonus.gzcar.business.backstage.mapper;
|
||||
|
||||
import com.bonus.gzcar.business.backstage.entity.BackParamsDto;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomeProDetailVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomeProRankingVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.HomeSupStatisticsVo;
|
||||
import com.bonus.gzcar.business.backstage.entity.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -109,4 +106,18 @@ public interface HomeIndexMapper {
|
|||
* @date 2025/1/17 9:58
|
||||
*/
|
||||
List<HomeProDetailVo> getProDetails(BackParamsDto dto);
|
||||
|
||||
/**
|
||||
* 查询支付金额及计划条数
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
IndexVo getPayMoney(BackParamsDto dto);
|
||||
|
||||
/**
|
||||
* 查询未支付计划 z0
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
IndexVo getNoPayMoney(BackParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,12 +100,14 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
|||
Future<List<Object>> future5 = testTaskExecutor.submit(() -> {
|
||||
log.info("数据概览-已付款金额{}", Thread.currentThread().getName());
|
||||
List<Object> dataList = new ArrayList<>(2);
|
||||
dataList.add(0, 0.0);
|
||||
dataList.add(1, 0);
|
||||
IndexVo indexVo = mapper.getPayMoney(dto);
|
||||
dataList.add(0, indexVo.getMoney());
|
||||
dataList.add(1, indexVo.getNum());
|
||||
return dataList;
|
||||
});
|
||||
Future<List<Object>> future6 = testTaskExecutor.submit(() -> {
|
||||
log.info("数据概览-应付款金额{}", Thread.currentThread().getName());
|
||||
IndexVo indexVo = mapper.getNoPayMoney(dto);
|
||||
List<Object> dataList = new ArrayList<>(2);
|
||||
dataList.add(0, 0.0);
|
||||
dataList.add(1, 0);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.gzcar.business.backstage.service;
|
|||
|
||||
import cn.afterturn.easypoi.cache.manager.IFileLoader;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.gzcar.business.backstage.entity.*;
|
||||
import com.bonus.gzcar.business.backstage.mapper.SupDispatchCarMapper;
|
||||
import com.bonus.gzcar.business.system.entity.AuditRecordVo;
|
||||
|
|
@ -328,6 +329,9 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService{
|
|||
public List<CarNeedPlanVo> getOutPageList(CarNeedPlanVo data) {
|
||||
List<CarNeedPlanVo> list=new ArrayList<>();
|
||||
try {
|
||||
String userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId().toString();
|
||||
data.setCreator(userId);
|
||||
data.setUserId(userId);
|
||||
list=mapper.getOutPageList(data);
|
||||
for (CarNeedPlanVo carNeedPlanVo:list){
|
||||
if(carNeedPlanVo.getFileNum()>0){
|
||||
|
|
@ -351,9 +355,12 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService{
|
|||
public ServerResponse uploadFile(HttpServletRequest request, MultipartFile[] files) {
|
||||
try {
|
||||
String params=request.getParameter("params");
|
||||
|
||||
if(StringHelper.isEmpty(params)){
|
||||
return ServerResponse.createErroe("请求参数缺失");
|
||||
}
|
||||
JSONObject json=JSON.parseObject(params);
|
||||
params=json.get("id").toString();
|
||||
uploadService.uploadImage(files,params,"car_plan_out","到货确认单");
|
||||
return ServerResponse.createBySuccessMsg("上传成功");
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -123,7 +123,43 @@ public class FileUploadService {
|
|||
return list;
|
||||
}
|
||||
|
||||
public List<FileUploadVo> uploadImageOne(MultipartFile file , String outId, String table, String type){
|
||||
List<FileUploadVo> list=new ArrayList<>();
|
||||
try {
|
||||
String fileName = file.getOriginalFilename();
|
||||
String suffix=IDUtils.getSuffix(fileName);
|
||||
String path="/"+DateTimeHelper.getNowYMD()+"/"+ IDUtils.createID()+suffix;
|
||||
String newPath= SystemUtils.getUploadPath()+path;
|
||||
File uploadFile = new File(newPath);
|
||||
//生成文件夹
|
||||
if (!uploadFile.getParentFile().exists()) {
|
||||
uploadFile.getParentFile().mkdirs();
|
||||
}
|
||||
String fileType=isImageFileExtension(fileName);
|
||||
// 存入临时文件
|
||||
file.transferTo(uploadFile);
|
||||
FileUploadVo vo=new FileUploadVo();
|
||||
vo.setFileName(fileName);
|
||||
vo.setFileUrl(path);
|
||||
vo.setOwnId(outId);
|
||||
vo.setModelTable(table);
|
||||
vo.setSuffix(suffix);
|
||||
vo.setFileType(fileType);
|
||||
String userId= UserUtil.getLoginUser().getUserId()+"";
|
||||
String userName=UserUtil.getLoginUser().getUsername();
|
||||
vo.setCreator(userId);
|
||||
vo.setCreateName(userName);
|
||||
if(StringHelper.isNotEmpty(type)){
|
||||
vo.setType(type);
|
||||
}
|
||||
list.add(vo);
|
||||
mapper.insertFileUpload(vo);
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
|
|||
filterChain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
if(uri.contains("/app/")){
|
||||
filterChain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
// if(uri.contains("/app/")){
|
||||
// filterChain.doFilter(request, response);
|
||||
// return;
|
||||
// }
|
||||
if(StringUtils.isEmpty(jwtToken)){
|
||||
ResultUtil.responseJson(response,ResultUtil.resultCode(401,"请先登录"));
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -89,9 +89,9 @@
|
|||
|
||||
</select>
|
||||
<select id="getAuditDetails" resultType="com.bonus.gzcar.business.app.entity.AppPlanVo">
|
||||
select id outId,status
|
||||
FROM car_plan_out
|
||||
WHERE apply_id=#{planId}
|
||||
select id outId,status
|
||||
FROM car_plan_out
|
||||
WHERE apply_id=#{planId}
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
GROUP BY cpas.sup_id
|
||||
)pro on pro.sup_id=cpo.sup_id
|
||||
where cpo.status=1
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and cs.name like concat('%',#{keyWord},'%')
|
||||
</if>
|
||||
GROUP BY cpo.sup_id
|
||||
</select>
|
||||
<select id="getPayCarPlanList" resultType="com.bonus.gzcar.business.backstage.entity.CarBalancePlanVo">
|
||||
|
|
@ -59,11 +62,18 @@
|
|||
cpa.need_num needNum ,cpa.type ,cs.`name` supName ,sum(cpo.money) money,cpa.remark,
|
||||
cpa.dispatch_day lastDay,cpa.user_name userName
|
||||
FROM car_plan_apply cpa
|
||||
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.bid_id=cpa.pro_id
|
||||
where cpa.dispatch_num>0 and cpas.sup_id=#{supId}
|
||||
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=1
|
||||
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.bid_id=cpa.pro_id
|
||||
where cpa.dispatch_num>0 and cpas.sup_id=#{supId} and csp.id is null
|
||||
<if test="code!=null and code!=''">
|
||||
and cpa.`code` like concat('%',#{code},'%')
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
and pro.`name` like concat('%',#{proName},'%')
|
||||
</if>
|
||||
GROUP BY cpa.id
|
||||
</select>
|
||||
<select id="getPayCarDetails" resultType="com.bonus.gzcar.business.backstage.entity.CarPlanOutVoDetailsVo">
|
||||
|
|
@ -105,11 +115,12 @@
|
|||
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.bid_id=cpa.pro_id
|
||||
where cpo.sup_id=#{supId}
|
||||
where cpo.sup_id=#{supId} and cpo.status=1
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
cpa.`code` like concat('%',#{keyWord},'%') or
|
||||
pro.name like concat('%',#{keyWord},'%')
|
||||
pro.name like concat('%',#{keyWord},'%') or
|
||||
cs.name like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
|
|
@ -124,19 +135,25 @@
|
|||
</select>
|
||||
<select id="getSltDetailsInfo" resultType="com.bonus.gzcar.business.backstage.entity.CarBalanceDetailsVo">
|
||||
select cpa.code,cs.name supName ,pro.name proName ,cpa.id planId ,cpa.dispatch_num carNum ,
|
||||
cpa.dispatch_day dispatchDay ,csp.money ,csp.slt_id sltId ,
|
||||
cpa.dispatch_day dispatchDay ,my.money ,csp.slt_id sltId ,
|
||||
cpa.remark
|
||||
from car_plan_apply cpa
|
||||
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 bm_project pro on pro.bid_id=cpa.pro_id
|
||||
left join (
|
||||
select sum(money) money,apply_id
|
||||
from car_plan_out
|
||||
WHERE status=1
|
||||
GROUP BY apply_id
|
||||
)my on my.apply_id=cpa.id
|
||||
left join car_slt_plan csp on csp.plan_id=cpa.id
|
||||
where cpa.id=#{planId}
|
||||
</select>
|
||||
<select id="getOutIdByPlanId" resultType="java.lang.String">
|
||||
SELECT id
|
||||
from car_plan_out
|
||||
where apply_id=#{planId}
|
||||
where apply_id=#{planId} AND status=1
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
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.bid_id=cpa.pro_id
|
||||
where 1=1
|
||||
where 1=1 and cpo.status=1
|
||||
<if test="supName!=null and supName!=''">
|
||||
and cs.name like concat('%',#{supName},'%')
|
||||
</if>
|
||||
|
|
@ -57,6 +57,7 @@
|
|||
<select id="getMoney" resultType="java.lang.String">
|
||||
SELECT IFNULL(SUM(money),0) money
|
||||
FROM car_plan_out
|
||||
where status=1
|
||||
UNION all
|
||||
SELECT IFNULL(SUM(money),0)
|
||||
FROM car_slt_plan csp
|
||||
|
|
@ -75,6 +76,7 @@
|
|||
left join(
|
||||
SELECT sum(money) money, cpo.apply_id
|
||||
from car_plan_out cpo
|
||||
where cpo.status=1
|
||||
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
|
||||
|
|
@ -99,7 +101,8 @@
|
|||
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
|
||||
left join car_plan_out cpo on cpo.apply_id=cpa.id AND cpo.status=1
|
||||
|
||||
LEFT JOIN (
|
||||
SELECT sum(money) money,csd.out_id id,csd.slt_id
|
||||
from car_slt_details csd
|
||||
|
|
@ -116,9 +119,10 @@
|
|||
SELECT cpa.`code` ,cpo.sup_id supId ,cpa.id planId ,IFNULL(sum(cpo.dispatch_num),0) carNum ,IFNULL(sum(cpo.money) ,0)money ,
|
||||
sum(IFNULL(csp.money,0)) payMoney ,IF(cpa.apply_type=0,'需求计划审批','紧急及内部用车') typeName ,
|
||||
if(csp.id is null,'未付','已付') status,pro.name proName ,IFNULL(cs.name,'-') supName ,cpa.type,
|
||||
IFNULL( sum(cpo.money)-sum(IFNULL(csp.money,0)),0) noPayMoney,cpa.need_num needNum
|
||||
IFNULL( sum(cpo.money)-sum(IFNULL(csp.money,0)),0) noPayMoney,cpa.need_num needNum,
|
||||
cpa.need_num- IFNULL(sum(cpo.dispatch_num),0) dpcNum
|
||||
from car_plan_apply cpa
|
||||
left join car_plan_out cpo on cpo.apply_id=cpa.id
|
||||
left join car_plan_out cpo on cpo.apply_id=cpa.id AND cpo.status=1
|
||||
LEFT JOIN (
|
||||
SELECT sum(money) money,csd.out_id id,csd.slt_id
|
||||
from car_slt_details csd
|
||||
|
|
@ -158,7 +162,7 @@
|
|||
select IFNULL(SUM(money),0)
|
||||
from car_plan_out cpo
|
||||
left join car_plan_apply cpa on cpa.id=cpo.apply_id
|
||||
where 1=1
|
||||
where 1=1 AND cpo.status=1
|
||||
<if test="year!=null and year!=''">
|
||||
and DATE_FORMAT(cpa.create_time,'%Y')=YEAR(CURDATE())
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -35,22 +35,21 @@
|
|||
<if test='type=="1"'>
|
||||
select count(1) num
|
||||
from car_plan_apply cpa
|
||||
where cpa.status_type=1
|
||||
where cpa.status_type=1 and cpa.dispatch_num>0
|
||||
<if test='proId!=null and proId!=""'>
|
||||
and cpa.pro_id=#{proId}
|
||||
</if>
|
||||
GROUP BY cpa.pro_id
|
||||
HAVING sum(cpa.dispatch_num)>0
|
||||
|
||||
</if>
|
||||
<if test='type=="2"'>
|
||||
select count(1) num
|
||||
from car_plan_apply cpa
|
||||
where cpa.status_type=1
|
||||
where cpa.status_type=1 and cpa.dispatch_num=0
|
||||
<if test='proId!=null and proId!=""'>
|
||||
and cpa.pro_id=#{proId}
|
||||
</if>
|
||||
GROUP BY cpa.pro_id
|
||||
HAVING sum(cpa.dispatch_num)=0
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLastDay" resultType="java.lang.String">
|
||||
|
|
|
|||
|
|
@ -146,4 +146,19 @@
|
|||
ELSE '1' END = #{dispatchStatus})
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPayMoney" resultType="com.bonus.gzcar.business.backstage.entity.IndexVo">
|
||||
SELECT count(csp.plan_id) num,sum(csp.money) money
|
||||
from car_slt_plan csp
|
||||
left join car_slt_apply sla on csp.slt_id=sla.id
|
||||
<where>
|
||||
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
||||
AND DATE_FORMAT(sla.create_time,'%Y-%m-%d') BETWEEN #{params.startTime} AND #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getNoPayMoney" resultType="com.bonus.gzcar.business.backstage.entity.IndexVo">
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -235,7 +235,8 @@
|
|||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
cpa.code like concat('%',#{keyWord},'%') or
|
||||
pro.name like concat('%',#{keyWord},'%')
|
||||
pro.name like concat('%',#{keyWord},'%') or
|
||||
cpa.user_name like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue