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

This commit is contained in:
bns_han 2023-12-20 17:04:42 +08:00
commit 5ecdc9261a
11 changed files with 274 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.base.api.domain;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -61,6 +62,11 @@ public class MaType extends BaseEntity {
@ApiModelProperty(value = "租赁单价")
private String leasePrice;
/** 租赁单价 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "租赁单价")
private Date effTime;
@ApiModelProperty(value = "外部价格")
private String rentPrice;

View File

@ -1,16 +1,12 @@
package com.bonus.sgzb.base.service.impl;
import cn.hutool.http.server.HttpServerRequest;
import com.bonus.sgzb.base.domain.RepairApplyRecord;
import com.bonus.sgzb.base.domain.RepairPartDetails;
import com.bonus.sgzb.base.domain.RepairTask;
import com.bonus.sgzb.base.domain.RepairTaskDetails;
import com.bonus.sgzb.base.domain.vo.TreeSelect;
import com.bonus.sgzb.base.domain.vo.dictVo;
import com.bonus.sgzb.base.mapper.RepairMapper;
import com.bonus.sgzb.base.service.RepairService;
import com.bonus.sgzb.common.core.constant.TokenConstants;
import com.bonus.sgzb.common.core.utils.SpringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.service.TokenService;
import com.bonus.sgzb.common.security.utils.SecurityUtils;

View File

@ -86,7 +86,7 @@
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id
LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id
LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id and bpi.status = '0' and bpi.del_flag = '0'
left join sys_user su on rd.create_by = su.user_id
left join sys_dic sd on sd.id = tt.task_status
where 1=1

View File

@ -0,0 +1,51 @@
package com.bonus.sgzb.system.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.io.File;
/**
* 通用映射配置
*
* @author ruoyi
*/
@Configuration
public class ResourcesConfig implements WebMvcConfigurer
{
/**
* 上传文件存储在本地的根路径
*/
@Value("${file.path}")
private String localFilePath;
/**
* 资源映射路径 前缀
*/
@Value("${file.prefix}")
public String localFilePrefix;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry)
{
/** 本地文件上传路径 */
registry.addResourceHandler("/**")
.addResourceLocations("file:" + localFilePath + File.separator);
}
/**
* 开启跨域
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
// 设置允许跨域的路由
registry.addMapping( "/**")
// 设置允许跨域请求的域名
.allowedOrigins("*")
// 设置允许的方法
.allowedMethods("GET");
}
}

View File

@ -0,0 +1,35 @@
package com.bonus.sgzb.system.controller;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.system.domain.SelectDto;
import com.bonus.sgzb.system.service.SelectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author 10488
* 统一下拉选
*/
@RestController
@RequestMapping("/select/")
public class SelectController {
@Resource(name = "SelectService")
private SelectService service;
@ApiOperation(value = "往来单位下拉选")
@PostMapping("getUnitData")
public AjaxResult getUnitData(SelectDto dto) {
return service.getUnitData(dto);
}
@ApiOperation(value = "工程下拉选")
@PostMapping("getProData")
public AjaxResult getProData(SelectDto dto) {
return service.getProData(dto);
}
}

View File

@ -0,0 +1,13 @@
package com.bonus.sgzb.system.domain;
import lombok.Data;
/**
* @author 10488
*/
@Data
public class SelectDto {
/** 参数id*/
private String id;
}

View File

@ -0,0 +1,16 @@
package com.bonus.sgzb.system.domain;
import lombok.Data;
/**
* @author 10488
*/
@Data
public class SelectVo {
/** id*/
private long id;
/** 名称*/
private String titleName;
}

View File

@ -0,0 +1,32 @@
package com.bonus.sgzb.system.mapper;
import com.bonus.sgzb.system.domain.SelectDto;
import com.bonus.sgzb.system.domain.SelectVo;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author 10488
* 统一下拉选
*/
@Repository("SelectMapper")
public interface SelectMapper {
/**
* @param dto
* @return List<SelectVo>
* @description 往来单位
* @author cwchen
* @date 2023/12/20 14:23
*/
List<SelectVo> getUnitData(SelectDto dto);
/**
* @param dto
* @return List<SelectVo>
* @description 工程
* @author cwchen
* @date 2023/12/20 15:05
*/
List<SelectVo> getProData(SelectDto dto);
}

View File

@ -0,0 +1,29 @@
package com.bonus.sgzb.system.service;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.system.domain.SelectDto;
/**
* @author 10488
* 统一下拉选
*/
public interface SelectService {
/**
* @param dto
* @return AjaxResult
* @description 往来单位
* @author cwchen
* @date 2023/12/20 14:20
*/
AjaxResult getUnitData(SelectDto dto);
/**
* @param dto
* @return AjaxResult
* @description 工程
* @author cwchen
* @date 2023/12/20 15:04
*/
AjaxResult getProData(SelectDto dto);
}

View File

@ -0,0 +1,47 @@
package com.bonus.sgzb.system.service.impl;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.system.domain.SelectDto;
import com.bonus.sgzb.system.domain.SelectVo;
import com.bonus.sgzb.system.mapper.SelectMapper;
import com.bonus.sgzb.system.service.SelectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author 10488
* 统一下拉选
*/
@Service("SelectService")
@Slf4j
public class SelectServiceImpl implements SelectService {
@Resource(name = "SelectMapper")
private SelectMapper mapper;
@Override
public AjaxResult getUnitData(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getUnitData(dto);
} catch (Exception e) {
log.error("往来单位-查询失败",e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getProData(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getProData(dto);
} catch (Exception e) {
log.error("工程-查询失败",e);
}
return AjaxResult.success(list);
}
}

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.system.mapper.SelectMapper">
<!--往来单位-->
<select id="getUnitData" resultType="com.bonus.sgzb.system.domain.SelectVo">
/*根据标段工程id关联协议查询往来单位*/
<if test="id != null and id != ''">
SELECT DISTINCT bui.unit_id AS id,
bui.unit_name AS titleName
FROM bm_project_lot bpl
LEFT JOIN bm_agreement_info bai ON bpl.lot_id = bai.project_id AND bai.`status` = '1'
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id AND bui.del_flag = '0'
WHERE bpl.lot_id = #{id} AND bpl.del_flag = '0'
</if>
<if test="id == null or id == ''">
SELECT unit_id AS id,
unit_name AS titleName
FROM bm_unit_info
WHERE del_flag = '0'
</if>
</select>
<!--工程-->
<select id="getProData" resultType="com.bonus.sgzb.system.domain.SelectVo">
/*根据往来单位id关联协议查询工程*/
<if test="id != null and id != ''">
SELECT DISTINCT bpl.lot_id AS id,
bpl.lot_name AS titleName
FROM bm_unit_info bui
LEFT JOIN bm_agreement_info bai ON bui.unit_id = bai.unit_id AND bai.`status` = '1'
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id AND bpl.del_flag = '0'
WHERE bui.unit_id = #{id} AND bui.del_flag = '0'
</if>
<if test="id == null or id == ''">
SELECT lot_id AS id,
lot_name AS titleName
FROM bm_project_lot
WHERE del_flag = '0'
</if>
</select>
</mapper>