update code
parent
46650c7b71
commit
30fbba6b6b
|
@ -0,0 +1,242 @@
|
||||||
|
package com.yanzhu.manage.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.yanzhu.common.core.annotation.Excel;
|
||||||
|
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目成本产值对象 pro_cost_output
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-12-21
|
||||||
|
*/
|
||||||
|
public class ProCostOutput extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 部门ID */
|
||||||
|
@Excel(name = "部门ID")
|
||||||
|
private Long comId;
|
||||||
|
|
||||||
|
/** 项目编号 */
|
||||||
|
@Excel(name = "项目编号")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/** 金额 */
|
||||||
|
@Excel(name = "金额")
|
||||||
|
private Long money;
|
||||||
|
|
||||||
|
/** 金额2 */
|
||||||
|
@Excel(name = "金额2")
|
||||||
|
private Long money2;
|
||||||
|
|
||||||
|
/** 金额2 */
|
||||||
|
@Excel(name = "金额3")
|
||||||
|
private Long money3;
|
||||||
|
|
||||||
|
/** 金额2 */
|
||||||
|
@Excel(name = "金额4")
|
||||||
|
private Long money4;
|
||||||
|
|
||||||
|
/** 金额2 */
|
||||||
|
@Excel(name = "金额5")
|
||||||
|
private Long money5;
|
||||||
|
|
||||||
|
|
||||||
|
/** 月份 */
|
||||||
|
@Excel(name = "月份")
|
||||||
|
private Long month;
|
||||||
|
|
||||||
|
/** 年份 */
|
||||||
|
@Excel(name = "年份")
|
||||||
|
private Long year;
|
||||||
|
|
||||||
|
/** 类型,字典project_cost_output_type */
|
||||||
|
@Excel(name = "类型,字典project_cost_output_type")
|
||||||
|
private Long costType;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Date date1;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Date date2;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Long isDel;
|
||||||
|
|
||||||
|
private String compName;
|
||||||
|
|
||||||
|
public Long getMoney3() {
|
||||||
|
return money3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoney3(Long money3) {
|
||||||
|
this.money3 = money3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMoney4() {
|
||||||
|
return money4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoney4(Long money4) {
|
||||||
|
this.money4 = money4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMoney5() {
|
||||||
|
return money5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoney5(Long money5) {
|
||||||
|
this.money5 = money5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompName() {
|
||||||
|
return compName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompName(String compName) {
|
||||||
|
this.compName = compName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectName() {
|
||||||
|
return projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectName(String projectName) {
|
||||||
|
this.projectName = projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setComId(Long comId)
|
||||||
|
{
|
||||||
|
this.comId = comId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getComId()
|
||||||
|
{
|
||||||
|
return comId;
|
||||||
|
}
|
||||||
|
public void setProjectId(Long projectId)
|
||||||
|
{
|
||||||
|
this.projectId = projectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getProjectId()
|
||||||
|
{
|
||||||
|
return projectId;
|
||||||
|
}
|
||||||
|
public void setMoney(Long money)
|
||||||
|
{
|
||||||
|
this.money = money;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMoney()
|
||||||
|
{
|
||||||
|
return money;
|
||||||
|
}
|
||||||
|
public void setMoney2(Long money2)
|
||||||
|
{
|
||||||
|
this.money2 = money2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMoney2()
|
||||||
|
{
|
||||||
|
return money2;
|
||||||
|
}
|
||||||
|
public void setMonth(Long month)
|
||||||
|
{
|
||||||
|
this.month = month;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonth()
|
||||||
|
{
|
||||||
|
return month;
|
||||||
|
}
|
||||||
|
public void setYear(Long year)
|
||||||
|
{
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getYear()
|
||||||
|
{
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
public void setCostType(Long costType)
|
||||||
|
{
|
||||||
|
this.costType = costType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCostType()
|
||||||
|
{
|
||||||
|
return costType;
|
||||||
|
}
|
||||||
|
public void setDate1(Date date1)
|
||||||
|
{
|
||||||
|
this.date1 = date1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDate1()
|
||||||
|
{
|
||||||
|
return date1;
|
||||||
|
}
|
||||||
|
public void setDate2(Date date2)
|
||||||
|
{
|
||||||
|
this.date2 = date2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDate2()
|
||||||
|
{
|
||||||
|
return date2;
|
||||||
|
}
|
||||||
|
public void setIsDel(Long isDel)
|
||||||
|
{
|
||||||
|
this.isDel = isDel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIsDel()
|
||||||
|
{
|
||||||
|
return isDel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("comId", getComId())
|
||||||
|
.append("projectId", getProjectId())
|
||||||
|
.append("money", getMoney())
|
||||||
|
.append("money2", getMoney2())
|
||||||
|
.append("month", getMonth())
|
||||||
|
.append("year", getYear())
|
||||||
|
.append("costType", getCostType())
|
||||||
|
.append("date1", getDate1())
|
||||||
|
.append("date2", getDate2())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("isDel", getIsDel())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.yanzhu.manage.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.yanzhu.manage.domain.ProCostOutput;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目成本产值Mapper接口
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-12-21
|
||||||
|
*/
|
||||||
|
public interface ProCostOutputMapper
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目成本产值
|
||||||
|
*
|
||||||
|
* @param id 项目成本产值主键
|
||||||
|
* @return 项目成本产值
|
||||||
|
*/
|
||||||
|
public ProCostOutput selectProCostOutputById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目成本产值列表
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 项目成本产值集合
|
||||||
|
*/
|
||||||
|
public List<ProCostOutput> selectProCostOutputList(ProCostOutput proCostOutput);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目成本产值
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertProCostOutput(ProCostOutput proCostOutput);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目成本产值
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateProCostOutput(ProCostOutput proCostOutput);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目成本产值
|
||||||
|
*
|
||||||
|
* @param id 项目成本产值主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProCostOutputById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除项目成本产值
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProCostOutputByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
public List<ProCostOutput> selectYearAndMonth(ProCostOutput where);
|
||||||
|
|
||||||
|
List<ProCostOutput> sumByDeptId(ProCostOutput where);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类汇总,用于大屏 【工程审批】【付款金额】
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ProCostOutput> sumForBsEnginAuditing(ProCostOutput where);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目付款明细,用于大屏【工程审批】【付款金额】
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ProCostOutput> selectForBigEnginList(ProCostOutput where);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目详情-项目分类汇总
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ProCostOutput> groupBYProject(ProCostOutput where);
|
||||||
|
}
|
|
@ -0,0 +1,380 @@
|
||||||
|
<?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.yanzhu.manage.mapper.ProCostOutputMapper">
|
||||||
|
|
||||||
|
<resultMap type="ProCostOutput" id="ProCostOutputResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="comId" column="com_id" />
|
||||||
|
<result property="projectId" column="project_id" />
|
||||||
|
<result property="money" column="money" />
|
||||||
|
<result property="money2" column="money2" />
|
||||||
|
<result property="money3" column="money3" />
|
||||||
|
<result property="money4" column="money4" />
|
||||||
|
<result property="money5" column="money5" />
|
||||||
|
<result property="month" column="month" />
|
||||||
|
<result property="year" column="year" />
|
||||||
|
<result property="costType" column="cost_type" />
|
||||||
|
<result property="date1" column="date1" />
|
||||||
|
<result property="date2" column="date2" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="isDel" column="is_del" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="compName" column="comp_name"/>
|
||||||
|
<result property="projectName" column="project_name"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectProCostOutputVo">
|
||||||
|
select po.id, po.com_id, po.project_id, po.money, po.money2,po.money3,po.money4,po.money5, po.month, po.year, po.cost_type, po.date1, po.date2,
|
||||||
|
po.remark, po.is_del, po.create_by, po.create_time, po.update_by, po.update_time,dp.`dept_name` comp_name,pi.`project_name`
|
||||||
|
from pro_cost_output po
|
||||||
|
LEFT JOIN sys_dept dp ON po.`com_id`=dp.`dept_id`
|
||||||
|
LEFT JOIN pro_project_info pi ON po.`project_id`=pi.`id`
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectProCostOutputList" parameterType="ProCostOutput" resultMap="ProCostOutputResult">
|
||||||
|
<include refid="selectProCostOutputVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="comId != null "> and po.com_id = #{comId}</if>
|
||||||
|
<if test="projectId != null "> and po.project_id = #{projectId}</if>
|
||||||
|
<if test="money != null "> and po.money = #{money}</if>
|
||||||
|
<if test="money2 != null "> and po.money2 = #{money2}</if>
|
||||||
|
<if test="money3 != null "> and po.money3 = #{money3}</if>
|
||||||
|
<if test="money4 != null "> and po.money4 = #{money4}</if>
|
||||||
|
<if test="money5 != null "> and po.money5 = #{money5}</if>
|
||||||
|
<if test="month != null "> and po.month = #{month}</if>
|
||||||
|
<if test="year != null "> and po.year = #{year}</if>
|
||||||
|
<if test="costType != null "> and po.cost_type = #{costType}</if>
|
||||||
|
<if test="date1 != null "> and po.date1 = #{date1}</if>
|
||||||
|
<if test="date2 != null "> and po.date2 = #{date2}</if>
|
||||||
|
<if test="isDel != null "> and po.is_del = #{isDel}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectProCostOutputById" parameterType="Long" resultMap="ProCostOutputResult">
|
||||||
|
<include refid="selectProCostOutputVo"/>
|
||||||
|
where po.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertProCostOutput" parameterType="ProCostOutput" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into pro_cost_output
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="comId != null">com_id,</if>
|
||||||
|
<if test="projectId != null">project_id,</if>
|
||||||
|
<if test="money != null">money,</if>
|
||||||
|
<if test="money2 != null">money2,</if>
|
||||||
|
<if test="money3 != null">money3,</if>
|
||||||
|
<if test="money4 != null">money4,</if>
|
||||||
|
<if test="money5 != null">money5,</if>
|
||||||
|
<if test="month != null">month,</if>
|
||||||
|
<if test="year != null">year,</if>
|
||||||
|
<if test="costType != null">cost_type,</if>
|
||||||
|
<if test="date1 != null">date1,</if>
|
||||||
|
<if test="date2 != null">date2,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="isDel != null">is_del,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="comId != null">#{comId},</if>
|
||||||
|
<if test="projectId != null">#{projectId},</if>
|
||||||
|
<if test="money != null">#{money},</if>
|
||||||
|
<if test="money2 != null">#{money2},</if>
|
||||||
|
<if test="money3 != null">#{money3},</if>
|
||||||
|
<if test="money4 != null">#{money4},</if>
|
||||||
|
<if test="money5 != null">#{money5},</if>
|
||||||
|
<if test="month != null">#{month},</if>
|
||||||
|
<if test="year != null">#{year},</if>
|
||||||
|
<if test="costType != null">#{costType},</if>
|
||||||
|
<if test="date1 != null">#{date1},</if>
|
||||||
|
<if test="date2 != null">#{date2},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="isDel != null">#{isDel},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateProCostOutput" parameterType="ProCostOutput">
|
||||||
|
update pro_cost_output
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="comId != null">com_id = #{comId},</if>
|
||||||
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||||||
|
<if test="money != null">money = #{money},</if>
|
||||||
|
<if test="money2 != null">money2 = #{money2},</if>
|
||||||
|
<if test="money3 != null">money3 = #{money3},</if>
|
||||||
|
<if test="money4 != null">money4 = #{money4},</if>
|
||||||
|
<if test="money5 != null">money5 = #{money5},</if>
|
||||||
|
<if test="month != null">month = #{month},</if>
|
||||||
|
<if test="year != null">year = #{year},</if>
|
||||||
|
<if test="costType != null">cost_type = #{costType},</if>
|
||||||
|
<if test="date1 != null">date1 = #{date1},</if>
|
||||||
|
<if test="date2 != null">date2 = #{date2},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="isDel != null">is_del = #{isDel},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteProCostOutputById" parameterType="Long">
|
||||||
|
delete from pro_cost_output where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteProCostOutputByIds" parameterType="String">
|
||||||
|
delete from pro_cost_output where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectYearAndMonth" parameterType="ProCostOutput" resultMap="ProCostOutputResult">
|
||||||
|
SELECT *
|
||||||
|
FROM pro_cost_output
|
||||||
|
WHERE project_id = #{projectId} and com_id=#{comId}
|
||||||
|
and (
|
||||||
|
(YEAR=#{year} AND cost_type=2) OR cost_type NOT IN (2, 9)
|
||||||
|
OR (cost_type = 9 AND YEAR = #{year} AND MONTH <= #{month})
|
||||||
|
OR (cost_type = 9 AND YEAR < #{year})
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="sumByDeptId" parameterType="ProCostOutput" resultMap="ProCostOutputResult">
|
||||||
|
|
||||||
|
SELECT 10 cost_type , SUM(money) money FROM pro_cost_output
|
||||||
|
WHERE cost_type=9 AND (YEAR <#{year} or ( Year =#{year} and MONTH <= #{month}))
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
SELECT 2 cost_type , SUM(money) money FROM pro_cost_output
|
||||||
|
WHERE (cost_type=9 AND YEAR=#{year} AND MONTH <= #{month} )
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
SELECT 9 cost_type , SUM(money) money FROM pro_cost_output
|
||||||
|
WHERE (cost_type=9 AND YEAR=#{year} AND MONTH= #{month} )
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="sumForBsEnginAuditing" parameterType="ProCostOutput" resultMap="ProCostOutputResult">
|
||||||
|
select 1 cost_type,sum(money) money,'合同总金额' remark
|
||||||
|
from pro_cost_output a
|
||||||
|
where a.cost_type=3
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
union
|
||||||
|
|
||||||
|
|
||||||
|
SELECT 2 cost_type,SUM(money) money,'建安费总金额' remark
|
||||||
|
FROM pro_cost_output a
|
||||||
|
WHERE a.cost_type=10
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
union
|
||||||
|
|
||||||
|
SELECT 3 cost_type,SUM(money2) money,'总计付款' remark
|
||||||
|
FROM pro_cost_output a
|
||||||
|
WHERE a.cost_type in (11,12)
|
||||||
|
<if test="createTime!=null "> and a.date1 >= #{createTime}</if>
|
||||||
|
<if test="updateTime!=null "> and a.date1 <= #{updateTime}</if>
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
union
|
||||||
|
|
||||||
|
SELECT 4 cost_type,SUM(money2) money,'进度款已支付' remark
|
||||||
|
FROM pro_cost_output a
|
||||||
|
WHERE a.cost_type in (11)
|
||||||
|
<if test="createTime!=null "> and a.date1 >= #{createTime}</if>
|
||||||
|
<if test="updateTime!=null "> and a.date1 <= #{updateTime}</if>
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
union
|
||||||
|
SELECT 5 cost_type,SUM(money2) money,'安措费已支付' remark
|
||||||
|
FROM pro_cost_output a
|
||||||
|
WHERE a.cost_type IN (12)
|
||||||
|
<if test="createTime!=null "> and a.date1 >= #{createTime}</if>
|
||||||
|
<if test="updateTime!=null "> and a.date1 <= #{updateTime}</if>
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
union
|
||||||
|
|
||||||
|
SELECT 6 cost_type,SUM(money-money2) money,'挂账总金额' remark
|
||||||
|
FROM pro_cost_output a
|
||||||
|
WHERE a.cost_type IN (11,12)
|
||||||
|
<if test="createTime!=null "> and a.date1 >= #{createTime}</if>
|
||||||
|
<if test="updateTime!=null "> and a.date1 <= #{updateTime}</if>
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
union
|
||||||
|
|
||||||
|
SELECT 7 cost_type,SUM(money3) money,'农民工专户支付金额(万元)' remark
|
||||||
|
FROM pro_cost_output a
|
||||||
|
WHERE a.cost_type in (11)
|
||||||
|
<if test="createTime!=null "> and a.date1 >= #{createTime}</if>
|
||||||
|
<if test="updateTime!=null "> and a.date1 <= #{updateTime}</if>
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="selectForBigEnginList" parameterType="ProCostOutput" resultMap="ProCostOutputResult">
|
||||||
|
SELECT a.id, a.project_id, a.money, a.year, a.month, a.cost_type,
|
||||||
|
CONCAT(sp.project_name,'(',sd.dept_name,')') remark, a.is_del,
|
||||||
|
a.create_by, a.create_time, a.update_by, a.update_time,a.money2,a.date1,a.date2,a.money3,a.money4,a.money5
|
||||||
|
FROM pro_cost_output a,pro_project_info sp,sys_dept sd
|
||||||
|
WHERE a.project_id=sp.id AND a.cost_type IN (11,12) AND a.com_id=dp.deptid
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and a.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="comId!=null and comId>0">
|
||||||
|
and a.com_id=#{comId}
|
||||||
|
</if>
|
||||||
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
and a.project_id in
|
||||||
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="createTime!=null "> and a.date1 >= #{createTime}</if>
|
||||||
|
<if test="updateTime!=null "> and a.date1 <= #{updateTime}</if>
|
||||||
|
ORDER BY a.create_time
|
||||||
|
</select>
|
||||||
|
<select id="groupBYProject" parameterType="ProCostOutput" resultMap="ProCostOutputResult">
|
||||||
|
select x.id,x.remark,x.money,y.money money2,x.month from (
|
||||||
|
select a.dict_value id, a.dict_label remark,sum(b.money) money,count(a.id) month ,'总投资' cost_type from ( SELECT a.id,c.dict_label,c.dict_value
|
||||||
|
FROM sur_project a,sys_dict_data c
|
||||||
|
where a.isDel=0
|
||||||
|
<if test="costType==1">
|
||||||
|
and a.projectType=c.dict_value and c.dict_type='project_category'
|
||||||
|
</if>
|
||||||
|
<if test="costType==2">
|
||||||
|
and a.projiectLevel=c.dict_value and c.dict_type='project_level'
|
||||||
|
</if>
|
||||||
|
<if test="id!=null and id>0"> and a.deptId = #{id}</if>
|
||||||
|
) a
|
||||||
|
left join (select project_id,money from sur_project_cost_output where cost_type=1) b on a.id=b.project_id
|
||||||
|
group by a.dict_value,a.dict_label ) x,
|
||||||
|
(
|
||||||
|
select a.dict_value id, a.dict_label remark,sum(b.money) money,count(a.id) month ,'年度' cost_type from (
|
||||||
|
SELECT a.id,c.dict_label,c.dict_value
|
||||||
|
FROM sur_project a,sys_dict_data c
|
||||||
|
where a.isDel=0
|
||||||
|
<if test="costType==1">
|
||||||
|
and a.projectType=c.dict_value and c.dict_type='project_category'
|
||||||
|
</if>
|
||||||
|
<if test="costType==2">
|
||||||
|
and a.projiectLevel=c.dict_value and c.dict_type='project_level'
|
||||||
|
</if>
|
||||||
|
<if test="id!=null and id>0"> and a.deptId = #{id}</if>
|
||||||
|
) a
|
||||||
|
left join (select project_id,money from sur_project_cost_output where cost_type=2 and year=#{year}) b on a.id=b.project_id
|
||||||
|
group by a.dict_value,a.dict_label
|
||||||
|
)y where x.id=y.id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -121,6 +121,9 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lowagie</groupId>
|
<groupId>com.lowagie</groupId>
|
||||||
<artifactId>iTextAsian</artifactId>
|
<artifactId>iTextAsian</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${pom.basedir}\libs\iTextAsian-1.0.0.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -138,6 +141,9 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aspose</groupId>
|
<groupId>com.aspose</groupId>
|
||||||
<artifactId>aspose-words</artifactId>
|
<artifactId>aspose-words</artifactId>
|
||||||
|
<version>15.8.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${pom.basedir}\libs\aspose-words-15.8.0-jdk16.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--word文件转化为PDF文件 结束-->
|
<!--word文件转化为PDF文件 结束-->
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
package com.yanzhu.manage.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.yanzhu.common.core.web.controller.BaseController;
|
||||||
|
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||||
|
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.yanzhu.common.log.annotation.Log;
|
||||||
|
import com.yanzhu.common.log.enums.BusinessType;
|
||||||
|
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.yanzhu.manage.domain.ProCostOutput;
|
||||||
|
import com.yanzhu.manage.service.IProCostOutputService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目成本产值Controller
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-12-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/costOutput")
|
||||||
|
public class ProCostOutputController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IProCostOutputService proCostOutputService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目成本产值列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:costOutput:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(ProCostOutput proCostOutput)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<ProCostOutput> list = proCostOutputService.selectProCostOutputList(proCostOutput);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出项目成本产值列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:costOutput:export")
|
||||||
|
@Log(title = "项目成本产值", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, ProCostOutput proCostOutput)
|
||||||
|
{
|
||||||
|
List<ProCostOutput> list = proCostOutputService.selectProCostOutputList(proCostOutput);
|
||||||
|
ExcelUtil<ProCostOutput> util = new ExcelUtil<ProCostOutput>(ProCostOutput.class);
|
||||||
|
util.exportExcel(response, list, "项目成本产值数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目成本产值详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:costOutput:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(proCostOutputService.selectProCostOutputById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目成本产值
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:costOutput:add")
|
||||||
|
@Log(title = "项目成本产值", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody ProCostOutput proCostOutput)
|
||||||
|
{
|
||||||
|
return toAjax(proCostOutputService.insertProCostOutput(proCostOutput));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目成本产值
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:costOutput:edit")
|
||||||
|
@Log(title = "项目成本产值", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody ProCostOutput proCostOutput)
|
||||||
|
{
|
||||||
|
return toAjax(proCostOutputService.updateProCostOutput(proCostOutput));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目成本产值
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:costOutput:remove")
|
||||||
|
@Log(title = "项目成本产值", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(proCostOutputService.deleteProCostOutputByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/selectYearAndMonth")
|
||||||
|
public AjaxResult selectYearAndMonth(@RequestBody ProCostOutput where){
|
||||||
|
List<ProCostOutput> list=proCostOutputService.selectYearAndMonth(where);
|
||||||
|
if(list.size()==0){
|
||||||
|
proCostOutputService.initProject(where.getProjectId(),where.getComId());
|
||||||
|
}
|
||||||
|
list=proCostOutputService.selectYearAndMonth(where);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/sumByDeptId")
|
||||||
|
public AjaxResult sumByDeptId(@RequestBody ProCostOutput where){
|
||||||
|
List<ProCostOutput> list=proCostOutputService.sumByDeptId(where);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类汇总,用于大屏 【工程审批】【付款金额】
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/sumForBsEnginAuditing")
|
||||||
|
public AjaxResult sumForBsEnginAuditing(@RequestBody ProCostOutput where){
|
||||||
|
Long deptId=where.getId();
|
||||||
|
List<ProCostOutput> list=proCostOutputService.sumForBsEnginAuditing(where);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目付款明细,用于大屏【工程审批】【付款金额】
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectForBigEnginList")
|
||||||
|
public AjaxResult selectForBigEnginList(@RequestBody ProCostOutput where){
|
||||||
|
Map<String,List<List<ProCostOutput>>> list=proCostOutputService.selectForBigEnginList(where);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.yanzhu.manage.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.yanzhu.manage.domain.ProCostOutput;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目成本产值Service接口
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-12-21
|
||||||
|
*/
|
||||||
|
public interface IProCostOutputService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询项目成本产值
|
||||||
|
*
|
||||||
|
* @param id 项目成本产值主键
|
||||||
|
* @return 项目成本产值
|
||||||
|
*/
|
||||||
|
public ProCostOutput selectProCostOutputById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目成本产值列表
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 项目成本产值集合
|
||||||
|
*/
|
||||||
|
public List<ProCostOutput> selectProCostOutputList(ProCostOutput proCostOutput);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目成本产值
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertProCostOutput(ProCostOutput proCostOutput);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目成本产值
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateProCostOutput(ProCostOutput proCostOutput);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除项目成本产值
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的项目成本产值主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProCostOutputByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目成本产值信息
|
||||||
|
*
|
||||||
|
* @param id 项目成本产值主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteProCostOutputById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目初始化
|
||||||
|
* @param projectId
|
||||||
|
*/
|
||||||
|
public void initProject(long projectId,long comId);
|
||||||
|
|
||||||
|
public void addYearInvestment(ProCostOutput where);
|
||||||
|
|
||||||
|
public void addMonthInvestment(ProCostOutput where);
|
||||||
|
|
||||||
|
public List<ProCostOutput> selectYearAndMonth(ProCostOutput where);
|
||||||
|
|
||||||
|
public List<ProCostOutput> sumByDeptId(ProCostOutput where);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量操作数据
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int batchUpdate(List<ProCostOutput> list);
|
||||||
|
/**
|
||||||
|
* 分类汇总,用于大屏 【工程审批】【付款金额】
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ProCostOutput> sumForBsEnginAuditing(ProCostOutput where);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目付款明细,用于大屏【工程审批】【付款金额】
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String,List<List<ProCostOutput>>> selectForBigEnginList(ProCostOutput where);
|
||||||
|
/**
|
||||||
|
* 项目详情-项目分类汇总
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ProCostOutput> groupBYProject(ProCostOutput where);
|
||||||
|
}
|
|
@ -0,0 +1,255 @@
|
||||||
|
package com.yanzhu.manage.service.impl;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||||
|
import com.yanzhu.common.core.utils.DateUtils;
|
||||||
|
import com.yanzhu.manage.domain.ProCostOutput;
|
||||||
|
import com.yanzhu.manage.mapper.ProCostOutputMapper;
|
||||||
|
import com.yanzhu.manage.service.IProCostOutputService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.actuate.web.mappings.MappingsEndpoint;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目成本产值Service业务层处理
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-12-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProCostOutputServiceImpl implements IProCostOutputService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ProCostOutputMapper proCostOutputMapper;
|
||||||
|
@Autowired
|
||||||
|
private MappingsEndpoint mappingsEndpoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目成本产值
|
||||||
|
*
|
||||||
|
* @param id 项目成本产值主键
|
||||||
|
* @return 项目成本产值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ProCostOutput selectProCostOutputById(Long id)
|
||||||
|
{
|
||||||
|
return proCostOutputMapper.selectProCostOutputById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目成本产值列表
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 项目成本产值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProCostOutput> selectProCostOutputList(ProCostOutput proCostOutput)
|
||||||
|
{
|
||||||
|
return proCostOutputMapper.selectProCostOutputList(proCostOutput);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目成本产值
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertProCostOutput(ProCostOutput proCostOutput)
|
||||||
|
{
|
||||||
|
proCostOutput.setCreateBy(SecurityContextHolder.getUserName());
|
||||||
|
proCostOutput.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return proCostOutputMapper.insertProCostOutput(proCostOutput);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目成本产值
|
||||||
|
*
|
||||||
|
* @param proCostOutput 项目成本产值
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateProCostOutput(ProCostOutput proCostOutput)
|
||||||
|
{
|
||||||
|
proCostOutput.setUpdateBy(SecurityContextHolder.getUserName());
|
||||||
|
proCostOutput.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return proCostOutputMapper.updateProCostOutput(proCostOutput);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除项目成本产值
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的项目成本产值主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteProCostOutputByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return proCostOutputMapper.deleteProCostOutputByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目成本产值信息
|
||||||
|
*
|
||||||
|
* @param id 项目成本产值主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteProCostOutputById(Long id)
|
||||||
|
{
|
||||||
|
return proCostOutputMapper.deleteProCostOutputById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initProject(long projectId,long comId) {
|
||||||
|
Calendar calendar=Calendar.getInstance();
|
||||||
|
int year=calendar.get(Calendar.YEAR);
|
||||||
|
ProCostOutput it=new ProCostOutput();
|
||||||
|
it.setProjectId(projectId);
|
||||||
|
it.setComId(comId);
|
||||||
|
it.setMoney(0l);
|
||||||
|
it.setRemark("");
|
||||||
|
it.setIsDel(0l);
|
||||||
|
it.setCostType(1l);//总投资
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(2l);//年度投资
|
||||||
|
it.setYear(year*1l);
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setYear(null);
|
||||||
|
it.setCostType(3l);//合同金额
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(4l);//合同支付金额
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(5l);//合同挂账金额
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(6l);//安措金额
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(7l);//安措支付金额
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(8l);//安措挂账金额
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(10l);//建安费金额
|
||||||
|
insertProCostOutput(it);
|
||||||
|
it.setCostType(9l);//月度投资
|
||||||
|
it.setYear(year*1l);
|
||||||
|
for(int i=1;i<=12;i++){
|
||||||
|
it.setMonth(i*1l);
|
||||||
|
insertProCostOutput(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addYearInvestment(ProCostOutput it) {
|
||||||
|
it.setMoney(0l);
|
||||||
|
it.setRemark("");
|
||||||
|
it.setIsDel(0l);
|
||||||
|
it.setCostType(2l);//年度投资
|
||||||
|
insertProCostOutput(it);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addMonthInvestment(ProCostOutput it) {
|
||||||
|
it.setMoney(0l);
|
||||||
|
it.setRemark("");
|
||||||
|
it.setIsDel(0l);
|
||||||
|
it.setCostType(9l);//月度投资
|
||||||
|
for(int i=1;i<=12;i++){
|
||||||
|
it.setMonth(i*1l);
|
||||||
|
insertProCostOutput(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProCostOutput> selectYearAndMonth(ProCostOutput where) {
|
||||||
|
return proCostOutputMapper.selectYearAndMonth(where);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProCostOutput> sumByDeptId(ProCostOutput where) {
|
||||||
|
return proCostOutputMapper.sumByDeptId(where);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchUpdate(List<ProCostOutput> list) {
|
||||||
|
ProCostOutput where=new ProCostOutput();
|
||||||
|
where.setProjectId(list.get(0).getProjectId());
|
||||||
|
where.setCostType(11l);//工程进度款支付
|
||||||
|
List<ProCostOutput> contractList=selectProCostOutputList(where);
|
||||||
|
where.setCostType(12l);//安措费支付明细
|
||||||
|
List<ProCostOutput> safetyList=selectProCostOutputList(where);
|
||||||
|
List<Long> contractIds=new ArrayList<>();
|
||||||
|
List<Long> safetyIds=new ArrayList<>();
|
||||||
|
for(ProCostOutput it:list){
|
||||||
|
if(it.getId()!=null){
|
||||||
|
updateProCostOutput(it);
|
||||||
|
if(it.getCostType().equals(11l)){
|
||||||
|
contractIds.add(it.getId());
|
||||||
|
}
|
||||||
|
if(it.getCostType().equals(12l)){
|
||||||
|
safetyIds.add(it.getId());
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
insertProCostOutput(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(ProCostOutput it :contractList){
|
||||||
|
if(!contractIds.contains(it.getId())){
|
||||||
|
deleteProCostOutputById(it.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(ProCostOutput it :safetyList){
|
||||||
|
if(!safetyIds.contains(it.getId())){
|
||||||
|
deleteProCostOutputById(it.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 分类汇总,用于大屏 【工程审批】【付款金额】
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProCostOutput> sumForBsEnginAuditing(ProCostOutput where) {
|
||||||
|
return proCostOutputMapper.sumForBsEnginAuditing(where);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<List<ProCostOutput>>> selectForBigEnginList(ProCostOutput where) {
|
||||||
|
List<ProCostOutput> list=proCostOutputMapper.selectForBigEnginList(where);
|
||||||
|
Map<String,List<List<ProCostOutput>>> map=new HashMap<>();
|
||||||
|
List<ProCostOutput> list11;//=new ArrayList<>();
|
||||||
|
List<ProCostOutput> list12;//=new ArrayList<>();
|
||||||
|
List<List<ProCostOutput>> plist;
|
||||||
|
for(ProCostOutput it:list){
|
||||||
|
String pname=it.getRemark();
|
||||||
|
if(!map.containsKey(pname)){
|
||||||
|
list12=new ArrayList<>();
|
||||||
|
list11=new ArrayList<>();
|
||||||
|
plist=new ArrayList<>();
|
||||||
|
plist.add(list12);
|
||||||
|
plist.add(list11);
|
||||||
|
map.put(pname,plist);
|
||||||
|
}
|
||||||
|
plist=map.get(pname);
|
||||||
|
list12=plist.get(0);
|
||||||
|
list11=plist.get(1);
|
||||||
|
if(it.getCostType().equals(12l)){
|
||||||
|
list12.add(it);
|
||||||
|
}else{
|
||||||
|
list11.add(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 项目详情-项目分类汇总
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProCostOutput> groupBYProject(ProCostOutput where) {
|
||||||
|
return proCostOutputMapper.groupBYProject(where);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询项目成本产值列表
|
||||||
|
export function listCostOutput(query) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/costOutput/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询项目成本产值详细
|
||||||
|
export function getCostOutput(id) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/costOutput/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增项目成本产值
|
||||||
|
export function addCostOutput(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/costOutput',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改项目成本产值
|
||||||
|
export function updateCostOutput(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/costOutput',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除项目成本产值
|
||||||
|
export function delCostOutput(id) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/costOutput/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,369 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="部门ID" prop="comId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.comId"
|
||||||
|
placeholder="请输入部门ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目编号" prop="projectId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectId"
|
||||||
|
placeholder="请输入项目编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="金额" prop="money">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.money"
|
||||||
|
placeholder="请输入金额"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="金额2" prop="money2">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.money2"
|
||||||
|
placeholder="请输入金额2"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="月份" prop="month">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.month"
|
||||||
|
placeholder="请输入月份"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="年份" prop="year">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.year"
|
||||||
|
placeholder="请输入年份"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="date1">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.date1"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择${comment}">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="date2">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.date2"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择${comment}">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="isDel">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.isDel"
|
||||||
|
placeholder="请输入${comment}"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['manage:costOutput:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['manage:costOutput:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['manage:costOutput:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['manage:costOutput:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="costOutputList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="${comment}" align="center" prop="id" />
|
||||||
|
<el-table-column label="部门ID" align="center" prop="comId" />
|
||||||
|
<el-table-column label="项目编号" align="center" prop="projectId" />
|
||||||
|
<el-table-column label="金额" align="center" prop="money" />
|
||||||
|
<el-table-column label="金额2" align="center" prop="money2" />
|
||||||
|
<el-table-column label="月份" align="center" prop="month" />
|
||||||
|
<el-table-column label="年份" align="center" prop="year" />
|
||||||
|
<el-table-column label="类型,字典project_cost_output_type" align="center" prop="costType" />
|
||||||
|
<el-table-column label="${comment}" align="center" prop="date1" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.date1, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="${comment}" align="center" prop="date2" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.date2, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:costOutput:edit']">修改</el-button>
|
||||||
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:costOutput:remove']">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改项目成本产值对话框 -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="costOutputRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="部门ID" prop="comId">
|
||||||
|
<el-input v-model="form.comId" placeholder="请输入部门ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目编号" prop="projectId">
|
||||||
|
<el-input v-model="form.projectId" placeholder="请输入项目编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="金额" prop="money">
|
||||||
|
<el-input v-model="form.money" placeholder="请输入金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="金额2" prop="money2">
|
||||||
|
<el-input v-model="form.money2" placeholder="请输入金额2" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="月份" prop="month">
|
||||||
|
<el-input v-model="form.month" placeholder="请输入月份" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="年份" prop="year">
|
||||||
|
<el-input v-model="form.year" placeholder="请输入年份" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="date1">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.date1"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择${comment}">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="date2">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.date2"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择${comment}">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="isDel">
|
||||||
|
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="CostOutput">
|
||||||
|
import { listCostOutput, getCostOutput, delCostOutput, addCostOutput, updateCostOutput } from "@/api/manage/costOutput";
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
|
const costOutputList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
comId: null,
|
||||||
|
projectId: null,
|
||||||
|
money: null,
|
||||||
|
money2: null,
|
||||||
|
month: null,
|
||||||
|
year: null,
|
||||||
|
costType: null,
|
||||||
|
date1: null,
|
||||||
|
date2: null,
|
||||||
|
isDel: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询项目成本产值列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listCostOutput(queryParams.value).then(response => {
|
||||||
|
costOutputList.value = response.rows;
|
||||||
|
total.value = response.total;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单重置
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
id: null,
|
||||||
|
comId: null,
|
||||||
|
projectId: null,
|
||||||
|
money: null,
|
||||||
|
money2: null,
|
||||||
|
month: null,
|
||||||
|
year: null,
|
||||||
|
costType: null,
|
||||||
|
date1: null,
|
||||||
|
date2: null,
|
||||||
|
remark: null,
|
||||||
|
isDel: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
proxy.resetForm("costOutputRef");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选框选中数据
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map(item => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加项目成本产值";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const _id = row.id || ids.value
|
||||||
|
getCostOutput(_id).then(response => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改项目成本产值";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["costOutputRef"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != null) {
|
||||||
|
updateCostOutput(form.value).then(response => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addCostOutput(form.value).then(response => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const _ids = row.id || ids.value;
|
||||||
|
proxy.$modal.confirm('是否确认删除项目成本产值编号为"' + _ids + '"的数据项?').then(function() {
|
||||||
|
return delCostOutput(_ids);
|
||||||
|
}).then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {
|
||||||
|
proxy.download('manage/costOutput/export', {
|
||||||
|
...queryParams.value
|
||||||
|
}, `costOutput_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
|
||||||
|
getList();
|
||||||
|
</script>
|
|
@ -115,7 +115,7 @@
|
||||||
|
|
||||||
<!-- 添加或修改项目信息对话框 -->
|
<!-- 添加或修改项目信息对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="1080px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" class="project-info-edit-dlg">
|
<el-dialog :title="title" v-model="open" width="1080px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" class="project-info-edit-dlg">
|
||||||
<el-form ref="proProjectInfoRef" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="proProjectInfoRef" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-tabs
|
<el-tabs
|
||||||
v-model="activeTags"
|
v-model="activeTags"
|
||||||
type="card"
|
type="card"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||||
<el-form-item label="项目名称" prop="projectName">
|
<el-form-item label="项目名称" prop="projectName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.projectName"
|
v-model="queryParams.projectName"
|
||||||
|
|
Loading…
Reference in New Issue