feat(sip): 新增订单管理功能
- 添加订单信息相关实体类和映射文件 - 实现订单信息的增删改查功能 - 优化项目信息和订单信息的关联 - 新增订单编号生成逻辑master
parent
b9eef1f522
commit
1aad3630db
|
@ -40,7 +40,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 订单管理Controller
|
||||
* 订单管理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-30
|
||||
|
|
|
@ -70,6 +70,7 @@ public class Cnarea {
|
|||
*/
|
||||
|
||||
private Double lat;
|
||||
private String shortCode;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -48,8 +48,11 @@ public class ProjectInfo extends BaseEntity
|
|||
private String industryType;
|
||||
|
||||
/** 属地 */
|
||||
@Excel(name = "属地")
|
||||
private String province;
|
||||
// @Excel(name = "属地")
|
||||
// private String province;
|
||||
/** 代表处 */
|
||||
private String agentCode;
|
||||
private String agentName;
|
||||
/** 项目把握度 */
|
||||
@Excel(name = "项目把握度")
|
||||
private String projectGraspDegree;
|
||||
|
|
|
@ -35,6 +35,7 @@ public class ProjectOrderInfo extends BaseEntity {
|
|||
private String projectName;
|
||||
private String customerName;
|
||||
private String industryType;
|
||||
|
||||
private String province;
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,4 +60,6 @@ public interface ProjectOrderInfoMapper
|
|||
public int deleteProjectOrderInfoByIds(String[] ids);
|
||||
|
||||
List<ProjectOrderInfo> selectProjectOrderInfoByProjectId(List<Long> projectId);
|
||||
|
||||
int selectMaxOrderCode(String province);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.CacheUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.domain.Cnarea;
|
||||
import com.ruoyi.sip.mapper.CnareaMapper;
|
||||
import com.ruoyi.sip.service.ICnareaService;
|
||||
|
@ -31,11 +32,13 @@ public class CnareaServiceImpl implements ICnareaService {
|
|||
*/
|
||||
@Override
|
||||
public List<Cnarea> queryAll(Cnarea cnarea) {
|
||||
if (CacheUtils.get(cnarea.getParentCode()) != null) {
|
||||
if (StringUtils.isNotEmpty(cnarea.getParentCode()) && CacheUtils.get(cnarea.getParentCode()) != null) {
|
||||
return (List<Cnarea>) CacheUtils.get(cnarea.getParentCode());
|
||||
}
|
||||
List<Cnarea> dataList = cnareaMapper.queryAll(cnarea);
|
||||
CacheUtils.put(cnarea.getParentCode(), dataList);
|
||||
if (StringUtils.isNotEmpty(cnarea.getParentCode())) {
|
||||
CacheUtils.put(cnarea.getParentCode(), dataList);
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
@Autowired
|
||||
private IProjectOperateLogService operateLogService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IProjectOrderInfoService orderInfoService;
|
||||
private static final String PROJECT_CODE_PREFIX = "V";
|
||||
|
@ -167,11 +168,11 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
// 获取更新前的项目信息
|
||||
ProjectInfo oldProjectInfo = this.selectProjectInfoById(projectInfo.getId());
|
||||
//变更属地校验
|
||||
if (!projectInfo.getProvince().equals(oldProjectInfo.getProvince())) {
|
||||
if (!projectInfo.getAgentCode().equals(oldProjectInfo.getAgentCode())) {
|
||||
//查询订单信息 如果有抛出异常
|
||||
List<ProjectOrderInfo> projectOrderInfos = orderInfoService.selectProjectOrderInfoByProjectId(Collections.singletonList(projectInfo.getId()));
|
||||
if (CollUtil.isNotEmpty(projectOrderInfos)) {
|
||||
throw new ServiceException("该项目存在订单流转,无法更改属地");
|
||||
throw new ServiceException("该项目存在订单流转,无法更改代表处");
|
||||
}
|
||||
//如果没有 变更编码 是否考虑高并发加锁
|
||||
setProjectCode(projectInfo);
|
||||
|
@ -205,7 +206,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
|
||||
logIndex = compareField(logContent, logIndex, "行业", DictUtils.getDictLabel(INDUSTRY_TYPE_DICT_TYPE, oldProjectInfo.getIndustryType())
|
||||
, DictUtils.getDictLabel(INDUSTRY_TYPE_DICT_TYPE, projectInfo.getIndustryType()));
|
||||
logIndex = compareField(logContent, logIndex, "属地", oldProjectInfo.getProvince(), projectInfo.getProvince());
|
||||
logIndex = compareField(logContent, logIndex, "代表处", oldProjectInfo.getAgentName(), projectInfo.getAgentName());
|
||||
logIndex = compareField(logContent, logIndex, "项目阶段", DictUtils.getDictLabel(PROJECT_STAGE_DICT_TYPE, oldProjectInfo.getProjectStage())
|
||||
, DictUtils.getDictLabel(PROJECT_STAGE_DICT_TYPE, projectInfo.getProjectStage()));
|
||||
logIndex = compareField(logContent, logIndex, "项目把握度", oldProjectInfo.getProjectGraspDegree(), projectInfo.getProjectGraspDegree());
|
||||
|
@ -298,24 +299,15 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
index++;
|
||||
} else if (oldProduct != null) {
|
||||
// 变更产品
|
||||
|
||||
if (!oldProduct.getProductCode().equals(newProduct.getProductCode())) {
|
||||
logContent.append(index).append(".").append(type).append("变更:").append(oldProduct.getProductCode()).append(" -> ").append(newProduct.getProductCode()).append("\n");
|
||||
index++;
|
||||
}
|
||||
if (!Objects.equals(oldProduct.getModel(), newProduct.getModel())) {
|
||||
logContent.append(index).append(".").append("型号").append("由‘").append(oldProduct.getModel()).append("’变更为‘").append(newProduct.getModel()).append("’\n");
|
||||
index++;
|
||||
}
|
||||
if (!Objects.equals(oldProduct.getQuantity(), newProduct.getQuantity())) {
|
||||
logContent.append(index).append(".").append("数量").append("由‘").append(oldProduct.getQuantity()).append("’变更为‘").append(newProduct.getQuantity()).append("’\n");
|
||||
index++;
|
||||
}
|
||||
if (!Objects.equals(oldProduct.getRemark(), newProduct.getRemark())) {
|
||||
logContent.append(index).append(".").append("备注").append("由‘").append(oldProduct.getRemark()).append("’变更为‘").append(newProduct.getRemark()).append("’\n");
|
||||
index++;
|
||||
}
|
||||
|
||||
index = compareField(logContent, index, "产品编号", oldProduct.getProductCode(), newProduct.getProductCode());
|
||||
index = compareField(logContent, index, "数量", oldProduct.getQuantity(), newProduct.getQuantity());
|
||||
index = compareField(logContent, index, "目录单价", oldProduct.getCataloguePrice(), newProduct.getCataloguePrice());
|
||||
index = compareField(logContent, index, "指导折扣", oldProduct.getGuidanceDiscount(), newProduct.getGuidanceDiscount());
|
||||
index = compareField(logContent, index, "指导折扣", oldProduct.getDiscount(), newProduct.getDiscount());
|
||||
index = compareField(logContent, index, "单价", oldProduct.getPrice(), newProduct.getPrice());
|
||||
index = compareField(logContent, index, "总价", oldProduct.getAllPrice(), newProduct.getAllPrice());
|
||||
index = compareField(logContent, index, "目录总价", oldProduct.getCatalogueAllPrice(), newProduct.getCatalogueAllPrice());
|
||||
index = compareField(logContent, index, "备注", oldProduct.getRemark(), newProduct.getRemark());
|
||||
}
|
||||
}
|
||||
return index;
|
||||
|
|
|
@ -6,9 +6,12 @@ import java.util.Map;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.sip.domain.Cnarea;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.service.ICnareaService;
|
||||
import com.ruoyi.sip.service.IProjectOrderFileLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -30,6 +33,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService {
|
|||
|
||||
@Autowired
|
||||
private IProjectOrderFileLogService fileLogService;
|
||||
@Autowired
|
||||
private ICnareaService cnareaService;
|
||||
/**
|
||||
* 查询订单管理
|
||||
*
|
||||
|
@ -66,12 +71,42 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService {
|
|||
*/
|
||||
@Override
|
||||
public int insertProjectOrderInfo(ProjectOrderInfo projectOrderInfo) {
|
||||
// 生成订单编号
|
||||
String orderNumber = generateOrderNumber(projectOrderInfo.getProvince());
|
||||
projectOrderInfo.setOrderCode(orderNumber);
|
||||
projectOrderInfo.setCreateTime(DateUtils.getNowDate());
|
||||
projectOrderInfo.setCreateBy(ShiroUtils.getUserId().toString());
|
||||
//todo 生成订单编号
|
||||
return projectOrderInfoMapper.insertProjectOrderInfo(projectOrderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成订单编号
|
||||
*
|
||||
* @param province 省份代码
|
||||
* @return 订单编号
|
||||
*/
|
||||
private String generateOrderNumber(String province) {
|
||||
// 获取当前时间,格式为yyyyMMdd
|
||||
String currentDate = DateUtils.dateTimeNow("yyyyMMdd");
|
||||
Cnarea cnarea = new Cnarea();
|
||||
cnarea.setName(province);
|
||||
cnarea.setLevel("1");
|
||||
List<Cnarea> cnareas = cnareaService.queryAll(cnarea);
|
||||
if (CollUtil.isEmpty(cnareas)) {
|
||||
throw new ServiceException("省市未配置,生成订单编号出错,请联系管理员");
|
||||
}
|
||||
String shortCode = cnareas.get(0).getShortCode();
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append("ZGXS-").append(currentDate).append(shortCode);
|
||||
// 查询当天已有的订单数量,用于生成顺序编码
|
||||
int count = projectOrderInfoMapper.selectMaxOrderCode(result.toString());
|
||||
// 生成顺序编码,不足三位补零
|
||||
String sequence = String.format("%03d", count + 1);
|
||||
result.append(sequence).append("-VDI");
|
||||
// 拼接订单编号
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单管理
|
||||
*
|
||||
|
@ -80,6 +115,12 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService {
|
|||
*/
|
||||
@Override
|
||||
public int updateProjectOrderInfo(ProjectOrderInfo projectOrderInfo) {
|
||||
ProjectOrderInfo existProjectOrderInfo = projectOrderInfoMapper.selectProjectOrderInfoById(projectOrderInfo.getId());
|
||||
if (!existProjectOrderInfo.getProvince().equals(projectOrderInfo.getProvince())) {
|
||||
String orderNumber = generateOrderNumber(projectOrderInfo.getProvince());
|
||||
projectOrderInfo.setOrderCode(orderNumber);
|
||||
}
|
||||
projectOrderInfo.setUpdateBy(ShiroUtils.getUserId().toString());
|
||||
projectOrderInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return projectOrderInfoMapper.updateProjectOrderInfo(projectOrderInfo);
|
||||
}
|
||||
|
|
|
@ -35,56 +35,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectProjectInfoVo">
|
||||
select id, project_code, project_name,bg_property, customer_code, customer_name, industry_type, province, project_stage, project_grasp_degree, hz_support_user, operate_institution
|
||||
select id, project_code, project_name,bg_property, customer_code, customer_name, industry_type, agent_code, project_stage, project_grasp_degree, hz_support_user, operate_institution
|
||||
, partner_code, partner_name, contact_way, estimated_amount, currency_type, estimated_order_time, estimated_deliver_time, competitor, country_product, server_configuration
|
||||
, key_problem, project_desc, create_by, create_time, update_by, update_time from project_info
|
||||
, key_problem, project_desc, create_by, create_time, update_by, update_time from project_info t1
|
||||
</sql>
|
||||
<sql id="selectRelationProjectInfoVo">
|
||||
select t1.id,
|
||||
t1.project_code,
|
||||
t1.project_name,
|
||||
t1.bg_property,
|
||||
t1.customer_code,
|
||||
t1.customer_name,
|
||||
t1.industry_type,
|
||||
t1.agent_code,
|
||||
t1.project_stage,
|
||||
t1.project_grasp_degree,
|
||||
t1.hz_support_user,
|
||||
t1.operate_institution,
|
||||
t1.partner_code,
|
||||
t1.partner_name,
|
||||
t1.contact_way,
|
||||
t1.estimated_amount,
|
||||
t1.currency_type,
|
||||
t1.estimated_order_time,
|
||||
t1.estimated_deliver_time,
|
||||
t1.competitor,
|
||||
t1.country_product,
|
||||
t1.server_configuration,
|
||||
t1.key_problem,
|
||||
t1.project_desc,
|
||||
t1.create_by,
|
||||
t1.create_time,
|
||||
t1.update_by,
|
||||
t1.update_time,
|
||||
t2.agent_name
|
||||
from project_info t1
|
||||
left join agent_info t2 on t1.agent_code = t2.agent_code
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectInfoList" parameterType="ProjectInfo" resultMap="ProjectInfoResult">
|
||||
<include refid="selectProjectInfoVo"/>
|
||||
<where>
|
||||
<if test="projectCode != null and projectCode != ''"> and project_code = #{projectCode}</if>
|
||||
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="customerCode != null and customerCode != ''"> and customer_code = #{customerCode}</if>
|
||||
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
||||
<if test="industryType != null and industryType != ''"> and industry_type = #{industryType}</if>
|
||||
<if test="bgProperty != null and bgProperty != ''"> and bg_property = #{bgProperty}</if>
|
||||
<if test="province != null and province != ''"> and province = #{province}</if>
|
||||
<if test="projectStage != null and projectStage != ''"> and project_stage = #{projectStage}</if>
|
||||
<if test="projectGraspDegree != null and projectGraspDegree != ''"> and project_grasp_degree = #{projectGraspDegree}</if>
|
||||
<if test="hzSupportUser != null and hzSupportUser != ''"> and hz_support_user = #{hzSupportUser}</if>
|
||||
<if test="operateInstitution != null and operateInstitution != ''"> and operate_institution = #{operateInstitution}</if>
|
||||
<if test="partnerCode != null and partnerCode != ''"> and partner_code = #{partnerCode}</if>
|
||||
<if test="partnerName != null and partnerName != ''"> and partner_name = #{partnerName}</if>
|
||||
<if test="contactWay != null and contactWay != ''"> and contact_way = #{contactWay}</if>
|
||||
<if test="estimatedAmount != null "> and estimated_amount = #{estimatedAmount}</if>
|
||||
<if test="currencyType != null and currencyType != ''"> and currency_type = #{currencyType}</if>
|
||||
<if test="estimatedOrderTime != null "> and estimated_order_time = #{estimatedOrderTime}</if>
|
||||
<if test="projectCode != null and projectCode != ''"> and t1.project_code = #{projectCode}</if>
|
||||
<if test="projectName != null and projectName != ''"> and t1.project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="customerCode != null and customerCode != ''"> and t1.customer_code = #{customerCode}</if>
|
||||
<if test="agentCode != null and agentCode != ''"> and t1.agent_code = #{agentCode}</if>
|
||||
<if test="customerName != null and customerName != ''"> and t1.customer_name like concat('%', #{customerName}, '%')</if>
|
||||
<if test="industryType != null and industryType != ''"> and t1.industry_type = #{industryType}</if>
|
||||
<if test="bgProperty != null and bgProperty != ''"> and t1.bg_property = #{bgProperty}</if>
|
||||
<if test="province != null and province != ''"> and t1.province = #{province}</if>
|
||||
<if test="projectStage != null and projectStage != ''"> and t1.project_stage = #{projectStage}</if>
|
||||
<if test="projectGraspDegree != null and projectGraspDegree != ''"> and t1.project_grasp_degree = #{projectGraspDegree}</if>
|
||||
<if test="hzSupportUser != null and hzSupportUser != ''"> and t1.hz_support_user = #{hzSupportUser}</if>
|
||||
<if test="operateInstitution != null and operateInstitution != ''"> and t1.operate_institution = #{operateInstitution}</if>
|
||||
<if test="partnerCode != null and partnerCode != ''"> and t1.partner_code = #{partnerCode}</if>
|
||||
<if test="partnerName != null and partnerName != ''"> and t1.partner_name = #{partnerName}</if>
|
||||
<if test="contactWay != null and contactWay != ''"> and t1.contact_way = #{contactWay}</if>
|
||||
<if test="estimatedAmount != null "> and t1.estimated_amount = #{estimatedAmount}</if>
|
||||
<if test="currencyType != null and currencyType != ''"> and t1.currency_type = #{currencyType}</if>
|
||||
<if test="estimatedOrderTime != null "> and t1.estimated_order_time = #{estimatedOrderTime}</if>
|
||||
<if test="estimatedOrderTimeStart != null or estimatedOrderTimeEnd != null">
|
||||
<choose>
|
||||
<when test="estimatedOrderTimeStart != null and estimatedOrderTimeEnd != null">
|
||||
and estimated_order_time between date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
and t1.estimated_order_time between date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
<when test="estimatedOrderTimeStart != null">
|
||||
and estimated_order_time <![CDATA[ >= ]]> date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
and t1.estimated_order_time <![CDATA[ >= ]]> date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
</when>
|
||||
<when test="estimatedOrderTimeEnd != null">
|
||||
and estimated_order_time <![CDATA[ <= ]]> date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
and t1.estimated_order_time <![CDATA[ <= ]]> date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
|
||||
</choose>
|
||||
</if>
|
||||
<if test="estimatedDeliverTime != null "> and estimated_deliver_time = #{estimatedDeliverTime}</if>
|
||||
<if test="estimatedDeliverTime != null "> and t1.estimated_deliver_time = #{estimatedDeliverTime}</if>
|
||||
<if test="estimatedDeliverTimeStart != null or estimatedDeliverTimeEnd != null">
|
||||
<choose>
|
||||
<when test="estimatedDeliverTimeStart != null and estimatedDeliverTimeEnd != null">
|
||||
and estimated_deliver_time between date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
and t1.estimated_deliver_time between date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
<when test="estimatedDeliverTimeStart != null">
|
||||
and estimated_deliver_time <![CDATA[ >= ]]> date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
and t1.estimated_deliver_time <![CDATA[ >= ]]> date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
</when>
|
||||
<when test="estimatedDeliverTimeEnd != null">
|
||||
and estimated_deliver_time <![CDATA[ <= ]]> date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
and t1.estimated_deliver_time <![CDATA[ <= ]]> date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
|
||||
</choose>
|
||||
|
@ -93,33 +127,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTimeStart != null or updateTimeEnd != null">
|
||||
<choose>
|
||||
<when test="updateTimeStart != null and updateTimeEnd != null">
|
||||
and update_time between date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
and t1.update_time between date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
<when test="updateTimeStart != null">
|
||||
and update_time <![CDATA[ >= ]]> date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
and t1.update_time <![CDATA[ >= ]]> date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
</when>
|
||||
<when test="updateTimeEnd != null">
|
||||
and update_time <![CDATA[ <= ]]> date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
and t1.update_time <![CDATA[ <= ]]> date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
|
||||
</choose>
|
||||
|
||||
</if>
|
||||
<if test="competitor != null and competitor != ''"> and competitor = #{competitor}</if>
|
||||
<if test="countryProduct != null and countryProduct != ''"> and country_product = #{countryProduct}</if>
|
||||
<if test="serverConfiguration != null and serverConfiguration != ''"> and server_configuration = #{serverConfiguration}</if>
|
||||
<if test="keyProblem != null and keyProblem != ''"> and key_problem = #{keyProblem}</if>
|
||||
<if test="projectDesc != null and projectDesc != ''"> and project_desc = #{projectDesc}</if>
|
||||
<if test="competitor != null and competitor != ''"> and t1.competitor = #{competitor}</if>
|
||||
<if test="countryProduct != null and countryProduct != ''"> and t1.country_product = #{countryProduct}</if>
|
||||
<if test="serverConfiguration != null and serverConfiguration != ''"> and t1.server_configuration = #{serverConfiguration}</if>
|
||||
<if test="keyProblem != null and keyProblem != ''"> and t1.key_problem = #{keyProblem}</if>
|
||||
<if test="projectDesc != null and projectDesc != ''"> and t1.project_desc = #{projectDesc}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectInfoById" parameterType="Long" resultMap="ProjectInfoResult">
|
||||
<include refid="selectProjectInfoVo"/>
|
||||
where id = #{id}
|
||||
<include refid="selectRelationProjectInfoVo"/>
|
||||
where t1.id = #{id}
|
||||
</select>
|
||||
<select id="selectMaxProjectCode" resultType="java.lang.String">
|
||||
select project_code from project_info
|
||||
where province=#{province}
|
||||
where agent_code=#{agentCode}
|
||||
order by project_code desc limit 1
|
||||
</select>
|
||||
<select id="selectUserById" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||
|
@ -138,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="customerName != null">customer_name,</if>
|
||||
<if test="industryType != null">industry_type,</if>
|
||||
<if test="bgProperty != null">bg_property,</if>
|
||||
<if test="province != null">province,</if>
|
||||
<if test="agentCode != null">agent_code,</if>
|
||||
<if test="projectStage != null">project_stage,</if>
|
||||
<if test="projectGraspDegree != null">project_grasp_degree,</if>
|
||||
<if test="hzSupportUser != null">hz_support_user,</if>
|
||||
|
@ -167,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="customerName != null">#{customerName},</if>
|
||||
<if test="industryType != null">#{industryType},</if>
|
||||
<if test="bgProperty != null">#{bgProperty},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
<if test="agentCode != null">#{agentCode},</if>
|
||||
<if test="projectStage != null">#{projectStage},</if>
|
||||
<if test="projectGraspDegree != null">#{projectGraspDegree},</if>
|
||||
<if test="hzSupportUser != null">#{hzSupportUser},</if>
|
||||
|
@ -200,7 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="customerName != null">customer_name = #{customerName},</if>
|
||||
<if test="bgProperty != null">bg_property=#{bgProperty},</if>
|
||||
<if test="industryType != null">industry_type = #{industryType},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="agentCode != null">agent_code = #{agentCode},</if>
|
||||
<if test="projectStage != null">project_stage = #{projectStage},</if>
|
||||
<if test="projectGraspDegree != null">project_grasp_degree = #{projectGraspDegree},</if>
|
||||
<if test="hzSupportUser != null">hz_support_user = #{hzSupportUser},</if>
|
||||
|
|
|
@ -36,13 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectProjectOrderInfoVo">
|
||||
select id, project_id, city, business_person, business_email, business_phone, order_code, currencyType,
|
||||
select id, project_id,province, city, business_person, business_email, business_phone, order_code, currencyType,
|
||||
shipment_amount, actual_purchase_amount, order_end_time, delivery_time, company_delivery, notifier,
|
||||
notifier_email, notifier_phone, duty, duty_email, duty_phone, order_channel, partner_code, supplier,
|
||||
remark, order_status, create_by, create_time, update_by, update_time from project_order_info t1
|
||||
</sql>
|
||||
<sql id="selectProjectOrderInfoRelationVo">
|
||||
select t1.id, t1.project_id, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
|
||||
select t1.id, t1.project_id,t1.province, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
|
||||
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,
|
||||
t1.notifier_email, t1.notifier_phone, t1.duty, t1.duty_email, t1.duty_phone, t1.order_channel, t1.partner_code, t1.supplier,
|
||||
t1.remark, t1.order_status, t1.create_by, t1.create_time, t1.update_by, t1.update_time
|
||||
|
@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectProjectOrderInfoRelationVo"/>
|
||||
<where>
|
||||
<if test="projectId != null "> and t1.project_id = #{projectId}</if>
|
||||
<if test="province != null and province != ''"> and t1.province = #{province}</if>
|
||||
<if test="city != null and city != ''"> and t1.city = #{city}</if>
|
||||
<if test="businessPerson != null and businessPerson != ''"> and t1.business_person = #{businessPerson}</if>
|
||||
<if test="businessEmail != null and businessEmail != ''"> and t1.business_email = #{businessEmail}</if>
|
||||
|
@ -92,12 +93,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
<select id="selectMaxOrderCode" resultType="java.lang.Integer">
|
||||
select ifnull( max(SUBSTR( order_code FROM 16 FOR 3 )), 0 )
|
||||
from project_order_info
|
||||
where order_code like concat(#{province}, '%')
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertProjectOrderInfo" parameterType="ProjectOrderInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into project_order_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="province != null">province,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="businessPerson != null">business_person,</if>
|
||||
<if test="businessEmail != null">business_email,</if>
|
||||
|
@ -127,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="businessPerson != null">#{businessPerson},</if>
|
||||
<if test="businessEmail != null">#{businessEmail},</if>
|
||||
|
@ -160,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update project_order_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="businessPerson != null">business_person = #{businessPerson},</if>
|
||||
<if test="businessEmail != null">business_email = #{businessEmail},</if>
|
||||
|
|
|
@ -15,11 +15,12 @@
|
|||
<result property="pinyin" column="pinyin"/>
|
||||
<result property="lng" column="lng"/>
|
||||
<result property="lat" column="lat"/>
|
||||
<result property="shortCode" column="short_code"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基本字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, level, parent_code, area_code, zip_code, city_code, name, short_name, merger_name, pinyin, lng, lat
|
||||
id, level, parent_code, area_code, zip_code, city_code, name, short_name, merger_name, pinyin, lng, lat,short_code
|
||||
</sql>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
|
|
Loading…
Reference in New Issue