update code

dev
lijun 2024-09-24 23:09:17 +08:00
parent 4bb2097e5c
commit 9c1d0b36cf
5 changed files with 148 additions and 23 deletions

View File

@ -49,12 +49,12 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://62.234.3.186:3306/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
#url: jdbc:mysql://62.234.3.186:3306/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: Sxyanzhu@cf123
#url: jdbc:mysql://192.168.126.19:3306/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
#password: Sxyanzhu@cf123
url: jdbc:mysql://192.168.126.19:3306/yanzhu_jh_test2024?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
#username: root
#password: hadoopspring123
password: hadoopspring123
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -11,16 +11,16 @@
</el-col>
</el-row>
<div style="padding: 10px; border:solid 1px #ccc;border-radius: 4px;margin-top:4px;max-height: calc(100vh - 360px);overflow-y: auto;"
class="scroll data-list">
class="scroll data-list" :class="costType==11?'is-contract':''">
<el-tabs type="border-card" v-model="tabName">
<el-tab-pane :label="dept.deptName" :name="'d' + dept.deptId" v-for="(dept, index) in depts"
:key="dept.deptId">
<el-row v-for="(it, idx) in dept['dataList' + costType]" :key="idx" class="datalist-row"
:class="'row-' + idx % 2 + (it.isErr ? ' is-error' : '')">
<el-col :span="2">
<el-col :span="costType==11?1:2">
{{ idx + 1 }}
</el-col>
<el-col :span="5">
<el-col :span="costType==11?4:5">
<el-form-item label="申请金额">
<el-input-number style="width: 130px;" :precision="4" @input="chkRowData(it)"
v-model="it.money" :class="it.money > 0 ? '' : 'txt-error'" placeholder="申请金额">
@ -28,14 +28,14 @@
<span class="sp-unit">万元</span>
</el-form-item>
</el-col>
<el-col :span="5">
<el-col :span="costType==11?4:5">
<el-form-item label="申请日期">
<el-date-picker style="width: 140px;" v-model="it.date1" type="date" placeholder="申请日期"
:class="it.date1 ? '' : ' txt-error'" @input="chkRowData(it)">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-col :span="costType==11?4:5">
<el-form-item label="支付金额">
<el-input-number style="width: 130px;" :precision="4" @input="chkRowData(it)"
v-model="it.money2" placeholder="支付金额">
@ -43,15 +43,24 @@
<span class="sp-unit">万元</span>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="挂账金额" :class="it.money3 < 0 ? 'txt-error' : 'is-ok'">
<el-input-number style="width: 130px;" :precision="4" v-model="it.money3" disabled
<el-col :span="costType==11?4:5">
<el-form-item label="挂账金额" :class="it.moneyTotal < 0 ? 'txt-error' : 'is-ok'">
<el-input-number style="width: 130px;" :precision="4" v-model="it.moneyTotal" disabled
placeholder="挂账金额">
</el-input-number>
<span class="sp-unit">万元</span>
</el-form-item>
</el-col>
<el-col :span="2">
<el-col :span="6" class="lbl160" v-if="costType==11">
<el-form-item label="含农民工专户支付金额" :class="it.money3 > it.money2 ? 'txt-error' : 'is-ok'">
<el-input-number style="width: 100px;" :precision="4" v-model="it.money3"
placeholder="民工支付金额">
</el-input-number>
<span class="sp-unit">万元</span>
<span class="err-msg">不能超过支付金额</span>
</el-form-item>
</el-col>
<el-col :span="costType==11?1:2">
<el-button style="margin-left: 12px;" size="mini" @click="doDelete(it, idx,dept)">删除</el-button>
</el-col>
</el-row>
@ -86,7 +95,7 @@ export default {
});
},
chkRowData(row) {
row.money3 = row.money * 1 - row.money2 * 1;
row.moneyTotal = row.money * 1 - row.money2 * 1;
row.isErr = (row.money * 1 + row.money2 * 1) == 0 || !row.date1;
this.$emit("change", this.depts);
},
@ -98,7 +107,8 @@ export default {
costType: this.costType,
money: '',
money2: '',
money3: '',
moneyTotal: '',
money3:'',
projectId: this.prj.id,
deptId: +deptId,
date1: undefined,
@ -157,11 +167,18 @@ export default {
this.$message.error("金额不能为负数!");
return false;
}
flag1 = datas.filter(d => d.money3 * 1 < 0).length == 0;
flag1 = datas.filter(d => d.moneyTotal * 1 < 0).length == 0;
if (!flag1) {
this.$message.error("挂账金额不能为负数!");
return false;
}
if(this.costType==11){
flag1=datas.filter(d => d.money3 * 1 >d.money2*1).length == 0;
if (!flag1) {
this.$message.error("含农民工专户支付金额不能超过支付金额!");
return false;
}
}
return true;
},
checkData() {
@ -185,8 +202,42 @@ export default {
</script>
<style lang="scss">
.cost-contract {
.data-list {
&.is-contract{
.el-form-item__label{
width:60px !important;
}
.el-form-item__content{
margin-left:60px !important;
}
.el-input-number{
width:120px !important;
}
.sp-unit{
margin-left: 4px !important;
}
.lbl160{
.el-form-item__label{
width:160px !important;
}
.err-msg{
display: none;
}
.txt-error{
position: relative;
.err-msg{
display: inline-block;
position: absolute;
bottom: -22px;
white-space: nowrap;
right: 60px;
font-size: 12px;
color: red;
z-index: 10;
}
}
}
}
.datalist-row {
* {
font-size: 12px;
@ -195,9 +246,11 @@ export default {
.el-row {
line-height: 36px;
line-height: 50px;
padding: 0px 10px;
display: flex;
align-items: center;
&.row-1 {
background-color: #eeeeee;
}

View File

@ -116,7 +116,8 @@ export default {
form: {
totalInv: null,//
contract1: null,//
contract2: null,//
contract2: null,//
contract3: null,//
safety1: null,//
safety2: null,//
safety3: null,//
@ -194,6 +195,7 @@ export default {
let obj = { ...it };
obj.money = obj.money ? obj.money * 10000 : 0;
obj.money2 = obj.money2 ? obj.money2 * 10000 : 0;
obj.money3 = obj.money3 ? obj.money3 * 10000 : 0;
obj.date1 = this.$dt(obj.date1).format("YYYY-MM-DD");
return obj;
});
@ -223,7 +225,8 @@ export default {
let tmps = (d.data || []).map(it => {
it.money = it.money ? it.money / 10000.0 : 0;
it.money2 = it.money2 ? it.money2 / 10000.0 : 0;
it.money3 = it.money - it.money2;
it.moneyTotal = it.money - it.money2;
it.money3 = it.money3 ? it.money3 / 10000.0 : 0;
it.isErr = false;
it.date1 = this.$dt(it.date1)
return it;

View File

@ -68,6 +68,39 @@ public class SurProjectCostOutput extends BaseEntity
@Excel(name = "金额2")
private Long money2;
@Excel(name = "金额3")
private Long money3;
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;
}
@Excel(name = "金额4")
private Long money4;
@Excel(name = "金额5")
private Long money5;
/** 日期1 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期1", width = 30, dateFormat = "yyyy-MM-dd")

View File

@ -18,13 +18,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="money2" column="money2" />
<result property="money3" column="money3" />
<result property="money4" column="money4" />
<result property="money5" column="money5" />
<result property="date1" column="date1" />
<result property="date2" column="date2" />
<result property="deptId" column="deptId"/>
</resultMap>
<sql id="selectSurProjectCostOutputVo">
select id, project_id, money, year, month, cost_type, remark, is_del, create_by, create_time, update_by, update_time,money2,date1,date2,deptId from sur_project_cost_output
select id, project_id, money, year, month, cost_type, remark, is_del, create_by, create_time, update_by, update_time,money2,money3,money4,money5,date1,date2,deptId from sur_project_cost_output
</sql>
<select id="selectSurProjectCostOutputList" parameterType="SurProjectCostOutput" resultMap="SurProjectCostOutputResult">
@ -38,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="costType != null "> and cost_type = #{costType}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<if test="money2 != null "> and money2 = #{money2}</if>
<if test="money3 != null "> and money3 = #{money3}</if>
<if test="money4 != null "> and money4 = #{money4}</if>
<if test="money5 != null "> and money5 = #{money5}</if>
<if test="date1 != null "> and date1 = #{date1}</if>
<if test="date2 != null "> and date2 = #{date2}</if>
</where>
@ -63,6 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</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="date1 != null">date1,</if>
<if test="date2 != null">date2,</if>
<if test="deptId != null">deptId,</if>
@ -80,6 +89,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</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="date1 != null">#{date1},</if>
<if test="date2 != null">#{date2},</if>
<if test="deptId != null">#{deptId},</if>
@ -101,6 +113,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</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="date1 != null">date1 = #{date1},</if>
<if test="date2 != null">date2 = #{date2},</if>
<if test="deptId != null">deptId = #{deptId},</if>
@ -283,9 +298,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
union
SELECT 7 cost_type,SUM(money3) money,'农民工专户支付金额(万元)' remark
FROM sur_project_cost_output a,sur_project sp
WHERE a.project_id=sp.id AND a.cost_type in (11)
and sp.isDel=0
<if test="createTime!=null "> and a.date1 &gt;= #{createTime}</if>
<if test="updateTime!=null "> and a.date1 &lt;= #{updateTime}</if>
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</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="SurProjectCostOutput" resultMap="SurProjectCostOutputResult">
SELECT a.id, a.project_id, a.money, a.year, a.month, a.cost_type, CONCAT(sp.projectName,'(',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
SELECT a.id, a.project_id, a.money, a.year, a.month, a.cost_type, CONCAT(sp.projectName,'(',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 sur_project_cost_output a,sur_project sp,sys_dept sd
WHERE a.project_id=sp.id AND a.cost_type IN (11,12) AND sd.dept_id=a.deptid
and sp.isDel=0