金额类型调整

This commit is contained in:
syruan 2026-01-13 09:32:57 +08:00
parent 374bb60d99
commit 415b3134a7
15 changed files with 155 additions and 135 deletions

View File

@ -45,7 +45,6 @@ public class CarBalanceController {
public PageInfo<CarBalanceVo> getSupPageList(EncryptedReq<CarBalanceVo> dto) {
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<CarBalanceVo> list = service.getSupPageList(dto.getData());
;
return new PageInfo<>(list);
}

View File

@ -36,23 +36,16 @@ public class CarNeedPlanController {
/**
* 分页查询类型数据接口
* @param
* dto
* @return
*/
@GetMapping("getCarNeedPlanList")
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
public PageInfo<CarNeedPlanVo> getCarPageList(EncryptedReq<CarNeedPlanVo> dto) {
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<CarNeedPlanVo> list = service.getCarNeedPlanList(dto.getData());;
PageInfo<CarNeedPlanVo> pageInfo = new PageInfo<>(list);
return pageInfo;
return new PageInfo<>(list);
}
/**
* 导出需求计划
* @param
* @param
* @param
*/
@PostMapping("export")
public void export(HttpServletResponse response, @RequestBody CarNeedPlanVo dto) {
@ -70,9 +63,6 @@ public class CarNeedPlanController {
/**
* 导出需求计划
* @param
* @param
* @param
*/
@PostMapping("exportDetails")
public void exportDetails(HttpServletResponse response, @RequestBody CarNeedPlanVo dto) {
@ -83,10 +73,9 @@ public class CarNeedPlanController {
log.error(e.toString(), e);
}
}
/**
* 新增需求计划
* @param
* @return
*/
@PostMapping("addNeedPlanData")
public ServerResponse addDriverData(HttpServletRequest request, @RequestParam(value = "file[]",required = false) MultipartFile[] files) {
@ -96,8 +85,6 @@ public class CarNeedPlanController {
/**
* 修改前查询
*
* @param dto
* @return
*/
@PostMapping("getNeedPlanInfo")
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
@ -108,9 +95,6 @@ public class CarNeedPlanController {
/**
* 查看
*
* @param dto
* @return
*/
@PostMapping("getNeedPlanDetails")
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
@ -121,8 +105,6 @@ public class CarNeedPlanController {
/**
* 查询车辆 申请 明细 查询
* @param dto
* @return
*/
@GetMapping("getNeedPlanDetailsList")
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
@ -131,19 +113,17 @@ public class CarNeedPlanController {
List<CarNeedPlanDetailVo> list = service.getNeedPlanDetailsList(dto.getData());;
return new PageInfo<>(list);
}
/**
* 修改需求计划
* @param
* @return
*/
@PostMapping("updateNeedPlanData")
public ServerResponse updateNeedPlanData(HttpServletRequest request, @RequestParam(value = "file[]",required = false) MultipartFile[] files) {
return service.updateNeedPlanData(request,files);
}
/**
* 删除计划
* @param
* @return
*/
@PostMapping("deleteNeedPlanData")
@DecryptAndVerify(decryptedClass = CarNeedPlanVo.class)
@ -153,7 +133,6 @@ public class CarNeedPlanController {
/**
* 需求计划撤回
* @param dto
* @return ServerResponse
* @author cwchen
* @date 2025/3/21 18:17

View File

@ -1,15 +1,12 @@
package com.bonus.gzcar.business.backstage.entity;
import javax.print.DocFlavor;
public class AuditStatusUtil {
/**
* 审核状态转换
* @param status
* @param statusType
* @return
* @param status 状态码
* @param statusType 状态类型
* @return 状态名称
*/
public static String getAuditStatus(int status,int statusType){
if(status == 0 && statusType == 0){

View File

@ -38,12 +38,18 @@ public class CarNeedPlanVo extends ParentVo {
@Excel(name = "计划类型", width = 10.0, orderNum = "2")
private String typeName;
/**
* 申请人
*/
@Excel(name = "申请人", width = 10.0, orderNum = "5")
private String userName;
/**
* 申请人昵称
*/
private String nickName;
@Excel(name = "申请时间", width = 10.0, orderNum = "6")
private String appLyTime;
/**

View File

@ -3,6 +3,7 @@ package com.bonus.gzcar.business.backstage.entity;
import com.bonus.gzcar.business.system.entity.FileUploadVo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
@ -103,11 +104,11 @@ public class CarPlanOutVoDetailsVo {
/**
* 公里数单价
*/
private String glsPrice;
private BigDecimal glsPrice;
/**
* 公里数金额
*/
private String glsMoney;
private BigDecimal glsMoney;
/**
* 驾驶员id
*/

View File

@ -41,13 +41,13 @@ public class CarBalanceServiceImpl implements CarBalanceService {
@Override
public List<CarBalanceVo> getSupPageList(CarBalanceVo data) {
List<CarBalanceVo> list = new ArrayList<>();
try {
list = mapper.getSupPageList(data);
return mapper.getSupPageList(data);
} catch (Exception e) {
System.err.println(e.getMessage());
log.error(e.toString(), e);
return Collections.emptyList();
}
return list;
}
/**
@ -218,7 +218,7 @@ public class CarBalanceServiceImpl implements CarBalanceService {
PriceVo priceVo = getMoney(vo.getContractId(), vo.getModelId(), vo.getSupId(), null, tonType);
sb.append("依据:").append(priceVo.getName()).append("-").append(priceVo.getModel());
vo.setPriceId(priceVo.getId());
vo.setGlsPrice(priceVo.getPrice());
vo.setGlsPrice(toBigDecimal(priceVo.getPrice()));
int dayToMonth = priceVo.getDayToMonth();
if (day >= dayToMonth) {
sb.append("、作业天数>=").append(dayToMonth);
@ -262,6 +262,18 @@ public class CarBalanceServiceImpl implements CarBalanceService {
}
}
public static BigDecimal toBigDecimal(String value) {
if (value == null || value.trim().isEmpty()) {
return BigDecimal.ZERO; // 或者 return null看业务
}
try {
return new BigDecimal(value.trim()).setScale(2, RoundingMode.HALF_UP);
} catch (NumberFormatException e) {
throw new IllegalArgumentException("非法数字格式:" + value, e);
}
}
/**
* 计算 车辆 公里数价格
*

View File

@ -12,10 +12,11 @@ import java.util.List;
* 车辆需求计划 接口层
* @author HEIZI
*/
public interface CarNeedPlanService{
/**
* 查询需求计划集合
*/
public interface CarNeedPlanService {
/**
* 查询需求计划集合
*/
List<CarNeedPlanVo> getCarNeedPlanList(CarNeedPlanVo data);
/**

View File

@ -70,7 +70,7 @@ public class CarNeedPlanServiceImpl implements CarNeedPlanService {
} catch (Exception e) {
log.error(e.toString());
}
return new ArrayList<CarNeedPlanVo>();
return new ArrayList<>();
}
/**

View File

@ -174,12 +174,18 @@ public class CarPlanAuditServiceImpl implements CarPlanAuditService{
*/
private boolean hasAuditPermission(int statusType, String userName) {
if (statusType == AuditNode.PLAN_DEPT || statusType == AuditNode.MGMT_CENTER) {
if (Objects.equals(userName, "管理员")) {
return true;
}
return sysAuditService.getUserPermission("car_plan", statusType);
} else if (statusType == AuditNode.EQUIP_DEPT) {
List<String> liftTeamUsers = Arrays.asList("项管专责1", "项管专责2");
if (Objects.equals(userName, "管理员")) {
return true;
}
return liftTeamUsers.contains(userName);
} else if (statusType == AuditNode.LIFT_TEAM) {
return "王炜".contains(userName);
return "王炜".contains(userName) || "管理员".equals(userName);
}
return false;
}

View File

@ -27,6 +27,8 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import static com.bonus.gzcar.business.backstage.service.CarBalanceServiceImpl.toBigDecimal;
/**
* 供应商 派车录入业务层
*
@ -468,7 +470,7 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService {
sb.append("公里:").append(priceVo.getPrice()).append("");
vo.setRemark(sb.toString());
vo.setPriceId(priceVo.getId());
vo.setGlsPrice(priceVo.getPrice());
vo.setGlsPrice(toBigDecimal(priceVo.getPrice()));
BigDecimal ton = new BigDecimal(vo.getTon());
BigDecimal nowGls = new BigDecimal(gls);
BigDecimal price = new BigDecimal(priceVo.getPrice());
@ -476,7 +478,7 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService {
BigDecimal glsMoney = nowGls.multiply(price).multiply(ton);
allMoney = allMoney.add(glsMoney);
vo.setCost(glsMoney.toString());
vo.setGlsMoney(glsMoney.toString());
vo.setGlsMoney(glsMoney);
} catch (Exception e) {
return "公里数不在厂商合同范围内";
}
@ -491,7 +493,7 @@ public class SupDispatchCarServiceImpl implements SupDispatchCarService {
PriceVo priceVo = getMoney(vo.getContractId(), vo.getModelId(), vo.getSupId(), null, null);
sb.append("依据:").append(priceVo.getName()).append("-").append(priceVo.getModel());
vo.setPriceId(priceVo.getId());
vo.setGlsPrice(priceVo.getPrice());
vo.setGlsPrice(toBigDecimal(priceVo.getPrice()));
int dayToMonth = priceVo.getDayToMonth();
if (day >= dayToMonth) {
sb.append("、作业天数>=").append(dayToMonth);

View File

@ -25,11 +25,9 @@ public class CustomAuthenticationFilter extends AbstractAuthenticationProcessing
super("/login/userLogin");
}
@Override
public Authentication attemptAuthentication(HttpServletRequest request,
HttpServletResponse response) throws AuthenticationException {
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
if (postOnly && !request.getMethod().equals("POST")) {
throw new AuthenticationServiceException(
"Authentication method not supported: " + request.getMethod());
throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod());
}
String username = obtainUsername(request);
@ -38,7 +36,6 @@ public class CustomAuthenticationFilter extends AbstractAuthenticationProcessing
if (username == null) {
username = "";
}
if (password == null) {
password = "";
}
@ -71,8 +68,8 @@ public class CustomAuthenticationFilter extends AbstractAuthenticationProcessing
String username =request.getParameter(usernameParameter);
return username == null ? "" : username;
}
protected void setDetails(HttpServletRequest request,
UsernamePasswordAuthenticationToken authRequest) {
protected void setDetails(HttpServletRequest request, UsernamePasswordAuthenticationToken authRequest) {
authRequest.setDetails(authenticationDetailsSource.buildDetails(request));
}
}

View File

@ -27,10 +27,17 @@ public class SelfUserEntity implements Serializable, UserDetails {
* 用户ID
*/
private Long userId;
/**
* 用户名
*/
private String username;
/**
* 用户昵称
*/
private String nickName;
/**
* 密码
*/

View File

@ -34,41 +34,34 @@
dc_unit = #{dcUnit},
day_or_m = #{isDayOrMonth}
WHERE id = #{id}
</update>
<!--查询 供应商集合-->
<select id="getSupPageList" resultType="com.bonus.gzcar.business.backstage.entity.CarBalanceVo">
select cpo.id,cpo.apply_id applyId ,cpo.sup_id supId,count(1) num ,cs.name supName ,slt.money payMoney,
SUM(cpo.money)-slt.money noPayMoney,
plan.planNum,pro.proNum,SUM(cpo.money) money,sum(cpo.dispatch_num) carNum,
if(CURRENT_DATE() BETWEEN cc.start_time and cc.end_time,'已生效', if(CURRENT_DATE() &lt; cc.start_time,'未生效','已失效')) status
from car_plan_out cpo
left join car_supplier cs on cs.id=cpo.sup_id
left join car_contract cc on cc.id =cpo.contract_id
left join car_plan_apply cpa on cpo.apply_id=cpa.id
left join (
SELECT sum(money) money,csa.sup_id
from car_slt_apply csa
GROUP BY csa.sup_id
)slt on slt.sup_id=cpo.sup_id
left join (
SELECT count(1) planNum ,cpas.sup_id
from car_plan_apply_sup cpas
left join car_plan_apply cpa on cpa.id=cpas.apply_id
GROUP BY cpas.sup_id
)plan on plan.sup_id=cpo.sup_id
left join(
SELECT count(distinct cpa.pro_id ) proNum ,cpas.sup_id
from car_plan_apply_sup cpas
left join car_plan_apply cpa on cpa.id=cpas.apply_id
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
cpo.id,cpo.apply_id applyId ,cpo.sup_id supId,count(1) num ,cs.name supName ,slt.money payMoney,
SUM(cpo.money)-slt.money noPayMoney,
plan.planNum,pro.proNum,SUM(cpo.money) money,sum(cpo.dispatch_num) carNum,
if(CURRENT_DATE() BETWEEN cc.start_time and cc.end_time,'已生效', if(CURRENT_DATE() &lt; cc.start_time,'未生效','已失效')) status
from
car_plan_out cpo
left join car_supplier cs on cs.id=cpo.sup_id
left join car_contract cc on cc.id =cpo.contract_id
left join car_plan_apply cpa on cpo.apply_id=cpa.id
left join ( SELECT sum(money) money,csa.sup_id from car_slt_apply csa GROUP BY csa.sup_id )slt on slt.sup_id=cpo.sup_id
left join (
SELECT count(1) planNum ,cpas.sup_id from car_plan_apply_sup cpas left join car_plan_apply cpa on cpa.id = cpas.apply_id GROUP BY cpas.sup_id) plan on plan.sup_id=cpo.sup_id
left join(
SELECT count(distinct cpa.pro_id ) proNum ,cpas.sup_id from car_plan_apply_sup cpas left join car_plan_apply cpa on cpa.id = cpas.apply_id 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">
select cpa.id,cpa.`code`,cpa.pro_id proId,pro.`name` proName ,cpa.dispatch_num dispatchNum,
cpa.need_num needNum ,cpa.type ,cs.`name` supName ,sum(cpo.money) money,cpa.remark,

View File

@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.gzcar.business.backstage.mapper.CarNeedPlanMapper">
<!--新增数据计划-->
<insert id="addNeedPlanData" useGeneratedKeys="true" keyProperty="id">
insert into car_plan_apply(
@ -14,19 +15,22 @@
#{carLength},#{carWidth},#{carHeight},#{carWeight},#{carStart},#{carEnd},#{routePoint}
)
</insert>
<insert id="addNeedPlanDetails">
insert into car_plan_details(
apply_id, model_id, need_num, need_day, remark,plan_type, back_date, car_spec
insert into car_plan_details(apply_id, model_id, need_num, need_day, remark,plan_type, back_date, car_spec
)values
<foreach collection="list" item="item" separator=",">
(#{param.id},#{item.modelId},#{item.needNum},#{item.needDay},#{item.remark},#{param.type},#{item.backDate},#{item.carSpec})
</foreach>
</insert>
</insert>
<insert id="addNeedPlanDetailsOnlyOne">
insert into car_plan_details(apply_id, model_id, need_num, need_day, remark,plan_type, back_date
)values(#{planId},#{modelId},#{needNum},#{needDay},#{remark},#{planType}, #{backDate})
insert into
car_plan_details(apply_id, model_id, need_num, need_day, remark,plan_type, back_date)
values
(#{planId},#{modelId},#{needNum},#{needDay},#{remark},#{planType}, #{backDate})
</insert>
<update id="updateNeedPlanData">
update car_plan_apply set
type=#{type}, pro_id=#{proId}, project_part=#{projectPart},
@ -37,14 +41,21 @@
car_weight=#{carWeight},car_start=#{carStart},car_end=#{carEnd},route_point=#{routePoint}
where id=#{id}
</update>
<update id="updateNeedPlanDetails">
update car_plan_details set model_id=#{modelId}, need_num=#{needNum}, need_day=#{needDay}, remark=#{remark},back_date=#{backDate}
where id=#{id}
update
car_plan_details
set
model_id=#{modelId}, need_num=#{needNum}, need_day=#{needDay}, remark=#{remark},back_date=#{backDate}
where
id = #{id}
</update>
<!--需求计划撤回-->
<update id="withdrawData">
UPDATE car_plan_apply SET status = '0',status_type = '0' WHERE id=#{id}
</update>
<delete id="deleteDetails">
delete from car_plan_details
where id in(
@ -53,58 +64,62 @@
</foreach>
)
</delete>
<delete id="deleteNeedPlanData">
delete from car_plan_apply where id=#{id}
delete from car_plan_apply where id = #{id}
</delete>
<delete id="deleteNeedPlanDetailsData">
delete from car_plan_details where apply_id=#{id}
delete from car_plan_details where apply_id = #{id}
</delete>
<!--查询待审核-->
<select id="getCarNeedPlanList" 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.status, cpa.updater, cpa.update_time updateTime,
if(cpa.type=1,'车辆','吊车') typeName ,
cpa.apply_type applyType, cpa.status_type statusType,cpa.user_name userName
from car_plan_apply cpa
left join bm_project pro on pro.id = cpa.pro_id
where 1=1
<if test="applyType!=null and applyType!=''">
and cpa.apply_type=#{applyType}
</if>
<choose>
<when test="status == 1">
AND cpa.status = 1 AND cpa.status_type != 1
</when>
<when test="status == 2">
AND cpa.status = 1 AND cpa.status_type = 1
</when>
<when test="status == 3">
AND cpa.status = 3
</when>
</choose>
<!-- <if test="status!=null and status!=''">
and cpa.status=#{status}
</if>-->
<if test="keyWord!=null and keyWord!=''">
and (
cpa.code like concat('%',#{keyWord},'%') or
cpa.user_name like concat('%',#{keyWord},'%') or
cpa.project_part like concat('%',#{keyWord},'%') or
cpa.project_content like concat('%',#{keyWord},'%') or
cpa.remark like concat('%',#{keyWord},'%') or
pro.name like concat('%',#{keyWord},'%')
)
</if>
ORDER BY cpa.create_time desc
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.status, cpa.updater, cpa.update_time updateTime, if(cpa.type=1,'车辆','吊车') typeName ,
cpa.apply_type applyType, cpa.status_type statusType,cpa.user_name userName, pu.`NAME` nickName
from
car_plan_apply cpa
left join bm_project pro on pro.id = cpa.pro_id
left join pm_user pu ON cpa.creator = pu.ID
where
1 = 1
<if test="applyType!=null and applyType!=''">
and cpa.apply_type=#{applyType}
</if>
<choose>
<when test="status == 1">
AND cpa.status = 1 AND cpa.status_type != 1
</when>
<when test="status == 2">
AND cpa.status = 1 AND cpa.status_type = 1
</when>
<when test="status == 3">
AND cpa.status = 3
</when>
</choose>
<if test="keyWord!=null and keyWord!=''">
and (
cpa.code like concat('%',#{keyWord},'%') or
cpa.user_name like concat('%',#{keyWord},'%') or
cpa.project_part like concat('%',#{keyWord},'%') or
cpa.project_content like concat('%',#{keyWord},'%') or
cpa.remark like concat('%',#{keyWord},'%') or
pro.name like concat('%',#{keyWord},'%')
)
</if>
ORDER BY
cpa.create_time desc
</select>
<select id="getPlanCode" resultType="java.lang.Integer">
select count(1)
from car_plan_apply
where DATE_FORMAT(create_time,'%Y-%m-%d')=CURRENT_DATE
</select>
<!--查询需求计划详情-->
<select id="getNeedPlanDetails" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
select cpa.id,
@ -138,6 +153,7 @@
left join bm_project pro on pro.id = cpa.pro_id
where cpa.id = #{id}
</select>
<select id="getNeedDetailInfo" 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,
cpd.back_date backDate, cpd.car_spec carSpec, remark,plan_type planType, cmti.type, cmti.name, cmti.model, cmti.unit
@ -151,6 +167,7 @@
and cmti.name like concat('%',#{name},'%')
</if>
</select>
<select id="getCarNeedPlanDetailsList"
resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanDetailVo">
select cpd.id, cpd.apply_id planId ,cpd.model_id modelId,cpd.need_day needDay,
@ -166,8 +183,10 @@
and cmti.name like concat('%',#{name},'%')
</if>
</select>
<select id="getPlanCodeNum" resultType="java.lang.Integer">
select count(1)
from car_plan_apply where code=#{code}
</select>
</mapper>

View File

@ -13,7 +13,7 @@
where id=#{id}
</update>
<select id="getCarAuditList" resultType="com.bonus.gzcar.business.backstage.entity.CarNeedPlanVo">
<select id="getCarAuditList" 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,
@ -29,10 +29,11 @@
WHEN cpa.status_type = '0' AND cpa.status = '0' then '已撤回'
END AS auditStatus,cpa.create_time createTime,
cpa.remark, cpa.status, cpa.updater, cpa.update_time updateTime,
if(cpa.type=1,'车辆','吊车') typeName ,
if(cpa.type=1,'车辆','吊车') typeName , pu.NAME as nickName,
cpa.apply_type applyType, cpa.status_type statusType,cpa.user_name userName
from car_plan_apply cpa
left join bm_project pro on pro.id=cpa.pro_id
left join bm_project pro on pro.id=cpa.pro_id
left join pm_user pu ON cpa.creator = pu.ID
where 1=1 and cpa.apply_type=0
<if test="auditStatus == 1">
and status = 1 and status_type != 1