二期修改
This commit is contained in:
parent
5016194652
commit
d0f725f02f
|
|
@ -33,7 +33,7 @@ public interface PmWorkerExitMapper {
|
|||
* @param einStatus
|
||||
* @return
|
||||
*/
|
||||
int updateEinProRecordStatus(@Param("id") Integer id,@Param("einStatus") Integer einStatus,@Param("isUploadFile") Integer isUploadFile,@Param("exitWay") String exitWay);
|
||||
int updateEinProRecordStatus(@Param("id") Integer id,@Param("einStatus") Integer einStatus,@Param("isUploadFile") Integer isUploadFile,@Param("exitWay") String exitWay,@Param("isLast") String isLast);
|
||||
|
||||
List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o);
|
||||
|
||||
|
|
@ -42,4 +42,6 @@ public interface PmWorkerExitMapper {
|
|||
String getIdNumberByWorkerId(Integer workerId);
|
||||
|
||||
Boolean getProLocationByProId(Integer proId);
|
||||
|
||||
int getEinProNum(Integer workerId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,7 +228,8 @@ public class AppServiceImpl implements AppService {
|
|||
if(isShangHai == null || !isShangHai){
|
||||
int m = contractMapper.deleteByWorkerId(record.getWorkerId());
|
||||
}
|
||||
|
||||
//查询是不是上海内最后一个在场工程(一定要放在删除实时在场前查)
|
||||
int number = pmWorkerExitMapper.getEinProNum(record.getWorkerId());
|
||||
//删除实时在场
|
||||
int n = pmWorkerExitMapper.deleteEinMsgByWorkerId(record.getWorkerId(),record.getProId());
|
||||
//修改在场记录表状态
|
||||
|
|
@ -243,7 +244,11 @@ public class AppServiceImpl implements AppService {
|
|||
}
|
||||
isUploadFile = 1;
|
||||
}
|
||||
int k = pmWorkerExitMapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay());
|
||||
String isLast = "";
|
||||
if(Boolean.TRUE.equals(isShangHai) && number > 1){
|
||||
isLast = "0";
|
||||
}
|
||||
int k = pmWorkerExitMapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay(),isLast);
|
||||
if(k==1){
|
||||
urkSendService.delUserByDevice(record.getWorkerId(),record.getProId(),record.getSubId(), record.getTeamId());
|
||||
//删除app人脸
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
//上海外删除合同
|
||||
int i = contractService.deleteByWorkerId(record.getWorkerId());
|
||||
}
|
||||
//查询是不是上海内最后一个在场工程(一定要放在删除实时在场前查)
|
||||
int number = mapper.getEinProNum(record.getWorkerId());
|
||||
//删除实时在场
|
||||
int n = mapper.deleteEinMsgByWorkerId(record.getWorkerId(), record.getProId());
|
||||
//修改在场记录表状态
|
||||
|
|
@ -83,7 +85,11 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
isUploadFile = 1;
|
||||
}
|
||||
|
||||
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay());
|
||||
String isLast = "";
|
||||
if(Boolean.TRUE.equals(isShangHai) && number > 1){
|
||||
isLast = "0";
|
||||
}
|
||||
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay(),isLast);
|
||||
if(k==1){
|
||||
try {
|
||||
urkSendService.delUserByDevice(record.getWorkerId(),record.getProId(),record.getSubId(),record.getTeamId());
|
||||
|
|
@ -128,12 +134,18 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
//上海外删除合同
|
||||
int i = contractService.deleteByWorkerId(bean.getWorkerId());
|
||||
}
|
||||
//查询是不是上海内最后一个在场工程(一定要放在删除实时在场前查)
|
||||
int number = mapper.getEinProNum(bean.getWorkerId());
|
||||
//删除实时在场
|
||||
int j = mapper.deleteEinMsgByWorkerId(bean.getWorkerId(),bean.getProId());
|
||||
int einStatus = 2;
|
||||
//是否上传文件
|
||||
int isUploadFile = 0;
|
||||
int k = mapper.updateEinProRecordStatus(bean.getId(), einStatus, isUploadFile, bean.getExitWay());
|
||||
String isLast = "";
|
||||
if(Boolean.TRUE.equals(isShangHai) && number > 1){
|
||||
isLast = "0";
|
||||
}
|
||||
int k = mapper.updateEinProRecordStatus(bean.getId(), einStatus, isUploadFile, bean.getExitWay(),isLast);
|
||||
if (k == 1) {
|
||||
userId.add(bean.getWorkerId());
|
||||
proId.add(bean.getProId());
|
||||
|
|
@ -185,7 +197,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
int einStatus = 0;
|
||||
//是否上传文件
|
||||
int isUploadFile = 1;
|
||||
int k = mapper.updateEinProRecordStatus(o.getId(),einStatus,isUploadFile,o.getExitWay());
|
||||
int k = mapper.updateEinProRecordStatus(o.getId(),einStatus,isUploadFile,o.getExitWay(),"");
|
||||
return !uploadFileVos.isEmpty() ?1:0;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -106,6 +106,9 @@
|
|||
, ein_status = #{einStatus}
|
||||
, exit_time = NOW()
|
||||
</if>
|
||||
<if test="isLast != null and isLast != '' ">
|
||||
, is_last = #{isLast}
|
||||
</if>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
|
@ -158,4 +161,12 @@
|
|||
FROM
|
||||
`pm_project` where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getEinProNum" resultType="int">
|
||||
SELECT
|
||||
count(1)
|
||||
FROM
|
||||
`bm_worker_ein_msg`
|
||||
where is_active = 1 and worker_id = #{workerId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@
|
|||
FROM
|
||||
pm_worker pw
|
||||
LEFT JOIN bm_worker_ein_msg bmew ON pw.id = bmew.worker_id
|
||||
LEFT JOIN pm_project pp ON pp.id = bmew.worker_id
|
||||
LEFT JOIN pm_project pp ON pp.id = bmew.pro_id
|
||||
WHERE
|
||||
id_number = #{idNumber} and pw.is_active = 1
|
||||
limit 1
|
||||
|
|
@ -321,6 +321,7 @@
|
|||
SELECT
|
||||
pw.id,
|
||||
pw.`name`,
|
||||
pw.id_number,
|
||||
pw.phone,
|
||||
bmew.post_name,
|
||||
bmew.pro_name,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
<select id="selectPro" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
|
||||
select
|
||||
distinct
|
||||
pp.id,
|
||||
pp.pro_name as `name`
|
||||
from pm_project pp
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
inner join bm_sub_contract bsc on pp.id = bsc.pro_id and bsc.sub_ein_status = 1 and bsc.is_active = 1
|
||||
</if>
|
||||
<if test="workerId != null">
|
||||
inner join bm_worker_ein_msg bwem on pp.id = bwem.pro_id and bwem.is_active = 1 and bwem.worker_id = #{workerId}
|
||||
Left join bm_worker_ein_msg bwem on pp.id = bwem.pro_id and bwem.is_active = 1 and bwem.worker_id = #{workerId}
|
||||
</if>
|
||||
<where>
|
||||
pp.is_active = 1
|
||||
|
|
@ -23,12 +24,14 @@
|
|||
</if>
|
||||
<if test="workerId != null">
|
||||
and bwem.pro_id is null
|
||||
and pp.is_shanghai = 1
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSub" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
|
||||
select
|
||||
distinct
|
||||
ps.id,
|
||||
ps.sub_name as `name`
|
||||
from pm_sub ps
|
||||
|
|
@ -46,6 +49,7 @@
|
|||
|
||||
<select id="selectTeam" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
|
||||
select
|
||||
distinct
|
||||
pst.id,
|
||||
pst.team_name as `name`
|
||||
from pm_sub_team pst
|
||||
|
|
|
|||
|
|
@ -83,10 +83,10 @@
|
|||
dev_model devModel,on_line onLine
|
||||
from pm_att_device
|
||||
where pro_id=#{proId} and is_active=1
|
||||
<if test='supId!=null and supId!=0 AND supId!="0"'>
|
||||
<if test='supId!=null and supId!=0 and supId!="0"'>
|
||||
and sub_id=#{supId}
|
||||
</if>
|
||||
<if test='teamId!=null and teamId!=0 AND teamId!="0"'>
|
||||
<if test='teamId!=null and teamId!=0 and teamId!="0"'>
|
||||
and team_id=#{teamId}
|
||||
</if>
|
||||
|
||||
|
|
|
|||
|
|
@ -39,14 +39,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bm_worker_ein_pro_record bwepr
|
||||
LEFT JOIN pm_worker pw ON pw.id = bwepr.worker_id
|
||||
WHERE #{currentDay} BETWEEN DATE_FORMAT(bwepr.ein_time, '%Y-%m-%d') AND
|
||||
DATE_FORMAT(IFNULL(bwepr.exit_time, NOW()), '%Y-%m-%d')
|
||||
DATE_FORMAT(IFNULL(bwepr.exit_time, NOW()), '%Y-%m-%d') and bwepr.is_active = 0
|
||||
ORDER BY
|
||||
bwepr.worker_id,
|
||||
bwepr.ein_time DESC
|
||||
LIMIT 10000000
|
||||
) aa
|
||||
GROUP BY
|
||||
aa.worker_id
|
||||
</select>
|
||||
|
||||
<insert id="insertEinDayRecord">
|
||||
|
|
|
|||
Loading…
Reference in New Issue