This commit is contained in:
mashuai 2024-04-29 16:52:51 +08:00
parent 4f9cb5e37e
commit d58c1b788d
4 changed files with 51 additions and 3 deletions

View File

@ -172,7 +172,7 @@ public class TmTaskController extends BaseController {
if (StringUtils.isNull(task)) {
return AjaxResult.error("参数错误");
}
if (StringUtils.isNotNull(task.getLeaseApplyInfo().getPhone())) {
if (StringUtils.isNotBlank(task.getLeaseApplyInfo().getPhone())) {
String phone = task.getLeaseApplyInfo().getPhone();
if (!PhoneUtil.isMobile(phone)){
logger.error("手机号格式错误 :{}", phone);

View File

@ -400,8 +400,12 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
List<ScrapAnalysisVo> bfValueList = mapper.getTotalOwnership(dto);
Integer bfValue = commonUtil.setBFData(bfValueList);
vo.setScrapNum(bfValue);
// 总保有量
vo.setTotalOwnershipNum(zkValue + drkValue + useValue + zxValue);
// 修饰待入库
dto.setType("6");
List<ScrapAnalysisVo> decoratedValueList = mapper.getTotalOwnership(dto);
Integer decoratedValue = commonUtil.setDeData(decoratedValueList);
// 总保有量 = 在库+在用+在修+修试后待入库
vo.setTotalOwnershipNum(zkValue + decoratedValue + useValue + zxValue);
return vo;
}

View File

@ -366,4 +366,28 @@ public class CommonUtil {
double doubleTotalValue = totalValue.doubleValue();
return (int) Math.round(doubleTotalValue);
}
/**
* 修饰待入库
* @param list
* @return
*/
public Integer setDeData(List<ScrapAnalysisVo> list) {
if (CollectionUtils.isEmpty(list)){
return 0;
}
BigDecimal finalValue = new BigDecimal(new Double(0).toString());
BigDecimal totalValue = new BigDecimal(new Double(0).toString());
BigDecimal totalValue2 = new BigDecimal(new Double(0).toString());
for (int i = 0; i < list.size(); i++) {
ScrapAnalysisVo vo = list.get(i);
BigDecimal value = new BigDecimal(new Double(String.valueOf(vo.getNum())));
totalValue = totalValue.add(value);
BigDecimal value2 = new BigDecimal(new Double(String.valueOf(vo.getNum2())));
totalValue2 = totalValue2.add(value2);
}
finalValue = totalValue.subtract(totalValue2);
double doubleValue = finalValue.doubleValue();
return (int) Math.round(doubleValue);
}
}

View File

@ -287,6 +287,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND sd.dept_id = #{companyId}
</if>
</if>
/*修饰待入库*/
<if test="type == 6">
SELECT rid.repair_num AS num,
rid.input_num AS num2,
mt.type_name AS typeName
FROM repair_input_details rid
LEFT JOIN ma_type mt ON rid.type_id = mt.type_id AND mt.`level` = '4'
LEFT JOIN sys_dept sd ON sd.dept_id = mt.company_id
<where>
<if test="maType!=null and maType == 1">
sd.dept_name = #{maTypeName}
</if>
<if test="maType!=null and maType == 2">
AND sd.dept_name = #{maTypeName}
</if>
<if test="companyId!=null and companyId !=''">
AND sd.dept_id = #{companyId}
</if>
</where>
</if>
</select>
<!--检修预警-->
<select id="getMaintenanceWarning" resultType="com.bonus.sgzb.largeScreen.domain.MaintenanceWarningVo">