Commit bcdd51c6 by lal Committed by chenzg

提交

parent 1cc98d58
...@@ -43,7 +43,8 @@ public class AttendanceGroup implements Serializable{ ...@@ -43,7 +43,8 @@ public class AttendanceGroup implements Serializable{
private String dkfs;// 打卡方式 private String dkfs;// 打卡方式
private Integer isWq;//外勤 private Integer isWq;//外勤
private Integer overtimeRulesId; private Integer overtimeRulesId;//加班规则id
private String overtimeRulesName;//加班规则名称
private Integer kqjid; private Integer kqjid;
......
...@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
...@@ -50,6 +51,7 @@ import cn.timer.api.config.annotation.UserBean; ...@@ -50,6 +51,7 @@ import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.SysRoleType; import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.dao.crm.CrmClientContactsMapper; import cn.timer.api.dao.crm.CrmClientContactsMapper;
import cn.timer.api.dao.crm.CrmClientDataMapper; import cn.timer.api.dao.crm.CrmClientDataMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dto.crm.CrmCartogramDto; import cn.timer.api.dto.crm.CrmCartogramDto;
import cn.timer.api.dto.crm.CrmClientDataImportVo; import cn.timer.api.dto.crm.CrmClientDataImportVo;
import cn.timer.api.utils.CheckUtil; import cn.timer.api.utils.CheckUtil;
...@@ -434,11 +436,15 @@ public class CrmController { ...@@ -434,11 +436,15 @@ public class CrmController {
return ResultUtil.error("请解封后继续编辑操作"); return ResultUtil.error("请解封后继续编辑操作");
List<CrmClientContacts> crmClientContacts = crmClientData.getCrmClientContacts(); List<CrmClientContacts> crmClientContacts = crmClientData.getCrmClientContacts();
if (crmClientContacts != null) { if (crmClientContacts != null) {
CrmClientContacts.builder().build().delete(new QueryWrapper<CrmClientContacts>().lambda().eq(CrmClientContacts::getCid, cid));
for (CrmClientContacts crmClientContact : crmClientContacts) { for (CrmClientContacts crmClientContact : crmClientContacts) {
// crmClientContact.updateById(); // crmClientContact.updateById();
crmClientContact.insertOrUpdate(); crmClientContact.insertOrUpdate();
} }
} }
crmClientData.setContactsNum(crmClientContacts.size());//客户联系人数量
List<CrmClientAssociate> oldAssociates = CrmClientAssociate.builder().build() List<CrmClientAssociate> oldAssociates = CrmClientAssociate.builder().build()
.selectList(new QueryWrapper<CrmClientAssociate>().lambda().eq(CrmClientAssociate::getCid, cid)); .selectList(new QueryWrapper<CrmClientAssociate>().lambda().eq(CrmClientAssociate::getCid, cid));
List<Integer> oldIdsList = oldAssociates.stream().map(CrmClientAssociate::getAssociateId) List<Integer> oldIdsList = oldAssociates.stream().map(CrmClientAssociate::getAssociateId)
...@@ -947,6 +953,8 @@ public class CrmController { ...@@ -947,6 +953,8 @@ public class CrmController {
return ResultUtil.error("接收失败"); return ResultUtil.error("接收失败");
} }
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Transactional @Transactional
@PostMapping("designateClientBelongers") @PostMapping("designateClientBelongers")
@ApiOperation(value = "转移客户归属人(批量客户)", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "转移客户归属人(批量客户)", httpMethod = "POST", notes = "接口发布说明")
...@@ -957,6 +965,33 @@ public class CrmController { ...@@ -957,6 +965,33 @@ public class CrmController {
// 业务组id列表 // 业务组id列表
List<Integer> gids = crmClientDatas.stream().map(CrmClientData::getBelongGroup).collect(Collectors.toList()); List<Integer> gids = crmClientDatas.stream().map(CrmClientData::getBelongGroup).collect(Collectors.toList());
Integer gid = gids.get(0); Integer gid = gids.get(0);
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode())
.in(QyzxEmpEntAsso::getUserType, "0,1")
.count();
if(count > 0) {
// 是否有不同组的客户
if (gids.stream().distinct().count() > 1)
return ResultUtil.error("请确认是否同一业务组客户");
// 转移人业务组信息
CrmBusinessGroupMember crmBusinessGroupMember = CrmBusinessGroupMember.builder().build()
.selectOne(new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid)
.eq(CrmBusinessGroupMember::getEmpNum, belonger));
if (crmBusinessGroupMember == null)
return ResultUtil.error("请确认转移目标是当前业务组成员");
for (CrmClientData crmClientData : crmClientDatas) {
crmClientData.setBelongUser(belonger);
crmClientData.setBelongUserName(getEmpName(getOrgCode(userBean), belonger));
crmClientData.updateById();
}
return ResultUtil.success("转移成功");
}
// 当前操作人是否管理员 // 当前操作人是否管理员
CrmBusinessGroupMember nowManager = CrmBusinessGroupMember.builder().build() CrmBusinessGroupMember nowManager = CrmBusinessGroupMember.builder().build()
.selectOne(new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid) .selectOne(new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid)
...@@ -964,22 +999,9 @@ public class CrmController { ...@@ -964,22 +999,9 @@ public class CrmController {
.eq(CrmBusinessGroupMember::getType, 1)); .eq(CrmBusinessGroupMember::getType, 1));
if (nowManager == null) if (nowManager == null)
return ResultUtil.error("没有操作权限,请联系组管理员进行操作"); return ResultUtil.error("没有操作权限,请联系组管理员进行操作");
// 是否有不同组的客户
if (gids.stream().distinct().count() > 1)
return ResultUtil.error("请确认是否同一业务组客户");
// 转移人业务组信息
CrmBusinessGroupMember crmBusinessGroupMember = CrmBusinessGroupMember.builder().build()
.selectOne(new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid)
.eq(CrmBusinessGroupMember::getEmpNum, belonger));
if (crmBusinessGroupMember == null)
return ResultUtil.error("请确认转移目标是当前业务组成员");
for (CrmClientData crmClientData : crmClientDatas) {
crmClientData.setBelongUser(belonger);
crmClientData.setBelongUserName(getEmpName(getOrgCode(userBean), belonger));
crmClientData.updateById();
}
return ResultUtil.success("转移成功"); return ResultUtil.success("转移成功");
} }
/** /**
......
...@@ -2049,6 +2049,10 @@ public class JxglController { ...@@ -2049,6 +2049,10 @@ public class JxglController {
} }
query.setEmpNums(empNums); query.setEmpNums(empNums);
String deptid = jxglAppraisalMapper.CurrentdepartmentID(orgCode, empNum);
query.setDeptid(deptid);
IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectMyEmpByQuery(page, query); IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectMyEmpByQuery(page, query);
List<JxglAppraisal> listA = pageA.getRecords(); List<JxglAppraisal> listA = pageA.getRecords();
......
...@@ -3,6 +3,7 @@ package cn.timer.api.controller.kqgl; ...@@ -3,6 +3,7 @@ package cn.timer.api.controller.kqgl;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.Format; import java.text.Format;
import java.text.ParseException; import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -188,6 +189,13 @@ public class ClockInTool { ...@@ -188,6 +189,13 @@ public class ClockInTool {
return strArrLast; return strArrLast;
} }
public static Date strToDateLong(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
/** /**
* @param timeStr 修改的时间 * @param timeStr 修改的时间
......
...@@ -177,6 +177,7 @@ public class TimeCardController { ...@@ -177,6 +177,7 @@ public class TimeCardController {
@ApiOperation(value = "2:新增班次信息", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "2:新增班次信息", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
public Result<KqglAssoBcsz> ShiftInformation(@CurrentUser UserBean userBean,@RequestBody KqglAssoBcsz shif) { public Result<KqglAssoBcsz> ShiftInformation(@CurrentUser UserBean userBean,@RequestBody KqglAssoBcsz shif) {
String sdf = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); String sdf = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
shif.setQyid(userBean.getOrgCode()); shif.setQyid(userBean.getOrgCode());
shif.setLusjTime(new Date().getTime()); shif.setLusjTime(new Date().getTime());
...@@ -207,11 +208,17 @@ public class TimeCardController { ...@@ -207,11 +208,17 @@ public class TimeCardController {
} }
} }
if(kqglassobcszmapper.insert(shif)>0){ // if(kqglassobcszmapper.insert(shif)>0){
return ResultUtil.data(shif, "新增班次成功"); // return ResultUtil.data(shif, "新增班次成功");
}else{ // }else{
return ResultUtil.error("新增班次失败"); // return ResultUtil.error("新增班次失败");
} // }
if (!shif.insert())
return ResultUtil.error("操作失败");
return ResultUtil.data(shif, "新增班次成功");
} }
/** /**
......
...@@ -89,6 +89,7 @@ import cn.timer.api.config.enums.CommonEnum; ...@@ -89,6 +89,7 @@ import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType; import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.config.exception.Regular; import cn.timer.api.config.exception.Regular;
import cn.timer.api.config.validation.ValidList; import cn.timer.api.config.validation.ValidList;
import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService; import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dao.clazz.CommonAreaMapper; import cn.timer.api.dao.clazz.CommonAreaMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
...@@ -268,6 +269,7 @@ public class YgglController { ...@@ -268,6 +269,7 @@ public class YgglController {
Integer syq = addygdaDto.getSyq(); Integer syq = addygdaDto.getSyq();
Integer sex = addygdaDto.getSex(); Integer sex = addygdaDto.getSex();
Integer bmgwId = addygdaDto.getBmgwId(); Integer bmgwId = addygdaDto.getBmgwId();
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper) QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one(); .eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
...@@ -290,6 +292,18 @@ public class YgglController { ...@@ -290,6 +292,18 @@ public class YgglController {
ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType) ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex) .jobStatus(jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build(); .empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
if(syq == 0) {
ygglMainEmp.setZzTime(rzTime);
}else {
String sdf = new SimpleDateFormat("yyyy-MM-dd").format(rzTime);
String zztime = ClockInTool.requires_extra_times(sdf, syq, 4, 1);
ygglMainEmp.setZzTime(ClockInTool.strToDateLong(zztime));
}
ygglMainEmp.insert(); ygglMainEmp.insert();
//假期规则初始化 //假期规则初始化
......
...@@ -24,5 +24,7 @@ public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> { ...@@ -24,5 +24,7 @@ public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> {
IPage<JxglAppraisal> selectListEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query); IPage<JxglAppraisal> selectListEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query);
IPage<JxglAppraisal> selectMyEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query); IPage<JxglAppraisal> selectMyEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query);
String CurrentdepartmentID(int orgcode,int empnum);
} }
...@@ -30,6 +30,6 @@ public class EmpPerformanceQuery extends Page { ...@@ -30,6 +30,6 @@ public class EmpPerformanceQuery extends Page {
@ApiModelProperty(value = "员工id", example = "") @ApiModelProperty(value = "员工id", example = "")
private List<Integer> empNums; private List<Integer> empNums;
private String deptid;
} }
...@@ -268,6 +268,14 @@ ...@@ -268,6 +268,14 @@
</select> </select>
<select id="CurrentdepartmentID" resultType="java.lang.String">
select
(SELECT id FROM zzgl_bmgw_m WHERE id = ( SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id LIMIT 1 ) LIMIT 1 ) AS bm_id
from yggl_main_emp b
where b.org_code = #{orgcode}
and b.emp_num = #{empnum}
</select>
<select id="selectMyEmpByQuery" resultMap="BaseResultMap_All" > <select id="selectMyEmpByQuery" resultMap="BaseResultMap_All" >
SELECT SELECT
<include refid="Base_Column_List_a" />, <include refid="Base_Column_List_a" />,
...@@ -302,6 +310,7 @@ ...@@ -302,6 +310,7 @@
b.phone like CONCAT('%',#{param.query},'%') b.phone like CONCAT('%',#{param.query},'%')
) )
</if> </if>
and ( SELECT id FROM zzgl_bmgw_m WHERE id = ( SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id LIMIT 1 ) LIMIT 1 ) = #{param.deptid}
</where> </where>
ORDER BY a.id DESC ORDER BY a.id DESC
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
<result column="is_wq" property="isWq" jdbcType="INTEGER" /> <result column="is_wq" property="isWq" jdbcType="INTEGER" />
<result column="overtime_rules_id" property="overtimeRulesId" /> <result column="overtime_rules_id" property="overtimeRulesId" />
<result column="overtimeRulesName" property="overtimeRulesName" />
<collection property="kqzdkfslist" ofType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode"> <collection property="kqzdkfslist" ofType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode">
<result column="kqzId" property="kqzId" jdbcType="INTEGER" /> <result column="kqzId" property="kqzId" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" /> <result column="type" property="type" jdbcType="INTEGER" />
...@@ -96,10 +98,10 @@ ...@@ -96,10 +98,10 @@
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select select kqz.*,
<include refid="Base_Column_List" /> (select bc.`name` from kqgl_asso_bcsz bc where bc.id = kqz.overtime_rules_id) as overtimeRulesName
from kqgl_main_kqz from kqgl_main_kqz kqz
where id = #{id,jdbcType=INTEGER} where kqz.id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from kqgl_main_kqz delete from kqgl_main_kqz
......
...@@ -136,7 +136,8 @@ ...@@ -136,7 +136,8 @@
a.org_code, a.org_code,
a.zj_type, a.zj_type,
a.zj_num, a.zj_num,
a.syq a.syq,
a.zz_time
</sql> </sql>
......
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