Commit e7c7ad27 authored by litengwei's avatar litengwei

签打BUG修复

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