Browse Source

xml

dev_kxc
zhuyulei 1 year ago
parent
commit
224810a441
  1. 66
      jwtech-system/src/main/java/com/kms/build/controller/BsSgcjsjdBuiProInfoController.java
  2. 3
      jwtech-system/src/main/java/com/kms/build/domain/BsSgcjsjdBuiProInfo.java
  3. 9
      jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java
  4. 18
      jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java
  5. 11
      jwtech-system/src/main/java/com/kms/earlyStage/mapper/SpecialProjectFeasibilityMapper.java
  6. 28
      jwtech-system/src/main/java/com/kms/earlyStage/service/SpecialProjectFeasibilityService.java
  7. 39
      jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml
  8. 47
      jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectFeasibilityMapper.xml
  9. 7
      jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectInfoMapper.xml
  10. 7
      jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectPlanInfoMapper.xml
  11. 7
      jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectPreDesignMapper.xml
  12. 7
      jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectProposalMapper.xml
  13. 7
      jwtech-system/src/main/resources/mapper/enterprise/BsSgcYxjdEnterpriseInfoMapper.xml
  14. 9
      jwtech-system/src/main/resources/mapper/system/SysXzqhMapper.xml

66
jwtech-system/src/main/java/com/kms/build/controller/BsSgcjsjdBuiProInfoController.java

@ -8,14 +8,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.jianwei.common.core.controller.BaseController;
import com.jianwei.common.core.domain.SearchParam;
import com.jianwei.common.core.domain.entity.SysDept;
import com.jianwei.common.core.domain.entity.SysUser;
import com.jianwei.common.utils.poi.ExcelUtil;
import com.kms.build.domain.BsSgcjsjdBuiProInfo;
import com.kms.build.service.BsSgcjsjdBuiProInfoService;
import com.kms.common.utils.BaseEntityUtils;
import com.kms.common.utils.UserUtils;
import com.kms.earlyStage.domain.SpecialProjectPlanInfo;
import com.kms.earlyStage.domain.SpecialProjectProposal;
import com.kms.earlyStage.service.SpecialProjectProposalService;
import com.kms.system.domain.SysXzqh;
import com.kms.system.service.SysDeptService;
import com.kms.system.service.SysXzqhService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,6 +60,12 @@ public class BsSgcjsjdBuiProInfoController extends BaseController
@Autowired
private SpecialProjectProposalService specialProjectProposalService;
@Autowired
private SysDeptService sysDeptService;
@Autowired
private SysXzqhService sysXzqhService;
@GetMapping("/getProposal")
public AjaxResult getSpecialProjectProposal() {
@ -70,7 +83,58 @@ public class BsSgcjsjdBuiProInfoController extends BaseController
@ApiOperation("项目基本信息管理列表")
public IPage list(@RequestBody SearchParam<BsSgcjsjdBuiProInfo> sp)
{
return bsSgcjsjdBuiProInfoService.selectPage(sp);
BsSgcjsjdBuiProInfo planInfo = sp.getData();
String adcd = planInfo.getAdcd();
SysUser sysUser = UserUtils.getUser();
if (sysUser.getUserName().equals("admin")) {
adcd = handleAdminUser(planInfo, adcd);
} else if (adcd == null) {
adcd = handleNullAdcd();
} else {
adcd = handleAdcd(adcd);
}
return bsSgcjsjdBuiProInfoService.selectPage(sp, adcd);
}
private String handleAdminUser(BsSgcjsjdBuiProInfo planInfo, String adcd) {
if (planInfo != null && planInfo.getAdcd() != null) {
adcd = planInfo.getAdcd();
adcd = handleAdcd(adcd);
}
return adcd;
}
private String handleNullAdcd() {
SysUser user = UserUtils.getUser();
String deptId = user.getDeptId();
SysDept sysDept = sysDeptService.get(deptId);
String xzqhId = sysDept.getXzqhId();
SysXzqh xzqh = sysXzqhService.getById(xzqhId);
return handleXzqh(xzqh);
}
private String handleAdcd(String adcd) {
QueryWrapper<SysXzqh> sysXzqhQueryWrapper = new QueryWrapper<>();
sysXzqhQueryWrapper.eq("XZQHDM", adcd);
SysXzqh xzqh = sysXzqhService.getOne(sysXzqhQueryWrapper);
return handleXzqh(xzqh);
}
private String handleXzqh(SysXzqh xzqh) {
String adcd;
if (xzqh.getLayer()==1) {
adcd = xzqh.getXzqhdm().substring(0, 2);
} else if (xzqh.getLayer()==2) {
adcd = xzqh.getXzqhdm().substring(0, 4);
} else {
adcd = xzqh.getXzqhdm();
}
return adcd;
}
/**

3
jwtech-system/src/main/java/com/kms/build/domain/BsSgcjsjdBuiProInfo.java

@ -32,6 +32,7 @@ public class BsSgcjsjdBuiProInfo extends BaseEntity
/** 项目名称 */
@Excel(name = "项目名称")
@ApiModelProperty("项目名称")
@TableField(exist = false)
private String projectName;
/** 项目法人 */
@ -87,6 +88,7 @@ public class BsSgcjsjdBuiProInfo extends BaseEntity
/** 行政区划 */
@Excel(name = "行政区划")
@ApiModelProperty("行政区划")
@TableField(exist = false)
private String adcd;
/** 所属流域 */
@ -97,6 +99,7 @@ public class BsSgcjsjdBuiProInfo extends BaseEntity
/** 项目类型 */
@Excel(name = "项目类型")
@ApiModelProperty("项目类型")
@TableField(exist = false)
private String projectType;
/** 资金来源 */

9
jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java

@ -1,9 +1,12 @@
package com.kms.build.mapper;
import com.kms.build.domain.BsSgcjsjdBuiProInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 项目基本信息管理Mapper接口
@ -14,4 +17,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@Repository
public interface BsSgcjsjdBuiProInfoMapper extends BaseMapper<BsSgcjsjdBuiProInfo> {
List<BsSgcjsjdBuiProInfo> getXzqh(@Param("id") String id,
@Param("projectName") String projectName,
@Param("adcd") String adcd,
@Param("orderBy") String orderBy,
@Param("pageNum") int pageNum,
@Param("pageSize") int pageSize);
}

18
jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java

@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
@ -31,12 +32,21 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM
private BsSgcjsjdBuiProInfoMapper bsSgcjsjdBuiProInfoMapper;
@Autowired
private BsSgcJsjdBuiContInfoService bsSgcJsjdBuiContInfoService;
private BsSgcJsjdBuiContInfoService bsSgcJsjdBuiContInfoService;
public IPage selectPage(SearchParam<BsSgcjsjdBuiProInfo> sp) {
public IPage selectPage(SearchParam<BsSgcjsjdBuiProInfo> sp, String adcd) {
Page page = bsSgcjsjdBuiProInfoMapper.selectPage(new Page<>(sp.getPageNum(), sp.getPageSize()), BeanToWrapper.getWrapper(sp));
BsSgcjsjdBuiProInfo data = sp.getData();
Map<String, Object> params = sp.getParams();
//create_time
String orderBy = (String) params.get("orderBy");
List<BsSgcjsjdBuiProInfo> list = bsSgcjsjdBuiProInfoMapper.getXzqh(data.getId(), data.getProjectName(), adcd, orderBy, sp.getPageNum(), sp.getPageSize());
Page<BsSgcjsjdBuiProInfo> page = new Page<>();
page.setRecords(list);
page.setTotal(list.size());
List<BsSgcjsjdBuiProInfo> records = page.getRecords();
@ -54,7 +64,7 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM
if (actualPayment == null) {
actualPayment = BigDecimal.ZERO;
}
contractPayment =contractPayment.add(actualPayment);
contractPayment = contractPayment.add(actualPayment);
}
record.setContractPayment(contractPayment);

11
jwtech-system/src/main/java/com/kms/earlyStage/mapper/SpecialProjectFeasibilityMapper.java

@ -1,9 +1,13 @@
package com.kms.earlyStage.mapper;
import com.kms.earlyStage.domain.SpecialProjectInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kms.earlyStage.domain.SpecialProjectFeasibility;
import java.util.List;
/**
* 可行性研究报告Mapper接口
*
@ -13,4 +17,11 @@ import com.kms.earlyStage.domain.SpecialProjectFeasibility;
@Repository
public interface SpecialProjectFeasibilityMapper extends BaseMapper<SpecialProjectFeasibility> {
List<SpecialProjectInfo> getXzqh(@Param("id") String id,
@Param("projectName") String projectName,
@Param("projectType") String projectType,
@Param("adcd") String adcd,
@Param("orderBy") String orderBy,
@Param("pageNum") int pageNum,
@Param("pageSize") int pageSize);
}

28
jwtech-system/src/main/java/com/kms/earlyStage/service/SpecialProjectFeasibilityService.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jianwei.common.core.domain.SearchParam;
import com.kms.earlyStage.domain.SpecialProjectInfo;
import com.kms.earlyStage.domain.SpecialProjectProposal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -11,6 +12,7 @@ import com.jianwei.common.core.service.BaseService;
import com.kms.earlyStage.mapper.SpecialProjectFeasibilityMapper;
import com.kms.earlyStage.domain.SpecialProjectFeasibility;
import java.util.List;
import java.util.Map;
/**
@ -27,22 +29,18 @@ public class SpecialProjectFeasibilityService extends BaseService<SpecialProject
public IPage selectPage(SearchParam<SpecialProjectFeasibility> sp, String adcd) {
QueryWrapper<SpecialProjectFeasibility> queryWrapper = new QueryWrapper<>();
SpecialProjectFeasibility projectInfo = sp.getData();
String projectName = projectInfo.getProjectName();
String projectType = projectInfo.getProjectType();
queryWrapper.eq(projectInfo.getId()!=null,"id", projectInfo.getId());
queryWrapper.like(projectName != null, "project_name", projectName);
queryWrapper.like(projectType != null, "project_type", projectType);
queryWrapper.likeRight(adcd != null, "ADCD", adcd);
SpecialProjectFeasibility data = sp.getData();
Map<String, Object> params = sp.getParams();
//create_time
String orderBy = (String) params.get("orderBy");
queryWrapper.orderByDesc(orderBy);
Page<SpecialProjectFeasibility> page = new Page<>(sp.getPageNum(),sp.getPageSize());
Page<SpecialProjectFeasibility> infoPage = specialProjectFeasibilityMapper.selectPage(page, queryWrapper);
return infoPage;
List<SpecialProjectInfo> list = specialProjectFeasibilityMapper.getXzqh(data.getId(),data.getProjectName(),
data.getProjectType(),adcd,(String)params.get("orderBy"),sp.getPageNum(),sp.getPageSize());
Page<SpecialProjectInfo> page = new Page<>();
page.setRecords(list);
page.setTotal(list.size());
return page;
}
}

39
jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml

@ -0,0 +1,39 @@
<?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.kms.build.mapper.BsSgcjsjdBuiProInfoMapper">
<sql id="info">
select pi.id,
pp.project_name,
pi.pro_code,
pp.adcd,
pp.project_type,
pi.CONSTRUCTION_NATURE
from bs_sgc_jsjd_bui_pro_info pi
left join bs_slgc_qqjd_spe_pro_proposal pp on pi.pro_code = pp.project_code and pi.pro_no = pp.pro_no
</sql>
<resultMap id="BsSgcjsjdBuiProInfo" type="BsSgcjsjdBuiProInfo">
<id property="id" column="id"/>
<result property="projectName" column="project_name"/>
<result property="adcd" column="adcd"/>
<result property="projectType" column="project_type"/>
<result property="proCode" column="pro_code"/>
<result property="constructionNature" column="CONSTRUCTION_NATURE"/>
</resultMap>
<select id="getXzqh" resultMap="BsSgcjsjdBuiProInfo">
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
<include refid="info"/>
<where>
<if test="projectName!=null and projectName!=''">
and project_name like concat('%',#{projectName},'%')
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
order by pi.${orderBy} desc LIMIT #{pageNum},#{pageSize};
</select>
</mapper>

47
jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectFeasibilityMapper.xml

@ -0,0 +1,47 @@
<?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.kms.earlyStage.mapper.SpecialProjectFeasibilityMapper">
<sql id="SpecialProjectInfo">
select id,
project_name,
project_code,
adcd,
project_type,
compiling_unit,
PROJECT_INVESTMENT_ESTIMATE,
APPROVAL_OPINION,
create_time
from bs_slgc_qqjd_spe_pro_fea
</sql>
<resultMap id="SpecialProjectFeasibility" type="SpecialProjectFeasibility">
<id property="id" column="id"/>
<result property="projectName" column="project_name"/>
<result property="projectCode" column="project_code"/>
<result property="adcd" column="adcd"/>
<result property="projectType" column="project_type"/>
<result property="compilingUnit" column="compiling_unit"/>
<result property="projectInvestmentEstimate" column="PROJECT_INVESTMENT_ESTIMATE"/>
<result property="approvalOpinion" column="APPROVAL_OPINION"/>
<result property="createTime" column="create_time"/>
</resultMap>
<select id="getXzqh" resultMap="SpecialProjectFeasibility">
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
<include refid="SpecialProjectInfo"/>
<where>
<if test="projectName!=null and projectName!=''">
and project_name like concat('%',#{projectName},'%')
</if>
<if test="projectType!=null and projectType!=''">
and project_type=#{projectType}
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize};
</select>
</mapper>

7
jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectInfoMapper.xml

@ -36,18 +36,13 @@
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
<include refid="SpecialProjectInfo"/>
<where>
<if test="id!=null and id!=''">
and id=#{id}
</if>
<if test="projectName!=null and projectName!=''">
and project_name like concat('%',#{projectName},'%')
</if>
<if test="projectType!=null and projectType!=''">
and project_type=#{projectType}
</if>
<if test="adcd!=null and adcd !=''">
and adcd like concat(#{adcd},'%')
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize};
</select>

7
jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectPlanInfoMapper.xml

@ -35,18 +35,13 @@
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
<include refid="SpecialProjectPlanInfo"></include>
<where>
<if test="id!=null and id!=''">
and id=#{id}
</if>
<if test="planName!=null and planName!=''">
and plan_name like concat('%',#{planName},'%')
</if>
<if test="planType!=null and planType!=''">
and plan_type=#{planType}
</if>
<if test="adcd!=null and adcd !=''">
and adcd like concat(#{adcd},'%')
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize};
</select>

7
jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectPreDesignMapper.xml

@ -34,15 +34,10 @@
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
<include refid="info"/>
<where>
<if test="id!=null and id!=''">
and id=#{id}
</if>
<if test="projectName!=null and projectName!=''">
and project_name like concat('%',#{projectName},'%')
</if>
<if test="adcd!=null and adcd !=''">
and adcd like concat(#{adcd},'%')
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize};
</select>

7
jwtech-system/src/main/resources/mapper/earlyStage/SpecialProjectProposalMapper.xml

@ -48,18 +48,13 @@
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
<include refid="info"></include>
<where>
<if test="id!=null and id!=''">
and id=#{id}
</if>
<if test="projectName!=null and projectName!=''">
and project_name like concat('%',#{projectName},'%')
</if>
<if test="projectType!=null and projectType!=''">
and project_type=#{projectType}
</if>
<if test="adcd!=null and adcd !=''">
and adcd like concat(#{adcd},'%')
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize};
</select>

7
jwtech-system/src/main/resources/mapper/enterprise/BsSgcYxjdEnterpriseInfoMapper.xml

@ -55,12 +55,7 @@
<if test="enterpriseName!=null and enterpriseName!=''">
and enterprise_name like concat('%',#{enterpriseName},'%')
</if>
<if test="adcd!=null and adcd !=''">
and adcd like concat(#{adcd},'%')
</if>
<if test="id!=null and id!=''">
and id=#{id}
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize};
</select>

9
jwtech-system/src/main/resources/mapper/system/SysXzqhMapper.xml

@ -17,5 +17,14 @@
GROUP BY SUBSTRING(XZQHDM, 1, 4);
</select>
<sql id="xzqhCondition">
<if test="adcd!=null and adcd !=''">
and adcd like concat(#{adcd},'%')
</if>
<if test="id!=null and id!=''">
and id=#{id}
</if>
</sql>
</mapper>

Loading…
Cancel
Save