Merge remote-tracking branch 'origin/master'

This commit is contained in:
haozq 2024-04-11 15:22:52 +08:00
commit 61457bf31b
8 changed files with 200 additions and 4 deletions

View File

@ -31,12 +31,12 @@ public class DeviceBdDetailVo {
@ApiModelProperty("最大阈值")
@Length(max = 50, message = "最大阈值字符长度不能超过50", groups = {Query.class})
@Pattern(regexp = "(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))",message = "最大阈值为大于0的数字",groups = {SignProVo.Query.class})
@Pattern(regexp = "(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))",message = "最大阈值为大于0的数字",groups = {Query.class})
private String maxValueData;
@ApiModelProperty("最小阈值")
@Length(max = 50, message = "最小阈值长字符度不能超过50", groups = {Query.class})
@Pattern(regexp = "(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))",message = "最小阈值为大于0的数字",groups = {SignProVo.Query.class})
@Pattern(regexp = "(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))",message = "最小阈值为大于0的数字",groups = {Query.class})
private String minValueData;
@ApiModelProperty("采集值类型")

View File

@ -1,11 +1,13 @@
package com.securitycontrol.entity.system.base.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.securitycontrol.entity.background.vo.DeviceBdDetailVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.List;
@ -49,6 +51,7 @@ public class ProVo {
@ApiModelProperty(value = "工程成本")
@NotBlank(message = "工程成本不能为空", groups = {Query.class})
@Pattern(regexp = "(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))",message = "工程成本为大于0的数字",groups = {Query.class})
@Length(max = 50, message = "工程成本字符长度不能超过50", groups = {Query.class})
private String proCost;

View File

@ -213,10 +213,12 @@ public class AppServiceImpl implements IAppService {
@Override
public AjaxResult proManagement(ParamDto dto) {
Map<String, Object> dataMap = new HashMap<>(16);
Map<String, Object> proCost = new HashMap<>(16);
ProVo vo = new ProVo();
JSONObject item = new JSONObject();
List<Map<String, Object>> proGxPlanList = new ArrayList<>();
List<ProjectCostVo> proCostList = new ArrayList<>();
double proCostData = 0.0,residueCostData = 0.0,expenditureCostData = 0.0;
try {
// 工程详情
vo = mapper.getProBrief(dto);
@ -236,13 +238,49 @@ public class AppServiceImpl implements IAppService {
}
// 标段工程成本
proCostList = mapper.getProCost(dto);
if(CollectionUtils.isNotEmpty(proCostList)){
BigDecimal value = new BigDecimal("0");
for (ProjectCostVo costVo : proCostList) {
String amount = costVo.getAmount();
if(isNumeric(amount)){
BigDecimal bigDecimal = new BigDecimal(amount);
value = value.add(bigDecimal);
}
}
expenditureCostData = value.doubleValue();
}
} catch (Exception e) {
log.error("工程管理", e);
}
// 计划成本 已支出 剩余
if (vo != null && StringUtils.isNotEmpty(vo.getProCost()) && isNumeric(vo.getProCost())) {
proCostData = Double.parseDouble(vo.getProCost());
}
if(proCostData >= expenditureCostData){
BigDecimal value = BigDecimal.valueOf(proCostData);
BigDecimal value2 = BigDecimal.valueOf(expenditureCostData);
residueCostData = value.subtract(value2).doubleValue();
}
proCost.put("proCostList", proCostList);
proCost.put("residueCost", residueCostData);
proCost.put("expenditureCost", expenditureCostData);
proCost.put("planCost", proCostData);
dataMap.put("vo", vo);
dataMap.put("item", item);
dataMap.put("proGxPlan", proGxPlanList);
dataMap.put("proCost", proCostList);
dataMap.put("proCost", proCost);
return AjaxResult.success(dataMap);
}
public static boolean isNumeric(String str) {
if (str == null || str.isEmpty()) {
return false;
}
try {
Double.parseDouble(str);
return true;
} catch (NumberFormatException e) {
return false;
}
}
}

View File

@ -117,7 +117,6 @@ public class SelectController extends BaseController {
return service.getSelectLists();
}
@ApiOperation(value = "项目下拉选")
@GetMapping("getProjectList")
public AjaxResult getProjectList(SelectDto dto){
@ -129,4 +128,22 @@ public class SelectController extends BaseController {
public AjaxResult getSignProList(SelectDto dto){
return service.getSignProList(dto);
}
@ApiOperation(value = "围栏类型下拉选")
@GetMapping("getRailLists")
public AjaxResult getRailLists() {
return service.getRailLists();
}
@ApiOperation(value = "报警下拉选")
@GetMapping("getGiveAnAlarmLists")
public AjaxResult getGiveAnAlarmLists() {
return service.getGiveAnAlarmLists();
}
@ApiOperation(value = "警戒等级下拉选")
@GetMapping("getGuardAgainstLists")
public AjaxResult getGuardAgainstLists() {
return service.getGuardAgainstLists();
}
}

View File

@ -173,4 +173,34 @@ public interface ISelectMapper {
* @date 2024/4/2 14:12
*/
List<SelectVo> getSignProList(SelectDto dto);
/**
* 围栏类型下拉选
*
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
List<SelectVo> getRailLists();
/**
* 报警下拉选
*
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
List<SelectVo> getGiveAnAlarmLists();
/**
* 警戒等级下拉选
*
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
List<SelectVo> getGuardAgainstLists();
}

View File

@ -177,4 +177,31 @@ public interface ISelectService {
* @date 2024/4/2 14:11
*/
AjaxResult getSignProList(SelectDto dto);
/**
* 围栏类型下拉选
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
AjaxResult getRailLists();
/**
* 报警下拉选
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
AjaxResult getGiveAnAlarmLists();
/**
* 警戒等级下拉选
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
AjaxResult getGuardAgainstLists();
}

View File

@ -249,4 +249,61 @@ public class SelectServiceImpl implements ISelectService {
}
return AjaxResult.success(list);
}
/**
* 围栏类型下拉选
*
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
@Override
public AjaxResult getRailLists() {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getRailLists();
} catch (Exception e) {
log.error("围栏类型下拉选",e);
}
return AjaxResult.success(list);
}
/**
* 报警下拉选
*
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
@Override
public AjaxResult getGiveAnAlarmLists() {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getGiveAnAlarmLists();
} catch (Exception e) {
log.error("报警下拉选",e);
}
return AjaxResult.success(list);
}
/**
* 警戒等级下拉选
*
* @return AjaxResult
* @description
* @author jjLv
* @date 2024/4/2 14:11
*/
@Override
public AjaxResult getGuardAgainstLists() {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getGuardAgainstLists();
} catch (Exception e) {
log.error("警戒等级下拉选",e);
}
return AjaxResult.success(list);
}
}

View File

@ -160,4 +160,28 @@
AND project_no = #{proNo}
</if>
</select>
<select id="getRailLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT sd2.dict_code AS id,
sd2.dict_name AS name
FROM sys_dict sd
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
WHERE sd.dict_code = '3000' AND sd.del_flag = 0
ORDER BY sd2.dict_sort
</select>
<select id="getGiveAnAlarmLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT sd2.dict_code AS id,
sd2.dict_name AS name
FROM sys_dict sd
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
WHERE sd.dict_code = '3100' AND sd.del_flag = 0
ORDER BY sd2.dict_sort
</select>
<select id="getGuardAgainstLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT sd2.dict_code AS id,
sd2.dict_name AS name
FROM sys_dict sd
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
WHERE sd.dict_code = '3200' AND sd.del_flag = 0
ORDER BY sd2.dict_sort
</select>
</mapper>