Compare commits

13 Commits
main ... master

Author SHA1 Message Date
wangmingwei
aafb96728f Merge branch 'master' of https://code.szlecheng.cn/yunzhupaas/yunzhupass-java-boot.git 2026-05-21 16:44:10 +08:00
wangmingwei
135440d1d1 修改文件名称,新增合同模块等 2026-05-21 16:44:05 +08:00
06f5fec8d2 feat(contract): 完善合同模版管理功能
- 移除示例模块依赖配置,优化项目结构
- 调整Admin模块控制器依赖顺序,修正模块引用错误
- 更新开发环境数据库配置,调整连接信息及资源路径
- 新增合同模版及打印模版实体、Mapper接口和Service接口
- 实现合同模版管理服务,包括列表查询、详情、创建、编辑、删除功能
- 新增合同模版控制器,提供REST接口支持前端访问
- 实现合同模版表单验证,包含唯一性和必填字段校验
- 支持合同打印模版子表数据的增删改操作
- 增加分页、排序及复杂条件查询支持,兼容PC与APP端数据过滤
- 完善合同模版数据转换和返回,支持多端数据交换和展示
2026-05-21 16:21:22 +08:00
wangmingwei
f81ecf9316 修改log提交 2026-05-20 17:14:41 +08:00
wangmingwei
d87f5958ce 更改pom文件引用 2026-05-20 17:09:04 +08:00
wangmingwei
81ebc6a772 提交合同模块 2026-05-20 16:06:31 +08:00
wangmingwei
4d923017eb 新增主数据与基本配置部分代码 2026-05-20 14:44:47 +08:00
wangmingwei
0f9631cf9a 修改主数据文件命名 2026-05-19 11:26:56 +08:00
wangmingwei
cc4e00f02a 新增主数据工种信息 2026-05-19 09:30:45 +08:00
wangmingwei
e3c5cbed35 去除空格 2026-05-08 16:10:30 +08:00
wangmingwei
5c690c5516 测试代码合并 2026-05-08 16:07:49 +08:00
wangmingwei
e162ab4a3a Merge branch 'master' of https://code.szlecheng.cn/yunzhupaas/yunzhupass-java-boot.git 2026-05-08 16:05:53 +08:00
32d76990a1 删除 text 2026-04-21 17:45:20 +08:00
166 changed files with 9652 additions and 583 deletions

2
.gitignore vendored
View File

@@ -2,7 +2,7 @@
*.lck
target/
*.json
log/
#log/
logback-test.xml

View File

@@ -19,7 +19,6 @@
<module>yunzhupaas-oauth</module>
<module>yunzhupaas-system</module>
<module>yunzhupaas-public/yunzhupaas-common-all</module>
<module>yunzhupaas-example</module>
<module>yunzhupaas-extend</module>
<module>yunzhupaas-visualdev</module>
<!-- <module>yunzhupaas-workflow</module>-->
@@ -35,8 +34,8 @@
<module>yunzhupaas-flowable</module>
<module>yunzhupaas-train</module>
<module>yunzhupaas-mdm</module>
<module>yunzhupaas-crm</module>
<module>yunzhupaas-pcm</module>
<module>yunzhupaas-cm</module>
<module>yunzhupaas-bc</module>
</modules>
<properties>

View File

@@ -85,11 +85,6 @@
<artifactId>yunzhupaas-oauth-controller</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-example-controller</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-app-controller</artifactId>
@@ -97,22 +92,21 @@
</dependency>
<!-- 基础信息-->
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-bc-controller</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-mdm-controller</artifactId>
<version>${project.version}</version>
</dependency>
<!-- 客户关系-->
<!-- <dependency>-->
<!-- <groupId>com.yunzhupaas</groupId>-->
<!-- <artifactId>yunzhupaas-crm-controller</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.yunzhupaas</groupId>-->
<!-- <artifactId>yunzhupaas-pcm-controller</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-cm-controller</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yunzhupaas</groupId>

View File

@@ -24,9 +24,9 @@ spring:
# host: aliyun.szlecheng.cn
host: mysql.szlecheng.cn
port: 13306
username: jnpfsoft
password: ZtRmzjij4CiaXpSE
db-name: jnpfsoft_dev
username: oa_yunzhupaas
password: OAYUNZHUPAAS
db-name: oa_yunzhupass
db-schema: #金仓达梦选填
prepare-url: #自定义url
@@ -205,8 +205,8 @@ config:
enable-storage: true #启用存储
enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高)
domain: "" # 访问域名例如“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名
# base-path: /data/work-data/upload/jnpfsoft/yunzhupaas-resources/ # 基础路径
base-path: E:/XiangMu/yunzhu/zero-resources/ # 基础路径
# base-path: /data/work-data/upload/yunzhupaas/yunzhupaas-resources/ # 基础路径
base-path: E:/workspace/yunzhupaas/v2.0/springboot/yunzhupaas-resources/ # 基础路径
path-patterns: /** # 访问路径
storage-path: # 存储路径
aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写

View File

@@ -3,7 +3,7 @@ spring:
name: yunzhupaas-boot
profiles:
# 指定环境配置 dev(开发环境-默认)、test(测试环境)、preview(预生产)、prod(生产环境)
active: test
active: dev
servlet:
multipart: #文件传输配置
max-file-size: 100MB #单个数据大小限制
@@ -60,7 +60,7 @@ config:
AllowPreviewFileType: doc,docx,xls,xlsx,ppt,pptx,pdf,jpg,gif,png,bmp,jpeg #允许预览文件类型
PreviewType: kkfile #文件预览方式 1.yozo 2.kkfile默认使用kkfile
kkFileUrl: http://127.0.0.1:30090/FileServer/ #kkfile文件预览服务地址
ApiDomain: http://127.0.0.1:30000 #后端域名(文档预览中使用)
ApiDomain: http://127.0.0.1:40001 #后端域名(文档预览中使用)
FrontDomain: http://127.0.0.1:3100 #前端域名(文档预览中使用)
AppDomain: http://127.0.0.1:8080 #app/h5端域名配置(文档预览中使用)
FlowDomain: http://127.0.0.1:31000 #流程引擎接口地址
@@ -154,7 +154,7 @@ logging:
log:
level:
# 等级 TRACE,DEBUG,INFO,WARN,ERROR(不区分大小写)
root: info
root: INFO
path: log/${spring.application.name}
mybatis:
mapper-locations: classpath*:com/**/mapper/**/*.xml

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunzhupaas.bsc.mapper.BillingItemMapper">
</mapper>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunzhupaas.bsc.mapper.ProjectExpbudgetTempMapper">
</mapper>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunzhupaas.bsc.mapper.ProjectTypeMapper">
</mapper>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunzhupaas.mdm.mapper.CrmLeadMapper">
</mapper>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunzhupaas.mdm.mapper.AssetMapper">
</mapper>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunzhupaas.mdm.mapper.ProjectsMapper">
<!-- 根据项目类型ID查询项目类型名称 -->
<select id="getProjettype" parameterType="string" resultType="string">
SELECT project_type_name
FROM bc_project_type
WHERE project_type_id = #{projectstypeId}
</select>
</mapper>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunzhupaas.mdm.mapper.WorkTypeMapper">
</mapper>

View File

@@ -9,12 +9,12 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-crm</artifactId>
<artifactId>yunzhupaas-bc</artifactId>
<packaging>pom</packaging>
<modules>
<module>yunzhupaas-crm-entity</module>
<module>yunzhupaas-crm-biz</module>
<module>yunzhupaas-crm-controller</module>
<module>yunzhupaas-bc-entity</module>
<module>yunzhupaas-bc-biz</module>
<module>yunzhupaas-bc-controller</module>
</modules>
<dependencies>
<!-- Apache POI dependencies -->

View File

@@ -3,18 +3,18 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yunzhupaas-crm</artifactId>
<artifactId>yunzhupaas-bc</artifactId>
<groupId>com.yunzhupaas</groupId>
<version>5.2.0-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-crm-biz</artifactId>
<artifactId>yunzhupaas-bc-biz</artifactId>
<dependencies>
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-crm-entity</artifactId>
<artifactId>yunzhupaas-bc-entity</artifactId>
<version>${project.version}</version>
</dependency>

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.bsc.mapper;
import com.yunzhupaas.bsc.entity.BillingItemEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 计费项目
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface BillingItemMapper extends SuperMapper<BillingItemEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.bsc.mapper;
import com.yunzhupaas.bsc.entity.ProjectExpbudgetTempEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 项目分类
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-19
*/
public interface ProjectExpbudgetTempMapper extends SuperMapper<ProjectExpbudgetTempEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.bsc.mapper;
import com.yunzhupaas.bsc.entity.ProjectTypeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 项目分类
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-19
*/
public interface ProjectTypeMapper extends SuperMapper<ProjectTypeEntity> {
}

View File

@@ -0,0 +1,31 @@
package com.yunzhupaas.bsc.service;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.base.service.SuperService;
import com.yunzhupaas.bsc.model.billingitem.*;
import java.util.*;
/**
* 计费项目
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface BillingItemService extends SuperService<BillingItemEntity> {
List<BillingItemEntity> getList(BillingItemPagination billingItemPagination);
List<BillingItemEntity> getTypeList(BillingItemPagination billingItemPagination,String dataType);
BillingItemEntity getInfo(String billingitemid);
void delete(BillingItemEntity entity);
void create(BillingItemEntity entity);
boolean update(String billingitemid, BillingItemEntity entity);
String checkForm(BillingItemForm form,int i);
void saveOrUpdate(BillingItemForm billingItemForm,String id, boolean isSave) throws Exception;
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.bsc.service;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 项目分类
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-19
*/
public interface ProjectExpbudgetTempService extends SuperService<ProjectExpbudgetTempEntity> {
}

View File

@@ -0,0 +1,32 @@
package com.yunzhupaas.bsc.service;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.base.service.SuperService;
import com.yunzhupaas.bsc.model.projecttype.*;
import java.util.*;
/**
* 项目分类
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-19
*/
public interface ProjectTypeService extends SuperService<ProjectTypeEntity> {
List<ProjectTypeEntity> getList(ProjectTypePagination projectTypePagination);
List<ProjectTypeEntity> getTypeList(ProjectTypePagination projectTypePagination,String dataType);
ProjectTypeEntity getInfo(String projecttypeid);
void delete(ProjectTypeEntity entity);
void create(ProjectTypeEntity entity);
boolean update(String projecttypeid, ProjectTypeEntity entity);
String checkForm(ProjectTypeForm form,int i);
void saveOrUpdate(ProjectTypeForm projectTypeForm,String id, boolean isSave) throws Exception;
List<Map<String, Object>> getTreeList();
}

View File

@@ -0,0 +1,338 @@
package com.yunzhupaas.bsc.service.impl;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.bsc.mapper.BillingItemMapper;
import com.yunzhupaas.bsc.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.bsc.model.billingitem.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import com.yunzhupaas.base.model.ColumnDataModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.yunzhupaas.model.QueryAllModel;
import java.text.SimpleDateFormat;
import com.yunzhupaas.util.*;
import java.util.*;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.permission.entity.UserEntity;
import com.github.pagehelper.PageHelper;
/**
*
* 计费项目
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Service
public class BillingItemServiceImpl extends SuperServiceImpl<BillingItemMapper, BillingItemEntity> implements BillingItemService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<BillingItemEntity> getList(BillingItemPagination billingItemPagination){
return getTypeList(billingItemPagination,billingItemPagination.getDataType());
}
/** 列表查询 */
@Override
public List<BillingItemEntity> getTypeList(BillingItemPagination billingItemPagination,String dataType){
String userId=userProvider.get().getUserId();
Map<String,Class> tableClassMap=new HashMap<>();
tableClassMap.put("bc_billing_item",BillingItemEntity.class);
MPJLambdaWrapper<BillingItemEntity> wrapper = JoinWrappers
.lambda("bc_billing_item",BillingItemEntity.class)
.selectAll(BillingItemEntity.class);
MPJLambdaWrapper<BillingItemEntity> wrapper2 = JoinWrappers
.lambda("bc_billing_item",BillingItemEntity.class)
.distinct().select(BillingItemEntity::getBillingItemId);
QueryAllModel queryAllModel = new QueryAllModel();
queryAllModel.setWrapper(wrapper);
queryAllModel.setClassMap(tableClassMap);
queryAllModel.setDbLink(BillingItemConstant.DBLINKID);
//数据过滤
boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc");
String columnData = !isPc ? BillingItemConstant.getAppColumnData() : BillingItemConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
queryAllModel.setRuleJson(ruleJson);
//高级查询
boolean hasSuperQuery = true;
if (hasSuperQuery) {
queryAllModel.setSuperJson(billingItemPagination.getSuperQueryJson());
}
//数据权限
boolean pcPermission = true;
boolean appPermission = false;
if (isPc && pcPermission) {
queryAllModel.setModuleId(billingItemPagination.getMenuId());
}
if (!isPc && appPermission) {
queryAllModel.setModuleId(billingItemPagination.getMenuId());
}
//拼接复杂条件
wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel);
if(wrapper == null) return new ArrayList<>();
queryAllModel.setWrapper(wrapper2);
wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel);
//其他条件拼接
otherConditions(billingItemPagination, wrapper, isPc);
otherConditions(billingItemPagination, wrapper2, isPc);
if("0".equals(dataType)){
com.github.pagehelper.Page<Object> objects = PageHelper.startPage((int) billingItemPagination.getCurrentPage(), (int) billingItemPagination.getPageSize(), true);
List<BillingItemEntity> userIPage = this.selectJoinList(BillingItemEntity.class, wrapper2);
List<Object> collect = userIPage.stream().map(t -> t.getBillingItemId()).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(collect)){
wrapper.in(BillingItemEntity::getBillingItemId,collect);
}
List<BillingItemEntity> result = this.selectJoinList(BillingItemEntity.class, wrapper);
return billingItemPagination.setData(result,objects.getTotal());
}else{
List<BillingItemEntity> list = this.selectJoinList(BillingItemEntity.class, wrapper);
if("2".equals(dataType)){
List<Object> selectIds = Arrays.asList(billingItemPagination.getSelectIds());
return list.stream().filter(t -> selectIds.contains(t.getBillingItemId())).collect(Collectors.toList());
}else{
return list;
}
}
}
/**
* 其他条件拼接
*/
private void otherConditions(BillingItemPagination billingItemPagination, MPJLambdaWrapper<BillingItemEntity> wrapper, boolean isPc) {
String databaseName;
try {
@Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection();
databaseName = cnn.getMetaData().getDatabaseProductName().trim();
} catch (SQLException e) {
throw new DataException(e.getMessage());
}
wrapper.isNull(BillingItemEntity::getFlowId);
//关键词
if(ObjectUtil.isNotEmpty(billingItemPagination.getYunzhupaasKeyword())){
}
//普通查询
if(isPc){
if(ObjectUtil.isNotEmpty(billingItemPagination.getBillingItemName())){
String value = billingItemPagination.getBillingItemName() instanceof List ?
JsonUtil.getObjectToString(billingItemPagination.getBillingItemName()) :
String.valueOf(billingItemPagination.getBillingItemName());
wrapper.like(BillingItemEntity::getBillingItemName,value);
}
if(ObjectUtil.isNotEmpty(billingItemPagination.getBillingItemType())){
List<String> idList = new ArrayList<>();
try {
String[][] billingItemType = JsonUtil.getJsonToBean(billingItemPagination.getBillingItemType(),String[][].class);
for(int i=0;i<billingItemType.length;i++){
if(billingItemType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(billingItemType[i])));
}
}
}catch (Exception e1){
try {
List<String> billingItemType = JsonUtil.getJsonToList(billingItemPagination.getBillingItemType(),String.class);
if(billingItemType.size()>0){
idList.addAll(billingItemType);
}
}catch (Exception e2){
idList.add(String.valueOf(billingItemPagination.getBillingItemType()));
}
}
wrapper.and(t->{
idList.forEach(tt->{
if(StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)){
tt = tt.replaceFirst("\\[","[[]");
}
t.like(BillingItemEntity::getBillingItemType, tt).or();
});
});
}
}
//排序
if(StringUtil.isEmpty(billingItemPagination.getSidx())){
wrapper.orderByDesc(BillingItemEntity::getBillingItemId);
}else{
try {
String[] split = billingItemPagination.getSidx().split(",");
for(String sidx:split){
BillingItemEntity billingItemEntity = new BillingItemEntity();
String oderTableField = billingItemEntity.getClass().getAnnotation(TableName.class).value();
boolean descFlag = sidx.startsWith("-");
String sidxField = descFlag ? sidx.substring(1) : sidx;
try{
Field declaredField = billingItemEntity.getClass().getDeclaredField(sidxField);
declaredField.setAccessible(true);
sidxField = declaredField.getAnnotation(TableField.class).value();
}catch (Exception e){
}
String finalOderTableField = oderTableField;
String finalSidxField = sidxField;
Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias())
&& Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null);
oderTableField = oderTableField + "." + sidxField;
if (select == null) {
wrapper.select(oderTableField);
}
if (descFlag) {
wrapper.orderByDesc(oderTableField);
} else {
wrapper.orderByAsc(oderTableField);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public BillingItemEntity getInfo(String billingitemid){
MPJLambdaWrapper<BillingItemEntity> wrapper = JoinWrappers
.lambda("bc_billing_item",BillingItemEntity.class)
.selectAll(BillingItemEntity.class);
wrapper.and(
t->t.eq(BillingItemEntity::getBillingItemId, billingitemid )
.or().eq(BillingItemEntity::getFlowTaskId, billingitemid)
);
return this.selectJoinOne(BillingItemEntity.class,wrapper);
}
@Override
public void create(BillingItemEntity entity){
this.save(entity);
}
@Override
public boolean update(String billingitemid, BillingItemEntity entity){
return this.updateById(entity);
}
@Override
public void delete(BillingItemEntity entity){
if(entity!=null){
this.removeById(entity.getBillingItemId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(BillingItemForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getBillingItemId()) && !form.getBillingItemId().equals("0");
Object id= null;
String countRecover = "";
String fieldTipName = "";
String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空");
String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复");
if (isUp){
id = form.getBillingItemId();
}
//验证业务主键
String businessErr = checkBusinessKey(form, isUp ? id : null, null);
if (StringUtil.isNotEmpty(businessErr)) {
return businessErr;
}
//主表字段验证
fieldTipName = "计费项目编码";
if(StringUtil.isEmpty(form.getBillingItemCode())){
return fieldTipName + canNotNull;
}
if(StringUtil.isNotEmpty(form.getBillingItemCode())){
form.setBillingItemCode(form.getBillingItemCode().trim());
QueryWrapper<BillingItemEntity> billing_item_codeWrapper=new QueryWrapper<>();
billing_item_codeWrapper.lambda().eq(BillingItemEntity::getBillingItemCode,form.getBillingItemCode());
billing_item_codeWrapper.lambda().isNull(BillingItemEntity::getFlowId);
if (isUp){
billing_item_codeWrapper.lambda().ne(BillingItemEntity::getBillingItemId, id);
}
if((int) this.count(billing_item_codeWrapper)>0){
countRecover = fieldTipName + canNotRepeated;
}
}
fieldTipName = "计费项目名称";
if(StringUtil.isEmpty(form.getBillingItemName())){
return fieldTipName + canNotNull;
}
fieldTipName = "费用类别";
fieldTipName = "备注";
return countRecover;
}
/**
* 验证业务主键
*/
private String checkBusinessKey(BillingItemForm form, Object id, List<String> flowIds){
QueryWrapper<BillingItemEntity> wrapper = new QueryWrapper<>();
//修改
if (id != null){
wrapper.lambda().ne(BillingItemEntity::getBillingItemId, id);
}
//是否流程
if(flowIds == null){
wrapper.lambda().isNull(BillingItemEntity::getFlowId);
}else{
wrapper.lambda().in(BillingItemEntity::getFlowId, flowIds);
}
//计费项目编码字段判断
if(form.getBillingItemCode() == null || form.getBillingItemCode().toString().trim().isEmpty()){
wrapper.lambda().isNull(BillingItemEntity::getBillingItemCode);
}else{
wrapper.lambda().eq(BillingItemEntity::getBillingItemCode, form.getBillingItemCode());
}
if((int) this.count(wrapper)>0){
return "计费项目编码已存在,请勿重复提交!";
}
return "";
}
/**
* 新增修改数据(事务回滚)
* @param id
* @param billingItemForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(BillingItemForm billingItemForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
billingItemForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(BillingItemConstant.getFormData(),billingItemForm,BillingItemConstant.TABLERENAMES),BillingItemForm.class);
BillingItemEntity entity = JsonUtil.getJsonToBean(billingItemForm, BillingItemEntity.class);
String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id;
if(isSave){
entity.setFlowTaskId(mainUuid);
entity.setBillingItemId(mainUuid);
} else {
}
boolean b = this.saveOrUpdate(entity);
BillingItemEntity info = this.getInfo(mainUuid);
if (info == null) throw new RuntimeException(MsgCode.FA001.get());
}
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.bsc.service.impl;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.bsc.mapper.ProjectExpbudgetTempMapper;
import com.yunzhupaas.bsc.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.bsc.model.projecttype.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 项目分类
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-19
*/
@Service
public class ProjectExpbudgetTempServiceImpl extends SuperServiceImpl<ProjectExpbudgetTempMapper, ProjectExpbudgetTempEntity> implements ProjectExpbudgetTempService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -0,0 +1,305 @@
package com.yunzhupaas.bsc.service.impl;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.bsc.mapper.ProjectTypeMapper;
import com.yunzhupaas.bsc.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.bsc.model.projecttype.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import com.yunzhupaas.base.model.ColumnDataModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.yunzhupaas.model.QueryAllModel;
import java.text.SimpleDateFormat;
import com.yunzhupaas.util.*;
import java.util.*;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.permission.entity.UserEntity;
import com.github.pagehelper.PageHelper;
/**
*
* 项目分类
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-19
*/
@Service
public class ProjectTypeServiceImpl extends SuperServiceImpl<ProjectTypeMapper, ProjectTypeEntity> implements ProjectTypeService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ProjectTypeMapper projectTypeMapper;
@Override
public List<ProjectTypeEntity> getList(ProjectTypePagination projectTypePagination){
return getTypeList(projectTypePagination,projectTypePagination.getDataType());
}
/** 列表查询 */
@Override
public List<ProjectTypeEntity> getTypeList(ProjectTypePagination projectTypePagination,String dataType){
String userId=userProvider.get().getUserId();
Map<String,Class> tableClassMap=new HashMap<>();
tableClassMap.put("bc_project_type",ProjectTypeEntity.class);
tableClassMap.put("bc_project_expbudget_temp",ProjectExpbudgetTempEntity.class);
MPJLambdaWrapper<ProjectTypeEntity> wrapper = JoinWrappers
.lambda("bc_project_type",ProjectTypeEntity.class)
.selectAssociation(ProjectExpbudgetTempEntity.class,ProjectTypeEntity::getProjectExpbudgetTemp)
.leftJoin(ProjectExpbudgetTempEntity.class,"bc_project_expbudget_temp",ProjectExpbudgetTempEntity::getProjectTypeId,ProjectTypeEntity::getProjectTypeId)
.selectAll(ProjectTypeEntity.class);
MPJLambdaWrapper<ProjectTypeEntity> wrapper2 = JoinWrappers
.lambda("bc_project_type",ProjectTypeEntity.class)
.leftJoin(ProjectExpbudgetTempEntity.class,"bc_project_expbudget_temp",ProjectExpbudgetTempEntity::getProjectTypeId,ProjectTypeEntity::getProjectTypeId)
.distinct().select(ProjectTypeEntity::getProjectTypeId);
QueryAllModel queryAllModel = new QueryAllModel();
queryAllModel.setWrapper(wrapper);
queryAllModel.setClassMap(tableClassMap);
queryAllModel.setDbLink(ProjectTypeConstant.DBLINKID);
//数据过滤
boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc");
String columnData = !isPc ? ProjectTypeConstant.getAppColumnData() : ProjectTypeConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
queryAllModel.setRuleJson(ruleJson);
//高级查询
boolean hasSuperQuery = true;
if (hasSuperQuery) {
queryAllModel.setSuperJson(projectTypePagination.getSuperQueryJson());
}
//数据权限
boolean pcPermission = true;
boolean appPermission = false;
if (isPc && pcPermission) {
queryAllModel.setModuleId(projectTypePagination.getMenuId());
}
if (!isPc && appPermission) {
queryAllModel.setModuleId(projectTypePagination.getMenuId());
}
//拼接复杂条件
wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel);
if(wrapper == null) return new ArrayList<>();
queryAllModel.setWrapper(wrapper2);
wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel);
//其他条件拼接
otherConditions(projectTypePagination, wrapper, isPc);
otherConditions(projectTypePagination, wrapper2, isPc);
//分组和树形生成这个代码,pc端返回全部数据 !"2".equals(dataType)导出选中数据
if(isPc && !"2".equals(dataType)){
dataType = "1";
}
if("0".equals(dataType)){
com.github.pagehelper.Page<Object> objects = PageHelper.startPage((int) projectTypePagination.getCurrentPage(), (int) projectTypePagination.getPageSize(), true);
List<ProjectTypeEntity> userIPage = this.selectJoinList(ProjectTypeEntity.class, wrapper2);
List<Object> collect = userIPage.stream().map(t -> t.getProjectTypeId()).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(collect)){
wrapper.in(ProjectTypeEntity::getProjectTypeId,collect);
}
List<ProjectTypeEntity> result = this.selectJoinList(ProjectTypeEntity.class, wrapper);
return projectTypePagination.setData(result,objects.getTotal());
}else{
List<ProjectTypeEntity> list = this.selectJoinList(ProjectTypeEntity.class, wrapper);
if("2".equals(dataType)){
List<Object> selectIds = Arrays.asList(projectTypePagination.getSelectIds());
return list.stream().filter(t -> selectIds.contains(t.getProjectTypeId())).collect(Collectors.toList());
}else{
return list;
}
}
}
/**
* 其他条件拼接
*/
private void otherConditions(ProjectTypePagination projectTypePagination, MPJLambdaWrapper<ProjectTypeEntity> wrapper, boolean isPc) {
String databaseName;
try {
@Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection();
databaseName = cnn.getMetaData().getDatabaseProductName().trim();
} catch (SQLException e) {
throw new DataException(e.getMessage());
}
wrapper.isNull(ProjectTypeEntity::getFlowId);
//关键词
if(ObjectUtil.isNotEmpty(projectTypePagination.getYunzhupaasKeyword())){
}
//普通查询
if(isPc){
if(ObjectUtil.isNotEmpty(projectTypePagination.getProjectTypeName())){
String value = projectTypePagination.getProjectTypeName() instanceof List ?
JsonUtil.getObjectToString(projectTypePagination.getProjectTypeName()) :
String.valueOf(projectTypePagination.getProjectTypeName());
wrapper.like(ProjectTypeEntity::getProjectTypeName,value);
}
}
//排序
if(StringUtil.isEmpty(projectTypePagination.getSidx())){
wrapper.orderByDesc(ProjectTypeEntity::getProjectTypeId);
}else{
try {
String[] split = projectTypePagination.getSidx().split(",");
for(String sidx:split){
ProjectTypeEntity projectTypeEntity = new ProjectTypeEntity();
String oderTableField = projectTypeEntity.getClass().getAnnotation(TableName.class).value();
boolean descFlag = sidx.startsWith("-");
String sidxField = descFlag ? sidx.substring(1) : sidx;
try{
Field declaredField = projectTypeEntity.getClass().getDeclaredField(sidxField);
declaredField.setAccessible(true);
sidxField = declaredField.getAnnotation(TableField.class).value();
}catch (Exception e){
}
String finalOderTableField = oderTableField;
String finalSidxField = sidxField;
Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias())
&& Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null);
oderTableField = oderTableField + "." + sidxField;
if (select == null) {
wrapper.select(oderTableField);
}
if (descFlag) {
wrapper.orderByDesc(oderTableField);
} else {
wrapper.orderByAsc(oderTableField);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public ProjectTypeEntity getInfo(String projecttypeid){
MPJLambdaWrapper<ProjectTypeEntity> wrapper = JoinWrappers
.lambda("bc_project_type",ProjectTypeEntity.class)
.selectAssociation(ProjectExpbudgetTempEntity.class,ProjectTypeEntity::getProjectExpbudgetTemp)
.leftJoin(ProjectExpbudgetTempEntity.class,"bc_project_expbudget_temp",ProjectExpbudgetTempEntity::getProjectTypeId,ProjectTypeEntity::getProjectTypeId)
.selectAll(ProjectTypeEntity.class);
wrapper.and(
t->t.eq(ProjectTypeEntity::getProjectTypeId, projecttypeid )
.or().eq(ProjectTypeEntity::getFlowTaskId, projecttypeid)
);
return this.selectJoinOne(ProjectTypeEntity.class,wrapper);
}
@Override
public void create(ProjectTypeEntity entity){
this.save(entity);
}
@Override
public boolean update(String projecttypeid, ProjectTypeEntity entity){
return this.updateById(entity);
}
@Override
public void delete(ProjectTypeEntity entity){
if(entity!=null){
this.removeById(entity.getProjectTypeId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(ProjectTypeForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getProjectTypeId()) && !form.getProjectTypeId().equals("0");
Object id= null;
String countRecover = "";
String fieldTipName = "";
String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空");
String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复");
if (isUp){
id = form.getProjectTypeId();
}
//主表字段验证
fieldTipName = "项目分类编码";
fieldTipName = "项目分类名称";
fieldTipName = "上级项目分类";
fieldTipName = "顺序号";
fieldTipName = "备注";
return countRecover;
}
/**
* 新增修改数据(事务回滚)
* @param id
* @param projectTypeForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(ProjectTypeForm projectTypeForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
projectTypeForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(ProjectTypeConstant.getFormData(),projectTypeForm,ProjectTypeConstant.TABLERENAMES),ProjectTypeForm.class);
ProjectTypeEntity entity = JsonUtil.getJsonToBean(projectTypeForm, ProjectTypeEntity.class);
String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id;
if(isSave){
entity.setFlowTaskId(mainUuid);
entity.setProjectTypeId(mainUuid);
} else {
}
boolean b = this.saveOrUpdate(entity);
ProjectTypeEntity info = this.getInfo(mainUuid);
if (info == null) throw new RuntimeException(MsgCode.FA001.get());
}
@Override
public List<Map<String, Object>> getTreeList() {
List<Map<String, Object>> result = new ArrayList<>();
List<ProjectTypeEntity> list = projectTypeMapper.selectList(null);
for (ProjectTypeEntity node : list) {
if (node.getPid() == null || node.getPid().isEmpty() || "0".equals(node.getPid())) {
Map<String, Object> map = new HashMap<>();
map.put("projectTypeId", node.getProjectTypeId());
map.put("projectTypeName", node.getProjectTypeName());
map.put("children", getChildrenSimple(list, node.getProjectTypeId()));
result.add(map);
}
}
return result;
}
private List<Map<String, Object>> getChildrenSimple(List<ProjectTypeEntity> list, String parentId) {
List<Map<String, Object>> children = new ArrayList<>();
for (ProjectTypeEntity node : list) {
if (parentId.equals(node.getPid())) {
Map<String, Object> map = new HashMap<>();
map.put("projectTypeId", node.getProjectTypeId());
map.put("projectTypeName", node.getProjectTypeName());
map.put("children", getChildrenSimple(list, node.getProjectTypeId()));
children.add(map);
}
}
return children;
}
}

View File

@@ -3,18 +3,18 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yunzhupaas-pcm</artifactId>
<artifactId>yunzhupaas-bc</artifactId>
<groupId>com.yunzhupaas</groupId>
<version>5.2.0-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-pcm-controller</artifactId>
<artifactId>yunzhupaas-bc-controller</artifactId>
<dependencies>
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-pcm-biz</artifactId>
<artifactId>yunzhupaas-bc-biz</artifactId>
<version>${project.version}</version>
</dependency>

View File

@@ -0,0 +1,381 @@
package com.yunzhupaas.bsc.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunzhupaas.base.ActionResult;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.permission.entity.UserEntity;
import com.yunzhupaas.constant.MsgCode;
import com.yunzhupaas.bsc.service.*;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.util.*;
import com.yunzhupaas.bsc.model.billingitem.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yunzhupaas.flowable.entity.TaskEntity;
import jakarta.validation.Valid;
import java.util.*;
import com.yunzhupaas.model.ExcelModel;
import com.yunzhupaas.excel.ExcelExportStyler;
import com.yunzhupaas.excel.ExcelHelper;
import com.yunzhupaas.annotation.YunzhupaasField;
import com.yunzhupaas.base.vo.PageListVO;
import com.yunzhupaas.base.vo.PaginationVO;
import com.yunzhupaas.base.vo.DownloadVO;
import com.yunzhupaas.config.ConfigValueUtil;
import com.yunzhupaas.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import com.yunzhupaas.flowable.entity.TaskEntity;
import com.yunzhupaas.exception.WorkFlowException;
import com.yunzhupaas.model.visualJson.UploaderTemplateModel;
import com.yunzhupaas.base.util.FormExecelUtils;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import com.yunzhupaas.onlinedev.model.ExcelImFieldModel;
import com.yunzhupaas.base.model.OnlineImport.ImportDataModel;
import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel;
import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel;
import com.yunzhupaas.base.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import com.yunzhupaas.model.visualJson.config.HeaderModel;
import com.yunzhupaas.base.model.ColumnDataModel;
import com.yunzhupaas.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* 计费项目
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Slf4j
@RestController
@Tag(name = "计费项目" , description = "1")
@RequestMapping("/api/bc/BillingItem")
public class BillingItemController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private BillingItemService billingItemService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
* 列表
*
* @param billingItemPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody BillingItemPagination billingItemPagination)throws Exception{
List<BillingItemEntity> list= billingItemService.getList(billingItemPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BillingItemEntity entity : list) {
Map<String, Object> billingItemMap=JsonUtil.entityToMap(entity);
billingItemMap.put("id", billingItemMap.get("billing_item_id"));
//副表数据
//子表数据
realList.add(billingItemMap);
}
//数据转换
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" ));
realList = generaterSwapUtil.swapDataList(realList, BillingItemConstant.getFormData(), BillingItemConstant.getColumnData(), billingItemPagination.getModuleId(),isPc?false:false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(billingItemPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
* 创建
*
* @param billingItemForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid BillingItemForm billingItemForm) {
String b = billingItemService.checkForm(billingItemForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
billingItemService.saveOrUpdate(billingItemForm, null ,true);
}catch(Exception e){
return ActionResult.fail(MsgCode.FA028.get());
}
return ActionResult.success(MsgCode.SU001.get());
}
/**
* 导出Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody BillingItemPagination billingItemPagination) throws IOException {
if (StringUtil.isEmpty(billingItemPagination.getSelectKey())){
return ActionResult.fail(MsgCode.IMP011.get());
}
List<BillingItemEntity> list= billingItemService.getList(billingItemPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BillingItemEntity entity : list) {
Map<String, Object> billingItemMap=JsonUtil.entityToMap(entity);
billingItemMap.put("id", billingItemMap.get("billing_item_id"));
//副表数据
//子表数据
realList.add(billingItemMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BillingItemConstant.getFormData(), BillingItemConstant.getColumnData(), billingItemPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(billingItemPagination.getSelectKey())?billingItemPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
String menuFullName = generaterSwapUtil.getMenuName(billingItemPagination.getMenuId());
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName);
return ActionResult.success(vo);
}
/**
* 导出表格方法
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo,String menuFullName){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "billing_item_code" :
entitys.add(new ExcelExportEntity("计费项目编码" ,"billing_item_code"));
break;
case "billing_item_name" :
entitys.add(new ExcelExportEntity("计费项目名称" ,"billing_item_name"));
break;
case "billing_item_type" :
entitys.add(new ExcelExportEntity("费用类别" ,"billing_item_type"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
List<ExcelExportEntity> mergerEntitys = new ArrayList<>(entitys);
List<Map<String, Object>> mergerList=new ArrayList<>(dataList);
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(BillingItemConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4));
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4));
}
exportParams.setStyle(ExcelExportStyler.class);
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList);
ExcelModel excelModel = generaterSwapUtil.getExcelParams(BillingItemConstant.getFormData(),Arrays.asList(keys));
ExcelHelper helper = new ExcelHelper();
helper.init(workbook, exportParams, entitys, excelModel);
helper.doPreHandle();
helper.doPostHandle();
}
String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
* 删除
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{
BillingItemEntity entity= billingItemService.getInfo(id);
if(entity!=null){
//主表数据删除
billingItemService.delete(entity);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 批量删除
* @param obj
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody Object obj){
Map<String, Object> objectMap = JsonUtil.entityToMap(obj);
List<String> idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class);
String errInfo = "";
List<String> successList = new ArrayList<>();
for (String allId : idList){
try {
this.delete(allId,false);
successList.add(allId);
} catch (Exception e) {
errInfo = e.getMessage();
}
}
if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){
return ActionResult.fail(errInfo);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 编辑
* @param id
* @param billingItemForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid BillingItemForm billingItemForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
BillingItemEntity entity= billingItemService.getInfo(id);
if(entity!=null){
billingItemForm.setBillingItemId(String.valueOf(entity.getBillingItemId()));
if (!isImport) {
String b = billingItemService.checkForm(billingItemForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
try{
billingItemService.saveOrUpdate(billingItemForm,id,false);
}catch (DataException e1){
return ActionResult.fail(e1.getMessage());
}catch(Exception e){
return ActionResult.fail(MsgCode.FA029.get());
}
return ActionResult.success(MsgCode.SU004.get());
}else{
return ActionResult.fail(MsgCode.FA002.get());
}
}
/**
* 表单信息(详情页)
* 详情页面使用-转换数据
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
BillingItemEntity entity= billingItemService.getInfo(id);
if(entity==null){
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> billingItemMap=JsonUtil.entityToMap(entity);
billingItemMap.put("id", billingItemMap.get("billing_item_id"));
//副表数据
//子表数据
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" ));
billingItemMap = generaterSwapUtil.swapDataDetail(billingItemMap,BillingItemConstant.getFormData(),"823544899306521605",isPc?false:false);
//子表数据
return ActionResult.success(billingItemMap);
}
/**
* 获取详情(编辑页)
* 编辑页面使用-不转换数据
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
BillingItemEntity entity= billingItemService.getInfo(id);
if(entity==null){
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> billingItemMap=JsonUtil.entityToMap(entity);
billingItemMap.put("id", billingItemMap.get("billing_item_id"));
//副表数据
//子表数据
billingItemMap = generaterSwapUtil.swapDataForm(billingItemMap,BillingItemConstant.getFormData(),BillingItemConstant.TABLEFIELDKEY,BillingItemConstant.TABLERENAMES);
return ActionResult.success(billingItemMap);
}
}

View File

@@ -0,0 +1,269 @@
package com.yunzhupaas.bsc.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunzhupaas.base.ActionResult;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.permission.entity.UserEntity;
import com.yunzhupaas.constant.MsgCode;
import com.yunzhupaas.bsc.service.*;
import com.yunzhupaas.bsc.entity.*;
import com.yunzhupaas.util.*;
import com.yunzhupaas.bsc.model.projecttype.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yunzhupaas.flowable.entity.TaskEntity;
import jakarta.validation.Valid;
import java.util.*;
import com.yunzhupaas.model.ExcelModel;
import com.yunzhupaas.excel.ExcelExportStyler;
import com.yunzhupaas.excel.ExcelHelper;
import com.yunzhupaas.annotation.YunzhupaasField;
import com.yunzhupaas.base.vo.PageListVO;
import com.yunzhupaas.base.vo.PaginationVO;
import com.yunzhupaas.base.vo.DownloadVO;
import com.yunzhupaas.config.ConfigValueUtil;
import com.yunzhupaas.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import com.yunzhupaas.flowable.entity.TaskEntity;
import com.yunzhupaas.exception.WorkFlowException;
import com.yunzhupaas.model.visualJson.UploaderTemplateModel;
import com.yunzhupaas.base.util.FormExecelUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* 项目分类
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-19
*/
@Slf4j
@RestController
@Tag(name = "项目分类" , description = "1")
@RequestMapping("/api/bc/ProjectType")
public class ProjectTypeController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ProjectTypeService projectTypeService;
/**
* 列表
*
* @param projectTypePagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ProjectTypePagination projectTypePagination)throws Exception{
List<ProjectTypeEntity> list= projectTypeService.getList(projectTypePagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ProjectTypeEntity entity : list) {
Map<String, Object> projectTypeMap=JsonUtil.entityToMap(entity);
projectTypeMap.put("id", projectTypeMap.get("project_type_id"));
//副表数据
//子表数据
realList.add(projectTypeMap);
}
//数据转换
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" ));
realList = generaterSwapUtil.swapDataList(realList, ProjectTypeConstant.getFormData(), ProjectTypeConstant.getColumnData(), projectTypePagination.getModuleId(),isPc?false:false);
if(isPc){
//分组和树形的树形数据转换
realList = generaterSwapUtil.swapDataList(realList, ProjectTypeConstant.getColumnData(), "project_type_id");
}
for (Map<String, Object> map : realList) {
Object object = map.get("children");
if (ObjectUtil.isNotNull(object) && object instanceof List) {
// ✅ 直接转换为原对象,不创建新对象
@SuppressWarnings("unchecked")
List<Map<String, Object>> children = (List<Map<String, Object>>) object;
for (Map<String, Object> child : children) {
Object pidIdObj = child.get("pid_id");
if (pidIdObj != null && !"".equals(pidIdObj.toString())) {
ProjectTypeEntity entity = projectTypeService.getInfo(pidIdObj.toString());
if (entity != null) {
child.put("pid", entity.getProjectTypeName());
}
}
}
}
}
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(projectTypePagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
* 创建
*
* @param projectTypeForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ProjectTypeForm projectTypeForm) throws Exception {
String b = projectTypeService.checkForm(projectTypeForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
projectTypeService.saveOrUpdate(projectTypeForm, null ,true);
}catch(Exception e){
return ActionResult.fail(MsgCode.FA028.get());
}
return ActionResult.success(MsgCode.SU001.get());
}
/**
* 删除
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{
ProjectTypeEntity entity= projectTypeService.getInfo(id);
if(entity!=null){
//主表数据删除
projectTypeService.delete(entity);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 批量删除
* @param obj
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody Object obj){
Map<String, Object> objectMap = JsonUtil.entityToMap(obj);
List<String> idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class);
String errInfo = "";
List<String> successList = new ArrayList<>();
for (String allId : idList){
try {
this.delete(allId,false);
successList.add(allId);
} catch (Exception e) {
errInfo = e.getMessage();
}
}
if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){
return ActionResult.fail(errInfo);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 编辑
* @param id
* @param projectTypeForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ProjectTypeForm projectTypeForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
ProjectTypeEntity entity= projectTypeService.getInfo(id);
if(entity!=null){
projectTypeForm.setProjectTypeId(String.valueOf(entity.getProjectTypeId()));
if (!isImport) {
String b = projectTypeService.checkForm(projectTypeForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
try{
projectTypeService.saveOrUpdate(projectTypeForm,id,false);
}catch (DataException e1){
return ActionResult.fail(e1.getMessage());
}catch(Exception e){
return ActionResult.fail(MsgCode.FA029.get());
}
return ActionResult.success(MsgCode.SU004.get());
}else{
return ActionResult.fail(MsgCode.FA002.get());
}
}
/**
* 表单信息(详情页)
* 详情页面使用-转换数据
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
ProjectTypeEntity entity= projectTypeService.getInfo(id);
if(entity==null){
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> projectTypeMap=JsonUtil.entityToMap(entity);
projectTypeMap.put("id", projectTypeMap.get("project_type_id"));
//副表数据
//子表数据
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" ));
projectTypeMap = generaterSwapUtil.swapDataDetail(projectTypeMap,ProjectTypeConstant.getFormData(),"824397917879010373",isPc?false:false);
//子表数据
if (StringUtil.isNotEmpty(entity.getPid())){
ProjectTypeEntity entitys= projectTypeService.getInfo(entity.getPid());
projectTypeMap.put("pid", entitys.getProjectTypeName());
}
return ActionResult.success(projectTypeMap);
}
/**
* 获取详情(编辑页)
* 编辑页面使用-不转换数据
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
ProjectTypeEntity entity= projectTypeService.getInfo(id);
if(entity==null){
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> projectTypeMap=JsonUtil.entityToMap(entity);
projectTypeMap.put("id", projectTypeMap.get("project_type_id"));
//副表数据
//子表数据
projectTypeMap = generaterSwapUtil.swapDataForm(projectTypeMap,ProjectTypeConstant.getFormData(),ProjectTypeConstant.TABLEFIELDKEY,ProjectTypeConstant.TABLERENAMES);
return ActionResult.success(projectTypeMap);
}
/**
* 树状列表查询
* @return
*/
@Operation(summary = "树状列表查询")
@GetMapping("/getTreeList")
public ActionResult getTreeList(){
List<Map<String, Object>> treeList= projectTypeService.getTreeList();
return ActionResult.success(treeList);
}
}

View File

@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yunzhupaas-pcm</artifactId>
<artifactId>yunzhupaas-bc</artifactId>
<groupId>com.yunzhupaas</groupId>
<version>5.2.0-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-pcm-entity</artifactId>
<artifactId>yunzhupaas-bc-entity</artifactId>
<dependencies>
<dependency>

View File

@@ -0,0 +1,56 @@
package com.yunzhupaas.bsc.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 计费项目
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("bc_billing_item")
public class BillingItemEntity {
@TableId(value ="billing_item_id" )
@JSONField(name = "billing_item_id")
private String billingItemId;
@TableField(value = "billing_item_code" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "billing_item_code")
private String billingItemCode;
@TableField(value = "billing_item_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "billing_item_name")
private String billingItemName;
@TableField(value = "billing_item_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "billing_item_type")
private String billingItemType;
@TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
@TableField("f_flow_id")
@JSONField(name = "f_flow_id")
private String flowId;
@TableField("f_flow_task_id")
@JSONField(name = "f_flow_task_id")
private String flowTaskId;
}

View File

@@ -0,0 +1,65 @@
package com.yunzhupaas.bsc.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 标准预算项
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-19
*/
@Data
@TableName("bc_project_expbudget_temp")
public class ProjectExpbudgetTempEntity {
@TableId(value ="expbudget_item_id" )
@JSONField(name = "expbudget_item_id")
private String expbudgetItemId;
@TableField("project_type_id")
@JSONField(name = "project_type_id")
private String projectTypeId;
@TableField("budget_item_id")
@JSONField(name = "budget_item_id")
private String budgetItemId;
@TableField("expbudget_item_code")
@JSONField(name = "expbudget_item_code")
private String expbudgetItemCode;
@TableField("expbudget_item_name")
@JSONField(name = "expbudget_item_name")
private String expbudgetItemName;
@TableField("pid")
@JSONField(name = "pid")
private String pid;
@TableField("cost_item_id")
@JSONField(name = "cost_item_id")
private String costItemId;
@TableField("remark")
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
@TableField("f_flow_id")
@JSONField(name = "f_flow_id")
private String flowId;
@TableField("f_flow_task_id")
@JSONField(name = "f_flow_task_id")
private String flowTaskId;
}

View File

@@ -0,0 +1,62 @@
package com.yunzhupaas.bsc.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 项目分类
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-19
*/
@Data
@TableName("bc_project_type")
public class ProjectTypeEntity {
@TableId(value ="project_type_id" )
@JSONField(name = "project_type_id")
private String projectTypeId;
@TableField(value = "project_type_code" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "project_type_code")
private String projectTypeCode;
@TableField(value = "project_type_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "project_type_name")
private String projectTypeName;
@TableField(value = "pid" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "pid")
private String pid;
@TableField(value = "seq_num" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "seq_num")
private Integer seqNum;
@TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
@TableField("f_flow_id")
@JSONField(name = "f_flow_id")
private String flowId;
@TableField("f_flow_task_id")
@JSONField(name = "f_flow_task_id")
private String flowTaskId;
@JSONField(name = "projectExpbudgetTemp")
@TableField(exist = false)
private ProjectExpbudgetTempEntity projectExpbudgetTemp;
}

View File

@@ -0,0 +1,22 @@
package com.yunzhupaas.bsc.model.billingitem;
import lombok.Data;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* 计费项目
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class BillingItemExcelErrorVO extends BillingItemExcelVO{
@Excel(name = "异常原因",orderNum = "-999")
@JSONField(name = "errorsInfo")
private String errorsInfo;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.bsc.model.billingitem;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 计费项目
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class BillingItemExcelVO{
}

View File

@@ -0,0 +1,47 @@
package com.yunzhupaas.bsc.model.billingitem;
import lombok.Data;
import java.util.*;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* 计费项目
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@Schema(description = "表单参数")
public class BillingItemForm {
/** 主键 */
@Schema(description = "主键")
@JSONField(name = "billing_item_id")
private String billingItemId;
/** 计费项目编码 **/
@Schema(description = "计费项目编码")
@JsonProperty("billing_item_code")
@JSONField(name = "billing_item_code")
private String billingItemCode;
/** 计费项目名称 **/
@Schema(description = "计费项目名称")
@JsonProperty("billing_item_name")
@JSONField(name = "billing_item_name")
private String billingItemName;
/** 费用类别 **/
@Schema(description = "费用类别")
@JsonProperty("billing_item_type")
@JSONField(name = "billing_item_type")
private Object billingItemType;
/** 备注 **/
@Schema(description = "备注")
@JsonProperty("remark")
@JSONField(name = "remark")
private String remark;
}

View File

@@ -0,0 +1,55 @@
package com.yunzhupaas.bsc.model.billingitem;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import com.yunzhupaas.base.Pagination;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
*
* 计费项目
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@Schema(description = "列表查询参数")
public class BillingItemPagination extends Pagination {
/** 关键词搜索 */
@Schema(description = "关键词搜索")
private String yunzhupaasKeyword;
/** 查询key */
@Schema(description = "查询key")
private String[] selectKey;
/** 选中数据数组id */
@Schema(description = "选中数据数组id")
private Object[] selectIds;
/** json */
@Schema(description = "json")
private String json;
/** 数据类型 0-当前页1-全部数据 */
@Schema(description = "数据类型 0-当前页1-全部数据")
private String dataType;
/** 高级查询 */
@Schema(description = "高级查询")
private String superQueryJson;
/** 功能id */
@Schema(description = "功能id")
private String moduleId;
/** 菜单id */
@Schema(description = "菜单id")
private String menuId;
/** 计费项目名称 */
@Schema(description = "计费项目名称")
@JsonProperty("billing_item_name")
@JSONField(name = "billingItemName")
private Object billingItemName;
/** 费用类别 */
@Schema(description = "费用类别")
@JsonProperty("billing_item_type")
@JSONField(name = "billingItemType")
private Object billingItemType;
}

View File

@@ -0,0 +1,22 @@
package com.yunzhupaas.bsc.model.projecttype;
import lombok.Data;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* 项目分类
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-19
*/
@Data
public class ProjectTypeExcelErrorVO extends ProjectTypeExcelVO{
@Excel(name = "异常原因",orderNum = "-999")
@JSONField(name = "errorsInfo")
private String errorsInfo;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.bsc.model.projecttype;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 项目分类
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-19
*/
@Data
public class ProjectTypeExcelVO{
}

View File

@@ -0,0 +1,52 @@
package com.yunzhupaas.bsc.model.projecttype;
import lombok.Data;
import java.util.*;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* 项目分类
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-19
*/
@Data
@Schema(description = "表单参数")
public class ProjectTypeForm {
/** 主键 */
@Schema(description = "主键")
@JSONField(name = "project_type_id")
private String projectTypeId;
/** 项目分类编码 **/
@Schema(description = "项目分类编码")
@JsonProperty("project_type_code")
@JSONField(name = "project_type_code")
private String projectTypeCode;
/** 项目分类名称 **/
@Schema(description = "项目分类名称")
@JsonProperty("project_type_name")
@JSONField(name = "project_type_name")
private String projectTypeName;
/** 上级项目分类 **/
@Schema(description = "上级项目分类")
@JsonProperty("pid")
@JSONField(name = "pid")
private Object pid;
/** 顺序号 **/
@Schema(description = "顺序号")
@JsonProperty("seq_num")
@JSONField(name = "seq_num")
private BigDecimal seqNum;
/** 备注 **/
@Schema(description = "备注")
@JsonProperty("remark")
@JSONField(name = "remark")
private Object remark;
}

View File

@@ -0,0 +1,58 @@
package com.yunzhupaas.bsc.model.projecttype;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import com.yunzhupaas.base.Pagination;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
*
* 项目分类
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-19
*/
@Data
@Schema(description = "列表查询参数")
public class ProjectTypePagination extends Pagination {
/** 关键词搜索 */
@Schema(description = "关键词搜索")
private String yunzhupaasKeyword;
/** 查询key */
@Schema(description = "查询key")
private String[] selectKey;
/** 选中数据数组id */
@Schema(description = "选中数据数组id")
private Object[] selectIds;
/** json */
@Schema(description = "json")
private String json;
/** 数据类型 0-当前页1-全部数据 */
@Schema(description = "数据类型 0-当前页1-全部数据")
private String dataType;
/** 高级查询 */
@Schema(description = "高级查询")
private String superQueryJson;
/** 功能id */
@Schema(description = "功能id")
private String moduleId;
/** 菜单id */
@Schema(description = "菜单id")
private String menuId;
/** 分类名称 */
@Schema(description = "分类名称")
@JsonProperty("project_type_name")
@JSONField(name = "projectTypeName")
private Object projectTypeName;
/**
* 树形异步父级字段传值
*/
private String treeParentValue;
/**
* 是否有参数
*/
private boolean hasParam=false;
}

View File

@@ -9,12 +9,12 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-pcm</artifactId>
<artifactId>yunzhupaas-cm</artifactId>
<packaging>pom</packaging>
<modules>
<module>yunzhupaas-pcm-entity</module>
<module>yunzhupaas-pcm-biz</module>
<module>yunzhupaas-pcm-controller</module>
<module>yunzhupaas-cm-entity</module>
<module>yunzhupaas-cm-biz</module>
<module>yunzhupaas-cm-controller</module>
</modules>
<dependencies>
<!-- Apache POI dependencies -->

View File

@@ -3,18 +3,18 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yunzhupaas-pcm</artifactId>
<artifactId>yunzhupaas-cm</artifactId>
<groupId>com.yunzhupaas</groupId>
<version>5.2.0-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-pcm-biz</artifactId>
<artifactId>yunzhupaas-cm-biz</artifactId>
<dependencies>
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-pcm-entity</artifactId>
<artifactId>yunzhupaas-cm-entity</artifactId>
<version>${project.version}</version>
</dependency>

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.AssetSubjectEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface AssetSubjectMapper extends SuperMapper<AssetSubjectEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.ContractEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface ContractMapper extends SuperMapper<ContractEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.ContractPrintingTempEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同模版
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface ContractPrintingTempMapper extends SuperMapper<ContractPrintingTempEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.ContractTempEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同模版
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface ContractTempMapper extends SuperMapper<ContractTempEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.MaterialSubjectEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface MaterialSubjectMapper extends SuperMapper<MaterialSubjectEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.PaymentPlanEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface PaymentPlanMapper extends SuperMapper<PaymentPlanEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.ProductSubjectEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface ProductSubjectMapper extends SuperMapper<ProductSubjectEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.TaskSubjectEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface TaskSubjectMapper extends SuperMapper<TaskSubjectEntity> {
}

View File

@@ -0,0 +1,17 @@
package com.yunzhupaas.cm.mapper;
import com.yunzhupaas.cm.entity.WorktypeSubjectEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunzhupaas.base.mapper.SuperMapper;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface WorktypeSubjectMapper extends SuperMapper<WorktypeSubjectEntity> {
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface AssetSubjectService extends SuperService<AssetSubjectEntity> {
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 合同模版管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-21
*/
public interface ContractPrintingTempService extends SuperService<ContractPrintingTempEntity> {
}

View File

@@ -0,0 +1,31 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
import com.yunzhupaas.cm.model.contract.*;
import java.util.*;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface ContractService extends SuperService<ContractEntity> {
List<ContractEntity> getList(ContractPagination contractPagination);
List<ContractEntity> getTypeList(ContractPagination contractPagination,String dataType);
ContractEntity getInfo(String contractid);
void delete(ContractEntity entity);
void create(ContractEntity entity);
boolean update(String contractid, ContractEntity entity);
String checkForm(ContractForm form,int i);
void saveOrUpdate(ContractForm contractForm,String id, boolean isSave) throws Exception;
}

View File

@@ -0,0 +1,31 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
import com.yunzhupaas.cm.model.contracttemp.*;
import java.util.*;
/**
* 合同模版管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-21
*/
public interface ContractTempService extends SuperService<ContractTempEntity> {
List<ContractTempEntity> getList(ContractTempPagination contractTempPagination);
List<ContractTempEntity> getTypeList(ContractTempPagination contractTempPagination,String dataType);
ContractTempEntity getInfo(String contracttempid);
void delete(ContractTempEntity entity);
void create(ContractTempEntity entity);
boolean update(String contracttempid, ContractTempEntity entity);
String checkForm(ContractTempForm form,int i);
void saveOrUpdate(ContractTempForm contractTempForm,String id, boolean isSave) throws Exception;
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface MaterialSubjectService extends SuperService<MaterialSubjectEntity> {
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface PaymentPlanService extends SuperService<PaymentPlanEntity> {
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface ProductSubjectService extends SuperService<ProductSubjectEntity> {
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface TaskSubjectService extends SuperService<TaskSubjectEntity> {
}

View File

@@ -0,0 +1,14 @@
package com.yunzhupaas.cm.service;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.base.service.SuperService;
/**
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
public interface WorktypeSubjectService extends SuperService<WorktypeSubjectEntity> {
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.AssetSubjectMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contract.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Service
public class AssetSubjectServiceImpl extends SuperServiceImpl<AssetSubjectMapper, AssetSubjectEntity> implements AssetSubjectService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.ContractPrintingTempMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contracttemp.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 合同模版管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-21
*/
@Service
public class ContractPrintingTempServiceImpl extends SuperServiceImpl<ContractPrintingTempMapper, ContractPrintingTempEntity> implements ContractPrintingTempService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -0,0 +1,352 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.ContractTempMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contracttemp.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import com.yunzhupaas.base.model.ColumnDataModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.yunzhupaas.model.QueryAllModel;
import java.text.SimpleDateFormat;
import com.yunzhupaas.util.*;
import java.util.*;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.permission.entity.UserEntity;
import com.github.pagehelper.PageHelper;
/**
*
* 合同模版管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-21
*/
@Service
public class ContractTempServiceImpl extends SuperServiceImpl<ContractTempMapper, ContractTempEntity> implements ContractTempService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ContractPrintingTempService contractPrintingTempService;
@Override
public List<ContractTempEntity> getList(ContractTempPagination contractTempPagination){
return getTypeList(contractTempPagination,contractTempPagination.getDataType());
}
/** 列表查询 */
@Override
public List<ContractTempEntity> getTypeList(ContractTempPagination contractTempPagination,String dataType){
String userId=userProvider.get().getUserId();
Map<String,Class> tableClassMap=new HashMap<>();
tableClassMap.put("cm_contract_temp",ContractTempEntity.class);
tableClassMap.put("cm_contract_printing_temp",ContractPrintingTempEntity.class);
MPJLambdaWrapper<ContractTempEntity> wrapper = JoinWrappers
.lambda("cm_contract_temp",ContractTempEntity.class)
.selectCollection(ContractPrintingTempEntity.class,ContractTempEntity::getContractPrintingTemp)
.leftJoin(ContractPrintingTempEntity.class,"cm_contract_printing_temp",ContractPrintingTempEntity::getContractTempId,ContractTempEntity::getContractTempCode)
.selectAll(ContractTempEntity.class);
MPJLambdaWrapper<ContractTempEntity> wrapper2 = JoinWrappers
.lambda("cm_contract_temp",ContractTempEntity.class)
.leftJoin(ContractPrintingTempEntity.class,"cm_contract_printing_temp",ContractPrintingTempEntity::getContractTempId,ContractTempEntity::getContractTempCode)
.distinct().select(ContractTempEntity::getContractTempId);
QueryAllModel queryAllModel = new QueryAllModel();
queryAllModel.setWrapper(wrapper);
queryAllModel.setClassMap(tableClassMap);
queryAllModel.setDbLink(ContractTempConstant.DBLINKID);
//数据过滤
boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc");
String columnData = !isPc ? ContractTempConstant.getAppColumnData() : ContractTempConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
queryAllModel.setRuleJson(ruleJson);
//高级查询
boolean hasSuperQuery = true;
if (hasSuperQuery) {
queryAllModel.setSuperJson(contractTempPagination.getSuperQueryJson());
}
//数据权限
boolean pcPermission = false;
boolean appPermission = false;
if (isPc && pcPermission) {
queryAllModel.setModuleId(contractTempPagination.getMenuId());
}
if (!isPc && appPermission) {
queryAllModel.setModuleId(contractTempPagination.getMenuId());
}
//拼接复杂条件
wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel);
if(wrapper == null) return new ArrayList<>();
queryAllModel.setWrapper(wrapper2);
wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel);
//其他条件拼接
otherConditions(contractTempPagination, wrapper, isPc);
otherConditions(contractTempPagination, wrapper2, isPc);
if("0".equals(dataType)){
com.github.pagehelper.Page<Object> objects = PageHelper.startPage((int) contractTempPagination.getCurrentPage(), (int) contractTempPagination.getPageSize(), true);
List<ContractTempEntity> userIPage = this.selectJoinList(ContractTempEntity.class, wrapper2);
List<Object> collect = userIPage.stream().map(t -> t.getContractTempId()).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(collect)){
wrapper.in(ContractTempEntity::getContractTempId,collect);
}
List<ContractTempEntity> result = this.selectJoinList(ContractTempEntity.class, wrapper);
return contractTempPagination.setData(result,objects.getTotal());
}else{
List<ContractTempEntity> list = this.selectJoinList(ContractTempEntity.class, wrapper);
if("2".equals(dataType)){
List<Object> selectIds = Arrays.asList(contractTempPagination.getSelectIds());
return list.stream().filter(t -> selectIds.contains(t.getContractTempId())).collect(Collectors.toList());
}else{
return list;
}
}
}
/**
* 其他条件拼接
*/
private void otherConditions(ContractTempPagination contractTempPagination, MPJLambdaWrapper<ContractTempEntity> wrapper, boolean isPc) {
String databaseName;
try {
@Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection();
databaseName = cnn.getMetaData().getDatabaseProductName().trim();
} catch (SQLException e) {
throw new DataException(e.getMessage());
}
wrapper.isNull(ContractTempEntity::getFlowId);
//关键词
if(ObjectUtil.isNotEmpty(contractTempPagination.getYunzhupaasKeyword())){
}
//普通查询
//排序
if(StringUtil.isEmpty(contractTempPagination.getSidx())){
wrapper.orderByDesc(ContractTempEntity::getContractTempId);
}else{
try {
String[] split = contractTempPagination.getSidx().split(",");
for(String sidx:split){
ContractTempEntity contractTempEntity = new ContractTempEntity();
String oderTableField = contractTempEntity.getClass().getAnnotation(TableName.class).value();
boolean descFlag = sidx.startsWith("-");
String sidxField = descFlag ? sidx.substring(1) : sidx;
try{
Field declaredField = contractTempEntity.getClass().getDeclaredField(sidxField);
declaredField.setAccessible(true);
sidxField = declaredField.getAnnotation(TableField.class).value();
}catch (Exception e){
}
String finalOderTableField = oderTableField;
String finalSidxField = sidxField;
Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias())
&& Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null);
oderTableField = oderTableField + "." + sidxField;
if (select == null) {
wrapper.select(oderTableField);
}
if (descFlag) {
wrapper.orderByDesc(oderTableField);
} else {
wrapper.orderByAsc(oderTableField);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public ContractTempEntity getInfo(String contracttempid){
MPJLambdaWrapper<ContractTempEntity> wrapper = JoinWrappers
.lambda("cm_contract_temp",ContractTempEntity.class)
.selectCollection(ContractPrintingTempEntity.class,ContractTempEntity::getContractPrintingTemp)
.leftJoin(ContractPrintingTempEntity.class,"cm_contract_printing_temp",ContractPrintingTempEntity::getContractTempId,ContractTempEntity::getContractTempCode)
.selectAll(ContractTempEntity.class);
wrapper.and(
t->t.eq(ContractTempEntity::getContractTempId, contracttempid )
.or().eq(ContractTempEntity::getFlowTaskId, contracttempid)
);
return this.selectJoinOne(ContractTempEntity.class,wrapper);
}
@Override
public void create(ContractTempEntity entity){
this.save(entity);
}
@Override
public boolean update(String contracttempid, ContractTempEntity entity){
return this.updateById(entity);
}
@Override
public void delete(ContractTempEntity entity){
if(entity!=null){
this.removeById(entity.getContractTempId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(ContractTempForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getContractTempId()) && !form.getContractTempId().equals("0");
Object id= null;
String countRecover = "";
String fieldTipName = "";
String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空");
String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复");
if (isUp){
id = form.getContractTempId();
}
//验证业务主键
String businessErr = checkBusinessKey(form, isUp ? id : null, null);
if (StringUtil.isNotEmpty(businessErr)) {
return businessErr;
}
//主表字段验证
fieldTipName = "合同模版编码";
if(StringUtil.isEmpty(form.getContractTempCode())){
return fieldTipName + canNotNull;
}
if(StringUtil.isNotEmpty(form.getContractTempCode())){
form.setContractTempCode(form.getContractTempCode().trim());
QueryWrapper<ContractTempEntity> contract_temp_codeWrapper=new QueryWrapper<>();
contract_temp_codeWrapper.lambda().eq(ContractTempEntity::getContractTempCode,form.getContractTempCode());
contract_temp_codeWrapper.lambda().isNull(ContractTempEntity::getFlowId);
if (isUp){
contract_temp_codeWrapper.lambda().ne(ContractTempEntity::getContractTempId, id);
}
if((int) this.count(contract_temp_codeWrapper)>0){
countRecover = fieldTipName + canNotRepeated;
}
}
fieldTipName = "合同模版名称";
if(StringUtil.isEmpty(form.getContractTempName())){
return fieldTipName + canNotNull;
}
fieldTipName = "备注";
fieldTipName = "框架合同";
fieldTipName = "清单合同";
fieldTipName = "启用产品清单";
fieldTipName = "启用材料清单";
fieldTipName = "启用人力清单";
fieldTipName = "启用资产清单";
fieldTipName = "启用任务清单";
fieldTipName = "合同类型";
fieldTipName = "启用在线打印";
fieldTipName = "我方签约类型";
fieldTipName = "乙方签约类型";
fieldTipName = "丙方签约类型";
//子表字段验证
if (form.getContractPrintingTempList()!=null){
fieldTipName = "打印模板"
+ "-" + "打印模版ID";
fieldTipName = "打印模板"
+ "-" + "是否启用";
}
return countRecover;
}
/**
* 验证业务主键
*/
private String checkBusinessKey(ContractTempForm form, Object id, List<String> flowIds){
QueryWrapper<ContractTempEntity> wrapper = new QueryWrapper<>();
//修改
if (id != null){
wrapper.lambda().ne(ContractTempEntity::getContractTempId, id);
}
//是否流程
if(flowIds == null){
wrapper.lambda().isNull(ContractTempEntity::getFlowId);
}else{
wrapper.lambda().in(ContractTempEntity::getFlowId, flowIds);
}
//合同模版编码字段判断
if(form.getContractTempCode() == null || form.getContractTempCode().toString().trim().isEmpty()){
wrapper.lambda().isNull(ContractTempEntity::getContractTempCode);
}else{
wrapper.lambda().eq(ContractTempEntity::getContractTempCode, form.getContractTempCode());
}
if((int) this.count(wrapper)>0){
return "数据已存在,请勿重复提交!";
}
return "";
}
/**
* 新增修改数据(事务回滚)
* @param id
* @param contractTempForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(ContractTempForm contractTempForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
contractTempForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(ContractTempConstant.getFormData(),contractTempForm,ContractTempConstant.TABLERENAMES),ContractTempForm.class);
ContractTempEntity entity = JsonUtil.getJsonToBean(contractTempForm, ContractTempEntity.class);
String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id;
if(isSave){
entity.setFlowTaskId(mainUuid);
entity.setContractTempId(mainUuid);
} else {
}
boolean b = this.saveOrUpdate(entity);
ContractTempEntity info = this.getInfo(mainUuid);
if (info == null) throw new RuntimeException(MsgCode.FA001.get());
//ContractPrintingTemp子表数据新增修改
QueryWrapper<ContractPrintingTempEntity> ContractPrintingTempqueryWrapper = new QueryWrapper<>();
ContractPrintingTempqueryWrapper.lambda().eq(ContractPrintingTempEntity::getContractTempId, info.getContractTempCode());
if(!isSave && !CollectionUtils.isNotEmpty(contractTempForm.getContractPrintingTempList())){
contractPrintingTempService.remove(ContractPrintingTempqueryWrapper);
}
if (CollectionUtils.isNotEmpty(contractTempForm.getContractPrintingTempList())){
List<ContractPrintingTempEntity> tablePrintingTemp = JsonUtil.getJsonToList(contractTempForm.getContractPrintingTempList(),ContractPrintingTempEntity.class);
//移除的数据
List<Object> childIds = tablePrintingTemp.stream().filter(t->t.getContractPrintingTempId()!=null).map(ContractPrintingTempEntity::getContractPrintingTempId).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(childIds)){
ContractPrintingTempqueryWrapper.lambda().notIn(ContractPrintingTempEntity::getContractPrintingTempId,childIds);
}
contractPrintingTempService.remove(ContractPrintingTempqueryWrapper);
for(ContractPrintingTempEntity entitys : tablePrintingTemp){
entitys.setContractTempId(entity.getContractTempCode());
if(entitys.getContractPrintingTempId()==null){
entitys.setContractPrintingTempId(RandomUtil.uuId());
}
contractPrintingTempService.saveOrUpdate(entitys);
}
}
}
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.MaterialSubjectMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contract.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Service
public class MaterialSubjectServiceImpl extends SuperServiceImpl<MaterialSubjectMapper, MaterialSubjectEntity> implements MaterialSubjectService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.PaymentPlanMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contract.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Service
public class PaymentPlanServiceImpl extends SuperServiceImpl<PaymentPlanMapper, PaymentPlanEntity> implements PaymentPlanService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.ProductSubjectMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contract.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Service
public class ProductSubjectServiceImpl extends SuperServiceImpl<ProductSubjectMapper, ProductSubjectEntity> implements ProductSubjectService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.TaskSubjectMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contract.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Service
public class TaskSubjectServiceImpl extends SuperServiceImpl<TaskSubjectMapper, TaskSubjectEntity> implements TaskSubjectService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -0,0 +1,34 @@
package com.yunzhupaas.cm.service.impl;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.cm.mapper.WorktypeSubjectMapper;
import com.yunzhupaas.cm.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhupaas.cm.model.contract.*;
import org.springframework.stereotype.Service;
import com.yunzhupaas.base.service.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunzhupaas.util.GeneraterSwapUtil;
import java.sql.Connection;
import java.sql.SQLException;
import lombok.Cleanup;
import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface;
import com.yunzhupaas.database.util.DynamicDataSourceUtil;
import org.apache.commons.collections4.CollectionUtils;
import com.yunzhupaas.i18n.util.I18nUtil;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.constant.MsgCode;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Service
public class WorktypeSubjectServiceImpl extends SuperServiceImpl<WorktypeSubjectMapper, WorktypeSubjectEntity> implements WorktypeSubjectService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
}

View File

@@ -3,18 +3,18 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yunzhupaas-crm</artifactId>
<artifactId>yunzhupaas-cm</artifactId>
<groupId>com.yunzhupaas</groupId>
<version>5.2.0-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-crm-controller</artifactId>
<artifactId>yunzhupaas-cm-controller</artifactId>
<dependencies>
<dependency>
<groupId>com.yunzhupaas</groupId>
<artifactId>yunzhupaas-crm-biz</artifactId>
<artifactId>yunzhupaas-cm-biz</artifactId>
<version>${project.version}</version>
</dependency>

View File

@@ -0,0 +1,833 @@
package com.yunzhupaas.cm.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunzhupaas.base.ActionResult;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.permission.entity.UserEntity;
import com.yunzhupaas.constant.MsgCode;
import com.yunzhupaas.cm.service.*;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.util.*;
import com.yunzhupaas.cm.model.contract.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yunzhupaas.flowable.entity.TaskEntity;
import jakarta.validation.Valid;
import java.util.*;
import com.yunzhupaas.model.ExcelModel;
import com.yunzhupaas.excel.ExcelExportStyler;
import com.yunzhupaas.excel.ExcelHelper;
import com.yunzhupaas.annotation.YunzhupaasField;
import com.yunzhupaas.base.vo.PageListVO;
import com.yunzhupaas.base.vo.PaginationVO;
import com.yunzhupaas.base.vo.DownloadVO;
import com.yunzhupaas.config.ConfigValueUtil;
import com.yunzhupaas.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import com.yunzhupaas.flowable.entity.TaskEntity;
import com.yunzhupaas.exception.WorkFlowException;
import com.yunzhupaas.model.visualJson.UploaderTemplateModel;
import com.yunzhupaas.base.util.FormExecelUtils;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import com.yunzhupaas.onlinedev.model.ExcelImFieldModel;
import com.yunzhupaas.base.model.OnlineImport.ImportDataModel;
import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel;
import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel;
import com.yunzhupaas.base.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import com.yunzhupaas.model.visualJson.config.HeaderModel;
import com.yunzhupaas.base.model.ColumnDataModel;
import com.yunzhupaas.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Slf4j
@RestController
@Tag(name = "合同管理" , description = "4")
@RequestMapping("/api/cm/Contract")
public class ContractController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ContractService contractService;
@Autowired
private ProductSubjectService productSubjectService;
@Autowired
private MaterialSubjectService materialSubjectService;
@Autowired
private WorktypeSubjectService worktypeSubjectService;
@Autowired
private AssetSubjectService assetSubjectService;
@Autowired
private TaskSubjectService taskSubjectService;
@Autowired
private PaymentPlanService paymentPlanService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
* 列表
*
* @param contractPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ContractPagination contractPagination)throws Exception{
List<ContractEntity> list= contractService.getList(contractPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ContractEntity entity : list) {
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("contract_id"));
//副表数据
//子表数据
List<ProductSubjectEntity> productSubjectList = entity.getProductSubject();
contractMap.put("tableProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
contractMap.put("productSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
List<MaterialSubjectEntity> materialSubjectList = entity.getMaterialSubject();
contractMap.put("tableMaterialList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
contractMap.put("materialSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
List<WorktypeSubjectEntity> worktypeSubjectList = entity.getWorktypeSubject();
contractMap.put("tableWorktypeList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
contractMap.put("worktypeSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
List<AssetSubjectEntity> assetSubjectList = entity.getAssetSubject();
contractMap.put("tableAssetList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
contractMap.put("assetSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
List<TaskSubjectEntity> taskSubjectList = entity.getTaskSubject();
contractMap.put("tableTaskList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
contractMap.put("taskSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
List<PaymentPlanEntity> paymentPlanList = entity.getPaymentPlan();
contractMap.put("tableField3494b2",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
contractMap.put("paymentPlanList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
realList.add(contractMap);
}
//数据转换
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" ));
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(),isPc?false:false);
//流程状态添加
generaterSwapUtil.getFlowStatus(realList);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(contractPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
* 创建
*
* @param contractForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm) {
String b = contractService.checkForm(contractForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
contractService.saveOrUpdate(contractForm, id ,true);
}catch(Exception e){
return ActionResult.fail(MsgCode.FA028.get());
}
return ActionResult.success(MsgCode.SU001.get());
}
/**
* 导出Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException {
if (StringUtil.isEmpty(contractPagination.getSelectKey())){
return ActionResult.fail(MsgCode.IMP011.get());
}
List<ContractEntity> list= contractService.getList(contractPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ContractEntity entity : list) {
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("contract_id"));
//副表数据
//子表数据
List<ProductSubjectEntity> productSubjectList = entity.getProductSubject();
contractMap.put("tableProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
contractMap.put("productSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
List<MaterialSubjectEntity> materialSubjectList = entity.getMaterialSubject();
contractMap.put("tableMaterialList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
contractMap.put("materialSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
List<WorktypeSubjectEntity> worktypeSubjectList = entity.getWorktypeSubject();
contractMap.put("tableWorktypeList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
contractMap.put("worktypeSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
List<AssetSubjectEntity> assetSubjectList = entity.getAssetSubject();
contractMap.put("tableAssetList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
contractMap.put("assetSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
List<TaskSubjectEntity> taskSubjectList = entity.getTaskSubject();
contractMap.put("tableTaskList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
contractMap.put("taskSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
List<PaymentPlanEntity> paymentPlanList = entity.getPaymentPlan();
contractMap.put("tableField3494b2",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
contractMap.put("paymentPlanList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
realList.add(contractMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(contractPagination.getSelectKey())?contractPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
String menuFullName = generaterSwapUtil.getMenuName(contractPagination.getMenuId());
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName);
return ActionResult.success(vo);
}
/**
* 导出表格方法
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo,String menuFullName){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
ExcelExportEntity tableProductListExcelEntity = new ExcelExportEntity("产品清单(tableProductList)","tableProductList");
List<ExcelExportEntity> tableProductListList = new ArrayList<>();
ExcelExportEntity tableMaterialListExcelEntity = new ExcelExportEntity("材料清单(tableMaterialList)","tableMaterialList");
List<ExcelExportEntity> tableMaterialListList = new ArrayList<>();
ExcelExportEntity tableWorktypeListExcelEntity = new ExcelExportEntity("人力清单(tableWorktypeList)","tableWorktypeList");
List<ExcelExportEntity> tableWorktypeListList = new ArrayList<>();
ExcelExportEntity tableAssetListExcelEntity = new ExcelExportEntity("资产租赁(tableAssetList)","tableAssetList");
List<ExcelExportEntity> tableAssetListList = new ArrayList<>();
ExcelExportEntity tableTaskListExcelEntity = new ExcelExportEntity("工作量清单(tableTaskList)","tableTaskList");
List<ExcelExportEntity> tableTaskListList = new ArrayList<>();
ExcelExportEntity tableField3494b2ExcelEntity = new ExcelExportEntity("付款计划(tableField3494b2)","tableField3494b2");
List<ExcelExportEntity> tableField3494b2List = new ArrayList<>();
for(String key:keys){
switch(key){
case "contract_type" :
entitys.add(new ExcelExportEntity("合同类型" ,"contract_type"));
break;
case "contract_temp_id" :
entitys.add(new ExcelExportEntity("引用模版" ,"contract_temp_id"));
break;
case "contract_name" :
entitys.add(new ExcelExportEntity("合同名称" ,"contract_name"));
break;
case "contract_code" :
entitys.add(new ExcelExportEntity("合同编码" ,"contract_code"));
break;
case "org_id" :
entitys.add(new ExcelExportEntity("归属组织" ,"org_id"));
break;
case "project_id" :
entitys.add(new ExcelExportEntity("归属项目" ,"project_id"));
break;
case "contract_category" :
entitys.add(new ExcelExportEntity("合同分类" ,"contract_category"));
break;
case "contract_date" :
entitys.add(new ExcelExportEntity("签约日期" ,"contract_date"));
break;
case "effective_date" :
entitys.add(new ExcelExportEntity("开始日期" ,"effective_date"));
break;
case "expiry_date" :
entitys.add(new ExcelExportEntity("结束日期" ,"expiry_date"));
break;
case "is_sub_contract" :
entitys.add(new ExcelExportEntity("是否子合同" ,"is_sub_contract"));
break;
case "ref_contract_id" :
entitys.add(new ExcelExportEntity("关联合同" ,"ref_contract_id"));
break;
case "major_person_id" :
entitys.add(new ExcelExportEntity("经办人" ,"major_person_id"));
break;
case "print_temp_id" :
entitys.add(new ExcelExportEntity("打印合同模版" ,"print_temp_id"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "our_company_type" :
entitys.add(new ExcelExportEntity("我方类型" ,"our_company_type"));
break;
case "our_company_id" :
entitys.add(new ExcelExportEntity("我方单位" ,"our_company_id"));
break;
case "our_company_name" :
entitys.add(new ExcelExportEntity("我方名称" ,"our_company_name"));
break;
case "second_party_type" :
entitys.add(new ExcelExportEntity("合作方类型" ,"second_party_type"));
break;
case "second_party_id" :
entitys.add(new ExcelExportEntity("合作单位" ,"second_party_id"));
break;
case "second_party_name" :
entitys.add(new ExcelExportEntity("合作方名称" ,"second_party_name"));
break;
case "third_party_type" :
entitys.add(new ExcelExportEntity("第三方类型" ,"third_party_type"));
break;
case "third_party_id" :
entitys.add(new ExcelExportEntity("第三方单位" ,"third_party_id"));
break;
case "third_party_name" :
entitys.add(new ExcelExportEntity("第三方名称" ,"third_party_name"));
break;
case "contract_money" :
entitys.add(new ExcelExportEntity("原合同金额" ,"contract_money"));
break;
case "final_contract_amount" :
entitys.add(new ExcelExportEntity("最终签约金额" ,"final_contract_amount"));
break;
case "final_amount_upper" :
entitys.add(new ExcelExportEntity("签约金额大写" ,"final_amount_upper"));
break;
case "tax_amount" :
entitys.add(new ExcelExportEntity("税额" ,"tax_amount"));
break;
case "excluding_tax_amount" :
entitys.add(new ExcelExportEntity("不含税金额" ,"excluding_tax_amount"));
break;
case "contract_files" :
entitys.add(new ExcelExportEntity("合同附件" ,"contract_files"));
break;
case "tableProductList-product_id":
tableProductListList.add(new ExcelExportEntity("产品名称" ,"product_id"));
break;
case "tableProductList-brand":
tableProductListList.add(new ExcelExportEntity("品牌" ,"brand"));
break;
case "tableProductList-product_model":
tableProductListList.add(new ExcelExportEntity("规格型号" ,"product_model"));
break;
case "tableProductList-quantity":
tableProductListList.add(new ExcelExportEntity("数量" ,"quantity"));
break;
case "tableProductList-unit_price":
tableProductListList.add(new ExcelExportEntity("单价" ,"unit_price"));
break;
case "tableProductList-quantity_unit":
tableProductListList.add(new ExcelExportEntity("单位" ,"quantity_unit"));
break;
case "tableProductList-currency":
tableProductListList.add(new ExcelExportEntity("币种" ,"currency"));
break;
case "tableProductList-total_amount":
tableProductListList.add(new ExcelExportEntity("总金额" ,"total_amount"));
break;
case "tableProductList-discount_type":
tableProductListList.add(new ExcelExportEntity("折扣类型" ,"discount_type"));
break;
case "tableProductList-discount_value":
tableProductListList.add(new ExcelExportEntity("折扣值" ,"discount_value"));
break;
case "tableProductList-final_amount":
tableProductListList.add(new ExcelExportEntity("最终金额" ,"final_amount"));
break;
case "tableProductList-tax_rate":
tableProductListList.add(new ExcelExportEntity("税率" ,"tax_rate"));
break;
case "tableProductList-tax_amount":
tableProductListList.add(new ExcelExportEntity("税额" ,"tax_amount"));
break;
case "tableProductList-warranty_period":
tableProductListList.add(new ExcelExportEntity("保修期" ,"warranty_period"));
break;
case "tableProductList-warranty_terms":
tableProductListList.add(new ExcelExportEntity("保修条款" ,"warranty_terms"));
break;
case "tableMaterialList-material_id":
tableMaterialListList.add(new ExcelExportEntity("材料名称" ,"material_id"));
break;
case "tableMaterialList-brand":
tableMaterialListList.add(new ExcelExportEntity("品牌" ,"brand"));
break;
case "tableMaterialList-quantity":
tableMaterialListList.add(new ExcelExportEntity("数量" ,"quantity"));
break;
case "tableMaterialList-unit_price":
tableMaterialListList.add(new ExcelExportEntity("单价" ,"unit_price"));
break;
case "tableMaterialList-quantity_unit":
tableMaterialListList.add(new ExcelExportEntity("单位" ,"quantity_unit"));
break;
case "tableMaterialList-currency":
tableMaterialListList.add(new ExcelExportEntity("币种" ,"currency"));
break;
case "tableMaterialList-total_amount":
tableMaterialListList.add(new ExcelExportEntity("总金额" ,"total_amount"));
break;
case "tableMaterialList-tax_rate":
tableMaterialListList.add(new ExcelExportEntity("税率" ,"tax_rate"));
break;
case "tableMaterialList-tax_amount":
tableMaterialListList.add(new ExcelExportEntity("税额" ,"tax_amount"));
break;
case "tableMaterialList-warranty_period":
tableMaterialListList.add(new ExcelExportEntity("保修期" ,"warranty_period"));
break;
case "tableMaterialList-warranty_terms":
tableMaterialListList.add(new ExcelExportEntity("保修条款" ,"warranty_terms"));
break;
case "tableWorktypeList-work_type_id":
tableWorktypeListList.add(new ExcelExportEntity("工种" ,"work_type_id"));
break;
case "tableWorktypeList-quantity":
tableWorktypeListList.add(new ExcelExportEntity("数量" ,"quantity"));
break;
case "tableWorktypeList-unit_price":
tableWorktypeListList.add(new ExcelExportEntity("销售单价" ,"unit_price"));
break;
case "tableWorktypeList-quantity_unit":
tableWorktypeListList.add(new ExcelExportEntity("数量单位" ,"quantity_unit"));
break;
case "tableWorktypeList-currency":
tableWorktypeListList.add(new ExcelExportEntity("币种" ,"currency"));
break;
case "tableWorktypeList-total_amount":
tableWorktypeListList.add(new ExcelExportEntity("总金额" ,"total_amount"));
break;
case "tableWorktypeList-discount_type":
tableWorktypeListList.add(new ExcelExportEntity("折扣类型" ,"discount_type"));
break;
case "tableWorktypeList-discount_value":
tableWorktypeListList.add(new ExcelExportEntity("折扣值" ,"discount_value"));
break;
case "tableWorktypeList-final_amount":
tableWorktypeListList.add(new ExcelExportEntity("最终金额" ,"final_amount"));
break;
case "tableWorktypeList-tax_rate":
tableWorktypeListList.add(new ExcelExportEntity("税率" ,"tax_rate"));
break;
case "tableWorktypeList-tax_amount":
tableWorktypeListList.add(new ExcelExportEntity("税额" ,"tax_amount"));
break;
case "tableWorktypeList-work_description":
tableWorktypeListList.add(new ExcelExportEntity("工种描述" ,"work_description"));
break;
case "tableAssetList-asset_id":
tableAssetListList.add(new ExcelExportEntity("资产名称" ,"asset_id"));
break;
case "tableAssetList-begin_date":
tableAssetListList.add(new ExcelExportEntity("开始日期" ,"begin_date"));
break;
case "tableAssetList-end_date":
tableAssetListList.add(new ExcelExportEntity("结束日期" ,"end_date"));
break;
case "tableAssetList-quantity":
tableAssetListList.add(new ExcelExportEntity("租赁天数" ,"quantity"));
break;
case "tableAssetList-unit_price":
tableAssetListList.add(new ExcelExportEntity("租赁单价" ,"unit_price"));
break;
case "tableAssetList-quantity_unit":
tableAssetListList.add(new ExcelExportEntity("单位" ,"quantity_unit"));
break;
case "tableAssetList-currency":
tableAssetListList.add(new ExcelExportEntity("币种" ,"currency"));
break;
case "tableAssetList-total_amount":
tableAssetListList.add(new ExcelExportEntity("总金额" ,"total_amount"));
break;
case "tableAssetList-discount_type":
tableAssetListList.add(new ExcelExportEntity("折扣类型" ,"discount_type"));
break;
case "tableAssetList-discount_value":
tableAssetListList.add(new ExcelExportEntity("折扣值" ,"discount_value"));
break;
case "tableAssetList-final_amount":
tableAssetListList.add(new ExcelExportEntity("最终金额" ,"final_amount"));
break;
case "tableAssetList-tax_rate":
tableAssetListList.add(new ExcelExportEntity("税率" ,"tax_rate"));
break;
case "tableAssetList-tax_amount":
tableAssetListList.add(new ExcelExportEntity("税额" ,"tax_amount"));
break;
case "tableTaskList-task_name":
tableTaskListList.add(new ExcelExportEntity("任务名称" ,"task_name"));
break;
case "tableTaskList-task_description":
tableTaskListList.add(new ExcelExportEntity("任务描述" ,"task_description"));
break;
case "tableTaskList-quantity":
tableTaskListList.add(new ExcelExportEntity("数量" ,"quantity"));
break;
case "tableTaskList-unit_price":
tableTaskListList.add(new ExcelExportEntity("单价" ,"unit_price"));
break;
case "tableTaskList-quantity_unit":
tableTaskListList.add(new ExcelExportEntity("单位" ,"quantity_unit"));
break;
case "tableTaskList-currency":
tableTaskListList.add(new ExcelExportEntity("币种" ,"currency"));
break;
case "tableTaskList-total_amount":
tableTaskListList.add(new ExcelExportEntity("总金额" ,"total_amount"));
break;
case "tableTaskList-discount_type":
tableTaskListList.add(new ExcelExportEntity("折扣类型" ,"discount_type"));
break;
case "tableTaskList-discount_value":
tableTaskListList.add(new ExcelExportEntity("折扣值" ,"discount_value"));
break;
case "tableTaskList-final_amount":
tableTaskListList.add(new ExcelExportEntity("最终金额" ,"final_amount"));
break;
case "tableTaskList-tax_rate":
tableTaskListList.add(new ExcelExportEntity("税率" ,"tax_rate"));
break;
case "tableTaskList-tax_amount":
tableTaskListList.add(new ExcelExportEntity("税额" ,"tax_amount"));
break;
case "tableTaskList-remark":
tableTaskListList.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "tableField3494b2-plan_seq_num":
tableField3494b2List.add(new ExcelExportEntity("序号" ,"plan_seq_num"));
break;
case "tableField3494b2-payment_name":
tableField3494b2List.add(new ExcelExportEntity("款项名称" ,"payment_name"));
break;
case "tableField3494b2-billing_item_id":
tableField3494b2List.add(new ExcelExportEntity("款项类型" ,"billing_item_id"));
break;
case "tableField3494b2-payment_condition":
tableField3494b2List.add(new ExcelExportEntity("付款条件" ,"payment_condition"));
break;
case "tableField3494b2-plan_date":
tableField3494b2List.add(new ExcelExportEntity("预计付款日期" ,"plan_date"));
break;
case "tableField3494b2-payment_ratio":
tableField3494b2List.add(new ExcelExportEntity("付款比例" ,"payment_ratio"));
break;
case "tableField3494b2-payment_amount":
tableField3494b2List.add(new ExcelExportEntity("付款金额" ,"payment_amount"));
break;
case "tableField3494b2-remark":
tableField3494b2List.add(new ExcelExportEntity("备注" ,"remark"));
break;
default:
break;
}
}
if(tableProductListList.size() > 0){
tableProductListExcelEntity.setList(tableProductListList);
entitys.add(tableProductListExcelEntity);
}
if(tableMaterialListList.size() > 0){
tableMaterialListExcelEntity.setList(tableMaterialListList);
entitys.add(tableMaterialListExcelEntity);
}
if(tableWorktypeListList.size() > 0){
tableWorktypeListExcelEntity.setList(tableWorktypeListList);
entitys.add(tableWorktypeListExcelEntity);
}
if(tableAssetListList.size() > 0){
tableAssetListExcelEntity.setList(tableAssetListList);
entitys.add(tableAssetListExcelEntity);
}
if(tableTaskListList.size() > 0){
tableTaskListExcelEntity.setList(tableTaskListList);
entitys.add(tableTaskListExcelEntity);
}
if(tableField3494b2List.size() > 0){
tableField3494b2ExcelEntity.setList(tableField3494b2List);
entitys.add(tableField3494b2ExcelEntity);
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
List<ExcelExportEntity> mergerEntitys = new ArrayList<>(entitys);
List<Map<String, Object>> mergerList=new ArrayList<>(dataList);
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(ContractConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4));
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4));
}
exportParams.setStyle(ExcelExportStyler.class);
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList);
ExcelModel excelModel = generaterSwapUtil.getExcelParams(ContractConstant.getFormData(),Arrays.asList(keys));
ExcelHelper helper = new ExcelHelper();
helper.init(workbook, exportParams, entitys, excelModel);
helper.doPreHandle();
helper.doPostHandle();
}
String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
* 删除
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{
ContractEntity entity= contractService.getInfo(id);
if(entity!=null){
if(!forceDel){
String errMsg = generaterSwapUtil.deleteFlowTask(entity.getFlowTaskId());
if (StringUtil.isNotEmpty(errMsg)) {
throw new DataException(errMsg);
}
}
//主表数据删除
contractService.delete(entity);
QueryWrapper<ProductSubjectEntity> queryWrapperProductSubject=new QueryWrapper<>();
queryWrapperProductSubject.lambda().eq(ProductSubjectEntity::getContractId,entity.getContractId());
//子表数据删除
productSubjectService.remove(queryWrapperProductSubject);
QueryWrapper<MaterialSubjectEntity> queryWrapperMaterialSubject=new QueryWrapper<>();
queryWrapperMaterialSubject.lambda().eq(MaterialSubjectEntity::getContractId,entity.getContractId());
//子表数据删除
materialSubjectService.remove(queryWrapperMaterialSubject);
QueryWrapper<WorktypeSubjectEntity> queryWrapperWorktypeSubject=new QueryWrapper<>();
queryWrapperWorktypeSubject.lambda().eq(WorktypeSubjectEntity::getContractId,entity.getContractId());
//子表数据删除
worktypeSubjectService.remove(queryWrapperWorktypeSubject);
QueryWrapper<AssetSubjectEntity> queryWrapperAssetSubject=new QueryWrapper<>();
queryWrapperAssetSubject.lambda().eq(AssetSubjectEntity::getContractId,entity.getContractId());
//子表数据删除
assetSubjectService.remove(queryWrapperAssetSubject);
QueryWrapper<TaskSubjectEntity> queryWrapperTaskSubject=new QueryWrapper<>();
queryWrapperTaskSubject.lambda().eq(TaskSubjectEntity::getContractId,entity.getContractId());
//子表数据删除
taskSubjectService.remove(queryWrapperTaskSubject);
QueryWrapper<PaymentPlanEntity> queryWrapperPaymentPlan=new QueryWrapper<>();
queryWrapperPaymentPlan.lambda().eq(PaymentPlanEntity::getContractId,entity.getContractId());
//子表数据删除
paymentPlanService.remove(queryWrapperPaymentPlan);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 批量删除
* @param obj
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody Object obj){
Map<String, Object> objectMap = JsonUtil.entityToMap(obj);
List<String> idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class);
String errInfo = "";
List<String> successList = new ArrayList<>();
for (String allId : idList){
try {
this.delete(allId,false);
successList.add(allId);
} catch (Exception e) {
errInfo = e.getMessage();
}
}
if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){
return ActionResult.fail(errInfo);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 编辑
* @param id
* @param contractForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ContractForm contractForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
ContractEntity entity= contractService.getInfo(id);
if(entity!=null){
contractForm.setContractId(String.valueOf(entity.getContractId()));
if (!isImport) {
String b = contractService.checkForm(contractForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
try{
contractService.saveOrUpdate(contractForm,id,false);
}catch (DataException e1){
return ActionResult.fail(e1.getMessage());
}catch(Exception e){
return ActionResult.fail(MsgCode.FA029.get());
}
return ActionResult.success(MsgCode.SU004.get());
}else{
return ActionResult.fail(MsgCode.FA002.get());
}
}
/**
* 表单信息(详情页)
* 详情页面使用-转换数据
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
ContractEntity entity= contractService.getInfo(id);
if(entity==null){
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("contract_id"));
//副表数据
//子表数据
List<ProductSubjectEntity> productSubjectList = entity.getProductSubject();
contractMap.put("tableProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
contractMap.put("productSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
List<MaterialSubjectEntity> materialSubjectList = entity.getMaterialSubject();
contractMap.put("tableMaterialList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
contractMap.put("materialSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
List<WorktypeSubjectEntity> worktypeSubjectList = entity.getWorktypeSubject();
contractMap.put("tableWorktypeList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
contractMap.put("worktypeSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
List<AssetSubjectEntity> assetSubjectList = entity.getAssetSubject();
contractMap.put("tableAssetList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
contractMap.put("assetSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
List<TaskSubjectEntity> taskSubjectList = entity.getTaskSubject();
contractMap.put("tableTaskList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
contractMap.put("taskSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
List<PaymentPlanEntity> paymentPlanList = entity.getPaymentPlan();
contractMap.put("tableField3494b2",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
contractMap.put("paymentPlanList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" ));
contractMap = generaterSwapUtil.swapDataDetail(contractMap,ContractConstant.getFormData(),"822512474837222405",isPc?false:false);
//子表数据
contractMap.put("productSubjectList",contractMap.get("tableProductList"));
contractMap.put("materialSubjectList",contractMap.get("tableMaterialList"));
contractMap.put("worktypeSubjectList",contractMap.get("tableWorktypeList"));
contractMap.put("assetSubjectList",contractMap.get("tableAssetList"));
contractMap.put("taskSubjectList",contractMap.get("tableTaskList"));
contractMap.put("paymentPlanList",contractMap.get("tableField3494b2"));
return ActionResult.success(contractMap);
}
/**
* 获取详情(编辑页)
* 编辑页面使用-不转换数据
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
ContractEntity entity= contractService.getInfo(id);
if(entity==null){
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("contract_id"));
//副表数据
//子表数据
List<ProductSubjectEntity> productSubjectList = entity.getProductSubject();
contractMap.put("tableProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
contractMap.put("productSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(productSubjectList)));
List<MaterialSubjectEntity> materialSubjectList = entity.getMaterialSubject();
contractMap.put("tableMaterialList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
contractMap.put("materialSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(materialSubjectList)));
List<WorktypeSubjectEntity> worktypeSubjectList = entity.getWorktypeSubject();
contractMap.put("tableWorktypeList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
contractMap.put("worktypeSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(worktypeSubjectList)));
List<AssetSubjectEntity> assetSubjectList = entity.getAssetSubject();
contractMap.put("tableAssetList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
contractMap.put("assetSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(assetSubjectList)));
List<TaskSubjectEntity> taskSubjectList = entity.getTaskSubject();
contractMap.put("tableTaskList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
contractMap.put("taskSubjectList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(taskSubjectList)));
List<PaymentPlanEntity> paymentPlanList = entity.getPaymentPlan();
contractMap.put("tableField3494b2",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
contractMap.put("paymentPlanList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentPlanList)));
contractMap = generaterSwapUtil.swapDataForm(contractMap,ContractConstant.getFormData(),ContractConstant.TABLEFIELDKEY,ContractConstant.TABLERENAMES);
return ActionResult.success(contractMap);
}
}

View File

@@ -0,0 +1,269 @@
package com.yunzhupaas.cm.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunzhupaas.base.ActionResult;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.permission.entity.UserEntity;
import com.yunzhupaas.constant.MsgCode;
import com.yunzhupaas.cm.service.*;
import com.yunzhupaas.cm.entity.*;
import com.yunzhupaas.util.*;
import com.yunzhupaas.cm.model.contracttemp.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yunzhupaas.flowable.entity.TaskEntity;
import jakarta.validation.Valid;
import java.util.*;
import com.yunzhupaas.model.ExcelModel;
import com.yunzhupaas.excel.ExcelExportStyler;
import com.yunzhupaas.excel.ExcelHelper;
import com.yunzhupaas.annotation.YunzhupaasField;
import com.yunzhupaas.base.vo.PageListVO;
import com.yunzhupaas.base.vo.PaginationVO;
import com.yunzhupaas.base.vo.DownloadVO;
import com.yunzhupaas.config.ConfigValueUtil;
import com.yunzhupaas.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import com.yunzhupaas.flowable.entity.TaskEntity;
import com.yunzhupaas.exception.WorkFlowException;
import com.yunzhupaas.model.visualJson.UploaderTemplateModel;
import com.yunzhupaas.base.util.FormExecelUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* 合同模版管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-21
*/
@Slf4j
@RestController
@Tag(name = "合同模版管理", description = "合同模版管理")
@RequestMapping("/api/cm/ContractTemp")
public class ContractTempController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ContractTempService contractTempService;
@Autowired
private ContractPrintingTempService contractPrintingTempService;
/**
* 列表
*
* @param contractTempPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ContractTempPagination contractTempPagination) throws Exception {
List<ContractTempEntity> list = contractTempService.getList(contractTempPagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (ContractTempEntity entity : list) {
Map<String, Object> contractTempMap = JsonUtil.entityToMap(entity);
contractTempMap.put("id", contractTempMap.get("contract_temp_id"));
// 副表数据
// 子表数据
List<ContractPrintingTempEntity> contractPrintingTempList = entity.getContractPrintingTemp();
contractTempMap.put("tablePrintingTemp",
JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(contractPrintingTempList)));
contractTempMap.put("contractPrintingTempList",
JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(contractPrintingTempList)));
realList.add(contractTempMap);
}
// 数据转换
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin"));
realList = generaterSwapUtil.swapDataList(realList, ContractTempConstant.getFormData(),
ContractTempConstant.getColumnData(), contractTempPagination.getModuleId(), isPc ? false : false);
// 返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(contractTempPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
* 创建
*
* @param contractTempForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContractTempForm contractTempForm) {
String b = contractTempService.checkForm(contractTempForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
try {
contractTempService.saveOrUpdate(contractTempForm, null, true);
} catch (Exception e) {
log.error("【合同模版创建接口异常】参数:{}", contractTempForm, e);
return ActionResult.fail(MsgCode.FA028.get());
}
return ActionResult.success(MsgCode.SU001.get());
}
/**
* 删除
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id,
@RequestParam(name = "forceDel", defaultValue = "false") boolean forceDel) throws Exception {
ContractTempEntity entity = contractTempService.getInfo(id);
if (entity != null) {
// 主表数据删除
contractTempService.delete(entity);
QueryWrapper<ContractPrintingTempEntity> queryWrapperContractPrintingTemp = new QueryWrapper<>();
queryWrapperContractPrintingTemp.lambda().eq(ContractPrintingTempEntity::getContractTempId,
entity.getContractTempCode());
// 子表数据删除
contractPrintingTempService.remove(queryWrapperContractPrintingTemp);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 批量删除
*
* @param obj
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody Object obj) {
Map<String, Object> objectMap = JsonUtil.entityToMap(obj);
List<String> idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class);
String errInfo = "";
List<String> successList = new ArrayList<>();
for (String allId : idList) {
try {
this.delete(allId, false);
successList.add(allId);
} catch (Exception e) {
errInfo = e.getMessage();
}
}
if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)) {
return ActionResult.fail(errInfo);
}
return ActionResult.success(MsgCode.SU003.get());
}
/**
* 编辑
*
* @param id
* @param contractTempForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractTempForm contractTempForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
ContractTempEntity entity = contractTempService.getInfo(id);
if (entity != null) {
contractTempForm.setContractTempId(String.valueOf(entity.getContractTempId()));
if (!isImport) {
String b = contractTempService.checkForm(contractTempForm, 1);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
}
try {
contractTempService.saveOrUpdate(contractTempForm, id, false);
} catch (DataException e1) {
return ActionResult.fail(e1.getMessage());
} catch (Exception e) {
log.error("【合同模版编辑接口异常】参数:{}", contractTempForm, e);
return ActionResult.fail(MsgCode.FA029.get());
}
return ActionResult.success(MsgCode.SU004.get());
} else {
return ActionResult.fail(MsgCode.FA002.get());
}
}
/**
* 表单信息(详情页)
* 详情页面使用-转换数据
*
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id) {
ContractTempEntity entity = contractTempService.getInfo(id);
if (entity == null) {
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> contractTempMap = JsonUtil.entityToMap(entity);
contractTempMap.put("id", contractTempMap.get("contract_temp_id"));
// 副表数据
// 子表数据
List<ContractPrintingTempEntity> contractPrintingTempList = entity.getContractPrintingTemp();
contractTempMap.put("tablePrintingTemp",
JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(contractPrintingTempList)));
contractTempMap.put("contractPrintingTempList",
JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(contractPrintingTempList)));
boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin"));
contractTempMap = generaterSwapUtil.swapDataDetail(contractTempMap, ContractTempConstant.getFormData(),
"826534292984170373", isPc ? false : false);
// 子表数据
contractTempMap.put("contractPrintingTempList", contractTempMap.get("tablePrintingTemp"));
return ActionResult.success(contractTempMap);
}
/**
* 获取详情(编辑页)
* 编辑页面使用-不转换数据
*
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id) {
ContractTempEntity entity = contractTempService.getInfo(id);
if (entity == null) {
return ActionResult.fail(MsgCode.FA001.get());
}
Map<String, Object> contractTempMap = JsonUtil.entityToMap(entity);
contractTempMap.put("id", contractTempMap.get("contract_temp_id"));
// 副表数据
// 子表数据
List<ContractPrintingTempEntity> contractPrintingTempList = entity.getContractPrintingTemp();
contractTempMap.put("tablePrintingTemp",
JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(contractPrintingTempList)));
contractTempMap.put("contractPrintingTempList",
JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(contractPrintingTempList)));
contractTempMap = generaterSwapUtil.swapDataForm(contractTempMap, ContractTempConstant.getFormData(),
ContractTempConstant.TABLEFIELDKEY, ContractTempConstant.TABLERENAMES);
return ActionResult.success(contractTempMap);
}
}

View File

@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>yunzhupaas-crm</artifactId>
<artifactId>yunzhupaas-cm</artifactId>
<groupId>com.yunzhupaas</groupId>
<version>5.2.0-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yunzhupaas-crm-entity</artifactId>
<artifactId>yunzhupaas-cm-entity</artifactId>
<dependencies>
<dependency>

View File

@@ -0,0 +1,93 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 合同标的物表(资产)
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("cm_asset_subject")
public class AssetSubjectEntity {
@TableId(value ="subject_id" )
@JSONField(name = "subject_id")
private String subjectId;
@TableField("contract_id")
@JSONField(name = "contract_id")
private String contractId;
@TableField(value = "asset_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "asset_id")
private String assetId;
@TableField(value = "quantity" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity")
private BigDecimal quantity;
@TableField(value = "quantity_unit" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity_unit")
private String quantityUnit;
@TableField(value = "unit_price" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
@TableField(value = "begin_date" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "begin_date")
private Date beginDate;
@TableField(value = "end_date" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "end_date")
private Date endDate;
@TableField(value = "currency" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "currency")
private String currency;
@TableField(value = "total_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
@TableField(value = "tax_rate" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
@TableField("tax_code_id")
@JSONField(name = "tax_code_id")
private String taxCodeId;
@TableField(value = "tax_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
@TableField(value = "discount_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_type")
private String discountType;
@TableField(value = "discount_value" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_value")
private BigDecimal discountValue;
@TableField(value = "final_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
@TableField("remark")
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
}

View File

@@ -0,0 +1,156 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 合同基本信息
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("cm_contract")
public class ContractEntity {
@TableId(value ="contract_id" )
@JSONField(name = "contract_id")
private String contractId;
@TableField(value = "contract_code" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_code")
private String contractCode;
@TableField(value = "contract_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_name")
private String contractName;
@TableField(value = "contract_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_type")
private String contractType;
@TableField(value = "contract_temp_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_temp_id")
private String contractTempId;
@TableField(value = "org_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "org_id")
private String orgId;
@TableField(value = "project_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "project_id")
private String projectId;
@TableField(value = "contract_category" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_category")
private String contractCategory;
@TableField(value = "effective_date" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "effective_date")
private Date effectiveDate;
@TableField(value = "expiry_date" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "expiry_date")
private Date expiryDate;
@TableField(value = "contract_date" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_date")
private Date contractDate;
@TableField(value = "contract_money" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_money")
private BigDecimal contractMoney;
@TableField(value = "final_contract_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "final_contract_amount")
private BigDecimal finalContractAmount;
@TableField(value = "tax_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
@TableField(value = "excluding_tax_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "excluding_tax_amount")
private BigDecimal excludingTaxAmount;
@TableField(value = "final_amount_upper" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "final_amount_upper")
private String finalAmountUpper;
@TableField(value = "our_company_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "our_company_id")
private String ourCompanyId;
@TableField(value = "our_company_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "our_company_type")
private String ourCompanyType;
@TableField(value = "second_party_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "second_party_id")
private String secondPartyId;
@TableField(value = "second_party_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "second_party_type")
private String secondPartyType;
@TableField(value = "third_party_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "third_party_id")
private String thirdPartyId;
@TableField(value = "third_party_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "third_party_type")
private String thirdPartyType;
@TableField(value = "print_temp_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "print_temp_id")
private String printTempId;
@TableField(value = "is_sub_contract" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "is_sub_contract")
private String isSubContract;
@TableField(value = "ref_contract_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "ref_contract_id")
private String refContractId;
@TableField(value = "major_person_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "major_person_id")
private String majorPersonId;
@TableField(value = "contract_files" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_files")
private String contractFiles;
@TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
@TableField("f_flow_id")
@JSONField(name = "f_flow_id")
private String flowId;
@TableField("f_flow_task_id")
@JSONField(name = "f_flow_task_id")
private String flowTaskId;
@TableField(value = "our_company_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "our_company_name")
private String ourCompanyName;
@TableField(value = "second_party_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "second_party_name")
private String secondPartyName;
@TableField(value = "third_party_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "third_party_name")
private String thirdPartyName;
@JSONField(name = "productSubject")
@TableField(exist = false)
private List<ProductSubjectEntity> productSubject;
@JSONField(name = "worktypeSubject")
@TableField(exist = false)
private List<WorktypeSubjectEntity> worktypeSubject;
@JSONField(name = "assetSubject")
@TableField(exist = false)
private List<AssetSubjectEntity> assetSubject;
@JSONField(name = "materialSubject")
@TableField(exist = false)
private List<MaterialSubjectEntity> materialSubject;
@JSONField(name = "taskSubject")
@TableField(exist = false)
private List<TaskSubjectEntity> taskSubject;
@JSONField(name = "paymentPlan")
@TableField(exist = false)
private List<PaymentPlanEntity> paymentPlan;
}

View File

@@ -0,0 +1,56 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 合同打印模版
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-21
*/
@Data
@TableName("cm_contract_printing_temp")
public class ContractPrintingTempEntity {
@TableId(value ="contract_printing_temp_id" )
@JSONField(name = "contract_printing_temp_id")
private String contractPrintingTempId;
@TableField("contract_temp_id")
@JSONField(name = "contract_temp_id")
private String contractTempId;
@TableField(value = "printing_temp_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "printing_temp_id")
private String printingTempId;
@TableField(value = "is_enabled" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "is_enabled")
private String isEnabled;
@TableField("remark")
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
@TableField("f_flow_id")
@JSONField(name = "f_flow_id")
private String flowId;
@TableField("f_flow_task_id")
@JSONField(name = "f_flow_task_id")
private String flowTaskId;
}

View File

@@ -0,0 +1,92 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 合同模版
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-21
*/
@Data
@TableName("cm_contract_temp")
public class ContractTempEntity {
@TableId(value ="contract_temp_id" )
@JSONField(name = "contract_temp_id")
private String contractTempId;
@TableField(value = "contract_temp_code" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_temp_code")
private String contractTempCode;
@TableField(value = "contract_temp_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_temp_name")
private String contractTempName;
@TableField(value = "is_framework" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "is_framework")
private String isFramework;
@TableField(value = "is_detail_list" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "is_detail_list")
private String isDetailList;
@TableField(value = "enable_tableProductList" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "enable_tableProductList")
private String enableTableProductList;
@TableField(value = "enable_tableMaterialList" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "enable_tableMaterialList")
private String enableTableMaterialList;
@TableField(value = "enable_tableWorktypeList" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "enable_tableWorktypeList")
private String enableTableWorktypeList;
@TableField(value = "enable_tableAssetList" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "enable_tableAssetList")
private String enableTableAssetList;
@TableField(value = "enable_tableTaskList" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "enable_tableTaskList")
private String enableTableTaskList;
@TableField(value = "contract_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "contract_type")
private String contractType;
@TableField(value = "enable_printing" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "enable_printing")
private String enablePrinting;
@TableField(value = "our_company_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "our_company_type")
private String ourCompanyType;
@TableField(value = "second_party_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "second_party_type")
private String secondPartyType;
@TableField(value = "third_party_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "third_party_type")
private String thirdPartyType;
@TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
@TableField("f_flow_id")
@JSONField(name = "f_flow_id")
private String flowId;
@TableField("f_flow_task_id")
@JSONField(name = "f_flow_task_id")
private String flowTaskId;
@JSONField(name = "contractPrintingTemp")
@TableField(exist = false)
private List<ContractPrintingTempEntity> contractPrintingTemp;
}

View File

@@ -0,0 +1,96 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 合同标的物表(材料)
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("cm_material_subject")
public class MaterialSubjectEntity {
@TableId(value ="subject_id" )
@JSONField(name = "subject_id")
private String subjectId;
@TableField("contract_id")
@JSONField(name = "contract_id")
private String contractId;
@TableField(value = "material_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "material_id")
private String materialId;
@TableField(value = "brand" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "brand")
private String brand;
@TableField(value = "quantity" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity")
private BigDecimal quantity;
@TableField(value = "quantity_unit" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity_unit")
private String quantityUnit;
@TableField(value = "unit_price" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
@TableField(value = "currency" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "currency")
private String currency;
@TableField(value = "total_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
@TableField(value = "tax_rate" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
@TableField("tax_code_id")
@JSONField(name = "tax_code_id")
private String taxCodeId;
@TableField(value = "tax_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
@TableField("discount_type")
@JSONField(name = "discount_type")
private String discountType;
@TableField("discount_value")
@JSONField(name = "discount_value")
private BigDecimal discountValue;
@TableField("final_amount")
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
@TableField(value = "warranty_period" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "warranty_period")
private Integer warrantyPeriod;
@TableField(value = "warranty_terms" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "warranty_terms")
private String warrantyTerms;
@TableField("remark")
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
}

View File

@@ -0,0 +1,55 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 合同付款计划
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("cm_payment_plan")
public class PaymentPlanEntity {
@TableId(value ="payment_plan_id" )
@JSONField(name = "payment_plan_id")
private String paymentPlanId;
@TableField("contract_id")
@JSONField(name = "contract_id")
private String contractId;
@TableField(value = "plan_seq_num" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "plan_seq_num")
private Integer planSeqNum;
@TableField(value = "billing_item_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "billing_item_id")
private String billingItemId;
@TableField(value = "payment_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "payment_name")
private String paymentName;
@TableField(value = "payment_condition" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "payment_condition")
private String paymentCondition;
@TableField(value = "payment_ratio" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "payment_ratio")
private BigDecimal paymentRatio;
@TableField(value = "payment_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "payment_amount")
private BigDecimal paymentAmount;
@TableField(value = "plan_date" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "plan_date")
private Date planDate;
@TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "remark")
private String remark;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
}

View File

@@ -0,0 +1,99 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 合同标的物表(产品)
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("cm_product_subject")
public class ProductSubjectEntity {
@TableId(value ="subject_id" )
@JSONField(name = "subject_id")
private String subjectId;
@TableField("contract_id")
@JSONField(name = "contract_id")
private String contractId;
@TableField(value = "product_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "product_id")
private String productId;
@TableField(value = "brand" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "brand")
private String brand;
@TableField(value = "product_model" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "product_model")
private String productModel;
@TableField(value = "quantity" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity")
private BigDecimal quantity;
@TableField(value = "quantity_unit" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity_unit")
private String quantityUnit;
@TableField(value = "unit_price" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
@TableField(value = "currency" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "currency")
private String currency;
@TableField(value = "total_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
@TableField(value = "tax_rate" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
@TableField("tax_code_id")
@JSONField(name = "tax_code_id")
private String taxCodeId;
@TableField(value = "tax_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
@TableField(value = "discount_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_type")
private String discountType;
@TableField(value = "discount_value" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_value")
private BigDecimal discountValue;
@TableField(value = "final_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
@TableField(value = "warranty_period" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "warranty_period")
private Integer warrantyPeriod;
@TableField(value = "warranty_terms" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "warranty_terms")
private String warrantyTerms;
@TableField("remark")
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
}

View File

@@ -0,0 +1,90 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 合同标的物表(任务)
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("cm_task_subject")
public class TaskSubjectEntity {
@TableId(value ="subject_id" )
@JSONField(name = "subject_id")
private String subjectId;
@TableField("contract_id")
@JSONField(name = "contract_id")
private String contractId;
@TableField(value = "task_name" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "task_name")
private String taskName;
@TableField(value = "task_description" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "task_description")
private String taskDescription;
@TableField(value = "quantity" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity")
private BigDecimal quantity;
@TableField(value = "quantity_unit" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity_unit")
private String quantityUnit;
@TableField(value = "unit_price" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
@TableField(value = "currency" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "currency")
private String currency;
@TableField(value = "total_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
@TableField(value = "tax_rate" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
@TableField("tax_code_id")
@JSONField(name = "tax_code_id")
private String taxCodeId;
@TableField(value = "tax_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
@TableField(value = "discount_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_type")
private String discountType;
@TableField(value = "discount_value" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_value")
private BigDecimal discountValue;
@TableField(value = "final_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
@TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
}

View File

@@ -0,0 +1,90 @@
package com.yunzhupaas.cm.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 合同标的物表(人工)
*
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@TableName("cm_worktype_subject")
public class WorktypeSubjectEntity {
@TableId(value ="subject_id" )
@JSONField(name = "subject_id")
private String subjectId;
@TableField("contract_id")
@JSONField(name = "contract_id")
private String contractId;
@TableField(value = "work_type_id" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "work_type_id")
private String workTypeId;
@TableField(value = "work_description" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "work_description")
private String workDescription;
@TableField(value = "quantity" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity")
private BigDecimal quantity;
@TableField(value = "quantity_unit" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "quantity_unit")
private String quantityUnit;
@TableField(value = "unit_price" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
@TableField(value = "currency" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "currency")
private String currency;
@TableField(value = "total_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
@TableField(value = "tax_rate" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
@TableField("tax_code_id")
@JSONField(name = "tax_code_id")
private String taxCodeId;
@TableField(value = "tax_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
@TableField(value = "discount_type" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_type")
private String discountType;
@TableField(value = "discount_value" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "discount_value")
private BigDecimal discountValue;
@TableField(value = "final_amount" , updateStrategy = FieldStrategy.IGNORED)
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
@TableField("remark")
@JSONField(name = "remark")
private String remark;
@TableField("create_by")
@JSONField(name = "create_by")
private String createBy;
@TableField("create_time")
@JSONField(name = "create_time")
private Date createTime;
@TableField("update_by")
@JSONField(name = "update_by")
private String updateBy;
@TableField("update_time")
@JSONField(name = "update_time")
private Date updateTime;
@TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE)
@JSONField(name = "f_tenant_id")
private String tenantId;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class AssetSubjectExcelVO{
}

View File

@@ -0,0 +1,94 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Data
@Schema(description = "AssetSubject子表参数")
public class AssetSubjectModel {
/** 子表AssetSubject 主键subject_id **/
@Schema(description = "主键")
@JsonProperty("subject_id")
private String subject_id;
/** 资产名称 **/
@Schema(description = "资产名称")
@JsonProperty("asset_id")
@JSONField(name = "asset_id")
private String assetId;
private String asset_id_id;
/** 开始日期 **/
@Schema(description = "开始日期")
@JsonProperty("begin_date")
@JSONField(name = "begin_date")
private Long beginDate;
/** 结束日期 **/
@Schema(description = "结束日期")
@JsonProperty("end_date")
@JSONField(name = "end_date")
private Long endDate;
/** 租赁天数 **/
@Schema(description = "租赁天数")
@JsonProperty("quantity")
@JSONField(name = "quantity")
private BigDecimal quantity;
/** 租赁单价 **/
@Schema(description = "租赁单价")
@JsonProperty("unit_price")
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
/** 单位 **/
@Schema(description = "单位")
@JsonProperty("quantity_unit")
@JSONField(name = "quantity_unit")
private String quantityUnit;
/** 币种 **/
@Schema(description = "币种")
@JsonProperty("currency")
@JSONField(name = "currency")
private Object currency;
/** 总金额 **/
@Schema(description = "总金额")
@JsonProperty("total_amount")
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
/** 折扣类型 **/
@Schema(description = "折扣类型")
@JsonProperty("discount_type")
@JSONField(name = "discount_type")
private Object discountType;
/** 折扣值 **/
@Schema(description = "折扣值")
@JsonProperty("discount_value")
@JSONField(name = "discount_value")
private BigDecimal discountValue;
/** 最终金额 **/
@Schema(description = "最终金额")
@JsonProperty("final_amount")
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
/** 税率 **/
@Schema(description = "税率")
@JsonProperty("tax_rate")
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
/** 税额 **/
@Schema(description = "税额")
@JsonProperty("tax_amount")
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,22 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class ContractExcelErrorVO extends ContractExcelVO{
@Excel(name = "异常原因",orderNum = "-999")
@JSONField(name = "errorsInfo")
private String errorsInfo;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class ContractExcelVO{
}

View File

@@ -0,0 +1,209 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.util.*;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@Schema(description = "表单参数")
public class ContractForm {
/** 主键 */
@Schema(description = "主键")
@JSONField(name = "contract_id")
private String contractId;
/** 流程id **/
@Schema(description = "流程id")
@JsonProperty("flowId")
@JSONField(name = "f_flow_id")
private String flowId;
/** 流程权限列表 **/
@JsonProperty("formOperates")
private List<Map<String,Object>> formOperates = new ArrayList<>();
/** 合同类型 **/
@Schema(description = "合同类型")
@JsonProperty("contract_type")
@JSONField(name = "contract_type")
private String contractType;
/** 引用模版 **/
@Schema(description = "引用模版")
@JsonProperty("contract_temp_id")
@JSONField(name = "contract_temp_id")
private String contractTempId;
/** 合同名称 **/
@Schema(description = "合同名称")
@JsonProperty("contract_name")
@JSONField(name = "contract_name")
private String contractName;
/** 合同编码 **/
@Schema(description = "合同编码")
@JsonProperty("contract_code")
@JSONField(name = "contract_code")
private String contractCode;
/** 归属组织 **/
@Schema(description = "归属组织")
@JsonProperty("org_id")
@JSONField(name = "org_id")
private Object orgId;
/** 归属项目 **/
@Schema(description = "归属项目")
@JsonProperty("project_id")
@JSONField(name = "project_id")
private Object projectId;
/** 合同分类 **/
@Schema(description = "合同分类")
@JsonProperty("contract_category")
@JSONField(name = "contract_category")
private Object contractCategory;
/** 签约日期 **/
@Schema(description = "签约日期")
@JsonProperty("contract_date")
@JSONField(name = "contract_date")
private String contractDate;
/** 开始日期 **/
@Schema(description = "开始日期")
@JsonProperty("effective_date")
@JSONField(name = "effective_date")
private String effectiveDate;
/** 结束日期 **/
@Schema(description = "结束日期")
@JsonProperty("expiry_date")
@JSONField(name = "expiry_date")
private String expiryDate;
/** 是否子合同 **/
@Schema(description = "是否子合同")
@JsonProperty("is_sub_contract")
@JSONField(name = "is_sub_contract")
private Integer isSubContract;
/** 关联合同 **/
@Schema(description = "关联合同")
@JsonProperty("ref_contract_id")
@JSONField(name = "ref_contract_id")
private String refContractId;
/** 经办人 **/
@Schema(description = "经办人")
@JsonProperty("major_person_id")
@JSONField(name = "major_person_id")
private Object majorPersonId;
/** 打印合同模版 **/
@Schema(description = "打印合同模版")
@JsonProperty("print_temp_id")
@JSONField(name = "print_temp_id")
private Object printTempId;
/** 备注 **/
@Schema(description = "备注")
@JsonProperty("remark")
@JSONField(name = "remark")
private String remark;
/** 我方类型 **/
@Schema(description = "我方类型")
@JsonProperty("our_company_type")
@JSONField(name = "our_company_type")
private Object ourCompanyType;
/** 我方单位 **/
@Schema(description = "我方单位")
@JsonProperty("our_company_id")
@JSONField(name = "our_company_id")
private String ourCompanyId;
/** 我方名称 **/
@Schema(description = "我方名称")
@JsonProperty("our_company_name")
@JSONField(name = "our_company_name")
private String ourCompanyName;
/** 合作方类型 **/
@Schema(description = "合作方类型")
@JsonProperty("second_party_type")
@JSONField(name = "second_party_type")
private Object secondPartyType;
/** 合作单位 **/
@Schema(description = "合作单位")
@JsonProperty("second_party_id")
@JSONField(name = "second_party_id")
private String secondPartyId;
/** 合作方名称 **/
@Schema(description = "合作方名称")
@JsonProperty("second_party_name")
@JSONField(name = "second_party_name")
private String secondPartyName;
/** 第三方类型 **/
@Schema(description = "第三方类型")
@JsonProperty("third_party_type")
@JSONField(name = "third_party_type")
private Object thirdPartyType;
/** 第三方单位 **/
@Schema(description = "第三方单位")
@JsonProperty("third_party_id")
@JSONField(name = "third_party_id")
private String thirdPartyId;
/** 第三方名称 **/
@Schema(description = "第三方名称")
@JsonProperty("third_party_name")
@JSONField(name = "third_party_name")
private String thirdPartyName;
/** 原合同金额 **/
@Schema(description = "原合同金额")
@JsonProperty("contract_money")
@JSONField(name = "contract_money")
private BigDecimal contractMoney;
/** 最终签约金额 **/
@Schema(description = "最终签约金额")
@JsonProperty("final_contract_amount")
@JSONField(name = "final_contract_amount")
private BigDecimal finalContractAmount;
/** 签约金额大写 **/
@Schema(description = "签约金额大写")
@JsonProperty("final_amount_upper")
@JSONField(name = "final_amount_upper")
private BigDecimal finalAmountUpper;
/** 税额 **/
@Schema(description = "税额")
@JsonProperty("tax_amount")
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
/** 不含税金额 **/
@Schema(description = "不含税金额")
@JsonProperty("excluding_tax_amount")
@JSONField(name = "excluding_tax_amount")
private BigDecimal excludingTaxAmount;
/** 合同附件 **/
@Schema(description = "合同附件")
@JsonProperty("contract_files")
@JSONField(name = "contract_files")
private Object contractFiles;
/** 子表数据 **/
@Schema(description = "productSubject子表数据")
@JsonProperty("productSubjectList")
private List<ProductSubjectModel> productSubjectList;
/** 子表数据 **/
@Schema(description = "materialSubject子表数据")
@JsonProperty("materialSubjectList")
private List<MaterialSubjectModel> materialSubjectList;
/** 子表数据 **/
@Schema(description = "worktypeSubject子表数据")
@JsonProperty("worktypeSubjectList")
private List<WorktypeSubjectModel> worktypeSubjectList;
/** 子表数据 **/
@Schema(description = "assetSubject子表数据")
@JsonProperty("assetSubjectList")
private List<AssetSubjectModel> assetSubjectList;
/** 子表数据 **/
@Schema(description = "taskSubject子表数据")
@JsonProperty("taskSubjectList")
private List<TaskSubjectModel> taskSubjectList;
/** 子表数据 **/
@Schema(description = "paymentPlan子表数据")
@JsonProperty("paymentPlanList")
private List<PaymentPlanModel> paymentPlanList;
}

View File

@@ -0,0 +1,68 @@
package com.yunzhupaas.cm.model.contract;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import com.yunzhupaas.base.Pagination;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
@Schema(description = "列表查询参数")
public class ContractPagination extends Pagination {
/** 流程模板id */
@Schema(description = "流程模板id")
private String flowId;
/** 关键词搜索 */
@Schema(description = "关键词搜索")
private String yunzhupaasKeyword;
/** 查询key */
@Schema(description = "查询key")
private String[] selectKey;
/** 选中数据数组id */
@Schema(description = "选中数据数组id")
private Object[] selectIds;
/** json */
@Schema(description = "json")
private String json;
/** 数据类型 0-当前页1-全部数据 */
@Schema(description = "数据类型 0-当前页1-全部数据")
private String dataType;
/** 高级查询 */
@Schema(description = "高级查询")
private String superQueryJson;
/** 功能id */
@Schema(description = "功能id")
private String moduleId;
/** 菜单id */
@Schema(description = "菜单id")
private String menuId;
/** 合同名称 */
@Schema(description = "合同名称")
@JsonProperty("contract_name")
@JSONField(name = "contractName")
private Object contractName;
/** 归属组织 */
@Schema(description = "归属组织")
@JsonProperty("org_id")
@JSONField(name = "orgId")
private Object orgId;
/** 合同分类 */
@Schema(description = "合同分类")
@JsonProperty("contract_category")
@JSONField(name = "contractCategory")
private Object contractCategory;
/** 合同编码 */
@Schema(description = "合同编码")
@JsonProperty("contract_code")
@JSONField(name = "contractCode")
private Object contractCode;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class MaterialSubjectExcelVO{
}

View File

@@ -0,0 +1,84 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Data
@Schema(description = "MaterialSubject子表参数")
public class MaterialSubjectModel {
/** 子表MaterialSubject 主键subject_id **/
@Schema(description = "主键")
@JsonProperty("subject_id")
private String subject_id;
/** 材料名称 **/
@Schema(description = "材料名称")
@JsonProperty("material_id")
@JSONField(name = "material_id")
private String materialId;
private String material_id_id;
/** 品牌 **/
@Schema(description = "品牌")
@JsonProperty("brand")
@JSONField(name = "brand")
private String brand;
/** 数量 **/
@Schema(description = "数量")
@JsonProperty("quantity")
@JSONField(name = "quantity")
private BigDecimal quantity;
/** 单价 **/
@Schema(description = "单价")
@JsonProperty("unit_price")
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
/** 单位 **/
@Schema(description = "单位")
@JsonProperty("quantity_unit")
@JSONField(name = "quantity_unit")
private String quantityUnit;
/** 币种 **/
@Schema(description = "币种")
@JsonProperty("currency")
@JSONField(name = "currency")
private Object currency;
/** 总金额 **/
@Schema(description = "总金额")
@JsonProperty("total_amount")
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
/** 税率 **/
@Schema(description = "税率")
@JsonProperty("tax_rate")
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
/** 税额 **/
@Schema(description = "税额")
@JsonProperty("tax_amount")
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
/** 保修期 **/
@Schema(description = "保修期")
@JsonProperty("warranty_period")
@JSONField(name = "warranty_period")
private BigDecimal warrantyPeriod;
/** 保修条款 **/
@Schema(description = "保修条款")
@JsonProperty("warranty_terms")
@JSONField(name = "warranty_terms")
private String warrantyTerms;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class PaymentPlanExcelVO{
}

View File

@@ -0,0 +1,69 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Data
@Schema(description = "PaymentPlan子表参数")
public class PaymentPlanModel {
/** 子表PaymentPlan 主键payment_plan_id **/
@Schema(description = "主键")
@JsonProperty("payment_plan_id")
private String payment_plan_id;
/** 序号 **/
@Schema(description = "序号")
@JsonProperty("plan_seq_num")
@JSONField(name = "plan_seq_num")
private String planSeqNum;
/** 款项名称 **/
@Schema(description = "款项名称")
@JsonProperty("payment_name")
@JSONField(name = "payment_name")
private String paymentName;
/** 款项类型 **/
@Schema(description = "款项类型")
@JsonProperty("billing_item_id")
@JSONField(name = "billing_item_id")
private String billingItemId;
private String billing_item_id_id;
/** 付款条件 **/
@Schema(description = "付款条件")
@JsonProperty("payment_condition")
@JSONField(name = "payment_condition")
private String paymentCondition;
/** 预计付款日期 **/
@Schema(description = "预计付款日期")
@JsonProperty("plan_date")
@JSONField(name = "plan_date")
private Long planDate;
/** 付款比例 **/
@Schema(description = "付款比例")
@JsonProperty("payment_ratio")
@JSONField(name = "payment_ratio")
private BigDecimal paymentRatio;
/** 付款金额 **/
@Schema(description = "付款金额")
@JsonProperty("payment_amount")
@JSONField(name = "payment_amount")
private BigDecimal paymentAmount;
/** 备注 **/
@Schema(description = "备注")
@JsonProperty("remark")
@JSONField(name = "remark")
private String remark;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class ProductSubjectExcelVO{
}

View File

@@ -0,0 +1,104 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Data
@Schema(description = "ProductSubject子表参数")
public class ProductSubjectModel {
/** 子表ProductSubject 主键subject_id **/
@Schema(description = "主键")
@JsonProperty("subject_id")
private String subject_id;
/** 产品名称 **/
@Schema(description = "产品名称")
@JsonProperty("product_id")
@JSONField(name = "product_id")
private String productId;
private String product_id_id;
/** 品牌 **/
@Schema(description = "品牌")
@JsonProperty("brand")
@JSONField(name = "brand")
private String brand;
/** 规格型号 **/
@Schema(description = "规格型号")
@JsonProperty("product_model")
@JSONField(name = "product_model")
private String productModel;
/** 数量 **/
@Schema(description = "数量")
@JsonProperty("quantity")
@JSONField(name = "quantity")
private BigDecimal quantity;
/** 单价 **/
@Schema(description = "单价")
@JsonProperty("unit_price")
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
/** 单位 **/
@Schema(description = "单位")
@JsonProperty("quantity_unit")
@JSONField(name = "quantity_unit")
private String quantityUnit;
/** 币种 **/
@Schema(description = "币种")
@JsonProperty("currency")
@JSONField(name = "currency")
private Object currency;
/** 总金额 **/
@Schema(description = "总金额")
@JsonProperty("total_amount")
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
/** 折扣类型 **/
@Schema(description = "折扣类型")
@JsonProperty("discount_type")
@JSONField(name = "discount_type")
private Object discountType;
/** 折扣值 **/
@Schema(description = "折扣值")
@JsonProperty("discount_value")
@JSONField(name = "discount_value")
private BigDecimal discountValue;
/** 最终金额 **/
@Schema(description = "最终金额")
@JsonProperty("final_amount")
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
/** 税率 **/
@Schema(description = "税率")
@JsonProperty("tax_rate")
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
/** 税额 **/
@Schema(description = "税额")
@JsonProperty("tax_amount")
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
/** 保修期 **/
@Schema(description = "保修期")
@JsonProperty("warranty_period")
@JSONField(name = "warranty_period")
private BigDecimal warrantyPeriod;
/** 保修条款 **/
@Schema(description = "保修条款")
@JsonProperty("warranty_terms")
@JSONField(name = "warranty_terms")
private String warrantyTerms;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class TaskSubjectExcelVO{
}

View File

@@ -0,0 +1,93 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Data
@Schema(description = "TaskSubject子表参数")
public class TaskSubjectModel {
/** 子表TaskSubject 主键subject_id **/
@Schema(description = "主键")
@JsonProperty("subject_id")
private String subject_id;
/** 任务名称 **/
@Schema(description = "任务名称")
@JsonProperty("task_name")
@JSONField(name = "task_name")
private String taskName;
/** 任务描述 **/
@Schema(description = "任务描述")
@JsonProperty("task_description")
@JSONField(name = "task_description")
private String taskDescription;
/** 数量 **/
@Schema(description = "数量")
@JsonProperty("quantity")
@JSONField(name = "quantity")
private BigDecimal quantity;
/** 单价 **/
@Schema(description = "单价")
@JsonProperty("unit_price")
@JSONField(name = "unit_price")
private BigDecimal unitPrice;
/** 单位 **/
@Schema(description = "单位")
@JsonProperty("quantity_unit")
@JSONField(name = "quantity_unit")
private String quantityUnit;
/** 币种 **/
@Schema(description = "币种")
@JsonProperty("currency")
@JSONField(name = "currency")
private Object currency;
/** 总金额 **/
@Schema(description = "总金额")
@JsonProperty("total_amount")
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
/** 折扣类型 **/
@Schema(description = "折扣类型")
@JsonProperty("discount_type")
@JSONField(name = "discount_type")
private Object discountType;
/** 折扣值 **/
@Schema(description = "折扣值")
@JsonProperty("discount_value")
@JSONField(name = "discount_value")
private BigDecimal discountValue;
/** 最终金额 **/
@Schema(description = "最终金额")
@JsonProperty("final_amount")
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
/** 税率 **/
@Schema(description = "税率")
@JsonProperty("tax_rate")
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
/** 税额 **/
@Schema(description = "税额")
@JsonProperty("tax_amount")
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
/** 备注 **/
@Schema(description = "备注")
@JsonProperty("remark")
@JSONField(name = "remark")
private String remark;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-20
*/
@Data
public class WorktypeSubjectExcelVO{
}

View File

@@ -0,0 +1,89 @@
package com.yunzhupaas.cm.model.contract;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
*
* 合同管理
* 版本: V5.2.7
* 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* 作者: 深圳市乐程软件有限公司
* 日期: 2026-05-20
*/
@Data
@Schema(description = "WorktypeSubject子表参数")
public class WorktypeSubjectModel {
/** 子表WorktypeSubject 主键subject_id **/
@Schema(description = "主键")
@JsonProperty("subject_id")
private String subject_id;
/** 工种 **/
@Schema(description = "工种")
@JsonProperty("work_type_id")
@JSONField(name = "work_type_id")
private String workTypeId;
private String work_type_id_id;
/** 数量 **/
@Schema(description = "数量")
@JsonProperty("quantity")
@JSONField(name = "quantity")
private BigDecimal quantity;
/** 销售单价 **/
@Schema(description = "销售单价")
@JsonProperty("unit_price")
@JSONField(name = "unit_price")
private String unitPrice;
/** 数量单位 **/
@Schema(description = "数量单位")
@JsonProperty("quantity_unit")
@JSONField(name = "quantity_unit")
private BigDecimal quantityUnit;
/** 币种 **/
@Schema(description = "币种")
@JsonProperty("currency")
@JSONField(name = "currency")
private Object currency;
/** 总金额 **/
@Schema(description = "总金额")
@JsonProperty("total_amount")
@JSONField(name = "total_amount")
private BigDecimal totalAmount;
/** 折扣类型 **/
@Schema(description = "折扣类型")
@JsonProperty("discount_type")
@JSONField(name = "discount_type")
private Object discountType;
/** 折扣值 **/
@Schema(description = "折扣值")
@JsonProperty("discount_value")
@JSONField(name = "discount_value")
private BigDecimal discountValue;
/** 最终金额 **/
@Schema(description = "最终金额")
@JsonProperty("final_amount")
@JSONField(name = "final_amount")
private BigDecimal finalAmount;
/** 税率 **/
@Schema(description = "税率")
@JsonProperty("tax_rate")
@JSONField(name = "tax_rate")
private BigDecimal taxRate;
/** 税额 **/
@Schema(description = "税额")
@JsonProperty("tax_amount")
@JSONField(name = "tax_amount")
private BigDecimal taxAmount;
/** 工种描述 **/
@Schema(description = "工种描述")
@JsonProperty("work_description")
@JSONField(name = "work_description")
private String workDescription;
}

View File

@@ -0,0 +1,25 @@
package com.yunzhupaas.cm.model.contracttemp;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* 合同模版管理
* @版本: V5.2.7
* @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有
* @作者: 深圳市乐程软件有限公司
* @日期: 2026-05-21
*/
@Data
public class ContractPrintingTempExcelVO{
}

Some files were not shown because too many files have changed in this diff Show More