Commit a41fb46f authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_bugfix@dl' into develop_bugfix@dl

parents 40d40a63 ba25aa32
......@@ -35,8 +35,6 @@ public class PluginInterceptor implements Interceptor {
* @throws Throwable
*/
public Object intercept(Invocation invocation) throws Throwable {
System.out.println("====intercept======");
Object[] args = invocation.getArgs();
MappedStatement mappedStatement = (MappedStatement) args[0];
Object parameter = args[1];
......@@ -101,7 +99,6 @@ public class PluginInterceptor implements Interceptor {
}
public Object plugin(Object target) {
System.out.println("-----------------------------plugin-------------------------");
return Plugin.wrap(target, this);
}
......
......@@ -2583,6 +2583,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}
List<Object> values = new ArrayList<>();
BigDecimal lastNum = BigDecimal.ZERO;
for (int i = 0; i < allTimeList.size(); i++) {
List<BigDecimal> orDefault = stringIntegerHashMap.getOrDefault(allTimeList.get(i), new ArrayList<>());
// 计算非空值的总和
......@@ -2597,12 +2598,13 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
BigDecimal divide;
if (count == 0) {
// 如果非空值数量为0,可以选择返回0或其他默认值
divide = BigDecimal.ZERO;
divide = lastNum;
} else {
// 否则,进行除法运算
divide = sum.divide(new BigDecimal(count), 2, RoundingMode.HALF_UP);
}
values.add(divide);
lastNum = divide.compareTo(BigDecimal.ZERO) == 0 ? lastNum : divide;
}
yaxisList.add(values);
}
......
......@@ -26,6 +26,7 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
public int equipCategoryStatistics(String bizOrgCode, SourceTypeEnum sourceType, String categoryCode) {
// 计算处通用code,用来上下级匹配如12001010000->1200101
String treeCode = subStringZero(categoryCode);
treeCode = treeCode.length() % 2 == 0 ? treeCode : treeCode + "0";
Set<String> keys = redisUtil.getKeys(buildPattenKey(bizOrgCode, sourceType.getCode(), treeCode));
if (keys.size() > 0) {
//求和
......
......@@ -31,8 +31,6 @@ public class PluginInterceptor implements Interceptor {
* @throws Throwable
*/
public Object intercept(Invocation invocation) throws Throwable {
System.out.println("====intercept======");
Object[] args = invocation.getArgs();
MappedStatement mappedStatement = (MappedStatement) args[0];
Object parameter = args[1];
......@@ -87,7 +85,6 @@ public class PluginInterceptor implements Interceptor {
}
public Object plugin(Object target) {
System.out.println("-----------------------------plugin-------------------------");
return Plugin.wrap(target, this);
}
......
......@@ -15,8 +15,14 @@
<if test="dto.name != null and dto.name != ''">
AND `name` LIKE CONCAT('%', #{dto.name}, '%')
</if>
<if test="dto.code != null and dto.code != ''">
AND `equip_model_code` LIKE concat('%', #{dto.code}, '%')
<!-- <if test="dto.code != null and dto.code != ''">-->
<!-- AND `equip_model_code` LIKE concat('%', #{dto.code}, '%')-->
<!-- </if>-->
<if test="dto.code == 'BPBJ'">
AND LEFT(equip_model_code, 1) = '4'
</if>
<if test="dto.code == 'KCQC'">
AND LEFT(equip_model_code, 1) != '4'
</if>
<if test="codeHead != null and codeHead != ''">
AND LEFT (equip_model_code, #{hierarchy}) = #{codeHead}
......@@ -35,26 +41,37 @@
</select>
<select id="countSpareEquip" resultType="java.util.Map">
select
a.equip_model_name AS `name`,
sum( a.stock_num ) AS `value`,
a.unit AS unit,
IFNULL( ifnull( b.img, b.shbz_img ), '' ) AS icon,
a.equip_model_id AS equipmentModelId,
a.equip_model_code AS equipmentModelCode
SELECT
'备品备件' AS name,
'BPBJ' AS code,
count( 1 ) AS value
FROM
wl_spare_equipment a
LEFT JOIN wl_equipment b ON b.id = a.equip_model_id
<where>
LEFT JOIN wl_equipment b ON b.id = a.equip_model_id
WHERE
a.is_delete = 0
AND a.stock_num != 0
AND LEFT(a.equip_model_code, 1) = '4'
<if test="bizOrgCode != '' and bizOrgCode != null">
AND a.`biz_org_code` LIKE concat(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'库存器材' AS name,
'KCQC' AS code,
count(1) AS value
FROM
wl_spare_equipment a
LEFT JOIN wl_equipment b ON b.id = a.equip_model_id
WHERE
a.is_delete = 0
AND a.stock_num != 0
AND LEFT(a.equip_model_code, 1) != '4'
<if test="bizOrgCode != '' and bizOrgCode != null">
AND a.`biz_org_code` LIKE concat(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
a.equip_model_id
HAVING
sum( a.stock_num ) != 0
</select>
<select id="exportList" resultType="com.yeejoin.equipmanage.common.entity.WlSpareEquipment">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment