Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
王晓迪 2 weeks ago
parent
commit
0b3731bc01
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExchangeRateMapper.java
  2. 20
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExchangeRateServiceImpl.java
  3. 8
      ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml
  4. 6
      ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml
  5. 4
      ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformMapper.xml
  6. 2
      ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html
  7. 6
      ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html

12
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExchangeRateMapper.java

@ -43,6 +43,15 @@ public interface BaseExchangeRateMapper
*/
public List<BaseExchangeRate> selectExchangeRateByTimeRange(BaseExchangeRate baseExchangeRate);
/**
* 查询时间交叉,并且排除当前id
*
* @param baseExchangeRate 基础资料汇率管理
* @return 基础资料汇率管理集合
*/
List<BaseExchangeRate> selectExchangeRateByTimeRangeAndExcludeId(BaseExchangeRate baseExchangeRate);
/**
* 新增基础资料汇率管理
*
@ -90,4 +99,7 @@ public interface BaseExchangeRateMapper
* @return 结果
*/
public int restoreBaseExchangeRateById(Long exchangeRateId);
}

20
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExchangeRateServiceImpl.java

@ -113,19 +113,29 @@ public class BaseExchangeRateServiceImpl implements IBaseExchangeRateService
String loginName = ShiroUtils.getLoginName();
baseExchangeRate.setUpdateBy(loginName);
baseExchangeRate.setUpdateTime(DateUtils.getNowDate());
Long exchangeRateId = baseExchangeRate.getExchangeRateId();
BaseExchangeRate oldExchangeRate = baseExchangeRateMapper.selectBaseExchangeRateById(exchangeRateId);
// 检查时间字段是否发生变化
boolean timeFieldsChanged = !baseExchangeRate.getStartTime().equals(oldExchangeRate.getStartTime()) ||
!baseExchangeRate.getEndTime().equals(oldExchangeRate.getEndTime());
if (timeFieldsChanged) {
Date startTime = baseExchangeRate.getStartTime();
Date endTime = baseExchangeRate.getEndTime();
if (startTime.after(endTime)) {
throw new BusinessException("新增汇率失败!开始时间不能大于结束时间!");
throw new BusinessException("修改汇率失败!开始时间不能大于结束时间!");
}
List<BaseExchangeRate> exchangeRates = baseExchangeRateMapper.selectExchangeRateByTimeRange(baseExchangeRate);
List<BaseExchangeRate> exchangeRates = baseExchangeRateMapper.selectExchangeRateByTimeRangeAndExcludeId(baseExchangeRate);
// List<BaseExchangeRate> exchangeRates = baseExchangeRateMapper.selectExchangeRateByTimeRange(baseExchangeRate);
if (!CollectionUtils.isEmpty(exchangeRates)) {
throw new BusinessException("新增汇率失败!该时间段内已存在汇率数据!");
throw new BusinessException("修改汇率失败!该时间段内已存在汇率数据!");
}
Long exchangeRateId = baseExchangeRate.getExchangeRateId();
BaseExchangeRate oldExchangeRate = baseExchangeRateMapper.selectBaseExchangeRateById(exchangeRateId);
}
List<SysFieldDifferent> compare = FieldCompareUtil.compare(BaseExchangeRate.class, baseExchangeRate, oldExchangeRate);
if (!CollectionUtils.isEmpty(compare)) {
int updateSysDiffLog = diffLogService.updateSysDiffLogByBusiness(exchangeRateId, BusinessKeysConstants.SYS_EXCHANGE_RATE, compare);

8
ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml

@ -47,13 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSalesShippingInformationList" parameterType="SalesShippingInformation" resultMap="SalesShippingInformationResult">
<include refid="selectSalesShippingInformationVo"/>
<where>
<if test="shippingInformationCode != null and shippingInformationCode != ''"> and shipping_information_code = #{shippingInformationCode}</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code = #{salesOrderCode}</if>
<if test="outOrderCode != null and outOrderCode != ''"> and out_order_code = #{outOrderCode}</if>
<if test="shippingInformationCode != null and shippingInformationCode != ''"> and shipping_information_code like concat('%', #{shippingInformationCode}, '%') </if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code like concat('%', #{salesOrderCode}, '%')</if>
<if test="outOrderCode != null and outOrderCode != ''"> and out_order_code like concat('%', #{outOrderCode}, '%')</if>
<if test="shippingInformationType != null and shippingInformationType != ''"> and shipping_information_type = #{shippingInformationType}</if>
<if test="warehouseOrderType != null and warehouseOrderType != ''"> and warehouse_order_type = #{warehouseOrderType}</if>
<if test="warehouseOutType != null and warehouseOutType != ''"> and warehouse_out_type = #{warehouseOutType}</if>
<if test="businessMembers != null and businessMembers != ''"> and business_members = #{businessMembers}</if>
<if test="businessMembers != null and businessMembers != ''"> and business_members like concat('%', #{businessMembers}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>

6
ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml

@ -45,6 +45,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE start_time &lt;= #{endTime} AND end_time &gt;= #{startTime}
</select>
<select id="selectExchangeRateByTimeRangeAndExcludeId" parameterType="BaseExchangeRate" resultMap="BaseExchangeRateResult">
<include refid="selectBaseExchangeRateVo"/>
WHERE start_time &lt;= #{endTime} AND end_time &gt;= #{startTime}
AND exchange_rate_id != #{exchangeRateId}
</select>
<insert id="insertBaseExchangeRate" parameterType="BaseExchangeRate" useGeneratedKeys="true" keyProperty="exchangeRateId">
insert into base_exchange_rate
<trim prefix="(" suffix=")" suffixOverrides=",">

4
ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformMapper.xml

@ -45,9 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysSalesShippingInformList" parameterType="SysSalesShippingInform" resultMap="SysSalesShippingInformResult">
<include refid="selectSysSalesShippingInformVo"/>
<where>
<if test="outOrderCode != null and outOrderCode != ''"> and out_order_code = #{outOrderCode}</if>
<if test="outOrderCode != null and outOrderCode != ''"> and out_order_code like concat('%',#{outOrderCode},'%')</if>
<if test="warehouseOutStatus != null and warehouseOutStatus != ''"> and warehouse_out_status = #{warehouseOutStatus}</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code = #{salesOrderCode}</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code like concat('%',#{salesOrderCode},'%')</if>
<if test="warehouseOrderType != null and warehouseOrderType != ''"> and warehouse_order_type = #{warehouseOrderType}</if>
<if test="businessMembers != null and businessMembers != ''"> and business_members = #{businessMembers}</if>
</where>

2
ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html

@ -63,7 +63,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="sales:salesShippingInformation:export">
<a class="btn btn-success" onclick="exportExcel()" shiro:hasPermission="sales:salesShippingInformation:export">
<i class="fa fa-download"></i> 导出
</a>
</div>

6
ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html

@ -11,11 +11,13 @@
<div class="select-list">
<ul>
<li>
<label>开始时间:</label>
<label>汇率时间区间:</label>
<input type="text" class="time-input" placeholder="请选择开始时间" name="startTime"/>
</li>
<li>
<label>结束时间:</label>
<span>-</span>
</li>
<li>
<input type="text" class="time-input" placeholder="请选择结束时间" name="endTime"/>
</li>
<li>

Loading…
Cancel
Save