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