Commit e7c7ad27 authored by litengwei's avatar litengwei

签打BUG修复

parent 1f57cfac
......@@ -93,4 +93,9 @@ public class SignDto extends BaseDto {
@ExcelProperty(value = "打卡类型", index = 3)
@ApiModelProperty(value = "打卡类型")
private String type;
@ExcelIgnore
@ApiModelProperty(value = "当日驻站消防队总人数(可变)")
private String personOfDay;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -37,5 +38,6 @@ public class SinStaticDto {
@ApiModelProperty(value = "结束时间")
private String dateLESS;
@ApiModelProperty(value = "当日驻站消防队总人数(可变)")
private String personOfDay;
}
......@@ -100,4 +100,10 @@ public class Sign extends BaseEntity {
@TableField("org_code")
private String orgCode;
/**
* 当日驻站消防队总人数(可变)
*/
@TableField("person_of_day")
private String personOfDay;
}
......@@ -44,13 +44,15 @@
</select>
<select id="queryStaticForPage" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.SinStaticDto">
select date,count(name) signNum,bizOrgName,bizOrgCode,personOfDay from (
SELECT
date,
count(sequence_nbr) signNum,
biz_org_name bizOrgName,
biz_org_code bizOrgCode
DISTINCT name,
date,
biz_org_Name bizOrgName,
biz_org_code bizOrgCode,
person_of_day personOfDay
FROM
cb_sign sign
cb_sign sign
<where>
<if test="dto.dateBIGGER!=null and dto.dateBIGGER!=''">
and sign.sign_time >= #{dto.dateBIGGER}
......@@ -65,8 +67,13 @@
and sign.biz_org_Name like CONCAT(#{dto.bizOrgName},'%')
</if>
</where>
group by date,biz_org_code
order by sign.rec_date desc
group by
date,
biz_org_code,
name
order by
sign.sign_time desc
) s group by date,bizOrgCode
</select>
<select id="queryPersonNum" resultType="java.lang.Integer">
select count(*) from cb_firefighters where fire_team_id in (
......
......@@ -48,19 +48,20 @@ public class SignServiceImpl extends BaseService<SignDto,Sign,SignMapper> implem
numberFormat.setMaximumFractionDigits(2);
sinStaticDtoIPage.getRecords().stream().forEach(e->{
int num = this.baseMapper.queryPersonNum(e.getBizOrgCode());
int signNum ;
if((Integer.parseInt(e.getSignNum()) & 1) != 0) {
signNum = (Integer.parseInt(e.getSignNum()) + 1) / 2;
} else {
signNum = (Integer.parseInt(e.getSignNum())) / 2;
}
// int num = this.baseMapper.queryPersonNum(e.getBizOrgCode());
// int signNum ;
// if((Integer.parseInt(e.getSignNum()) & 1) != 0) {
// signNum = (Integer.parseInt(e.getSignNum()) + 1) / 2;
// } else {
// signNum = (Integer.parseInt(e.getSignNum())) / 2;
// }
if(num != 0) {
e.setAttendance(numberFormat.format((float) Integer.valueOf(signNum)/(float) num * 100) + "%");
} else {
e.setAttendance("0%");
}
// if(num != 0) {
// e.setAttendance(numberFormat.format((float) Integer.valueOf(signNum)/(float) num * 100) + "%");
// } else {
// e.setAttendance("0%");
// }
e.setAttendance(e.getSignNum() + "/" + e.getPersonOfDay());
});
return sinStaticDtoIPage;
......@@ -98,7 +99,9 @@ public class SignServiceImpl extends BaseService<SignDto,Sign,SignMapper> implem
@Override
public Boolean saveSign(SignDto dot) {
Sign sign = new Sign();
int num = this.baseMapper.queryPersonNum(dot.getBizOrgCode());
Bean.copyExistPropertis(dot,sign);
sign.setPersonOfDay(String.valueOf(num));
return this.save(sign);
}
}
\ No newline at end of file
......@@ -3359,6 +3359,18 @@
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='打卡记录';
</sql>
</changeSet>
<changeSet author="ltw" id="20220902-ltw-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_sign" columnName="person_of_day"/>
</not>
</preConditions>
<comment>modify table cb_sign add columns</comment>
<sql>
ALTER TABLE `cb_sign`
ADD person_of_day varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '当日驻站消防队总人数(可变)';
</sql>
</changeSet>
</databaseChangeLog>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment