项目、合同、运单、预结算、正式结算、付款对接mk
This commit is contained in:
+14
@@ -30,6 +30,8 @@ import org.springblade.transport.pojo.entity.ProjectApply;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目立项视图实体类
|
* 项目立项视图实体类
|
||||||
@@ -104,4 +106,16 @@ public class ProjectApplyVO extends ProjectApply {
|
|||||||
@Schema(description = "风险计算额度基数")
|
@Schema(description = "风险计算额度基数")
|
||||||
private BigDecimal maxFundLimit;
|
private BigDecimal maxFundLimit;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "货物类型字典,公开页回显使用")
|
||||||
|
private List<Map<String, String>> cargoTypeOptions;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "运输类型字典,公开页回显使用")
|
||||||
|
private List<Map<String, String>> transportTypeOptions;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "结算方式字典,公开页回显使用")
|
||||||
|
private List<Map<String, String>> settlementModeOptions;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+28
@@ -22,9 +22,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.springblade.transport.mapper;
|
package org.springblade.transport.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.springblade.transport.pojo.entity.ProjectApply;
|
import org.springblade.transport.pojo.entity.ProjectApply;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目立项 Mapper 接口
|
* 项目立项 Mapper 接口
|
||||||
*
|
*
|
||||||
@@ -32,4 +38,26 @@ import org.springblade.transport.pojo.entity.ProjectApply;
|
|||||||
*/
|
*/
|
||||||
public interface ProjectApplyMapper extends BaseMapper<ProjectApply> {
|
public interface ProjectApplyMapper extends BaseMapper<ProjectApply> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按租户读取业务字典项,供未登录公开页回显下拉文案
|
||||||
|
*/
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
@Select("""
|
||||||
|
SELECT dict_key AS dictKey, dict_value AS dictValue
|
||||||
|
FROM blade_dict_biz
|
||||||
|
WHERE is_deleted = 0 AND parent_id <> 0 AND tenant_id = #{tenantId} AND code = #{code}
|
||||||
|
""")
|
||||||
|
List<Map<String, Object>> selectDictBizItems(@Param("tenantId") String tenantId, @Param("code") String code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取系统字典项,供未登录公开页回显下拉文案
|
||||||
|
*/
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
@Select("""
|
||||||
|
SELECT dict_key AS dictKey, dict_value AS dictValue
|
||||||
|
FROM blade_dict
|
||||||
|
WHERE is_deleted = 0 AND parent_id <> 0 AND code = #{code}
|
||||||
|
""")
|
||||||
|
List<Map<String, Object>> selectDictItems(@Param("code") String code);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -211,7 +211,7 @@ public final class MkProcessBizHandlers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object publicDetail(Long id) {
|
public Object publicDetail(Long id) {
|
||||||
return service.getById(id);
|
return service.publicDetail(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+8
@@ -46,6 +46,14 @@ public interface IWaybillService extends BaseService<Waybill> {
|
|||||||
IPage<WaybillVO> selectWaybillPage(IPage<Waybill> page, WaybillVO waybill);
|
IPage<WaybillVO> selectWaybillPage(IPage<Waybill> page, WaybillVO waybill);
|
||||||
WaybillVO detail(Long id);
|
WaybillVO detail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公开详情,不校验当前用户所属组织
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运单详情
|
||||||
|
*/
|
||||||
|
WaybillVO publicDetail(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理端:运单打卡记录 + 司机上传凭证图(label=节点-凭证类型)
|
* 管理端:运单打卡记录 + 司机上传凭证图(label=节点-凭证类型)
|
||||||
*/
|
*/
|
||||||
|
|||||||
+59
@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.core.log.exception.ServiceException;
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
import org.springblade.core.secure.utils.AuthUtil;
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
@@ -71,6 +72,7 @@ import java.util.stream.Collectors;
|
|||||||
* @author Chill
|
* @author Chill
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ProjectApplyServiceImpl extends BaseServiceImpl<ProjectApplyMapper, ProjectApply> implements IProjectApplyService {
|
public class ProjectApplyServiceImpl extends BaseServiceImpl<ProjectApplyMapper, ProjectApply> implements IProjectApplyService {
|
||||||
|
|
||||||
@@ -116,6 +118,7 @@ public class ProjectApplyServiceImpl extends BaseServiceImpl<ProjectApplyMapper,
|
|||||||
ProjectApplyVO projectApplyVO = ProjectApplyWrapper.build().entityVO(loadExists(id));
|
ProjectApplyVO projectApplyVO = ProjectApplyWrapper.build().entityVO(loadExists(id));
|
||||||
normalizeOptionalFields(projectApplyVO);
|
normalizeOptionalFields(projectApplyVO);
|
||||||
projectApplyVO.setReadonly(true);
|
projectApplyVO.setReadonly(true);
|
||||||
|
fillPublicDictOptions(projectApplyVO);
|
||||||
return projectApplyVO;
|
return projectApplyVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -888,6 +891,62 @@ public class ProjectApplyServiceImpl extends BaseServiceImpl<ProjectApplyMapper,
|
|||||||
projectApplyVO.setReadonly(!canCurrentUserOperate(projectApplyVO));
|
projectApplyVO.setReadonly(!canCurrentUserOperate(projectApplyVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公开页没有登录态,下拉字典接口无法访问,这里按项目租户把文案一并返回。
|
||||||
|
*/
|
||||||
|
private void fillPublicDictOptions(ProjectApplyVO projectApplyVO) {
|
||||||
|
try {
|
||||||
|
projectApplyVO.setCargoTypeOptions(loadSystemDictOptions("type_of_goods"));
|
||||||
|
projectApplyVO.setTransportTypeOptions(loadBizDictOptions(projectApplyVO.getTenantId(), "transport_type"));
|
||||||
|
projectApplyVO.setSettlementModeOptions(loadBizDictOptions(projectApplyVO.getTenantId(), "settle_method"));
|
||||||
|
} catch (Exception exception) {
|
||||||
|
log.warn("公开项目详情字典加载失败, id={}", projectApplyVO.getId(), exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Map<String, String>> loadSystemDictOptions(String code) {
|
||||||
|
return toDictOptions(baseMapper.selectDictItems(code));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Map<String, String>> loadBizDictOptions(String tenantId, String code) {
|
||||||
|
if (Func.isEmpty(tenantId)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return toDictOptions(baseMapper.selectDictBizItems(tenantId, code));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Map<String, String>> toDictOptions(List<Map<String, Object>> rows) {
|
||||||
|
List<Map<String, String>> options = new ArrayList<>();
|
||||||
|
if (rows == null) {
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
for (Map<String, Object> row : rows) {
|
||||||
|
String dictKey = dictColumn(row, "dictKey", "dictkey", "dict_key");
|
||||||
|
if (Func.isEmpty(dictKey) || "-1".equals(dictKey)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String dictValue = dictColumn(row, "dictValue", "dictvalue", "dict_value");
|
||||||
|
Map<String, String> option = new LinkedHashMap<>();
|
||||||
|
option.put("value", dictKey);
|
||||||
|
option.put("label", Func.isEmpty(dictValue) ? dictKey : dictValue);
|
||||||
|
options.add(option);
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String dictColumn(Map<String, Object> row, String... names) {
|
||||||
|
if (row == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (String name : names) {
|
||||||
|
Object value = row.get(name);
|
||||||
|
if (value != null && Func.isNotEmpty(String.valueOf(value))) {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
private boolean canCurrentUserOperate(ProjectApply projectApply) {
|
private boolean canCurrentUserOperate(ProjectApply projectApply) {
|
||||||
if (AuthUtil.isAdministrator()) {
|
if (AuthUtil.isAdministrator()) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+17
@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import org.springblade.core.log.exception.ServiceException;
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
import org.springblade.core.tenant.annotation.TenantIgnore;
|
||||||
import org.springblade.core.tool.jackson.JsonUtil;
|
import org.springblade.core.tool.jackson.JsonUtil;
|
||||||
import org.springblade.core.tool.utils.BeanUtil;
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
import org.springblade.core.tool.utils.Func;
|
import org.springblade.core.tool.utils.Func;
|
||||||
@@ -138,6 +139,22 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
|
public WaybillVO publicDetail(Long id) {
|
||||||
|
if (Func.isEmpty(id)) {
|
||||||
|
throw new ServiceException("主键不能为空");
|
||||||
|
}
|
||||||
|
Waybill waybill = getById(id);
|
||||||
|
if (Func.isEmpty(waybill) || Objects.equals(waybill.getIsDeleted(), 1)) {
|
||||||
|
throw new ServiceException("运单管理不存在");
|
||||||
|
}
|
||||||
|
WaybillVO waybillVO = WaybillWrapper.build().entityVO(waybill);
|
||||||
|
waybillVO.setReadonly(true);
|
||||||
|
fillCustomerNameFromContract(waybillVO);
|
||||||
|
return waybillVO;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WaybillLocateVO locateVehicle(Long id) {
|
public WaybillLocateVO locateVehicle(Long id) {
|
||||||
Waybill waybill = requireWaybillWithVehicleNo(id, "无法实时定位");
|
Waybill waybill = requireWaybillWithVehicleNo(id, "无法实时定位");
|
||||||
|
|||||||
Reference in New Issue
Block a user