添加配置

This commit is contained in:
haozq 2025-12-29 14:41:45 +08:00
parent 5079b16f65
commit 6b99b0c66a
7 changed files with 87 additions and 30 deletions

View File

@ -30,7 +30,12 @@
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<!-- Minio -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>${minio.version}</version>
</dependency>
<!--加密依赖包-->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>

View File

@ -1,31 +1,21 @@
package com.bonus.bmw.controller;
import com.bonus.bmw.domain.dto.WebFileDto;
import com.bonus.bmw.domain.po.HomePagePo;
import com.bonus.bmw.domain.po.PmSub;
import com.bonus.bmw.domain.vo.PmWorker;
import com.bonus.bmw.domain.vo.TbProConfigVo;
import com.bonus.bmw.service.TbProConfigService;
import com.bonus.common.core.utils.encryption.Sm4Utils;
import com.bonus.common.core.utils.json.FastJsonHelper;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.InnerAuth;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.bonus.bmw.utils.OwnPermissionUtil.dealWithPermission;
/**
* 多工程入场 配置
@ -72,17 +62,24 @@ public class TbProConfigController extends BaseController {
/**
* 多工程入场 默认无数据是 不可以
* 是否需要离场结算 无数据是需要
* 是否需要离场结算 无数据是 需要
* 0 退场证明 1 是否可以多工程入场
* 必传 分公司id-工程类型 ,工程地区type=>0 退场证明 1 是否可以多工程入场
* @param params
* @return
*/
@PostMapping("/getConfig")
@SysLog(title = "工程配置", businessType = OperaType.DELETE, logType = 0, module = "工程配置->工程配置->新增配置", details = "获取配置")
@SysLog(title = "工程配置", businessType = OperaType.QUERY, logType = 0, module = "工程配置->工程配置->新增配置", details = "获取配置")
public AjaxResult getConfig(@RequestBody TbProConfigVo params) {
return service.getConfig(params);
}
@PostMapping("/getConfigByProId")
@SysLog(title = "工程配置", businessType = OperaType.QUERY, logType = 0, module = "工程配置->工程配置->新增配置", details = "获取配置")
public AjaxResult getConfigByProId(@RequestBody TbProConfigVo params) {
return service.getConfigByProId(params);
}
}

View File

@ -19,7 +19,7 @@ public class TbProConfigVo {
*/
private String proArea;
/**
* 数据类型0 退场证明 1 是否可以多工程入场
* 0 退场证明 1 是否可以多工程入场
*/
private String type;
/**
@ -39,4 +39,10 @@ public class TbProConfigVo {
* 配置id
*/
private String configId;
/**
* 工程id
*/
private String proId;
}

View File

@ -65,4 +65,11 @@ public interface TbProConfigMapper {
* @return
*/
TbProConfigVo TbProConfigVo(TbProConfigVo params);
/**
* 查询配置信息
* @param params
* @return
*/
List<TbProConfigVo> getConfigByProId(TbProConfigVo params);
}

View File

@ -40,4 +40,11 @@ public interface TbProConfigService {
* @return
*/
AjaxResult getConfig(TbProConfigVo params);
/**
* 依据工程id 判断工程是否需要 出入场/是否多工程入场
* @param params
* @return
*/
AjaxResult getConfigByProId(TbProConfigVo params);
}

View File

@ -10,9 +10,7 @@ import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.*;
@Service
@Slf4j
@ -138,11 +136,8 @@ public class TbProConfigServiceImpl implements TbProConfigService {
if(vo!=null){
return AjaxResult.success(vo);
}else{
if("0".equals(params.getType())){
params.setIsNeed("1");
}else{
params.setIsNeed("0");
}
//默认不需要-不可以
params.setIsNeed("0");
}
return AjaxResult.success(params);
}catch (Exception e){
@ -150,4 +145,34 @@ public class TbProConfigServiceImpl implements TbProConfigService {
}
return AjaxResult.error("查询失败");
}
/**
* 依据工程id查询
* @param params
* @return
*/
@Override
public AjaxResult getConfigByProId(TbProConfigVo params) {
Map<String,Object> map=new HashMap<String,Object>();
try{
List<TbProConfigVo> list=mapper.getConfigByProId(params);
if(list!=null&& !list.isEmpty()){
for(TbProConfigVo proConfig:list){
if("0".equals(proConfig.getIsNeed())){
map.put("tczm",proConfig.getIsNeed());
} else{
map.put("dgc",proConfig.getIsNeed());
}
}
//如果没有数据 就提供默认值
map.putIfAbsent("tczm", "0");
map.putIfAbsent("dgc", "0");
}
}catch (Exception e){
map.putIfAbsent("tczm", "0");
map.putIfAbsent("dgc", "0");
log.error(e.toString(),e);
}
return AjaxResult.success(map);
}
}

View File

@ -32,11 +32,14 @@
<if test="subName!=null and subName!=''">
and sub_name like concat('%',#{subName},'%')
</if>
<if test="keyWord!=null and keyWord!=''">
and(
pro_area like concat('%',#{keyWord},'%') OR
pro_type like concat('%',#{keyWord},'%')
)
<if test="type!=null and type!=''">
and type =#{type}
</if>
<if test="proType!=null and proType!=''">
and pro_type =#{proType}
</if>
<if test="proArea!=null and proArea!=''">
and pro_area =#{proArea}
</if>
</where>
</select>
@ -53,4 +56,11 @@
from tb_pro_config_real
where pro_type=#{proType} and sub_id=#{subId} and pro_area=#{proArea} and type=#{type}
</select>
<select id="getConfigByProId" resultType="com.bonus.bmw.domain.vo.TbProConfigVo">
select pro.id, IFNULL(pcr.is_need,0) isNeed ,pcr.type
FROM pm_project pro
left join tb_pro_config_real pcr on pcr.sub_id=pro.sub_com_id
and pcr.pro_type=pro.pro_type and pcr.pro_area=pro.is_shanghai
where pro.id=#{proId}
</select>
</mapper>