Commit bd909e43 by 翁国栋

运营后台--

企业用户列表,增删改
用户批量投保
parent 9e21787f
......@@ -48,7 +48,7 @@ public class InsureApplicant extends Model<InsureApplicant> {
/**
* 企业/网点名称
*/
@ApiModelProperty(value = "目录名称")
@ApiModelProperty(value = "企业/网点名称")
private String applicantEName;
/**
* 企业/网点地址
......@@ -132,6 +132,8 @@ public class InsureApplicant extends Model<InsureApplicant> {
private String applicantInvoicedAmount;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value="银行账号")
private String applicantCorporateBankAccount;
/**
* 设置:id
......
......@@ -44,88 +44,28 @@ import org.springframework.web.multipart.MultipartFile;
@Transactional
@RequestMapping(value = "/insureApplicant", produces = {"application/json"})
public class InsureApplicantController {
private static final Logger log = LoggerFactory.getLogger(InsureApplicantController.class);
@Autowired
private InsureApplicantMapper insureApplicantMapper;
@Value("insure.type.test.appid")
private String appid;
@Value("insure.type.test.secret")
private String secret;
@Value("insure.type.test.appidq")
private String appidq;
@Value("insure.type.test.secretq")
private String secretq;
@Value("insure.type.test.uploadUrl")
private String uploadUrl;
@Value("insure.type.test.insuredUrl")
private String insuredUrl;
@Value("insure.type.test.uploadUrlq")
private String uploadUrl2;
@PostMapping("/insureApplicationSetting")
@ApiOperation(value = "设置投保人", httpMethod = "POST", notes = "投保申请")
private Result<Object> insureApplicationSetting(@CurrentUser UserBean userBean, @RequestBody InsureApplicant params) {
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode,userBean.getOrgCode()));
if(insureApplicant==null){
private Result<Object> insureApplicationSetting(@RequestBody InsureApplicant params) {
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();if(insureApplicant==null){
params.insert();
return ResultUtil.data(params);
}
BeanUtils.copyProperties(params,insureApplicant);
insureApplicant.updateById();
return ResultUtil.data(insureApplicant);
params.setId(insureApplicant.getId());
params.updateById();
return ResultUtil.data(params);
}
@PostMapping("/getApplicant")
@ApiOperation(value = "获取投保人", httpMethod = "POST", notes = "获取投保人")
private Result<Object> getApplicant(@CurrentUser UserBean userBean) {
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode,userBean.getOrgCode()));
@GetMapping("/getApplicant")
@ApiOperation(value = "获取投保人", httpMethod = "Get", notes = "获取投保人")
private Result<Object> getApplicant() {
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();
if(insureApplicant==null){
return ResultUtil.data(null);
}
return ResultUtil.data(insureApplicant);
}
/**
* 设置链接参数
*
* @param sign
* @return
*/
private Map setParams(String sign) {
/*当前时间戳*/
long timestamp = System.currentTimeMillis()/1000;
log.info("时间戳" + timestamp);
Map paramsMap = Maps.newHashMap();
paramsMap.put("pid", appidq);
paramsMap.put("timestamp", String.valueOf(timestamp));
paramsMap.put("trace_id", appidq + timestamp + new Random().nextInt((9999 - 100) + 1) + 10);
// paramsMap.put("sign",Md5.md5(appid+secret+timestamp+sign.trim()));
String value = appidq + secretq + timestamp + sign;
log.info("body参数======" + sign);
paramsMap.put("sign", DigestUtils.md5Hex(value));
log.info("params参数======" + JSONObject.toJSONString(paramsMap));
return paramsMap;
}
/**
* 设置返回信息
*
* @param data
* @return
*/
private Object message(String data) {
Map<String, Object> dataMap = JSONObject.parseObject(data);
if (dataMap.get("errcode").toString().equals("suc")) {
return dataMap.get("data");
}
return dataMap.get("errmsg");
}
}
......@@ -2,6 +2,7 @@ package cn.timer.api.controller.insure;
//import cn.timer.api.bean.insure.InsuredUser;
import cn.timer.api.bean.crm.CrmBusinessGroupMember;
import cn.timer.api.bean.insure.InsureApplicant;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.bean.insure.InsureUser;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
......@@ -17,6 +18,7 @@ import cn.timer.api.dto.insure.PolicyDto;
import cn.timer.api.utils.*;
import com.alibaba.druid.util.Base64;
import com.alibaba.fastjson.TypeReference;
import com.aliyuncs.http.HttpRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.beust.jcommander.internal.Lists;
......@@ -27,6 +29,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.eclipse.jetty.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -131,8 +135,8 @@ public class InsureContorll {
@PostMapping(value = "/insured_add")
@ApiOperation(value = "1.投保申请", httpMethod = "Post", notes = "投保申请")
@ApiOperationSupport(order = 2)
public Result<Object> insured_add(@CurrentUser UserBean userBean, @RequestParam(required = true) String url, @RequestBody InsureDto insureDto) {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(userBean.getOrgCode()).build().selectById(); // 企业信息
public Result<Object> insured_add(@RequestBody InsureDto insureDto) {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(insureDto.getOrgCode())).build().selectById(); // 企业信息
DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
DateFormat dtf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
......@@ -151,6 +155,30 @@ public class InsureContorll {
quotations.put("from_source","");/*币种:5人民币*/
quotations.put("operator_name","");/*币种:5人民币*/
/*企业信息*/
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();
if(insureApplicant==null){
return ResultUtil.error("未设置投保人");
}
Map companyApplicantMap = Maps.newHashMap();
companyApplicantMap.put("applicant_e_name",insureApplicant.getApplicantEName());/*企业/网点名称*/
companyApplicantMap.put("applicant_e_address",insureApplicant.getApplicantEAddress());/*企业/网点地址*/
companyApplicantMap.put("applicant_e_contacts", insureApplicant.getApplicantEContacts());/*企业授权操作人姓名*/
companyApplicantMap.put("applicant_e_phone", insureApplicant.getApplicantEPhone());/*操作人的联系电话*/
companyApplicantMap.put("applicant_e_no_type", insureApplicant.getApplicantENoType());/*企业证件类型*/
companyApplicantMap.put("applicant_e_no", insureApplicant.getApplicantENo());/*企业证件号码*/
companyApplicantMap.put("applicant_e_mail", insureApplicant.getApplicantEMail());/*企业邮箱*/
companyApplicantMap.put("applicant_province_city", "21721");/*省市区*/
/*人员清单填被保人员*/
String url= creaXSSFWorkbook(insureDto.getUserIds());
if(!StringUtil.isNotBlank(url)){
return ResultUtil.error("文件错误");
}
companyApplicantMap.put("applicant_employee_list",url);
quotations.put("company_applicant",companyApplicantMap);
Map basicMap = Maps.newHashMap();
basicMap.put("partner_pid","1231");/*分销商pid*/
basicMap.put("plan_code_id","61b85207b73d2ab09fb2959");/*计划代码,选项值:61b85207b73d2ab09fb2959 (生产环境) 61b85207b73d2ab09fb2959 (沙箱环境)*/
......@@ -168,26 +196,14 @@ public class InsureContorll {
quotations.put("basic",basicMap);
quotations.put("individual_applicant",Maps.newHashMap());
/*企业信息*/
Map companyApplicantMap = Maps.newHashMap();
companyApplicantMap.put("applicant_e_name","测试企业一");/*企业/网点名称*/
companyApplicantMap.put("applicant_e_address", "测试地址");/*企业/网点地址*/
companyApplicantMap.put("applicant_e_contacts", "测试人");/*企业授权操作人姓名*/
companyApplicantMap.put("applicant_e_phone", "13800138000");/*操作人的联系电话*/
companyApplicantMap.put("applicant_e_no_type", "3646");/*企业证件类型*/
companyApplicantMap.put("applicant_e_no", "91310230MA1JXL5059");/*企业证件号码*/
companyApplicantMap.put("applicant_e_mail", "123@123.com");/*企业邮箱*/
companyApplicantMap.put("applicant_province_city", "21721");/*省市区*/
/*人员清单填被保人员*/
companyApplicantMap.put("applicant_employee_list",url);
quotations.put("company_applicant",companyApplicantMap);
/*被保人员 填被保企业信息*/
ArrayList<Map> insuredArray = new ArrayList<>();
Map insured = Maps.newHashMap();
insured.put("trans_id","P_"+qyzxEntInfoM.getId()+"_"+dtf2.format(now));
insured.put("price","75");/*根据基础计划生成*/
insured.put("price",insureDto.getUserIds().length*15);/*根据基础计划生成*/
insured.put("insured_applicant_relations", "36960");
insured.put("insured_mobile", qyzxEntInfoM.getLinkManPhone());
insured.put("insured_e_contact", qyzxEntInfoM.getLinkMan());
......@@ -246,7 +262,7 @@ public class InsureContorll {
insurePolicy.setStatus("1");
insurePolicy.setPolicyFile(policyMap.get("policy_file").toString());
insurePolicy.setKitUrl(policyMap.get("kit_url").toString());
insurePolicy.setOrgCode(userBean.getOrgCode());
insurePolicy.setOrgCode(qyzxEntInfoM.getId());
insurePolicy.setCreateTime(new Date());
insurePolicy.setSchemeName("【新】-安诚-雇主责任险(劳务公司)预付款");/*先写死*/
insurePolicy.insert();
......@@ -255,12 +271,8 @@ public class InsureContorll {
insurePolicy.setPolicyDateEnd(null);
e.printStackTrace();
}
}
return ResultUtil.data("");
return ResultUtil.error("");
}
/*测试用生产环境不需要*/
......@@ -272,7 +284,7 @@ public class InsureContorll {
}else{
if(dataMap.get("errcode").toString().equals("e1")&&dataMap.get("errmsg").toString().equals("出单中")){
try {
Thread.sleep(60000);
Thread.sleep(30000);
return requestAgent(bodyMap);
} catch (InterruptedException e) {
e.printStackTrace();
......@@ -358,51 +370,62 @@ public class InsureContorll {
return dataMap.get("errmsg");
}
@GetMapping(value = "/downExcel")
@ApiOperation(value = "2.核保", httpMethod = "Get", notes = "下载投保文件")
@ApiOperationSupport(order = 2)
public void downExcel(@CurrentUser UserBean userBean, HttpServletRequest request, HttpServletResponse resp,@RequestParam("ids") String[] ids){
public String creaXSSFWorkbook(String[] ids){
if(ids.length<=0){
return;
return "error";
}
LocalDate localDate = LocalDate.now();
/*获取该企业下所有未投保员工 测试用*/
// List<YgglMainEmp> ygglMainEmpList =YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode,userBean.getOrgCode())
// .eq(YgglMainEmp::getIsInsure,0));
List<YgglMainEmp> ygglMainEmpList=ygglMainEmpMapper.selectListByIds(ids);
ExcelBean excelBean;
List list=Lists.newArrayList();
for (YgglMainEmp y:ygglMainEmpList) {
String[] arr =new String[]{String.valueOf(y.getId()),y.getName(),"身份证",y.getZjNum(),"50万意外/5万医疗/扩展24小时(A类)","","深圳名邦人力资源管理有限公司","无","A类"};
list.add(arr);
}
String[] rowName=new String[]{"ID","name","ID_type","ID_number","Scheme_name","Date_start","Branch","Tricycle_frame_number","benefit_occupation_category"};
/*随机抽取五名幸运用户投保*/
OutputStream os = null;
XSSFWorkbook xssfWorkbook= ExcelUtils.exportExcel(localDate+"_"+list.size()+"名人员清单.xlsx",rowName,list);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
resp.setContentType("application/octet-stream");
resp.setHeader("content-disposition", "attachment; filename=" + URLEncoder.encode(localDate+"_"+list.size()+"名人员清单.xlsx", "UTF-8"));
resp.setCharacterEncoding("UTF-8");
os = resp.getOutputStream();
ExcelUtils.exportExcel(localDate+"_"+list.size()+"名人员清单.xlsx",rowName,list,os);
} catch (FileNotFoundException e) {
e.printStackTrace();
xssfWorkbook.write(byteArrayOutputStream);
byte[] bytes = byteArrayOutputStream.toByteArray();
String fileBase64= Base64.byteArrayToBase64(bytes);
/*body参数 begin*/
Map bodyMap= Maps.newHashMap();
bodyMap.put("app","mall");
bodyMap.put("name",localDate+"_"+list.size()+"名人员清单.xlsx");
bodyMap.put("file",fileBase64);
/*end*/
String data=HttpUtils.sendPost(uploadUrl,setParams(JSONObject.toJSONString(bodyMap)),bodyMap);
Map<String,Object> dataMap = JSONObject.parseObject(data);
if (dataMap.get("errcode").toString().equals("suc")) {
Object o = dataMap.get("data");
Map <String,Object> map= JSONObject.parseObject(JSONObject.toJSONString(o));
return map.get("url").toString();
}
/*文件流base64*/
} catch (IOException e) {
e.printStackTrace();
}finally {
try {
os.close();
xssfWorkbook.close();
byteArrayOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return "suc";
}
@PostMapping(value = "/policyList")
@ApiOperation(value = "3.保单列表", httpMethod = "Post", notes = "保单列表")
@ApiOperationSupport(order = 2)
public Result<Object> policyList(@RequestBody PolicyDto policyDto) {
List<PolicyDto> list = insureUserMapper.selectPolicyList(String.valueOf(policyDto.getId()));
return ResultUtil.data(list);
return ResultUtil.data(Optional.ofNullable(list).orElse(Lists.newArrayList()));
}
@PostMapping(value = "/policyListAdmin")
@ApiOperation(value = "4.保单列表--运营后台端", httpMethod = "Post", notes = "保单列表")
......
package cn.timer.api.controller.qyzx;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.servlet.http.HttpSession;
import cn.timer.api.dto.qyzx.*;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -57,12 +52,6 @@ import cn.timer.api.dao.qyzx.QyzxOperLogMapper;
import cn.timer.api.dao.qyzx.QyzxPayServeMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.login.QysDto;
import cn.timer.api.dto.qyzx.AdminListDto;
import cn.timer.api.dto.qyzx.AttaFpglQueryDto;
import cn.timer.api.dto.qyzx.EntauthDto;
import cn.timer.api.dto.qyzx.LogBuyDto;
import cn.timer.api.dto.qyzx.MenuStructureDto;
import cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
......@@ -100,7 +89,7 @@ public class QyzxController {
/**
* 获取企业信息
*
*
* @param
* @return
*/
......@@ -115,7 +104,7 @@ public class QyzxController {
/**
* 添加/修改企业信息
*
*
* @param
* @return
*/
......@@ -136,7 +125,7 @@ public class QyzxController {
/**
* 企业认证-申请
*
*
* @param qyzxEntAuth
* @return
*/
......@@ -154,7 +143,7 @@ public class QyzxController {
/**
* 运营管理 企业认证-审核-通过/不通过(weng)
*
*
* @param qyzxEntAuth
* @return
*/
......@@ -179,7 +168,7 @@ public class QyzxController {
/**
* 新增/编辑常用企业开票资料
*
*
* @param QyzxInvoiceUsual
* @return
*/
......@@ -198,7 +187,7 @@ public class QyzxController {
/**
* 显示常用的企业开票资料
*
*
* @param QyzxInvoiceUsual
* @return
*/
......@@ -220,7 +209,7 @@ public class QyzxController {
/**
* 显示企业的超级管理员
*
*
* @param qyzxEntAuth
* @return
*/
......@@ -240,7 +229,7 @@ public class QyzxController {
* 获取企业的到期时间和版本号
*//*
* @GetMapping(value = "/endtimeversion")
*
*
* @ApiOperation(value = "获取企业的到期时间和版本号", httpMethod = "GET", notes = "接口发布说明")
* public Result<QyzxEntInfoM> endtimeversion(@CurrentUser UserBean userBean) {
* QyzxEntInfoM qyzxEntInfoM = new
......@@ -252,7 +241,7 @@ public class QyzxController {
/**
* 当前用户企业列表
*
*
* @param
* @return
*/
......@@ -283,7 +272,7 @@ public class QyzxController {
/**
* 切换企业
*
*
* @param org_num
* @return
*/
......@@ -369,7 +358,7 @@ public class QyzxController {
/**
* 购买服务(添加服务计算,添加购买记录)
*
*
* @param
* @return
*/
......@@ -412,7 +401,7 @@ public class QyzxController {
// 使用系统购买服务
/**
* 获取服务计算
*
*
* @param
* @return
*/
......@@ -426,7 +415,7 @@ public class QyzxController {
/**
* 获取购买记录
*
*
* @param
* @return
*/
......@@ -440,7 +429,7 @@ public class QyzxController {
/**
* 查询购买记录
*
*
* @param
* @return
*/
......@@ -462,7 +451,7 @@ public class QyzxController {
/**
* 账号管理 获取账号
*
*
* @param
* @return
*/
......@@ -479,7 +468,7 @@ public class QyzxController {
/**
* 查询-操作日志
*
*
* @param
* @return
*/
......@@ -513,11 +502,11 @@ public class QyzxController {
return ResultUtil.data(pages, listOl, "操作成功!");
}
@PostMapping(value = "/menusequencedata")
@ApiOperation(value = "菜单顺序数据", httpMethod = "POST", notes = "")
public Result<Object> menusequencedata(@CurrentUser UserBean userBean) {
List<MenuStructureDto> mestrs = new ArrayList<MenuStructureDto>();
List<QyzxAdminMenu> qyme = QyzxAdminMenu.builder().build().selectList(new QueryWrapper<QyzxAdminMenu>().lambda().eq(QyzxAdminMenu::getOrgCode, userBean.getOrgCode()).orderByAsc(QyzxAdminMenu::getSortNumber));
String[] zdy = new String[qyme.size()];
......@@ -531,11 +520,11 @@ public class QyzxController {
mestrs.add(metr);
zdy[i] = me.getMenuCode();
i++;
}
}
//
List<AdminMenuTemplate> adtes = AdminMenuTemplate.builder().build().selectList(new QueryWrapper<AdminMenuTemplate>().lambda().eq(AdminMenuTemplate::getEnable, 1).orderByAsc(AdminMenuTemplate::getSortNumber));
for(AdminMenuTemplate adm : adtes) {
if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(zdy), adm.getMenuCode())) {
if(adm.getDistribution() == 0 && userBean.getOrgCode() == 3) {
MenuStructureDto metr = MenuStructureDto.builder().build();
......@@ -554,17 +543,17 @@ public class QyzxController {
}
}
}
return ResultUtil.data(mestrs, "成功");
}
@PostMapping(value = "/menustructure")
@ApiOperation(value = "菜单结构", httpMethod = "POST", notes = "")
public Result<Object> menustructure(@CurrentUser UserBean userBean,@RequestBody List<QyzxAdminMenu> qymu) {
QyzxAdminMenu.builder().build().delete(new QueryWrapper<QyzxAdminMenu>().lambda().eq(QyzxAdminMenu::getOrgCode, userBean.getOrgCode()));
for(QyzxAdminMenu me : qymu) {
QyzxAdminMenu meu = QyzxAdminMenu.builder().build();
meu.setMenuCode(me.getMenuCode());
......@@ -574,36 +563,36 @@ public class QyzxController {
meu.setAddtime(new Date().getTime());
meu.insert();
}
return ResultUtil.data(qymu, "修改成功");
}
@PostMapping(value = "/corporatecolor")
@ApiOperation(value = "菜单自定义颜色", httpMethod = "POST", notes = "")
public Result<Object> corporatecolor(@CurrentUser UserBean userBean) {
QyzxAdminColour cdys = QyzxAdminColour.builder().build().selectOne(new QueryWrapper<QyzxAdminColour>().lambda().eq(QyzxAdminColour::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(cdys, "查询成功");
}
@PostMapping(value = "/customcolor")
@ApiOperation(value = "菜单自定义颜色", httpMethod = "POST", notes = "")
public Result<Object> customcolor(@CurrentUser UserBean userBean,@RequestBody QyzxAdminColour cdys) {
cdys.setOrgCode(userBean.getOrgCode());
cdys.setAddtime(new Date().getTime());
cdys.insertOrUpdate();
return ResultUtil.data(cdys, "保存成功");
}
/**
* 删除-操作日志
*
*
* @param
* @return
*/
......@@ -617,4 +606,44 @@ public class QyzxController {
return ResultUtil.data(delCount, "操作成功!");
}
/**
* 运营后台---企业信息列表
* @param
* @param cdys
* @return
*/
@PostMapping(value = "/companyAdminList")
@ApiOperation(value = "运营后台---企业信息列表", httpMethod = "POST", notes = "")
public Result<Object> companyAdminList(@RequestBody cn.timer.api.utils.Page page) {
Map map = Maps.newHashMap();
List<EntInfoDto> list = Optional.ofNullable(qyzxEntInfoMMapper.companyAdminList(page)).orElse(Lists.newArrayList());
Integer count = qyzxEntInfoMMapper.companyAdminCount();
map.put("list",list);
map.put("count",count);
return ResultUtil.data(map);
}
@GetMapping(value = "/selectentbyId")
@ApiOperation(value = "运营后台---获取企业信息", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> selectentbyId(@RequestParam("id") String id) {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(id)).build().selectById();
return ResultUtil.data(qyzxEntInfoM, "获取企业信息成功");
}
@PostMapping(value = "/aeCompamy")
@ApiOperation(value = "运营后台---添加/修改企业信息", httpMethod = "POST", notes = "接口发布说明")
@Log(title = "运营后台---添加/修改-企业信息", businessType = BusinessType.UPDATE)
public Result<QyzxEntInfoM> aeCompamy(@RequestBody QyzxEntInfoM qyzxEntInfoM) {
QyzxEntInfoM q = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper)
.eq(QyzxEntInfoM::getId, qyzxEntInfoM.getId()).one();
if(q!=null){
qyzxEntInfoM.setRegisterTime(q.getRegisterTime());
}
qyzxEntInfoM.insertOrUpdate();
return ResultUtil.data(qyzxEntInfoM, "添加/修改企业");
}
@GetMapping(value = "/getCompanySelect")
@ApiOperation(value = "运营后台---获取选择框下的企业信息", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> getCompanySelect() {
return ResultUtil.data(qyzxEntInfoMMapper.getCompanyList(), "获取成功");
}
}
......@@ -35,7 +35,7 @@ public class SuperLoginController {
private HttpSession session;
@PostMapping(value = "/adminLogin")
@ApiOperation(value = "运营后台登录", httpMethod = "POST", notes = "接口发布说明")
public Result<AdminAccount> adminLogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request){
public Result<Object> adminLogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request){
String ip = UserIp.getIpAddr(request);
AdminAccount adminAccount = AdminAccount.builder().build().selectOne(new QueryWrapper<AdminAccount>().lambda()
.eq(AdminAccount::getAccount,entRegisterDto.getPhone())
......
/**
* @date 2019年11月15日
* @date 2019年11月15日
* @author 翁东州
* @方法中文名称:
*/
......@@ -33,13 +33,7 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -180,7 +174,7 @@ public class YgglController {
/**
* 获取员工档案
*
*
* @param
* @return
*/
......@@ -220,7 +214,7 @@ public class YgglController {
/**
* 根据岗位id获取员工档案部门岗位名称
*
*
* @param
* @return
*/
......@@ -250,20 +244,20 @@ public class YgglController {
return ResultUtil.data(bmgw);
}
@Autowired
private RealTimeUpdate realtimeupdate;
@Autowired
private KqglAssoKqzdkfsMapper kqglassokqzdkfsmapper;
@Value("${config-8timer.machine8timerUrl}")
public String mac_command; // 回调地址
@Autowired
private UserEquiRelationMapper userequirelationmapper;
/**
* 添加员工档案
*
*
* @param userBean
* @param addygdaDto
* @return
......@@ -312,7 +306,7 @@ public class YgglController {
Integer syq = addygdaDto.getSyq();
Integer sex = addygdaDto.getSex();
Integer bmgwId = addygdaDto.getBmgwId();
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
......@@ -335,17 +329,17 @@ 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).customNum(customNum).build();
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) {
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) {
// 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";
HttpHeaders headers = new HttpHeaders();
......@@ -356,37 +350,37 @@ public class YgglController {
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, login.getId()).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
KqglAssoYhsb uskqj = KqglAssoYhsb.builder().userId(login.getId()).kqjid(kqj.getId()).type(1).build();
UserEquiRelation isgly = userequirelationmapper.selectByuserId(login.getId());
if(isgly != null) {
uskqj.setIsGly(isgly.getIsGly());
}else {
uskqj.setIsGly(0);
}
if (!uskqj.insert())
if (!uskqj.insert())
return ResultUtil.error("操作失败--新增用户与设备关系");
}
}
}
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();
//假期规则初始化
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));
......@@ -397,14 +391,14 @@ public class YgglController {
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);
} catch (ParseException e) {
e.printStackTrace();
}
return ResultUtil.data(ygglMainEmp, "添加员工成功!");
} else {
return ResultUtil.error("该手机号已被使用,请输入正确手机号");
......@@ -414,7 +408,7 @@ public class YgglController {
/**
* 修改员工档案
*
*
* @param
* @return
*/
......@@ -453,7 +447,7 @@ public class YgglController {
/**
* 员工搜索
*
*
* @param
* @return
*/
......@@ -486,13 +480,13 @@ public class YgglController {
return ResultUtil.data(ygglMainEmpPage);
}
@Autowired
private ZzglBmgwMService zzglBmgwMService;
/**
* 员工列表-分页
*
*
* @param
* @return
*/
......@@ -504,7 +498,7 @@ public class YgglController {
Integer bmgwId = empQuery.getBmgwid();
Page<YgglMainEmp> page = new Page<YgglMainEmp>(empQuery.getCurrentPage(), empQuery.getTotalPage());
List<Integer> empNums = CollUtil.toList();
if (bmgwId != null) {
List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), bmgwId);
if (CollectionUtil.isNotEmpty(usersQuery)) {
......@@ -512,7 +506,7 @@ public class YgglController {
}else {
return ResultUtil.data(null);
}
if (CollectionUtil.isEmpty(empNums)) {
return ResultUtil.data(null);
}
......@@ -522,7 +516,7 @@ public class YgglController {
IPage<YgglMainEmp> ygglMainEmpPage = ygglMainEmpMapper.selectME(page, empQuery);
List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
return ResultUtil.data(page, ygglMainEmps);
}
......@@ -559,7 +553,7 @@ public class YgglController {
// List<AddygdaDto> list = listAddygdaDto.stream()
// .filter(o -> o != null && !listPhone.contains(o.getPhone()) && !listzjNum.contains(o.getZjNum()))
// .collect(Collectors.toList());
// 过滤掉 导入数据中, listPhone已存在 的 phone 的对象集合
List<AddygdaDto> list = listAddygdaDto.stream()
.filter(o -> o != null && !listPhone.contains(o.getPhone())).collect(Collectors.toList());
......@@ -636,9 +630,9 @@ public class YgglController {
// 存放 插入失败的 数据
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));
......@@ -649,8 +643,8 @@ public class YgglController {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}
}
}
JSONObject obj = JSONUtil.createObj();
......@@ -666,7 +660,7 @@ public class YgglController {
/**
* 获取导入模板
*
*
* @param
* @return
* @throws IOException
......@@ -723,7 +717,7 @@ public class YgglController {
/**
* 导出员工
*
*
* @param
* @return
*/
......@@ -738,7 +732,7 @@ public class YgglController {
/**
* 获取员工教育经历表
*
*
* @param
* @return
*/
......@@ -765,7 +759,7 @@ public class YgglController {
/**
* 添加/修改员工教育经历表
*
*
* @param
* @return
*/
......@@ -781,7 +775,7 @@ public class YgglController {
/**
* 删除员工教育经历表
*
*
* @param
* @return
*/
......@@ -796,7 +790,7 @@ public class YgglController {
/**
* 获取员工培训经历信息表
*
*
* @param
* @return
*/
......@@ -824,7 +818,7 @@ public class YgglController {
/**
* 添加/修改员工培训经历信息表
*
*
* @param
* @return
*/
......@@ -841,7 +835,7 @@ public class YgglController {
/**
* 删除员工培训经历信息表
*
*
* @param
* @return
*/
......@@ -856,7 +850,7 @@ public class YgglController {
/**
* 获取员工工作经历表
*
*
* @param
* @return
*/
......@@ -883,7 +877,7 @@ public class YgglController {
/**
* 添加/修改员工工作经历表
*
*
* @param
* @return
*/
......@@ -899,7 +893,7 @@ public class YgglController {
/**
* 删除员工工作经历表
*
*
* @param
* @return
*/
......@@ -914,7 +908,7 @@ public class YgglController {
/**
* 获取员工职称信息表
*
*
* @param
* @return
*/
......@@ -941,7 +935,7 @@ public class YgglController {
/**
* 添加/修改员工职称信息表
*
*
* @param
* @return
*/
......@@ -957,7 +951,7 @@ public class YgglController {
/**
* 删除员工职称信息表
*
*
* @param
* @return
*/
......@@ -972,7 +966,7 @@ public class YgglController {
/**
* 获取员工证书证件表
*
*
* @param
* @return
*/
......@@ -999,7 +993,7 @@ public class YgglController {
/**
* 添加/修改员工证书证件表
*
*
* @param
* @return
*/
......@@ -1015,7 +1009,7 @@ public class YgglController {
/**
* 删除员工证书证件表
*
*
* @param
* @return
*/
......@@ -1030,7 +1024,7 @@ public class YgglController {
/**
* 获取员工联系信息表
*
*
* @param
* @return
*/
......@@ -1057,7 +1051,7 @@ public class YgglController {
/**
* 添加/修改员工联系信息表
*
*
* @param
* @return
*/
......@@ -1073,7 +1067,7 @@ public class YgglController {
/**
* 删除员工联系信息表
*
*
* @param
* @return
*/
......@@ -1088,7 +1082,7 @@ public class YgglController {
/**
* 获取员工紧急联系人表
*
*
* @param
* @return
*/
......@@ -1115,7 +1109,7 @@ public class YgglController {
/**
* 添加/修改员工紧急联系人表
*
*
* @param
* @return
*/
......@@ -1131,7 +1125,7 @@ public class YgglController {
/**
* 删除员工紧急联系人表
*
*
* @param
* @return
*/
......@@ -1147,7 +1141,7 @@ public class YgglController {
// 获取工资卡信息
/**
* 获取员工工资卡信息
*
*
* @param
* @return
*/
......@@ -1173,7 +1167,7 @@ public class YgglController {
/**
* 添加/修改工资卡信息
*
*
* @param
* @return
*/
......@@ -1189,7 +1183,7 @@ public class YgglController {
/**
* 删除工资卡信息
*
*
* @param
* @return
*/
......@@ -1204,7 +1198,7 @@ public class YgglController {
/**
* 获取员工合同信息表
*
*
* @param
* @return
*/
......@@ -1231,7 +1225,7 @@ public class YgglController {
/**
* 添加/修改员工合同信息表
*
*
* @param
* @return
*/
......@@ -1247,7 +1241,7 @@ public class YgglController {
/**
* 删除员工合同信息表
*
*
* @param
* @return
*/
......@@ -1262,7 +1256,7 @@ public class YgglController {
/**
* 获取员工材料附件表
*
*
* @param
* @return
*/
......@@ -1289,7 +1283,7 @@ public class YgglController {
/**
* 添加/修改员工材料附件表
*
*
* @param
* @return
*/
......@@ -1305,7 +1299,7 @@ public class YgglController {
/**
* 删除员工材料附件表
*
*
* @param
* @return
*/
......@@ -1320,7 +1314,7 @@ public class YgglController {
/**
* 获取成长记录表
*
*
* @param
* @return
*/
......@@ -1347,7 +1341,7 @@ public class YgglController {
/**
* 添加/修改成长记录表
*
*
* @param
* @return
*/
......@@ -1363,7 +1357,7 @@ public class YgglController {
/**
* 获取单个离职员工信息(管)
*
*
* @param
* @return
*/
......@@ -1378,7 +1372,7 @@ public class YgglController {
/**
* 员工转正 0-1
*
*
* @param
* @return
*/
......@@ -1395,7 +1389,7 @@ public class YgglController {
/**
* 计划离职 type1-2
*
*
* @param
* @return
*/
......@@ -1409,11 +1403,11 @@ public class YgglController {
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if (ygglMainEmp.getJobStatus() == jobStatus.LIZHIZHONG.getType()) {
return ResultUtil.success("你已在离职中");
}
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
......@@ -1437,7 +1431,7 @@ public class YgglController {
/**
* 确认离职 type2-3
*
*
* @param
* @return
*/
......@@ -1475,11 +1469,11 @@ public class YgglController {
if (listEEA != null && listEEA.size() > 0) {
QyzxEmpLogin.builder().id(empNum).orgId(CollUtil.getFirst(listEEA).getOrgCode()).build().updateById();
}
QyzxEmpLogin.builder().build().delete(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()).eq(QyzxEmpLogin::getId, empNum));
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);
......@@ -1487,13 +1481,13 @@ public class YgglController {
} catch (ParseException e) {
e.printStackTrace();
}
return ResultUtil.success("确认离职员工成功");
}
/**
* 放弃离职 type 2-1
*
*
* @param
* @return
*/
......@@ -1532,7 +1526,7 @@ public class YgglController {
/**
* 查询离职员工列表
*
*
* @param
* @return
*/
......@@ -1551,7 +1545,7 @@ public class YgglController {
/**
* 展示民族/展示所有民族
*
*
* @param
* @return
*/
......@@ -1572,7 +1566,7 @@ public class YgglController {
/**
* 籍贯树
*
*
* @param
* @return
*/
......@@ -1588,7 +1582,7 @@ public class YgglController {
/**
* 查询员工列表
*
*
* @param
* @return
*/
......@@ -1596,7 +1590,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());
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode(),null);
for (YgQueryDto yg : ygQueryDto) {
if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl("");
......@@ -1608,7 +1602,7 @@ public class YgglController {
/*************** 统计图 ***************/
/**
* 查询统计图
*
*
* @return 成功信息
*/
@GetMapping("/yggl")
......@@ -1651,7 +1645,7 @@ public class YgglController {
/**
* 员工信息统计图
*
*
* @return 成功信息(weng)
*/
@GetMapping("/Cartogram")
......@@ -1729,7 +1723,7 @@ public class YgglController {
/**
* 获取员工社保公积金
*
*
* @param
* @return
*/
......@@ -1745,7 +1739,7 @@ public class YgglController {
/**
* 获取员工社保公积金
*
*
* @param
* @return
*/
......@@ -1762,7 +1756,7 @@ public class YgglController {
/**
* 添加/修改员工社保公积金
*
*
* @param
* @return
*/
......@@ -1787,7 +1781,7 @@ public class YgglController {
/**
* 删除员工社保公积金
*
*
* @param
* @return
*/
......@@ -1829,7 +1823,7 @@ public class YgglController {
/**
* 获取登录人的相关信息
*
*
* @param
* @return
*/
......@@ -1864,22 +1858,22 @@ public class YgglController {
loginInfo.setGwId(gw);
loginInfo.setGwName(gwObj != null ? gwObj.getName() : "");
loginInfo.setEntryTime(ygglMainEmp.getRzTime());
if(ygglMainEmp.getSyq()!=null) {
// System.out.println(ygglMainEmp.getSyq());
Date expireDate = DateUtil.offsetMonth(ygglMainEmp.getRzTime(), ygglMainEmp.getSyq()); // 时间偏移
loginInfo.setRegularTime(expireDate);
loginInfo.setRegularTime(expireDate);
}else {
loginInfo.setRegularTime(new Date());
loginInfo.setRegularTime(new Date());
}
}
return ResultUtil.data(loginInfo);
}
/**
* 获取登录人和上级主管的empNum和名称
*
*
* @param
* @return
*/
......@@ -1887,16 +1881,16 @@ public class YgglController {
@ApiOperation(value = "70.获取登录人和上级主管的empNum和名称", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
public Result<List<LoginerChargeDto>> loginerChargers(@CurrentUser UserBean userBean) {
List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
Integer empNum = userBean.getEmpNum();
Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
if(gw != null && gw > 0) {
ZzglBmgwM buid = ZzglBmgwM.builder().id(gw).build().selectById();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).list();
// 获取该员工的上级部门id 的数组list
......@@ -1912,7 +1906,7 @@ public class YgglController {
}
List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList);
// List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
for (Integer leaderId : leaderList) {
for (YgglMainEmp m : ygglMainEmps) {
if(leaderId.equals(m.getEmpNum())) {
......@@ -1922,10 +1916,10 @@ public class YgglController {
loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(), m.getName(), m.getHeadUrl()));
}
}
}
Collections.reverse(loginerChargeDtos);
if(loginerChargeDtos.size()>0) {
if((userBean.getEmpNum()).equals(loginerChargeDtos.get(loginerChargeDtos.size()-1).getLeaderEmpNum())) {
......@@ -1935,7 +1929,7 @@ public class YgglController {
return ResultUtil.data(loginerChargeDtos);
}
return ResultUtil.data(loginerChargeDtos);
}
// 根据传来的empNum获取该人员信息,没有则传全部
......@@ -1965,7 +1959,7 @@ public class YgglController {
/**
* 获取用户头像
*
*
* @param
* @return
*/
......@@ -1987,52 +1981,65 @@ public class YgglController {
}
return ResultUtil.data(yglList);
}
@Autowired
private KqglAssoLeaveBalanceMapper kqglassoleavebalancemapper;
@GetMapping(value = "/address_book")
@ApiOperation(value = "APP 获取通讯录", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
public Result<Object> Getaddressbook(@CurrentUser UserBean userBean) {
List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(userBean.getOrgCode());
return ResultUtil.data(userlist);
}
@PostMapping(value = "/modify_avatar")
@ApiOperation(value = "APP_修改头像", httpMethod = "POST", notes = "接口发布说明")
public Result<YgglAttaSbgjj> Modify_Avatar(@CurrentUser UserBean userBean, @RequestBody ModifyAvatarDto modifyavatardto) {
YgglMainEmp.builder().headUrl(modifyavatardto.getAvatar_path()).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum()));
QyzxEmpLogin.builder().headUrl(modifyavatardto.getAvatar_path()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode())
.eq(QyzxEmpLogin::getPhone, userBean.getQyzxEmpLogin().getPhone()));
return ResultUtil.success("上传成功");
}
@PostMapping(value = "/new_account")
@ApiOperation(value = "修改账号", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> New_account(@CurrentUser UserBean userBean, @RequestBody UserInfo userinfo) {
YgglMainEmp sjhpd = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getPhone, userinfo.getPhone())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
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()));
return ResultUtil.success("修改成功");
}else {
return ResultUtil.error("该号码已存在");
}
}
@GetMapping(value = "/getUserList")
@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);
for (YgQueryDto yg : ygQueryDto) {
if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl("");
}
}
return ResultUtil.data(ygQueryDto);
}
}
package cn.timer.api.dao.qyzx;
import cn.timer.api.dto.qyzx.EntInfoDto;
import cn.timer.api.utils.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import java.util.List;
import java.util.Map;
/**
......@@ -14,6 +18,11 @@ import cn.timer.api.bean.qyzx.QyzxEntInfoM;
*/
@Repository
public interface QyzxEntInfoMMapper extends BaseMapper<QyzxEntInfoM> {
public List<EntInfoDto> companyAdminList(@Param("page")Page page);
public Integer companyAdminCount();
public List<Map<String,String>> getCompanyList();
......
......@@ -49,7 +49,7 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @param userBean
* @return
*/
List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode);
List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode,@Param("isInsure")Integer isInsure);
/**
......
package cn.timer.api.dto.qyzx;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/17 10:09
*/
@Data
public class EntInfoDto {
private Integer id;
private String name;
private String linkMan;
private String linkManPhone;
private String areaName;
private String totalNum;
private String logoUrl;
private String registerTime;
private String endTime;
private Integer totlaSpmk;
private Integer totlaCc;
}
/**
* @date 2019年11月16日
* @date 2019年11月16日
* @author 翁东州
* @方法中文名称:
*/
......@@ -27,6 +27,8 @@ import lombok.NoArgsConstructor;
public class YgQueryDto extends Page {
// private static final long serialVersionUID = -1230023773946170942L;
@ApiModelProperty
private Integer id;
@ApiModelProperty(value = "员工姓名", example = "华仔")
private String empName;
......
......@@ -291,11 +291,11 @@ public class ExcelUtils {
* @param out 输出流
* @throws Exception
*/
public static void exportExcel(String title, String[] rowName, List<Object[]> dataList, OutputStream out) {
public static XSSFWorkbook exportExcel(String title, String[] rowName, List<Object[]> dataList) {
logger.info("========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 开始 =========================");
XSSFWorkbook workbook = null;
try {
/*
1,创建工作簿对象,然后创建大标题行,并设置标题
*/
......@@ -417,22 +417,7 @@ public class ExcelUtils {
sheet.setColumnWidth(colNum, (columnWidth + 4) * 256);
}
}
workbook.write(out);
} catch (Exception e) {
logger.info("ExcelUtils.java ->> exportExcel() ->> 异常信息:" + e);
throw new RuntimeException(e);
} finally {
try {
if (workbook != null) {
workbook.close();
logger.info("ExcelUtils.java ->> exportExcel() ->> 关闭Workbook资源");
}
} catch (Exception e) {
e.printStackTrace();
}
logger.info("========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 结束 =========================");
}
return workbook;
}
/**
......
......@@ -23,6 +23,7 @@
<result property="transId" column="trans_id"/>
<result property="currency" column="currency"/>
<result property="applicantInvoicedAmount" column="applicant_invoiced_amount"/>
<result property="applicantCorporateBankAccount" column="applicant_corporate_bank_account"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureApplicant">
......@@ -145,7 +146,8 @@
`applicant_type`,
`trans_id`,
`currency`,
`applicant_invoiced_amount`)
`applicant_invoiced_amount`,
`applicant_corporate_bank_account`)
values (#{applicantEName},
#{applicantEAddress},
#{applicantEmployeeList},
......@@ -162,7 +164,7 @@
#{applicantType},
#{transId},
#{currency},
#{applicantInvoicedAmount})
#{applicantCorporateBankAccount})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
......@@ -186,6 +188,7 @@
<if test="transId != null">,`trans_id`</if>
<if test="currency != null">,`currency`</if>
<if test="applicantInvoicedAmount != null">,`applicant_invoiced_amount`</if>
<if test="applicantCorporateBankAccount != null">,`applicant_corporate_bank_account`</if>
)
values
(
......@@ -205,7 +208,7 @@
<if test="applicantType != null">,#{applicantType}</if>
<if test="transId != null">,#{transId}</if>
<if test="currency != null">,#{currency}</if>
<if test="applicantInvoicedAmount != null">,#{applicantInvoicedAmount}</if>
<if test="applicantCorporateBankAccount != null">,#{applicantCorporateBankAccount}</if>
)
</insert>
......@@ -283,6 +286,7 @@
<if test="transId != null">`trans_id` = #{transId},</if>
<if test="currency != null">`currency` = #{currency},</if>
<if test="applicantInvoicedAmount != null">`applicant_invoiced_amount` = #{applicantInvoicedAmount}</if>
<if test="applicantCorporateBankAccount != null">`applicant_corporate_bank_account` = #{applicantCorporateBankAccount}</if>
</set>
where id = #{id}
</update>
......
......@@ -53,7 +53,7 @@
attest_time
</sql>
<!--
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxEntInfoM">
INSERT INTO qyzx_ent_info_m
......@@ -199,5 +199,37 @@
</select>
-->
<select id="companyAdminList" resultType="cn.timer.api.dto.qyzx.EntInfoDto">
SELECT
qeim.id AS id,
qeim.logo_url AS logoUrl,
qeim.NAME AS NAME,
qeim.link_man AS linkMan,
qeim.phone AS linkManPhone,
qeim.area_name AS areaName,
count( yme.id ) AS totalNum,
qeim.register_time AS registerTime,
qeim.end_time AS endTime,
IFNULL(a.totlaSpmk,0) as totlaSpmk,
IFNULL(b.totlaCc,0) as totlaCc
FROM
qyzx_ent_info_m qeim
LEFT JOIN yggl_main_emp yme ON yme.org_code = qeim.id
LEFT JOIN ( SELECT sas.org_code AS oid, count( sas.id ) AS totlaSpmk FROM spmk_approve_summary sas GROUP BY sas.org_code ) AS a ON a.oid = qeim.id
LEFT JOIN ( SELECT cc.organization_id AS oid, count( cc.id ) AS totlaCc FROM cms_content cc GROUP BY cc.organization_id ) AS b ON b.oid = qeim.id
GROUP BY
qeim.id
<if test="page.offset != null and page.totalPage !=null">
limit #{page.offset},#{page.totalPage}
</if>
</select>
<select id="companyAdminCount" resultType="java.lang.Integer">
select count(qeim.id) from qyzx_ent_info_m qeim
</select>
<select id ="getCompanyList" resultType="java.util.HashMap">
select id as value , name as label from qyzx_ent_info_m
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -231,6 +231,7 @@
<!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT
a.id,
a.name empName,
a.emp_num empNum,
b.name deptName,
......@@ -247,6 +248,9 @@
a.org_code = #{orgCode}
AND
a.job_status in (0,1,2)
<if test="isInsure!=null and isInsure != ''">
AND a.is_insure=#{isInsure}
</if>
ORDER BY
emp_num DESC
</select>
......
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