Commit 547dd23f by 龙于生

Merge remote-tracking branch 'origin/develop' into develop

parents fcd2b395 fde44c57
......@@ -218,6 +218,11 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@Transient
@TableField(exist = false)
private String error;//错误信息提示
@Transient
@TableField(exist = false)
@ApiModelProperty(value="员工登陆账号(手机号)",example="员工登陆账号(手机号)")
private String empLoginPhone;
......
......@@ -208,9 +208,13 @@ public class YgglController {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum));
Date rz = ygglMainEmp.getRzTime();
QyzxEmpLogin login = QyzxEmpLogin.builder().build().selectOne(new QueryWrapper<QyzxEmpLogin>().select("phone").eq("id", empNum));
if (rz != null) {
ygglMainEmp.setWorkTime(DateUtil.formatBetween(ygglMainEmp.getRzTime(), new Date(), Level.DAY));
}
if (!StringUtils.isEmpty(login) && !StringUtils.isEmpty(login.getPhone())) {
ygglMainEmp.setEmpLoginPhone(login.getPhone());
}
return ResultUtil.data(ygglMainEmp);
}
......@@ -424,6 +428,18 @@ public class YgglController {
&& !DateFormatUtils.getCompareDate(ygglMainEmp.getRzTime(), ygglMainEmp.getZzTime())) {
return ResultUtil.error("入职日期 不可以大于 转正日期");
}
//修改 员工登陆账号 检测账号是否重复
if(!StringUtils.isEmpty(ygglMainEmp.getEmpLoginPhone())){
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(ygglMainEmp.getEmpLoginPhone()), QyzxEmpLogin::getPhone, ygglMainEmp.getEmpLoginPhone()).one();
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getPhone, ygglMainEmp.getEmpLoginPhone())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if(StringUtils.isEmpty(login) && StringUtils.isEmpty(emp)){
QyzxEmpLogin.builder().phone(ygglMainEmp.getEmpLoginPhone()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId,ygglMainEmp.getEmpNum()));
}else{
return ResultUtil.error("该号码已存在,请更换员工登陆账号");
}
}
if (ygglMainEmp.getEmpNum() != null) {
ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda()
......
......@@ -16,6 +16,7 @@ public class DailyDetailsDto {
private String name;// 姓名
private Integer num;// 工号
private String customNum;// 工号
private String dept;// 部门
private String post;// 岗位
private Integer orgcode;// 岗位
......
package cn.timer.api.service;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqgl.PunchRecord;
import java.util.List;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/11/12
*/
public interface KqglAssoDkjlService{
/**
* 打卡记录修改批处理
* @param entityList
* @return
*/
void updateKqglAssoDkjlById(List<PunchRecord> entityList);
/**
* 打卡明细修改批处理
* @param entityList
* @return
*/
void updateKqglAssoDkmxById(List<PunchCardDetails> entityList);
}
package cn.timer.api.service.impl;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqgl.PunchRecord;
import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
import cn.timer.api.dao.kqgl.PunchRecordMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkjlMapper;
import cn.timer.api.service.KqglAssoDkjlService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.List;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/11/12
*/
@Slf4j
@Service
public class KqglAssoDkjlServiceImpl implements KqglAssoDkjlService {
@Autowired
private SqlSessionFactory sqlSessionFactory;
@Transactional
@Override
public void updateKqglAssoDkjlById(List<PunchRecord> entityList) {
SqlSession session = sqlSessionFactory.openSession(ExecutorType.BATCH,false);
PunchRecordMapper mapper = session.getMapper(PunchRecordMapper.class);
for (int i = 0; i < entityList.size(); i++) {
mapper.updateByPrimaryKeySelective(entityList.get(i));
//每100条提交一次
if(i%100==99){
session.commit();
session.clearCache();
}
}
session.commit();
session.clearCache();
}
@Override
public void updateKqglAssoDkmxById(List<PunchCardDetails> entityList) {
SqlSession session = sqlSessionFactory.openSession(ExecutorType.BATCH,false);
PunchCardDetailsMapper mapper = session.getMapper(PunchCardDetailsMapper.class);
for (int i = 0; i < entityList.size(); i++) {
mapper.updateByPrimaryKeySelective(entityList.get(i));
//每100条提交一次
if(i%100==99){
session.commit();
session.clearCache();
}
}
session.commit();
session.clearCache();
}
}
......@@ -410,10 +410,11 @@
where dkjl.attime &gt;= #{start}
and dkjl.attime &lt;= #{end}
and dkjl.user_id = #{userId,jdbcType=INTEGER}
and dkjl.`status` != 0
and dkjl.sort != 0
and dkjl.`status` > 0
and dkjl.sort > 0
and dkjl.qyid = #{qyid}
and dkjl.dkmxid != 0
and dkjl.dkmxid > 0
and dkjl.id > 0
ORDER BY dkjl.id ASC
</select>
......
......@@ -151,7 +151,8 @@
<resultMap id="DailyDetailsMap" type="cn.timer.api.dto.kqmk.DailyDetailsDto" >
<result column="name" property="name" />
<result column="num" property="num" />
<result column="num" property="num" />
<result column="custom_num" property="customNum" />
<result column="dept" property="dept" />
<result column="post" property="post" />
<result column="orgcode" property="orgcode" />
......@@ -314,6 +315,7 @@
<select id="Dailydetails" resultMap="DailyDetailsMap">
select sum.num,
info.custom_num,
sum.`name`,
sum.org_code as orgcode,
sum.dept,sum.post,
......@@ -484,7 +486,7 @@
bcsz.`name` as bcname,bcsz.sbdk1 as bcsbdk1,bcsz.xbdk1 as bcxbdk1,bcsz.sbdk2 as bcsbdk2,bcsz.xbdk2 as bcxbdk2,bcsz.sbdk3 as bcsbdk3,bcsz.xbdk3 as bcxbdk3,
dkmx.`userid`,dkmx.`data` ,dkmx.`sbdk1`,dkmx.`sbdk1jg`,dkmx.`xbdk1` ,dkmx.`xbdk1jg`,dkmx.`sbdk2` ,dkmx.`sbdk2jg` ,dkmx.`xbdk2` ,
dkmx.`xbdk2jg`,dkmx.`sbdk3` ,dkmx.`sbdk3jg` ,dkmx.`xbdk3`,dkmx.`xbdk3jg` ,dkmx.`ydkcs` ,dkmx.`gzsc` ,dkmx.`qyid`,dkmx.`dksj` ,
dkmx.`yzcdcs` ,dkmx.`yzcdsc` ,dkmx.`kgcdfzs`,dkmx.dktj1,dkmx.dktj2,dkmx.dktj3,dkmx.dktj4,dkmx.dktj5,dkmx.dktj6,dkmx.dkst1,dkmx.dkst2,dkmx.dkst3
dkmx.`yzcdcs` ,dkmx.`yzcdsc` ,dkmx.`kgcdfzs`,dkmx.dktj1,dkmx.dktj2,dkmx.dktj3,dkmx.dktj4,dkmx.dktj5,dkmx.dktj6,dkmx.dkst1,dkmx.dkst2,dkmx.dkst3,info.custom_num
from kqgl_asso_dkmx dkmx
LEFT JOIN yggl_main_emp as info on info.emp_num = dkmx.userid and info.org_code = #{param.orgCode}
LEFT JOIN kqgl_asso_dkjl as dkjl on dkjl.dkmxid = dkmx.id
......@@ -492,13 +494,15 @@
where dkmx.qyid = #{param.orgCode}
and dkmx.`data` = #{param.times}
) as rtj on rtj.userid = sum.num
LEFT JOIN yggl_main_emp as info on info.emp_num = sum.num and info.org_code = #{param.orgCode}
where sum.org_code = #{param.orgCode}
and sum.belong_year = #{param.year}
and sum.belong_month = #{param.month}
<if test="param.query != null and param.query != ''">
and ( sum.`name` like CONCAT('%',#{param.query},'%') or
sum.num like CONCAT('%',#{param.query},'%'))
sum.num like CONCAT('%',#{param.query},'%') or
info.custom_num like CONCAT('%',#{param.query},'%'))
</if>
<if test="param.attid != null and param.attid != ''">
and sum.att_group = #{param.attid}
......
......@@ -100,9 +100,9 @@
<select id="selectPageByQuery" resultMap="BaseResultMap_As" >
SELECT
<include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_id,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_name
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num and a.org_code=org_code limit 1) limit 1) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num and a.org_code=org_code limit 1) limit 1) limit 1) as bm_id,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num and a.org_code=org_code limit 1) limit 1) limit 1) as bm_name
FROM spmk_approve_summary a
WHERE a.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''">
......
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