Commit fa63ee3f by 陶湘宇

Merge branch 'develop' of develop-gitlab.youlingrc.com:8timerv2/8timerapiv200 into develop

* 'develop' of develop-gitlab.youlingrc.com:8timerv2/8timerapiv200:
  8小时运营后台-- 增加保单回调是查询保单信息 导入保单时判断批改
  修改BUG 1495
  8小时后台-- 应需求一定要展示前四张图片
  8小时后台-- 解决了 Bug 导入名册页,未完成 1468
  8小时后台-- 解决了 Bug 在候选人详情页进行刷新页面操作,系统会提示用户简历信息获取失败 1491 解决了 Bug 添加员工,员工状态修改异常 1533 解决了 Bug 面试登记表中,籍贯,名族,学历中内容显示错误 1490 解决了 Bug 员工详情页新增合同信息,合同类型无展示 1488
  微信公众号(服务号)appSecret 更新
  8小时运营后台-- 增加查询条件
  8小时运营后台-- 保全支付回调
  8小时运营后台-- 保全支付回调
  8小时后台-- 导入人员时生成一个员工登录表数据
parents 7812b499 da6a2372
......@@ -25,3 +25,15 @@ ALTER TABLE yggl_main_emp`
ALTER TABLE `timer_test`.`insure_user`
ADD COLUMN `create_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '创建时间' AFTER `reason`;
CREATE TABLE ` yggl_main_importLog ` (
` id ` int(11) NOT NULL AUTO_INCREMENT,
` user_id ` int(11) NULL DEFAULT NULL COMMENT ''yggl_main_emp_empnum'',
` create_time ` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT ''导入时间'',
` success_num ` int(11) NULL DEFAULT NULL COMMENT ''成功条数'',
` err_num ` int(11) NULL DEFAULT NULL COMMENT ''失败条数'',
` org_code ` int(11) NULL DEFAULT NULL,
PRIMARY KEY (` id `) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
ALTER TABLE `timer_test`.`insure_user`
MODIFY COLUMN `apply_type` int(11) NULL DEFAULT NULL COMMENT '申请类型:1新增 2投保 3批改' AFTER `replace_trans_id`;
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
......@@ -16,8 +17,9 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -152,7 +154,7 @@ public class InsureUser extends Model<InsureUser> {
@ApiModelProperty(value = "替换流水号,使用trans_id,RP_开头")
private String replaceTransId;
@ApiModelProperty(value = "申请类型:1新增 2投保 3批")
@ApiModelProperty(value = "申请类型:1新增 2投保 3批")
private Integer applyType;
@ApiModelProperty(value = "批改原因")
......@@ -161,5 +163,8 @@ public class InsureUser extends Model<InsureUser> {
@ApiModelProperty(value = "录单时间")
private Date createTime;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "导入备注")
private String remake;
}
package cn.timer.api.bean.yggl;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
*
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-06-10 17:42:53
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name="yggl_main_import_log")
@ApiModel("员工导入记录")
public class YgglMainImportLog extends Model<YgglMainImportLog> {
private static final long serialVersionUID = -1825678752247238544L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* yggl_main_emp_empnum
*/
private Integer userId;
/**
* 导入时间
*/
private Date createTime;
/**
* 成功条数
*/
private Integer successNum;
/**
* 失败条数
*/
private Integer errNum;
/**
*
*/
private Integer orgCode;
/**
* 设置:
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:
*/
public Integer getId() {
return id;
}
/**
* 设置:yggl_main_emp_id
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* 获取:yggl_main_emp_id
*/
public Integer getUserId() {
return userId;
}
/**
* 设置:导入时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:导入时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:成功条数
*/
public void setSuccessNum(Integer successNum) {
this.successNum = successNum;
}
/**
* 获取:成功条数
*/
public Integer getSuccessNum() {
return successNum;
}
/**
* 设置:失败条数
*/
public void setErrNum(Integer errNum) {
this.errNum = errNum;
}
/**
* 获取:失败条数
*/
public Integer getErrNum() {
return errNum;
}
/**
* 设置:
*/
public void setOrgCode(Integer orgCode) {
this.orgCode = orgCode;
}
/**
* 获取:
*/
public Integer getOrgCode() {
return orgCode;
}
}
......@@ -400,4 +400,8 @@ public class ZpglRcxx extends Model<ZpglRcxx> {
@ApiModelProperty(value = "淘汰原因")
private String failCause;
/*民族*/
@Transient
@TableField(exist = false)
private String nationName;
}
......@@ -8,6 +8,7 @@ import cn.timer.api.utils.ResultUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.mysql.cj.util.StringUtils;
import io.swagger.annotations.Api;
......@@ -96,7 +97,7 @@ public class CallBackContorll {
@PostMapping(value = "/addpPayCallBack")
@ApiOperation(value = "11.增员核保回调", httpMethod = "POST", notes = "增员核保回调")
@Transactional(rollbackFor = Exception.class)
public Map addpPayCallBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) throws IOException {
public Map addpPayCallBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) {
/*核保*/
/*如果是在线支付的话*/
Map map = Maps.newHashMap();
......@@ -173,7 +174,7 @@ public class CallBackContorll {
@PostMapping(value = "/CallBack")
@ApiOperation(value = "7.保全增员申请回调", httpMethod = "POST", notes = "投保申请回调")
@Transactional(rollbackFor = Exception.class)
public Map callBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) throws IOException {
public Map callBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) {
Map map = Maps.newHashMap();
map.put("status", "error");
if (StringUtils.isNullOrEmpty(pid) || StringUtils.isNullOrEmpty(sign) && StringUtils.isNullOrEmpty(timestamp)) {
......@@ -199,7 +200,10 @@ public class CallBackContorll {
paramsMap.put("timestamp", timestamp);
paramsMap.put("sign", sign);
CallBack callBack = JSONObject.parseObject(sb.toString(), CallBack.class);
List<InsureUser> list = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getBatchNo, callBack.getOrder_import_info().getUuid()).eq(InsureUser::getInsureStatus, 3));
List<InsureUser> list = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getTransId, callBack.getOrder_import_info().getThird_uuid()));
if(list.size()<=0){
list = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getBatchNo, callBack.getOrder_import_info().getUuid()));
}
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getPolicyNo, list.get(0).getPolicyNo()));
if (callBack.getStatus().equals("1")) {
list.forEach(i -> {
......@@ -223,7 +227,7 @@ public class CallBackContorll {
insurePolicy.setPolicyFile(callBack.getOrder_import_info().getEndorsement_file());
InsureLog.builder().requestParam(JSONObject.toJSONString(paramsMap)).type(7)
.requestData(sb.toString()).createTime(new Date()).requestType(1).returnBody(JSONObject.toJSONString(callBack)).requestPath(base_api_url + "/callBack/policy/CallBack")
.returnCode(callBack.getStatus()).returnMsg("更新成功").policyId(insurePolicy.getId()).build().insert();
.returnCode(callBack.getStatus()).returnMsg("保单增员-更新成功").policyId(insurePolicy.getId()).build().insert();
} else {
String errorMsg = "";
InsureLog insureLog = InsureLog.builder().build().selectOne(new QueryWrapper<InsureLog>().lambda().eq(InsureLog::getTransId, callBack.getOrder_import_info().getThird_uuid()));
......@@ -271,7 +275,7 @@ public class CallBackContorll {
@GetMapping(value = "/payStatus")
@ApiOperation(value = "8.支付完成跳转", httpMethod = "GET", notes = "用于支付时跳回我们系统更新状态")
@Transactional(rollbackFor = Exception.class)
public ModelAndView callBackPayStatus(HttpServletRequest request, @RequestParam Integer policyId) throws IOException {
public ModelAndView callBackPayStatus(HttpServletRequest request, @RequestParam Integer policyId) {
InsurePolicy insurePolicy = InsurePolicy.builder().id(policyId).build().selectById();
InsurePay insurePay = InsurePay.builder().id(insurePolicy.getPayId()).build().selectById();
insurePay.setPayTime(new Date());
......@@ -286,7 +290,7 @@ public class CallBackContorll {
@PostMapping(value = "/payCallBack")
@ApiOperation(value = "9.投保支付收银台回调", httpMethod = "POST", notes = "支付完成跳转")
@Transactional(rollbackFor = Exception.class)
public Map payCallBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) throws IOException {
public Map payCallBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) {
try {
InputStream is = null;
is = request.getInputStream();
......@@ -343,7 +347,7 @@ public class CallBackContorll {
@PostMapping(value = "/issueCallback")
@ApiOperation(value = "10.保单出单回调", httpMethod = "POST", notes = "支付完成跳转")
@Transactional(rollbackFor = Exception.class)
public Map issueCallback(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) throws IOException {
public Map issueCallback(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) {
try {
InputStream is = null;
is = request.getInputStream();
......@@ -397,9 +401,9 @@ public class CallBackContorll {
}
@PostMapping(value = "/batchPayCallback")
@ApiOperation(value = "增员支付回调-保司接口没启用", httpMethod = "POST", notes = "增员支付回调")
@ApiOperation(value = "增员支付回调", httpMethod = "POST", notes = "增员支付回调")
@Transactional(rollbackFor = Exception.class)
public Map batchPayCallback(HttpServletRequest request) throws IOException {
public Map batchPayCallback(HttpServletRequest request,@RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) {
try {
InputStream is = null;
......@@ -409,6 +413,10 @@ public class CallBackContorll {
for (int n; (n = is.read(b)) != -1; ) {
sb.append(new String(b, 0, n));
}
String value = DigestUtils.md5Hex(pid + secretq + timestamp + sb.toString());
if (!value.equals(sign)) {
throw new CustomException("增员支付回调验签失败");
}
BatchPayCallBack callBack = JSONObject.parseObject(sb.toString(), BatchPayCallBack.class);
InsurePay insurePay = InsurePay.builder().build().selectOne(new QueryWrapper<InsurePay>().lambda().eq(InsurePay::getSerialNumber, callBack.getOrder_import_uuid()));
if (insurePay != null) {
......
......@@ -2,10 +2,12 @@ package cn.timer.api.controller.insure;
import cn.timer.api.bean.insure.*;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.Regular;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.controller.insure.enums.PlanEnum;
......@@ -113,6 +115,8 @@ public class InsureContorll {
@Value("${insure.cancelPayment}")
private String cancelPayment;
@Value(value = "${config-8timer.init-password}")
private String pwd;
private static SimpleDateFormat dtf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -546,8 +550,11 @@ public class InsureContorll {
YgglMainEmp y = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getName, insureDto.getUserName()).eq(YgglMainEmp::getZjNum, insureDto.getIdCardNo()));
if (y == null) {
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(String.valueOf(System.currentTimeMillis())).pw(Md5.md5(pwd)).regTime(new Date()).orgId(Integer.parseInt(insureDto.getOrgCode())).username(insureDto.getUserName()).sts(CommonEnum.U_STS_ON.getType()).build();
qyzxEmpLogin.insert();
y = new YgglMainEmp();
y.setName(insureDto.getUserName());
y.setEmpNum(qyzxEmpLogin.getId());
y.setZjType(0);
y.setZjNum(insureDto.getIdCardNo());
y.setOrgCode(Integer.parseInt(insureDto.getOrgCode()));
......@@ -795,7 +802,11 @@ public class InsureContorll {
for (int index = 0; index < row.getPhysicalNumberOfCells(); index++) {
XSSFCell titleCell = titleRow.getCell(index);
XSSFCell cell = row.getCell(index);
if (cell == null) {
continue;
} else {
cell.setCellType(CellType.STRING);
}
if (cell.getStringCellValue().equals("")) {
continue;
}
......@@ -851,7 +862,12 @@ public class InsureContorll {
List<String> idNumList = userList.stream().map(YgglMainEmp::getZjNum).collect(Collectors.toList());
List<YgglMainEmp> newList = yg.stream().filter(v -> !idNumList.contains(v.getZjNum())).collect(Collectors.toList());
if (newList.size() > 0) {
newList.forEach(u -> u.insert());
newList.forEach(u ->{
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(String.valueOf(System.currentTimeMillis())).pw(Md5.md5(pwd)).regTime(new Date()).orgId(company.getId()).username(u.getName()).sts(CommonEnum.U_STS_ON.getType()).build();
qyzxEmpLogin.insert();
u.setEmpNum(qyzxEmpLogin.getId());
u.insert();
});
}
allList = ygglMainEmpMapper.selectListByIZjNum(yg.stream().map(YgglMainEmp::getZjNum).toArray(String[]::new), company.getId());
selectUserList = allList.stream().filter(s -> s.getIsInsure() == 0).collect(Collectors.toList());
......@@ -900,7 +916,11 @@ public class InsureContorll {
for (int index = 0; index < row.getPhysicalNumberOfCells(); index++) {
XSSFCell titleCell = titleRow.getCell(index);
XSSFCell cell = row.getCell(index);
if (cell == null) {
continue;
} else {
cell.setCellType(CellType.STRING);
}
if (cell.getStringCellValue().equals("")) {
continue;
}
......@@ -1091,6 +1111,11 @@ public class InsureContorll {
case "总保费":
user.setPrice(ExcelUtils.getString(cell));
break;
case "备注":
if(!StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))){
user.setRemake(ExcelUtils.getString(cell));
}
break;
}
}
userList.add(user);
......@@ -1109,6 +1134,9 @@ public class InsureContorll {
if (!dataMap.get("product_code").equals(insureProduct.getProductCodeId())) {
return ResultUtil.error("导入的保单产品和选择的保单产品不一致");
}
if(!dataMap.get("corporate_applicant_name").equals(company.getName())){
return ResultUtil.error("导入的保单投保人和企业投保人不一样");
}
policy.setProductId(insureProduct.getId());
policy.setPolicyFile(dataMap.get("policy_file").toString());
policy.setStatus("1");
......@@ -1144,8 +1172,11 @@ public class InsureContorll {
}
insureUser.setInsuredMobile(ygglMainEmp.getPhone());
} else {
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(String.valueOf(System.currentTimeMillis())).pw(Md5.md5(pwd)).regTime(new Date()).orgId(insureUser.getOrgCode()).username(insureUser.getInsuredEContact()).sts(CommonEnum.U_STS_ON.getType()).build();
qyzxEmpLogin.insert();
/*如果不存在员工就创建一名员工*/
ygglMainEmp = new YgglMainEmp();
ygglMainEmp.setEmpNum(qyzxEmpLogin.getId());
ygglMainEmp.setName(insureUser.getInsuredEContact());
ygglMainEmp.setZjType(0);
ygglMainEmp.setZjNum(insureUser.getInsuredNo());
......@@ -1160,7 +1191,26 @@ public class InsureContorll {
insureUser.setStatus("1");
insureUser.setCreateTime(new Date());
insureUser.insert();
/*判断批改状态*/
if(insureUser.getApplyType()==3){
if(StringUtils.isNullOrEmpty(insureUser.getRemake())){
return ResultUtil.data("批改状态下备注不能为空");
}
if(insureUser.getRemake().indexOf("被保险人信息批改-原被保险人,")!=-1){
String newStr= insureUser.getRemake().substring(insureUser.getRemake().indexOf(",")+1,insureUser.getRemake().length());
String[] arr = newStr.split("/");
if(arr[0].equals(insureUser.getInsuredEContact())&&arr[2].equals(insureUser.getInsuredNo())){
return ResultUtil.data("批改状态下替换人和被替换人不能相同");
}
/*更新人员投保状态*/
InsureUser.builder().status("2").insureStatus(2).build().update(new QueryWrapper<InsureUser>()
.lambda().eq(InsureUser::getInsuredNo,arr[2]).eq(InsureUser::getInsuredEContact,arr[0]));
ygglMainEmp.builder().isInsure(2).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getId,insureUser.getUserId()));
}
}
}
InsureLog.builder().requestParam(JSONObject.toJSONString(map)).type(9).createTime(new Date()).requestType(2).returnBody(data).requestPath(policyDetailUrl)
.returnCode(returnMap.get("errcode").toString()).returnMsg(returnMap.get("errmsg").toString()).policyId(policy.getId()).build().insert();
} catch (IOException e) {
......@@ -1202,7 +1252,11 @@ public class InsureContorll {
for (int index = 0; index < row.getPhysicalNumberOfCells(); index++) {
XSSFCell titleCell = titleRow.getCell(index);
XSSFCell cell = row.getCell(index);
if (cell == null) {
continue;
} else {
cell.setCellType(CellType.STRING);
}
switch (ExcelUtils.getString(titleCell)) {
case "被保人姓名(必填)":
if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
......@@ -1255,7 +1309,10 @@ public class InsureContorll {
y = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getZjNum, iu.getInsuredNo())
.eq(YgglMainEmp::getName, iu.getInsuredEContact()).eq(YgglMainEmp::getOrgCode, qyzxEntInfoM.getId()));
if (y == null) {
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().pw(Md5.md5(pwd)).phone(String.valueOf(System.currentTimeMillis())).regTime(new Date()).orgId(qyzxEntInfoM.getId()).username(iu.getInsuredEContact()).sts(CommonEnum.U_STS_ON.getType()).build();
qyzxEmpLogin.insert();
y = new YgglMainEmp();
y.setEmpNum(qyzxEmpLogin.getId());
y.setName(iu.getInsuredEContact());
y.setZjType(0);
y.setZjNum(iu.getInsuredNo());
......@@ -1321,7 +1378,6 @@ public class InsureContorll {
}
} else {
/*保全支付*/
toPayParamsMap = setParams(batchToPayUrl, appidq, secretq);
toPayParamsMap.put("order_import_uuid", insurePay.getSerialNumber());
String returnPay = HttpUtils.sendPost(batchToPayUrl, setParams(JSONObject.toJSONString(toPayParamsMap), appidq, secretq), toPayParamsMap);
Map<String, Object> payDataMap = JSONObject.parseObject(returnPay);
......@@ -1332,7 +1388,10 @@ public class InsureContorll {
insurePay.updateById();
InsureLog.builder().requestParam(JSONObject.toJSONString(toPayParamsMap)).returnBody(returnPay).type(7).createTime(new Date()).requestType(2).requestPath(batchToPayUrl)
.returnMsg("请求保全支付").policyId(insurePolicy.getId()).build().insert();
return ResultUtil.data(importPayInfo.get("pay_url").toString() + "&jump_url=" + base_api_url + "/callBack/policy/payStatus?policyId=" + insurePolicy.getId() + "&notify_url=" + base_api_url + "/callBack/policy/batchPayCallback");
/*设置验签参数*/
long timestamp = System.currentTimeMillis() / 1000;
String sign= DigestUtils.md5Hex(appidq + secretq + timestamp);
return ResultUtil.data(importPayInfo.get("pay_url").toString() + "&jump_url=" + base_api_url + "/callBack/policy/payStatus?policyId=" + insurePolicy.getId() + "&notify_url=" + base_api_url + "/callBack/policy/batchPayCallback&pid="+appidq+"&sign="+sign+"&timestamp="+timestamp);
}
} catch (Exception e) {
log.error("重新发起支付异常:", e);
......
package cn.timer.api.controller.qyxx;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.*;
import cn.timer.api.utils.redis.RedisUtil;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -88,13 +85,22 @@ public class CmsController {
*/
@GetMapping(value = "/zxqyxx")
@ApiOperation(value = "获取最新讯息的标题、发布时间", httpMethod = "GET", notes = "接口发布说明")
public Result<List<CmsContent>> groupbyTime(@CurrentUser UserBean userBean) {
public Result<Object> groupbyTime(@CurrentUser UserBean userBean) {
Map map = Maps.newHashMap();
Integer orgCode = userBean.getOrgCode();
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.select("id", "title", "author", "releasetime", "fmtpath").eq("releasestate", 0)
.eq("organization_id", orgCode).orderByDesc("releasetime").last("limit 6");
List<CmsContent> qynr = CmsContent.builder().build().selectList(queryWrapper);
return ResultUtil.data(qynr, "查询分类成功!");
/*应需求一定要展示前四张图片*/
QueryWrapper<CmsContent> qw = new QueryWrapper<>();
qw.select("fmtpath").eq("releasestate", 0).isNotNull("fmtpath").ne("fmtpath","")
.eq("organization_id", orgCode).orderByDesc("releasetime").last("limit 4");
List<CmsContent> picList = CmsContent.builder().build().selectList(qw);
map.put("list",qynr);
map.put("picList",picList);
return ResultUtil.data(map, "查询分类成功!");
}
/**
......
......@@ -129,14 +129,14 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* @date 2019年11月15日
* @author 翁东州
* @date 2019年11月15日
* @方法中文名称:
*/
@Api(tags = "3.员工管理")
@RestController
@Transactional(rollbackOn = Exception.class)
@RequestMapping(value = "/yggl", produces = { "application/json" })
@RequestMapping(value = "/yggl", produces = {"application/json"})
public class YgglController {
@Value(value = "${config-8timer.init-password}")
......@@ -259,6 +259,7 @@ public class YgglController {
@Autowired
private UserEquiRelationMapper userequirelationmapper;
/**
* 添加员工档案
*
......@@ -279,7 +280,7 @@ public class YgglController {
String zjNum = addygdaDto.getZjNum();
Integer attgroupid = addygdaDto.getAttgroupid();//考勤组id
boolean isvalid = true;
if(zjType != null){
if (zjType != null) {
switch (zjType) {
case 0:
isvalid = IdcardUtil.isValidCard15(zjNum) || IdcardUtil.isValidCard18(zjNum);
......@@ -336,18 +337,18 @@ public class YgglController {
.jobStatus(jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).customNum(customNum).build();
if(addygdaDto.getAttgroupid() != null) {
if (addygdaDto.getAttgroupid() != null) {
KqglAssoYhkqz.builder().kqzid(attgroupid).userid(login.getId()).qyid(userBean.getOrgCode()).build().insert();
List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, addygdaDto.getAttgroupid()).eq(KqglAssoKqzdkfs::getType, 1));
for(KqglAssoKqzdkfs abp:kqjs) {
for (KqglAssoKqzdkfs abp : kqjs) {
KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();
KqglAssoYhsb kqjry = KqglAssoYhsb.builder().build().selectOne(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, login.getId()).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
if(kqjry == null) {
if (kqjry == null) {
// YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, login.getId()));
String url = mac_command+"/addUserName";
String url = mac_command + "/addUserName";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", kqj.getCode());
......@@ -362,9 +363,9 @@ public class YgglController {
KqglAssoYhsb uskqj = KqglAssoYhsb.builder().userId(login.getId()).kqjid(kqj.getId()).type(1).build();
UserEquiRelation isgly = userequirelationmapper.selectByuserId(login.getId());
if(isgly != null) {
if (isgly != null) {
uskqj.setIsGly(isgly.getIsGly());
}else {
} else {
uskqj.setIsGly(0);
}
if (!uskqj.insert())
......@@ -373,10 +374,10 @@ public class YgglController {
}
}
if(syq != null){
if(syq == 0) {
if (syq != null) {
if (syq == 0) {
ygglMainEmp.setZzTime(rzTime);
}else {
} else {
String sdf = new SimpleDateFormat("yyyy-MM-dd").format(rzTime);
......@@ -391,17 +392,17 @@ public class YgglController {
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
for(KqglAssoLeaveRules r : rul) {
if(r.getLeaveBalance() == 0) {
for (KqglAssoLeaveRules r : rul) {
if (r.getLeaveBalance() == 0) {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).balanceDays(-1).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}else {
} else {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}
}
try {
realtimeupdate.AttendanceTask(userBean.getOrgCode(), ygglMainEmp.getEmpNum(), 2,null);
realtimeupdate.AttendanceTask(userBean.getOrgCode(), ygglMainEmp.getEmpNum(), 2, null);
} catch (ParseException e) {
e.printStackTrace();
}
......@@ -430,14 +431,14 @@ public class YgglController {
return ResultUtil.error("入职日期 不可以大于 转正日期");
}
//修改 员工登陆账号 检测账号是否重复
if(!StringUtils.isEmpty(ygglMainEmp.getEmpLoginPhone())){
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{
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("该号码已存在,请更换员工登陆账号");
}
}
......@@ -510,7 +511,7 @@ public class YgglController {
List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), bmgwId);
if (CollectionUtil.isNotEmpty(usersQuery)) {
empNums = usersQuery.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
}else {
} else {
return ResultUtil.data(null);
}
......@@ -526,17 +527,17 @@ public class YgglController {
// 在职
map.put("list", ygglMainEmpPage.getRecords());
// 在职
map.put("zaizhi", ygglMainEmpMapper.selectEmpCount(orgCode,1));
map.put("zaizhi", ygglMainEmpMapper.selectEmpCount(orgCode, 1));
// 全职
map.put("quanzhi", ygglMainEmpMapper.selectEmpCount(orgCode,2));
map.put("quanzhi", ygglMainEmpMapper.selectEmpCount(orgCode, 2));
// 试用期
map.put("shiyongqi", ygglMainEmpMapper.selectEmpCount(orgCode,3));
map.put("shiyongqi", ygglMainEmpMapper.selectEmpCount(orgCode, 3));
// 正式
map.put("zhengshi", ygglMainEmpMapper.selectEmpCount(orgCode,4));
map.put("zhengshi", ygglMainEmpMapper.selectEmpCount(orgCode, 4));
// 待离职
map.put("dailizhi", ygglMainEmpMapper.selectEmpCount(orgCode,5));
map.put("dailizhi", ygglMainEmpMapper.selectEmpCount(orgCode, 5));
// 已离职
map.put("yilizhi", ygglMainEmpMapper.selectEmpCount(orgCode,6));
map.put("yilizhi", ygglMainEmpMapper.selectEmpCount(orgCode, 6));
return ResultUtil.data(ygglMainEmpPage, map);
}
......@@ -646,27 +647,40 @@ public class YgglController {
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
if (yme.insert()) {
/*员工状态为离职*/
Integer jobStatus = ad.getJobStatus();
yme.setJobStatus(jobStatus);
if (jobStatus == 2 || jobStatus == 3) {
yme.updateById();
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(yme.getEmpNum()).build();
ygglMainLzb.setLzTime(ad.getLzTime());
BeanUtil.copyProperties(yme, ygglMainLzb, "before_leaving_sts");
ygglMainLzb.insert();
}
listYmp.add(yme);
} else {
// 存放 插入失败的 数据
insertErrors.add(yme);
}
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
for(KqglAssoLeaveRules r : rul) {
if(r.getLeaveBalance() == 0) {
for (KqglAssoLeaveRules r : rul) {
if (r.getLeaveBalance() == 0) {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(-1).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}else {
} else {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}
}
}
YgglMainImportLog.builder().userId(userBean.getEmpNum())
.createTime(new Date())
.orgCode(userBean.getOrgCode())
.errNum(insertErrors.size())
.successNum(listYmp.size()).build().insert();
JSONObject obj = JSONUtil.createObj();
obj.set("empList", listYmp);
......@@ -1160,6 +1174,7 @@ public class YgglController {
}
// 获取工资卡信息
/**
* 获取员工工资卡信息
*
......@@ -1239,7 +1254,7 @@ public class YgglController {
@ApiOperationSupport(order = 43)
public Result<List<YgglAttaHtxxb>> selecthtxxb(@CurrentUser UserBean userBean, @PathVariable Integer empNum) {
List<YgglAttaHtxxb> ygglAttaHtxxbs = YgglAttaHtxxb.builder().build()
.selectList(new QueryWrapper<YgglAttaHtxxb>().lambda().eq(YgglAttaHtxxb::getDeleteFlag,0)
.selectList(new QueryWrapper<YgglAttaHtxxb>().lambda().eq(YgglAttaHtxxb::getDeleteFlag, 0)
.eq(YgglAttaHtxxb::getOrgCode, userBean.getOrgCode()).eq(YgglAttaHtxxb::getEmpNum, empNum));
return ResultUtil.data(ygglAttaHtxxbs);
}
......@@ -1402,13 +1417,13 @@ public class YgglController {
@ApiOperationSupport(order = 54)
public Result<Void> ygzz(@CurrentUser UserBean userBean, @RequestBody YgzzDto ygzzDto) {
Integer ogwid = null;
YgglMainEmp ygglMainEmp=YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()).eq(YgglMainEmp::getOrgCode,userBean.getOrgCode()));
if(ygglMainEmp.getBmgwId()!=null){
ogwid=ygglMainEmp.getBmgwId();
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if (ygglMainEmp.getBmgwId() != null) {
ogwid = ygglMainEmp.getBmgwId();
}
ygglMainEmp.setJobStatus(jobStatus.ZHENSHI.getType());
ygglMainEmp.setZzTime(ygzzDto.getZzTime());
ygglMainEmp.setSjzzTime(ygzzDto.getSjzzTime()==null?new Date():ygzzDto.getSjzzTime());
ygglMainEmp.setSjzzTime(ygzzDto.getSjzzTime() == null ? new Date() : ygzzDto.getSjzzTime());
ygglMainEmp.setZzRemark(ygzzDto.getZzRemark());
ygglMainEmp.setBmgwId(ygzzDto.getBmgwId());
ygglMainEmp.updateById();
......@@ -1416,8 +1431,8 @@ public class YgglController {
// orgCode
List<Integer> list = Lists.newArrayList();
list.add(ygzzDto.getEmpNum());
zzglLogDgjlMapper.insertbyaddemp(list, userBean.getEmpNum(), ygzzDto.getBmgwId(),ogwid, userBean.getOrgCode(),
ygzzDto.getZzRemark(),1);
zzglLogDgjlMapper.insertbyaddemp(list, userBean.getEmpNum(), ygzzDto.getBmgwId(), ogwid, userBean.getOrgCode(),
ygzzDto.getZzRemark(), 1);
return ResultUtil.success("转正成功!");
}
......@@ -1454,7 +1469,7 @@ public class YgglController {
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
//设置员工自定义工号工号
String jobNum = StringUtils.isEmpty(ygglMainEmp.getCustomNum())?ygglMainEmp.getEmpNum().toString():ygglMainEmp.getCustomNum();
String jobNum = StringUtils.isEmpty(ygglMainEmp.getCustomNum()) ? ygglMainEmp.getEmpNum().toString() : ygglMainEmp.getCustomNum();
YgglMainLzb.builder().jobStatus(jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).jobNum(jobNum).build()
.update(new UpdateWrapper<YgglMainLzb>().lambda()
......@@ -1462,8 +1477,8 @@ public class YgglController {
.eq(YgglMainLzb::getOrgCode, userBean.getOrgCode()));
List<Integer> list = Lists.newArrayList();
list.add(empNum);
zzglLogDgjlMapper.insertbyaddemp(list, userBean.getEmpNum(), null,null, userBean.getOrgCode(),
lzygQueryDto.getLzyy(),3);
zzglLogDgjlMapper.insertbyaddemp(list, userBean.getEmpNum(), null, null, userBean.getOrgCode(),
lzygQueryDto.getLzyy(), 3);
return ResultUtil.data(ygglMainLzb, "添加待离职员工成功");
}
......@@ -1513,9 +1528,9 @@ public class YgglController {
KqglAssoYhkqz.builder().build().delete(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getUserid, empNum).eq(KqglAssoYhkqz::getQyid, userBean.getOrgCode()));
try {
realtimeupdate.AttendanceTask(userBean.getOrgCode(), empNum, 2,null);
realtimeupdate.AttendanceTask(userBean.getOrgCode(), empNum, 2, null);
redisUtil.set("BlockUser"+empNum,"BlockUser",session_timeout);
redisUtil.set("BlockUser" + empNum, "BlockUser", session_timeout);
} catch (ParseException e) {
e.printStackTrace();
}
......@@ -1628,7 +1643,7 @@ public class YgglController {
@ApiOperation(value = "62.查询员工列表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 62)
public Result<List<YgQueryDto>> queryEmpMessage(@CurrentUser UserBean userBean) {
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode(),0);
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode(), 0);
for (YgQueryDto yg : ygQueryDto) {
if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl("");
......@@ -1873,7 +1888,7 @@ public class YgglController {
Integer orgCode = userBean.getOrgCode();
LoginInfoDto loginInfo = LoginInfoDto.builder().build();
YgglMainEmp ygglMainEmp = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId, YgglMainEmp::getName, YgglMainEmp::getRzTime, YgglMainEmp::getZzTime,YgglMainEmp::getSyq,
.select(YgglMainEmp::getBmgwId, YgglMainEmp::getName, YgglMainEmp::getRzTime, YgglMainEmp::getZzTime, YgglMainEmp::getSyq,
YgglMainEmp::getEmpNum)
.eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
if (ygglMainEmp != null) {
......@@ -1897,11 +1912,11 @@ public class YgglController {
loginInfo.setGwName(gwObj != null ? gwObj.getName() : "");
loginInfo.setEntryTime(ygglMainEmp.getRzTime());
if(ygglMainEmp.getSyq()!=null) {
if (ygglMainEmp.getSyq() != null) {
// System.out.println(ygglMainEmp.getSyq());
Date expireDate = DateUtil.offsetMonth(ygglMainEmp.getRzTime(), ygglMainEmp.getSyq()); // 时间偏移
loginInfo.setRegularTime(expireDate);
}else {
} else {
loginInfo.setRegularTime(new Date());
}
......@@ -1926,7 +1941,7 @@ public class YgglController {
ArrayList<Integer> list = new ArrayList<Integer>();
Integer empNum = userBean.getEmpNum();
Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
if(gw != null && gw > 0) {
if (gw != null && gw > 0) {
ZzglBmgwM buid = ZzglBmgwM.builder().id(gw).build().selectById();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
......@@ -1947,7 +1962,7 @@ public class YgglController {
for (Integer leaderId : leaderList) {
for (YgglMainEmp m : ygglMainEmps) {
if(leaderId.equals(m.getEmpNum())) {
if (leaderId.equals(m.getEmpNum())) {
if (m.getHeadUrl() == null) {
m.setHeadUrl(CommonEnum.NULL_STR.getDesc());
}
......@@ -1959,9 +1974,9 @@ public class YgglController {
Collections.reverse(loginerChargeDtos);
if(loginerChargeDtos.size()>0) {
if((userBean.getEmpNum()).equals(loginerChargeDtos.get(loginerChargeDtos.size()-1).getLeaderEmpNum())) {
loginerChargeDtos.remove(loginerChargeDtos.size()-1);
if (loginerChargeDtos.size() > 0) {
if ((userBean.getEmpNum()).equals(loginerChargeDtos.get(loginerChargeDtos.size() - 1).getLeaderEmpNum())) {
loginerChargeDtos.remove(loginerChargeDtos.size() - 1);
}
}
return ResultUtil.data(loginerChargeDtos);
......@@ -2054,13 +2069,13 @@ public class YgglController {
YgglMainEmp sjhpd = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getPhone, userinfo.getPhone())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if(sjhpd == null) {
if (sjhpd == null) {
YgglMainEmp.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, userinfo.getName()).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
QyzxEmpLogin.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId,userinfo.getName()).eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()));
QyzxEmpLogin.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId, userinfo.getName()).eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()));
return ResultUtil.success("修改成功");
}else {
} else {
return ResultUtil.error("该号码已存在");
}
......@@ -2070,7 +2085,7 @@ public class YgglController {
@ApiOperation(value = "62-1.运营后台--查询员工列表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 62)
public Result<List<YgQueryDto>> getUserList(@RequestParam("companyId") String companyId) {
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(Integer.parseInt(companyId),0);
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(Integer.parseInt(companyId), 0);
for (YgQueryDto yg : ygQueryDto) {
if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl("");
......@@ -2081,48 +2096,50 @@ public class YgglController {
@PostMapping(value = "/addLzyy")
@ApiOperation(value = "离职原因", httpMethod = "POST", notes = "离职原因")
public Result<Object> addLzyy(@CurrentUser UserBean userBean,@RequestBody YgglEmpLzyy data) {
if(StringUtils.isEmpty(data.getValue())){
public Result<Object> addLzyy(@CurrentUser UserBean userBean, @RequestBody YgglEmpLzyy data) {
if (StringUtils.isEmpty(data.getValue())) {
return ResultUtil.error("请输入离职原因");
}
YgglEmpLzyy ygglEmpLzyy = YgglEmpLzyy.builder().build().selectOne(new QueryWrapper<YgglEmpLzyy>().lambda()
.eq(YgglEmpLzyy::getValue,data.getValue()).eq(YgglEmpLzyy::getOrgCode,userBean.getOrgCode()));
if(ygglEmpLzyy!=null){
.eq(YgglEmpLzyy::getValue, data.getValue()).eq(YgglEmpLzyy::getOrgCode, userBean.getOrgCode()));
if (ygglEmpLzyy != null) {
return ResultUtil.error("离职原因已存在");
}
YgglEmpLzyy.builder().value(data.getValue()).orgCode(userBean.getOrgCode()).build().insert();
return ResultUtil.data("添加成功");
}
@GetMapping(value = "/allLzyyList")
@ApiOperation(value = "获取所有离职原因", httpMethod = "GET", notes = "获取所有离职原因")
public Result<Object> allLzyyList(@CurrentUser UserBean userBean) {
List<YgglEmpLzyy> ygglEmpLzyyList = YgglEmpLzyy.builder().build().selectList(new QueryWrapper<YgglEmpLzyy>().lambda().eq(YgglEmpLzyy::getOrgCode,userBean.getOrgCode()));
List<YgglEmpLzyy> ygglEmpLzyyList = YgglEmpLzyy.builder().build().selectList(new QueryWrapper<YgglEmpLzyy>().lambda().eq(YgglEmpLzyy::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(ygglEmpLzyyList);
}
@PostMapping(value = "/getContract")
@ApiOperation(value = "72.运营后台--合同概况列表", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 72)
public Result<Object> getContract(@CurrentUser UserBean userBean,@RequestBody HtgkDto htgkDto) {
List<HtgkDto> htgkDtos=Lists.newArrayList();
public Result<Object> getContract(@CurrentUser UserBean userBean, @RequestBody HtgkDto htgkDto) {
List<HtgkDto> htgkDtos = Lists.newArrayList();
Map map = Maps.newHashMap();
if(htgkDto.getType()!=2){
htgkDtos = ygglAttaHtxxbMapper.selectListByType(htgkDto.getType(),htgkDto.getPage(),userBean.getOrgCode());
map.put("totalNum",ygglAttaHtxxbMapper.selectTotalByType(htgkDto.getType(),userBean.getOrgCode()));
}else {
if (htgkDto.getType() != 2) {
htgkDtos = ygglAttaHtxxbMapper.selectListByType(htgkDto.getType(), htgkDto.getPage(), userBean.getOrgCode());
map.put("totalNum", ygglAttaHtxxbMapper.selectTotalByType(htgkDto.getType(), userBean.getOrgCode()));
} else {
htgkDtos = ygglAttaHtxxbMapper.queryContract(userBean.getOrgCode());
map.put("totalNum",0);
map.put("totalNum", 0);
}
map.put("list",htgkDtos);
map.put("list", htgkDtos);
return ResultUtil.data(map);
}
@GetMapping(value = "/getPersonnelForm")
@ApiOperation(value = "人事--人事表格列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglPersonnelForm>> getPersonnelForm(@CurrentUser UserBean userBean,String query) {
public Result<List<YgglPersonnelForm>> getPersonnelForm(@CurrentUser UserBean userBean, String query) {
List<YgglPersonnelForm> personnelForms = ygglPersonnelFormMapper.selectList(new QueryWrapper<YgglPersonnelForm>().lambda()
.eq(YgglPersonnelForm::getDeleteFlag, 0)
.like(!StrUtil.isEmpty(query),YgglPersonnelForm::getFileName, query)
.like(!StrUtil.isEmpty(query), YgglPersonnelForm::getFileName, query)
.and(QueryWrapper -> QueryWrapper.eq(YgglPersonnelForm::getOrgCode, userBean.getOrgCode())
.or().isNull(YgglPersonnelForm::getOrgCode)));
return ResultUtil.data(personnelForms);
......@@ -2130,7 +2147,7 @@ public class YgglController {
@GetMapping(value = "/updateFormFileName")
@ApiOperation(value = "人事--修改人事表格文件名", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> updateFormFileName(@CurrentUser UserBean userBean,@RequestParam("fileName") String fileName,@RequestParam("id") Long id) {
public Result<Object> updateFormFileName(@CurrentUser UserBean userBean, @RequestParam("fileName") String fileName, @RequestParam("id") Long id) {
try {
YgglPersonnelForm.builder().id(id).fileName(fileName).build().updateById();
} catch (Exception e) {
......@@ -2142,7 +2159,7 @@ public class YgglController {
@GetMapping(value = "/removePersonnelForm")
@ApiOperation(value = "人事--删除人事表格文件", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> removeFormFileName(@CurrentUser UserBean userBean,@RequestParam("id") Long id) {
public Result<Object> removeFormFileName(@CurrentUser UserBean userBean, @RequestParam("id") Long id) {
try {
YgglPersonnelForm.builder().id(id).deleteFlag(1).build().updateById();
} catch (Exception e) {
......@@ -2154,7 +2171,7 @@ public class YgglController {
@PostMapping(value = "/addPersonnelForm")
@ApiOperation(value = "人事--新增人事表格文件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> addPersonnelForm(@CurrentUser UserBean userBean,@RequestBody PersonnelFormDto personnelFormDto) {
public Result<Object> addPersonnelForm(@CurrentUser UserBean userBean, @RequestBody PersonnelFormDto personnelFormDto) {
try {
YgglPersonnelForm.builder().fileName(personnelFormDto.getFileName())
.fileUrl(personnelFormDto.getFileUrl())
......@@ -2166,6 +2183,17 @@ public class YgglController {
}
return ResultUtil.success();
}
@GetMapping(value = "/importLog")
@ApiOperation(value = "获取人员导入记录", httpMethod = "GET", notes = "获取人员导入记录")
public Result<Object> importLog(@CurrentUser UserBean userBean) {
try {
List<YgglMainImportLog> ygglMainImportlogList=YgglMainImportLog.builder().build().selectList(new QueryWrapper<YgglMainImportLog>().lambda().eq(YgglMainImportLog::getOrgCode,userBean.getOrgCode()));
return ResultUtil.data(ygglMainImportlogList);
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
}
package cn.timer.api.controller.zpgl;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.clazz.NationClass;
import cn.timer.api.bean.kqgl.UserEquiRelation;
import cn.timer.api.bean.kqmk.*;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
......@@ -501,6 +502,7 @@ public class ZpglController {
@ApiParam("人才信息ID") @RequestParam(required = false) Integer zpglRcxxId) {
try {
ZpglRcxx zpglRcxx = ZpglRcxx.builder().id(zpglRcxxId).build().selectById();
zpglRcxx.setNationName(NationClass.builder().id(zpglRcxx.getNationClassId()).build().selectById().getName());
// 工作经验
List<ZpglRcxxExperience> zpglRcxxExperiences = ZpglRcxxExperience.builder().build().selectList(
new QueryWrapper<ZpglRcxxExperience>().lambda().eq(ZpglRcxxExperience::getZpglRcxxId, zpglRcxxId)
......
......@@ -524,7 +524,7 @@ public class ZpglServiceImpl implements ZpglService {
return ResultUtil.error("导入简历失败,手机号码不存在~");
}
// 查询简历是否重复导入
ZpglRcxx zpglRcxxEntiyt = ZpglRcxx.builder().build().selectOne(new QueryWrapper<ZpglRcxx>().lambda().eq(ZpglRcxx::getMobile, phone).eq(ZpglRcxx::getDeleteFlag, 0));
ZpglRcxx zpglRcxxEntiyt = ZpglRcxx.builder().build().selectOne(new QueryWrapper<ZpglRcxx>().lambda().eq(ZpglRcxx::getOrgCode, userBean.getOrgCode()).eq(ZpglRcxx::getMobile, phone).eq(ZpglRcxx::getDeleteFlag, 0));
if (!StringUtils.isEmpty(zpglRcxxEntiyt)) {
return ResultUtil.error("简历已入库,请勿重复导入");
}
......
package cn.timer.api.dao.yggl;
import cn.timer.api.bean.yggl.YgglMainImportLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
*
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-06-10 17:42:53
*/
@Repository
public interface YgglMainImportlogMapper extends BaseMapper<YgglMainImportLog> {
}
......@@ -85,5 +85,11 @@ public class AddygdaDto extends Page implements Serializable{
@ApiModelProperty(value="对应工作地点典ID",example="0")
private Integer zpglGzddId;
@ApiModelProperty(value = "员工状态 0试用、1正式、2离职中、3已离职",example = "0")
private Integer jobStatus;
@JSONField(format="yyyy-MM-dd")
@ApiModelProperty(value="离职日期 ",example="客户注册后的时间为入职时间")
private Date lzTime;
}
......@@ -269,7 +269,7 @@ sftp:
wxgzh:
appid: 'wxd331ab19a67e2319'
appSecret: '31259f6fee0c0771d6f48c3d5159c551'
appSecret: '7032afbdb4235a45e2400b98a8ec4763'
#我方token 在微信公众号基本配置里面配置( token = 8timer123 md5加密得)
token: 'af37997effca937229453180e830b164'
#消息加解密密钥
......
......@@ -254,7 +254,7 @@ sftp:
#微信公众号(服务号)
wxgzh:
appid: 'wxd331ab19a67e2319'
appSecret: '31259f6fee0c0771d6f48c3d5159c551'
appSecret: '7032afbdb4235a45e2400b98a8ec4763'
#我方token 在微信公众号基本配置里面配置( token = 8timer123 md5加密得)
token: 'af37997effca937229453180e830b164'
#消息加解密密钥
......
......@@ -247,7 +247,7 @@ sftp:
#微信公众号(服务号)
wxgzh:
appid: 'wxd331ab19a67e2319'
appSecret: '31259f6fee0c0771d6f48c3d5159c551'
appSecret: '7032afbdb4235a45e2400b98a8ec4763'
#我方token 在微信公众号基本配置里面配置( token = 8timer123 md5加密得)
token: 'af37997effca937229453180e830b164'
#消息加解密密钥
......
......@@ -298,6 +298,12 @@
<if test="policy.policyDateStart!=null and policy.policyDateStart!=''">
and ip.policy_date_start <![CDATA[ >= ]]> #{policy.policyDateStart}
</if>
<if test="policy.companyName!=null and policy.companyName!=''">
and qy.name like CONCAT('%',#{policy.companyName},'%')
</if>
<if test="policy.policyNo!=null and policy.policyNo!=''">
and ip.policy_no like CONCAT('%',#{policy.policyNo},'%')
</if>
</where>
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.yggl.YgglMainImportlogMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.yggl.YgglMainImportLog" id="ygglMainImportlogMap">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="createTime" column="create_time"/>
<result property="successNum" column="success_num"/>
<result property="errNum" column="err_num"/>
<result property="orgCode" column="org_code"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.yggl.YgglMainImportLog">
select *
from yggl_main_importLog
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.yggl.YgglMainImportLog">
select * from yggl_main_importLog
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="userId != null and userId != ''">AND `user_id` = #{userId}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="successNum != null and successNum != ''">AND `success_num` = #{successNum}</if>
<if test="errNum != null and errNum != ''">AND `err_num` = #{errNum}</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from yggl_main_importLog
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="userId != null and userId != ''">AND `user_id` = #{userId}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="successNum != null and successNum != ''">AND `success_num` = #{successNum}</if>
<if test="errNum != null and errNum != ''">AND `err_num` = #{errNum}</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.yggl.YgglMainImportLog">
insert into yggl_main_importLog
(`id`,
`user_id`,
`create_time`,
`success_num`,
`err_num`,
`org_code`)
values (#{id},
#{userId},
#{createTime},
#{successNum},
#{errNum},
#{orgCode})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.yggl.YgglMainImportLog">
insert into yggl_main_importLog
(
<if test="id != null">`id`</if>
<if test="userId != null">,`user_id`</if>
<if test="createTime != null">,`create_time`</if>
<if test="successNum != null">,`success_num`</if>
<if test="errNum != null">,`err_num`</if>
<if test="orgCode != null">,`org_code`</if>
)
values
(
<if test="id != null">#{id}</if>
<if test="userId != null">,#{userId}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="successNum != null">,#{successNum}</if>
<if test="errNum != null">,#{errNum}</if>
<if test="orgCode != null">,#{orgCode}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.yggl.YgglMainImportLog">
insert into yggl_main_importLog
(
`id`,
`user_id`,
`create_time`,
`success_num`,
`err_num`,
`org_code`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.userId},
#{item.createTime},
#{item.successNum},
#{item.errNum},
#{item.orgCode}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.yggl.YgglMainImportLog">
update yggl_main_importLog
<set>
<if test="userId != null">`user_id` = #{userId},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="successNum != null">`success_num` = #{successNum},</if>
<if test="errNum != null">`err_num` = #{errNum},</if>
<if test="orgCode != null">`org_code` = #{orgCode}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from yggl_main_importLog
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from yggl_main_importLog where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
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