Commit bcdd51c6 by lal Committed by chenzg

提交

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