Commit e98f437e by dengshichuan

Merge branch 'tzq' into 'develop'

审批 转正、调岗、离职 业务对接、bug修复

See merge request 8timerv2/8timerapiv200!77
parents 6a564afb cb410dcb
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.58</version> <version>1.2.62</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -261,15 +261,15 @@ ...@@ -261,15 +261,15 @@
</dependency> </dependency>
<!-- jackson --> <!-- jackson -->
<dependency> <!-- <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId> <artifactId>spring-boot-starter-json</artifactId>
</dependency> </dependency> -->
<dependency> <!-- <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
</dependency> </dependency> -->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
......
...@@ -16,10 +16,6 @@ import org.springframework.web.cors.CorsConfiguration; ...@@ -16,10 +16,6 @@ import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter; import org.springframework.web.filter.CorsFilter;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import cn.hutool.core.net.NetUtil; import cn.hutool.core.net.NetUtil;
@MapperScan("cn.timer.api.dao") // 扫描的mapper @MapperScan("cn.timer.api.dao") // 扫描的mapper
...@@ -38,28 +34,6 @@ public class Application { ...@@ -38,28 +34,6 @@ public class Application {
SpringApplication.run(Application.class, args); SpringApplication.run(Application.class, args);
} }
/**
* 配置FastJson方式二
*
* @return HttpMessageConverters
*/
@Bean
public HttpMessageConverters fastJsonHttpMessageConverters() {
// 1.定义一个converters转换消息的对象
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
// 2.添加fastjson的配置信息,比如: 是否需要格式化返回的json数据
FastJsonConfig fastJsonConfig = new FastJsonConfig();
fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss");
fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat);
// 3.在converter中添加配置信息
fastConverter.setFastJsonConfig(fastJsonConfig);
// 4.将converter赋值给HttpMessageConverter
HttpMessageConverter<?> converter = fastConverter;
// 5.返回HttpMessageConverters对象
return new HttpMessageConverters(converter);
}
// extends SpringBootServletInitializer
@Autowired @Autowired
private RestTemplateBuilder restTemplateBuilder; private RestTemplateBuilder restTemplateBuilder;
......
package cn.timer.api.bean.clazz;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
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;
/**
* @author Tang 2020-05-09
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("地区")
public class CommonArea extends Model<CommonArea> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="编号",example="1")
private Integer codeId;
@ApiModelProperty(value="父编号",example="10")
private Integer parentId;
@ApiModelProperty(value="城市名称",example="1")
private String cityName;
@ApiModelProperty(value="下级",example="1")
private List<CommonArea> commonAreas;
}
\ No newline at end of file
...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.swagger.IgnoreSwaggerParameter;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -86,4 +87,16 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> { ...@@ -86,4 +87,16 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> {
@ApiModelProperty(value = "摘要 ", example = "摘要") @ApiModelProperty(value = "摘要 ", example = "摘要")
private String digest; private String digest;
@ApiModelProperty(value = "岗位名称", example = "岗位名称")
private String gwName;
@ApiModelProperty(value = "部门id", example = "1")
private String bmId;
@ApiModelProperty(value = "部门名称", example = "部门名称")
private String bmName;
} }
\ No newline at end of file
...@@ -113,6 +113,10 @@ public interface YgEnumInterface { ...@@ -113,6 +113,10 @@ public interface YgEnumInterface {
public static String tranTime(String index) { public static String tranTime(String index) {
//String str ="2013/11/12"; //String str ="2013/11/12";
if (index == null) {
return null;
}
String p = "年|月|日|号|时|/|//-"; String p = "年|月|日|号|时|/|//-";
String result = index.replaceAll(p, "-"); String result = index.replaceAll(p, "-");
String p2 = "-$"; String p2 = "-$";
......
package cn.timer.api.config.exception;
/**
* 自定义异常
*
* @author Tang
*/
public class CustomException extends RuntimeException
{
private static final long serialVersionUID = 1L;
private String code;
private String message;
public CustomException(String message)
{
this.message = message;
}
public CustomException(String message, String code)
{
this.message = message;
this.code = code;
}
public CustomException(String message, Throwable e)
{
super(message, e);
this.message = message;
}
@Override
public String getMessage()
{
return message;
}
public String getCode()
{
return code;
}
}
package cn.timer.api.config.exception;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
/**
* 全局异常处理器
*
* @author Tang
*/
@RestControllerAdvice // @ControllerAdvice + @ResponseBody 组合注解
public class GlobalExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@ExceptionHandler(Exception.class)
public Result<Object> handleException(Exception e) {
log.error(e.getMessage(), e);
return ResultUtil.error(e.getMessage());
}
/**
* 空指针异常
* @param e
* @return
*/
@ExceptionHandler(NullPointerException.class)
public Result<Object> nullPointerException(NullPointerException e) {
log.error(e.getMessage(), e);
return ResultUtil.error(e.getMessage());
}
/**
* 类型强制转换异常
* @param e
* @return
*/
@ExceptionHandler(ClassCastException.class)
public Result<Object> classCastException(ClassCastException e) {
log.error(e.getMessage(), e);
return ResultUtil.error(e.getMessage());
}
/**
* 业务异常
*/
@ExceptionHandler(CustomException.class)
public Result<Object> businessException(CustomException e) {
if (StrUtil.isBlank(e.getCode())) {
return ResultUtil.error(e.getMessage());
}
return ResultUtil.error(e.getCode(), e.getMessage());
}
}
package cn.timer.api.config.interceptor;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.StringHttpMessageConverter;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class MyConfiguration {
@Bean
public HttpMessageConverters customConverters() {
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
// 创建配置类
FastJsonConfig config = new FastJsonConfig();
config.setSerializerFeatures(
SerializerFeature.WriteNullListAsEmpty,
SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteNullStringAsEmpty
);
//此处是全局处理方式
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
config.setCharset(Charset.forName("UTF-8"));
fastConverter.setFastJsonConfig(config);
List<MediaType> supportedMediaTypes = new ArrayList<>();
supportedMediaTypes.add(MediaType.ALL);
fastConverter.setSupportedMediaTypes(supportedMediaTypes);
//支持text 转string
StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
return new HttpMessageConverters(fastConverter, stringHttpMessageConverter);
}
}
package cn.timer.api.config.interceptor; package cn.timer.api.config.interceptor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -9,11 +11,13 @@ import org.springframework.context.annotation.Bean; ...@@ -9,11 +11,13 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.ValueFilter;
import com.alibaba.fastjson.support.config.FastJsonConfig; import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
...@@ -51,8 +55,21 @@ public class WebSecurityConfig implements WebMvcConfigurer { ...@@ -51,8 +55,21 @@ public class WebSecurityConfig implements WebMvcConfigurer {
// registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*"); // registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*");
} }
/**
* 配置消息转换器--这里我用的是alibaba 开源的 fastjson
* @param converters
*/
@Override @Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
// Iterator<HttpMessageConverter<?>> iterator = converters.iterator();
// while(iterator.hasNext()){
// HttpMessageConverter<?> converter = iterator.next();
// if(converter instanceof MappingJackson2HttpMessageConverter){
// iterator.remove();
// }
// }
// 1.需要先定义一个convert 转换消息的对象 // 1.需要先定义一个convert 转换消息的对象
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter(); FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
// 2.添加fastJson的配置信息,比如,是否需要格式化返回的json数据 // 2.添加fastJson的配置信息,比如,是否需要格式化返回的json数据
...@@ -66,10 +83,21 @@ public class WebSecurityConfig implements WebMvcConfigurer { ...@@ -66,10 +83,21 @@ public class WebSecurityConfig implements WebMvcConfigurer {
// WriteNullNumberAsZero 将数值类型字段的空值输出为0 // WriteNullNumberAsZero 将数值类型字段的空值输出为0
// WriteNullBooleanAsFalse 将Boolean类型字段的空值输出为false // WriteNullBooleanAsFalse 将Boolean类型字段的空值输出为false
fastJsonConfig.setSerializerFeatures( fastJsonConfig.setSerializerFeatures(
SerializerFeature.PrettyFormat, SerializerFeature.PrettyFormat
SerializerFeature.WriteMapNullValue, // SerializerFeature.WriteEnumUsingToString,
SerializerFeature.WriteDateUseDateFormat, // SerializerFeature.WriteNullStringAsEmpty,
SerializerFeature.WriteNullStringAsEmpty); // SerializerFeature.WriteMapNullValue,
// SerializerFeature.WriteDateUseDateFormat
);
// fastJsonConfig.setSerializeFilters((ValueFilter) (o, s, source) -> {
// if (source == null) {
// return "";//此处是关键,如果返回对象的变量为null,则自动变成""
// }
// if (source instanceof Date) {
// return ((Date) source).getTime();
// }
// return source;
// });
// 处理中文乱码问题 // 处理中文乱码问题
List<MediaType> fastMediaTypes = new ArrayList<>(); List<MediaType> fastMediaTypes = new ArrayList<>();
fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8); fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
...@@ -77,7 +105,7 @@ public class WebSecurityConfig implements WebMvcConfigurer { ...@@ -77,7 +105,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
// 3.在convert中添加配置信息 // 3.在convert中添加配置信息
fastConverter.setFastJsonConfig(fastJsonConfig); fastConverter.setFastJsonConfig(fastJsonConfig);
// 4.将convert添加到converters当中 // 4.将convert添加到converters当中
converters.add(fastConverter); converters.add(0,fastConverter);
} }
......
...@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
...@@ -426,8 +427,15 @@ public class LoginController { ...@@ -426,8 +427,15 @@ public class LoginController {
qyzxEmpLogin1.setPw(Md5.md5("123456"));// 密码初始化 qyzxEmpLogin1.setPw(Md5.md5("123456"));// 密码初始化
qyzxEmpLogin1.updateById(); qyzxEmpLogin1.updateById();
//员工信息 手机号修改
YgglMainEmp.builder().phone(phone).build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, qyzxEmpLogin1.getId()));
return ResultUtil.success("修改手机号/用户名成功"); return ResultUtil.success("修改手机号/用户名成功");
} }
return ResultUtil.error("修改手机号/用户名失败"); return ResultUtil.error("修改手机号/用户名失败");
} }
......
...@@ -49,6 +49,7 @@ import cn.hutool.core.collection.ListUtil; ...@@ -49,6 +49,7 @@ import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.BetweenFormater.Level; import cn.hutool.core.date.BetweenFormater.Level;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.clazz.CommonArea;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso; import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin; import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.yggl.YgglAttaClfjb; import cn.timer.api.bean.yggl.YgglAttaClfjb;
...@@ -70,6 +71,8 @@ import cn.timer.api.config.annotation.CurrentUser; ...@@ -70,6 +71,8 @@ import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.YgEnumInterface; import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enums.CommonEnum; import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.controller.yggl.service.YgglService;
import cn.timer.api.dao.clazz.CommonAreaMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper; import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgAreaDtoMapper; import cn.timer.api.dao.yggl.YgAreaDtoMapper;
import cn.timer.api.dao.yggl.YgCityDtoMapper; import cn.timer.api.dao.yggl.YgCityDtoMapper;
...@@ -422,12 +425,20 @@ public class YgglController { ...@@ -422,12 +425,20 @@ public class YgglController {
@PostMapping(value = "/updateygda") @PostMapping(value = "/updateygda")
@ApiOperation(value = "修改员工档案", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "修改员工档案", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp) { public Result<Object> updateygda(@CurrentUser UserBean userBean, @RequestBody YgglMainEmp ygglMainEmp) throws Exception{
if (ygglMainEmp.getEmpNum() != null) { if (ygglMainEmp.getEmpNum() != null) {
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>(); UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("org_code", userBean.getOrgCode()).eq("emp_num", ygglMainEmp.getEmpNum()); updateWrapper.eq("org_code", userBean.getOrgCode()).eq("emp_num", ygglMainEmp.getEmpNum());
ygglMainEmp.update(updateWrapper); ygglMainEmp.update(updateWrapper);
// Integer count = qyzxEmpLoginMapper.selectCount(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getPhone, ygglMainEmp.getPhone()));
// if (count >= 1) {
// return ResultUtil.error("手机号已被使用!");
// }
//
// QyzxEmpLogin.builder().phone(ygglMainEmp.getPhone()).build()
// .update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId, userBean.getEmpNum()));
return ResultUtil.data(ygglMainEmp, "修改成功"); return ResultUtil.data(ygglMainEmp, "修改成功");
} }
return ResultUtil.error("请确认该员工是否存在!"); return ResultUtil.error("请确认该员工是否存在!");
...@@ -483,6 +494,7 @@ public class YgglController { ...@@ -483,6 +494,7 @@ public class YgglController {
@ApiOperation(value = "导入威力加强版", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "导入威力加强版", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
public Result<List<YgDrjqbDto>> ygdr(@CurrentUser UserBean userBean, @RequestBody YgDrsDto drList) { public Result<List<YgDrjqbDto>> ygdr(@CurrentUser UserBean userBean, @RequestBody YgDrsDto drList) {
drList.setErrorList(new ArrayList<YgDrjqbDto>());
drList.setOrgCode(userBean.getOrgCode()); drList.setOrgCode(userBean.getOrgCode());
YgDrsDto tofList = errorFilter(drList);// 滤嘴,过滤信息 YgDrsDto tofList = errorFilter(drList);// 滤嘴,过滤信息
if (tofList.getDrList().size() == 0) if (tofList.getDrList().size() == 0)
...@@ -784,7 +796,7 @@ public class YgglController { ...@@ -784,7 +796,7 @@ public class YgglController {
// 员工状态(最大优化) // 员工状态(最大优化)
d.setJobStatus(YgEnumInterface.jobStatus.isZhen(jobStatus)); d.setJobStatus(YgEnumInterface.jobStatus.isZhen(jobStatus));
// 入职日期(最大优化) // 入职日期(最大优化)
d.setRzTime(YgEnumInterface.rzTime.tranTime2(YgEnumInterface.rzTime.tranTime(rzTime))); d.setRzTime(rzTime != null ? YgEnumInterface.rzTime.tranTime2(YgEnumInterface.rzTime.tranTime(rzTime)) : null);
// 试用期(最大优化) // 试用期(最大优化)
d.setSyq(YgEnumInterface.syq.choose(syq)); d.setSyq(YgEnumInterface.syq.choose(syq));
} }
...@@ -1521,8 +1533,11 @@ public class YgglController { ...@@ -1521,8 +1533,11 @@ public class YgglController {
@ApiOperation(value = "添加离职计划", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "添加离职计划", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 54) @ApiOperationSupport(order = 54)
public Result<YgglMainLzb> addjhlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) { public Result<YgglMainLzb> addjhlz(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
Integer empNum = lzygQueryDto.getEmpNum();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>(); QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>();
queryWrapper.eq("emp_num", lzygQueryDto.getEmpNum()).eq("org_code", userBean.getOrgCode()); queryWrapper.eq("emp_num", empNum).eq("org_code", userBean.getOrgCode());
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper); YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build(); YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表 // 移动员工表数据到离职表
...@@ -1530,17 +1545,13 @@ public class YgglController { ...@@ -1530,17 +1545,13 @@ public class YgglController {
ygglMainLzb.insert(); ygglMainLzb.insert();
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>(); UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum()); updateWrapper.eq("emp_num", empNum);
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>(); UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum()); updateWrapper1.eq("emp_num", empNum);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(3).build().update(updateWrapper); YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(3).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime()) YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1); .lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
// 删除员工表
// ygglMainEmp.deleteById();
// 删除员工登陆表
// QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().id(ygglMainLzb.getEmpNum()).build();
// qyzxEmpLogin.deleteById();
return ResultUtil.data(ygglMainLzb, "添加待离职员工成功"); return ResultUtil.data(ygglMainLzb, "添加待离职员工成功");
} }
...@@ -1554,22 +1565,29 @@ public class YgglController { ...@@ -1554,22 +1565,29 @@ public class YgglController {
@ApiOperation(value = "确认离职", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "确认离职", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 55) @ApiOperationSupport(order = 55)
public Result<Void> addlzb(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) { public Result<Void> addlzb(@CurrentUser UserBean userBean, @RequestBody LzygQueryDto lzygQueryDto) {
Integer empNum = lzygQueryDto.getEmpNum();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>(); QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>();
queryWrapper.eq("emp_num", lzygQueryDto.getEmpNum()); queryWrapper.eq("emp_num", empNum);
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>(); UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum()); updateWrapper.eq("emp_num", empNum);
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>(); UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum()); updateWrapper1.eq("emp_num", empNum);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()) YgglMainEmp.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
.build().update(updateWrapper); .build().update(updateWrapper);
YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()) YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
.sjlzTime(new Date()).build().update(updateWrapper1); .sjlzTime(new Date()).build().update(updateWrapper1);
// 查询该员工的关联表 // 查询该员工的关联表
QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>(); QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>();
queryWrapper1.eq("emp_num", lzygQueryDto.getEmpNum()); queryWrapper1.eq("emp_num", empNum);
// 确认离职 删除员工关联表 // 确认离职 删除员工关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(lzygQueryDto.getEmpNum()).build(); QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(lzygQueryDto.getEmpNum()).build();
qyzxEmpEntAsso.delete(queryWrapper1); qyzxEmpEntAsso.delete(queryWrapper1);
// 初始化 部门主管
zzglBmgwMMapper.update(ZzglBmgwM.builder().leader(null).build(), new UpdateWrapper<ZzglBmgwM>()
.lambda()
.eq(ZzglBmgwM::getLeader, empNum));
return ResultUtil.success("确认离职员工成功"); return ResultUtil.success("确认离职员工成功");
} }
...@@ -1646,6 +1664,25 @@ public class YgglController { ...@@ -1646,6 +1664,25 @@ public class YgglController {
return ResultUtil.data(mz, "展示该民族"); return ResultUtil.data(mz, "展示该民族");
} }
@Autowired
CommonAreaMapper commonAreaMapper;
/**
* 籍贯树-Mini
*
* @param
* @return
*/
@GetMapping(value = "/native_place")
@ApiOperation(value = "籍贯树-Mini", httpMethod = "GET", notes = "籍贯树-Mini")
@ApiOperationSupport(order = 60)
public Result<List<CommonArea>> selectNativePlace() {
List<CommonArea> listCommonArea = commonAreaMapper.AllAreaForTree();
return ResultUtil.data(listCommonArea, "操作成功!");
}
/** /**
* 展示籍贯/展示所有籍贯 * 展示籍贯/展示所有籍贯
* *
......
package cn.timer.api.controller.yggl.service;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgzzDto;
public interface YgglService {
void applicationResignation(LzygQueryDto lzygQueryDto);
void applicationRegularization(YgzzDto ygzzDto);
}
package cn.timer.api.controller.yggl.service;
import java.util.Date;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgzzDto;
@Service
public class YgglServiceImpl implements YgglService {
@Override
public void applicationResignation(LzygQueryDto lzygQueryDto) {
// TODO Auto-generated method stub
Integer empNum = lzygQueryDto.getEmpNum();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>();
queryWrapper.eq("emp_num", empNum).eq("org_code", lzygQueryDto.getOrgCode());
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb);
ygglMainLzb.insert();
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", empNum);
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", empNum);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
}
@Override
public void applicationRegularization(YgzzDto ygzzDto) {
// TODO Auto-generated method stub
YgglMainEmp.builder()
.jobStatus(2)
.zzTime(ygzzDto.getZzTime())
.sjzzTime(new Date())
.zzRemark(ygzzDto.getZzRemark())
.build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
}
}
...@@ -229,19 +229,19 @@ public class ZzglController { ...@@ -229,19 +229,19 @@ public class ZzglController {
// zzglLogDgjlMapper.insert // zzglLogDgjlMapper.insert
return ResultUtil.success(); return ResultUtil.success();
} }
//修改/删除员工部门(供审批管理使用) //修改/删除员工部门(供审批管理使用)
public void updatelistempdeptforspgl (Integer empNum,Integer orgCode, UpEmpDeptDto upEmpDeptDto) { public void updatelistempdeptforspgl (Integer empNum,Integer orgCode, UpEmpDeptDto upEmpDeptDto) {
Integer dpetId = upEmpDeptDto.getDpetId(); Integer dpetId = upEmpDeptDto.getDpetId();
List<Integer> empNums = new ArrayList<Integer>(); List<Integer> empNums = new ArrayList<Integer>();
empNums.add(empNum); empNums.add(empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build(); YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
// zzglLogDgjlMapper
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>(); UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", dpetId).eq("org_code", orgCode).in("emp_num", empNum); updateWrapper.set("bmgw_id", dpetId).eq("org_code", orgCode).in("emp_num", empNum);
zzglLogDgjlMapper.insertbyaddemp(empNums, empNum, dpetId, orgCode, zzglLogDgjlMapper.insertbyaddemp(empNums, empNum, dpetId, orgCode,
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗"); dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
ygglMainEmp.update(updateWrapper); ygglMainEmp.update(updateWrapper);
// zzglLogDgjlMapper.insert
} }
/** /**
......
...@@ -2,6 +2,8 @@ package cn.timer.api.controller.zzgl.service; ...@@ -2,6 +2,8 @@ package cn.timer.api.controller.zzgl.service;
import java.util.List; import java.util.List;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
/** /**
* 部门岗位 服务层 * 部门岗位 服务层
* *
...@@ -9,6 +11,8 @@ import java.util.List; ...@@ -9,6 +11,8 @@ import java.util.List;
*/ */
public interface ZzglBmgwMService { public interface ZzglBmgwMService {
public List<Integer> empNumupGetDepts(Integer orgCode,Integer empNum); List<Integer> empNumupGetDepts(Integer orgCode,Integer empNum);
void applicationTransferPosition(Integer empNum,Integer orgCode,UpEmpDeptDto upEmpDeptDto);
} }
package cn.timer.api.controller.zzgl.service; package cn.timer.api.controller.zzgl.service;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -7,6 +8,7 @@ import java.util.Set; ...@@ -7,6 +8,7 @@ import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
...@@ -14,6 +16,8 @@ import cn.timer.api.bean.yggl.YgglMainEmp; ...@@ -14,6 +16,8 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglBmgwM; import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.dao.yggl.YgglMainEmpMapper; import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper; import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
/** /**
* 部门岗位 服务逻辑层 * 部门岗位 服务逻辑层
...@@ -29,6 +33,9 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService { ...@@ -29,6 +33,9 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
@Autowired @Autowired
private YgglMainEmpMapper ygglMainEmpMapper; private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private ZzglLogDgjlMapper zzglLogDgjlMapper;
//根据传来的empNum获取该人员的岗位,以及上面所有的部门id,返回integer数组 //根据传来的empNum获取该人员的岗位,以及上面所有的部门id,返回integer数组
@Override @Override
public List<Integer> empNumupGetDepts(Integer orgCode,Integer empNum) { public List<Integer> empNumupGetDepts(Integer orgCode,Integer empNum) {
...@@ -61,4 +68,22 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService { ...@@ -61,4 +68,22 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
return lanzi; return lanzi;
} }
/**
* 调岗
*/
@Override
public void applicationTransferPosition(Integer empNum,Integer orgCode,UpEmpDeptDto upEmpDeptDto) {
// TODO Auto-generated method stub
Integer dpetId = upEmpDeptDto.getDpetId();
List<Integer> empNums = new ArrayList<Integer>();
empNums.add(empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", dpetId).eq("org_code", orgCode).in("emp_num", empNum);
zzglLogDgjlMapper.insertbyaddemp(empNums, empNum, dpetId, orgCode,
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
ygglMainEmp.update(updateWrapper);
}
} }
package cn.timer.api.dao.clazz;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.clazz.CommonArea;
/**
* 地区
* @author Tang 2020-05-09
*/
@Repository
public interface CommonAreaMapper extends BaseMapper<CommonArea> {
List<CommonArea> AllAreaForTree();
}
package cn.timer.api.dao.spmk; package cn.timer.api.dao.spmk;
import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.dzht.DzhtAssoHtmb;
import cn.timer.api.bean.spmk.SpmkApproveSummary; import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.dto.spmk.MySummaryQueryDto; import cn.timer.api.dto.spmk.MySummaryQueryDto;
import cn.timer.api.dto.spmk.SummaryQueryDto; import cn.timer.api.dto.spmk.SummaryQueryDto;
......
...@@ -31,6 +31,9 @@ public class SpmkApproveSummaryDto{ ...@@ -31,6 +31,9 @@ public class SpmkApproveSummaryDto{
@ApiModelProperty(value = "审批名称 ", example = "审批名称", required = true) @ApiModelProperty(value = "审批名称 ", example = "审批名称", required = true)
private String approveName; private String approveName;
@ApiModelProperty(value = "摘要", example = "摘要", required = true)
private String digest;
@NotBlank(message = "initiator为空") @NotBlank(message = "initiator为空")
@ApiModelProperty(value = "发起人名称 ", example = "发起人名称", required = true) @ApiModelProperty(value = "发起人名称 ", example = "发起人名称", required = true)
private String initiator; private String initiator;
......
...@@ -49,6 +49,9 @@ public class LzygQueryDto extends Page implements Serializable{ ...@@ -49,6 +49,9 @@ public class LzygQueryDto extends Page implements Serializable{
@ApiModelProperty(value="员工工号",example="666") @ApiModelProperty(value="员工工号",example="666")
private Integer empNum; private Integer empNum;
@ApiModelProperty(value="企业id",example="666")
private Integer orgCode;
@ApiModelProperty(value="应离职时间",example="2019-12-12") @ApiModelProperty(value="应离职时间",example="2019-12-12")
private Date lzTime; private Date lzTime;
} }
package cn.timer.api.utils;
import java.io.Serializable;
import lombok.Data;
@Data
public class ApiReturnObject implements Serializable{
private static final long serialVersionUID = 1L;
public ApiReturnObject(String errorCode, Object errorMessage, Object returnObject) {
super();
this.errorCode = errorCode;
this.errorMessage = errorMessage;
this.returnObject = returnObject;
}
public ApiReturnObject(Object errorMessage, Object returnObject) {
super();
this.errorMessage = errorMessage;
this.returnObject = returnObject;
}
String errorCode="00";
Object errorMessage;
Object returnObject;
String pageNumber;
String pageSize;
String totalElements;
String totalPages;
public ApiReturnObject(String pageNumber,String pageSize,String totalElements,String totalPages,String errorCode, Object errorMessage, Object returnObject) {
super();
this.pageNumber = pageNumber;
this.errorCode = errorCode;
this.errorMessage = errorMessage;
this.returnObject = returnObject;
this.pageSize = pageSize;
this.totalElements = totalElements;
this.totalPages = totalPages;
}
}
package cn.timer.api.utils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class ApiReturnUtil implements Serializable{
private static final long serialVersionUID = 1L;
public static ApiReturnObject error(Object errorMessage) {
System.out.println(errorMessage);
List<Object> object=new ArrayList<Object>();
return new ApiReturnObject("01",errorMessage,object);
}
public static ApiReturnObject error(Object errorMessage, Object returnObject) {
List<Object> object=new ArrayList<Object>();
object.add(returnObject);
return new ApiReturnObject("01",errorMessage,object);
}
public static ApiReturnObject success(Object returnObject) {
if(returnObject instanceof java.util.List){
return new ApiReturnObject("00","success",returnObject);
}else {
List<Object> object=new ArrayList<Object>();
object.add(returnObject);
return new ApiReturnObject("00","success",object);
}
}
public static ApiReturnObject success(Object errorMessage, Object returnObject) {
if(returnObject instanceof java.util.List){
return new ApiReturnObject("00",errorMessage,returnObject);
}else {
List<Object> object=new ArrayList<Object>();
object.add(returnObject);
return new ApiReturnObject("00",errorMessage,object);
}
}
public static ApiReturnObject pageManual(Integer pageNumber, Integer pageSize,Integer countNum, List<Void> returnObject) {
return new ApiReturnObject(pageNumber+"",pageSize+"",countNum+"",getTotalPages(countNum, pageSize),"00","success",returnObject);
}
public static String getTotalPages(Integer countNum, Integer pageSize) {
if((countNum%pageSize)==0) {
return ((countNum/pageSize))+"";
}else {
return ((countNum/pageSize)+1)+"";
}
}
}
package cn.timer.api.utils;
import java.lang.reflect.Field;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Cell;
import org.springframework.web.multipart.MultipartFile;
/**
*
* @author Tang
* @date 2019年7月26日
*
*/
public class ImportExcelUntil {
/**
* 拼装单个obj
*
* @param obj
* @param row
* @return
* @throws Exception
*/
private static Map<String, Object> dataObj(Object obj, HSSFRow row)
throws Exception {
Class<?> rowClazz = obj.getClass();
Field[] fields = FieldUtils.getAllFields(rowClazz);
if (fields == null || fields.length < 1) {
return null;
}
// 容器
Map<String, Object> map = new HashMap<String, Object>();
// 注意excel表格字段顺序要和obj字段顺序对齐 (如果有多余字段请另作特殊下标对应处理)
for (int j = 0; j < fields.length; j++) {
map.put(fields[j].getName(), getVal(row.getCell(j)));
}
return map;
}
@SuppressWarnings("deprecation")
public static List<Map<String, Object>> importExcel(MultipartFile file,Object obj) throws Exception {
// 装载流
POIFSFileSystem fs = new POIFSFileSystem(file.getInputStream());
HSSFWorkbook hw = new HSSFWorkbook(fs);
// 获取第一个sheet页
HSSFSheet sheet = hw.getSheetAt(0);
// 容器
List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>();
// 遍历行 从下标第一行开始(去除标题)
for (int i = 1; i < sheet.getLastRowNum() + 1; i++) {
HSSFRow row = sheet.getRow(i);
String result = new String();
if (row != null) {
// 装载obj
for (int k = 0; k < row.getLastCellNum(); k++) {
HSSFCell cell = row.getCell(k);
if (null != cell) {
switch (cell.getCellType()) {
case HSSFCell.CELL_TYPE_NUMERIC: // 数字
// System.out.print(cell.getNumericCellValue()
// + " ");
// System.out.print( new DecimalFormat("#").format(cellValue));
DecimalFormat df=new DecimalFormat("0");
String cellValue = df.format(cell.getNumericCellValue());;
if(cellValue.lastIndexOf("E")>-1){
cell.setCellValue(new DecimalFormat("#").format(cell.getNumericCellValue()));
}
String str = String.valueOf(cell);
if (str.indexOf(".0") != -1 || str.indexOf("-") != -1) {
if (HSSFDateUtil.isCellDateFormatted(cell)) {// 处理日期格式、时间格式
SimpleDateFormat sdf = null;
if (cell.getCellStyle().getDataFormat() == HSSFDataFormat.getBuiltinFormat("h:mm")) {
sdf = new SimpleDateFormat("HH:mm");
} else {// 日期
sdf = new SimpleDateFormat("yyyyMMdd");
}
Date date = cell.getDateCellValue();
result = sdf.format(date);
cell.setCellValue(result);
} else if (cell.getCellStyle().getDataFormat() == 176) {
// 处理自定义日期格式:m月d日(通过判断单元格的格式id解决,id的值是58)
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
double value = cell.getNumericCellValue();
Date date = org.apache.poi.ss.usermodel.DateUtil.getJavaDate(value);
result = sdf.format(date);
cell.setCellValue(result);
} else if(cell.getCellStyle().getDataFormat() == 14 || cell.getCellStyle().getDataFormat() == 31){
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
double value = cell.getNumericCellValue();
Date date = org.apache.poi.ss.usermodel.DateUtil.getJavaDate(value);
result = sdf.format(date);
cell.setCellValue(result);
}
System.out.println(result);
}
break;
case HSSFCell.CELL_TYPE_STRING: // 字符串
// System.out.print(cell.getStringCellValue()
// + " ");
break;
case HSSFCell.CELL_TYPE_BOOLEAN: // Boolean
// System.out.println(cell.getBooleanCellValue()
// + " ");
break;
case HSSFCell.CELL_TYPE_FORMULA: // 公式
// System.out.print(cell.getCellFormula() + " ");
break;
case HSSFCell.CELL_TYPE_BLANK: // 空值
// System.out.println(" ");
break;
case HSSFCell.CELL_TYPE_ERROR: // 故障
// System.out.println(" ");
break;
default:
// System.out.print("未知类型 ");
break;
}
}
}
ret.add(dataObj(obj, row));
}
}
hw.close();
return ret;
}
/**
* 处理val(暂时只处理string和number,可以自己添加自己需要的val类型)
*
* @param hssfCell
* @return
*/
@SuppressWarnings("deprecation")
public static String getVal(HSSFCell hssfCell) {
if(hssfCell!=null){
hssfCell.setCellType(Cell.CELL_TYPE_STRING);
return hssfCell.getStringCellValue();
}else {
return "";
}
}
}
\ No newline at end of file
package cn.timer.api.utils;
import java.util.Calendar;
import java.util.Date;
public class LevelPriceDateFromatUtils {
/**
* 时间运算
* @param unit
* @param num
* @param time
* @return
*/
public static Long getTimestampByUnitAndNumAddTime(String unit,Long num,Long time) {
//单位 1天 2月 3季 4年 5两年
Calendar calendar = LevelPriceDateFromatUtils.getCalendarByTimestamp(time);
switch (unit) {
case "1":
calendar.add(Calendar.DATE, num.intValue());
break;
case "2":
calendar.add(Calendar.DAY_OF_MONTH, num.intValue());
break;
case "3":
calendar.add(Calendar.DAY_OF_MONTH, num.intValue()*3);//一季度等于三个月
break;
case "4":
calendar.add(Calendar.YEAR, num.intValue());
break;
case "5":
calendar.add(Calendar.YEAR, num.intValue()*2);
for (int i = 0; i < num; i++) {
calendar.add(Calendar.YEAR, 1);//买二送一
}
break;
default:
break;
}
return calendar.getTimeInMillis();
}
public static Calendar getCalendarByTimestamp(Long time) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
return cal;
}
public static Long getTimestampByNow() {
Date date = new Date();
return date.getTime();
}
public static void main(String[] args) {
//System.out.println(3/2);
System.out.println(getCalendarByTimestamp(0L).get(Calendar.YEAR));
}
}
package cn.timer.api.utils;
import java.text.SimpleDateFormat;
/**
* 随机数生成
* @author Administrator
*/
public class NumberedGeneration {
public static Integer test(int l) {
String str = new SimpleDateFormat("yy-mm-dd")
.format(new java.util.Date());
long m = Long.parseLong((str));
Integer ret = (int) (m + l);
long n = l + 1;
System.out.println(n);
return ret+1000;
}
public static Integer six() {
Integer ret =(int)((Math.random()*9+1)*100000);
return ret;
}
public static Integer eight() {
Integer ret =(int)((Math.random()*9+1)*10000000);
return ret;
}
public static Integer nine() {
Integer ret =(int)((Math.random()*9+1)*100000000);
return ret;
}
public static Integer test2() {
Integer ret = (int) (Math.random()*9000+1000);
return ret;
}
public static void main(String[] args) {
//System.out.println(six());
}
}
package cn.timer.api.utils;
import java.io.Serializable;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description:Json返回结果集工具类
* @Package:org.jeese.model
* @author:wubc
* @version:1.0
* @date:2017年10月30日-下午1:51:24
* @Copyright:2017 Inc. All rights reserved.
*/
@ApiModel
@Service("responseResultnew")
public class ResponseResultNew<T> implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value="code",example="101")
private String code;
@ApiModelProperty(value="result",example="101")
private boolean result;
@ApiModelProperty(value="message",example="101")
private String message;
@ApiModelProperty(value="data",example="101")
private T data;
// private List<T> datas;
//
// private T page;
//
//
// private static final String PAGE_KEY = "page";
// private static final String NUMBER_KEY = "number";
// private static final String SIZE_KEY = "size";
// private static final String TOTALELEMENTS_KEY = "totalelements";
// private static final String TOTALPAGES_KEY = "totalpages";
// private static final String OFFSET_KEY = "offset";
private static final String MESSAGE_SUCCESS = "操作成功";
// private static final String MESSAGE_FAIL = "操作失败";
// private static final String MESSAGE_ERROR = "操作错误";
// private static final String MESSAGE_UNLOGIN = "会话超时,请重新登录";
// private static final String MESSAGE_KICKOUT = "当前账户已在其他地方登录,请重新登录";
// private static final String MESSAGE_PARAMERROR = "参数错误";
// private static final String MESSAGE_UNAUTHORIZED = "授权错误";
// private static final String MESSAGE_UNAUTHENTICATED = "认证错误";
// private static final String MESSAGE_EXCEPTION = "服务器异常";
private static final String STATUS_CODE_SUCCESS = "200";
// private static final String STATUS_CODE_FAIL = "201";
// private static final String STATUS_CODE_ERROR = "202";
// private static final String STATUS_CODE_UNLOGIN = "301";
// private static final String STATUS_CODE_KICKOUT = "302";
// private static final String STATUS_CODE_UNPARAM = "400";
// private static final String STATUS_CODE_UNAUTHORIZED = "401";
// private static final String STATUS_CODE_UNAUTHENTICATED = "405";
// private static final String STATUS_CODE_EXCEPTION = "500";
public ResponseResultNew() {
this.code = STATUS_CODE_SUCCESS;
this.result = Boolean.TRUE;
this.message = MESSAGE_SUCCESS;
this.data = null;
}
/**
* 请求成功
*
* @return
*/
@SuppressWarnings("rawtypes")
public ResponseResultNew success() {
this.code = STATUS_CODE_SUCCESS;
this.result = Boolean.TRUE;
this.message = MESSAGE_SUCCESS;
this.data = null;
return this;
}
/**
* 请求成功,并带消息
*
* @param message
* @return
*/
@SuppressWarnings("rawtypes")
public ResponseResultNew success(String message) {
this.code = STATUS_CODE_SUCCESS;
this.result = Boolean.TRUE;
this.message = message;
this.data = null;
return this;
}
@SuppressWarnings("rawtypes")
public ResponseResultNew fail(String message) {
this.code = STATUS_CODE_SUCCESS;
this.result = Boolean.TRUE;
this.message = message;
this.data = null;
return this;
}
/**
* @param obj
* @return
*/
@SuppressWarnings("rawtypes")
public ResponseResultNew successData(T data) {
this.code = STATUS_CODE_SUCCESS;
this.result = Boolean.TRUE;
this.message = MESSAGE_SUCCESS;
this.data = data;
return this;
}
}
...@@ -3,8 +3,10 @@ package cn.timer.api.utils; ...@@ -3,8 +3,10 @@ package cn.timer.api.utils;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
import java.util.List; import java.util.List;
/** /**
* 反序列化 * 反序列化
*
* @author Administrator * @author Administrator
*/ */
public class SerializationUtils { public class SerializationUtils {
......
...@@ -11,8 +11,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -11,8 +11,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.ConvertException;
import cn.hutool.core.lang.Console; import cn.hutool.core.lang.Console;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord; import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
import cn.timer.api.bean.spmk.SpmkApproveSummary; import cn.timer.api.bean.spmk.SpmkApproveSummary;
...@@ -44,12 +44,12 @@ public class RouterUtils { ...@@ -44,12 +44,12 @@ public class RouterUtils {
private final static String RELATION_TYPE_DEPARTMENT = "department"; private final static String RELATION_TYPE_DEPARTMENT = "department";
private final static String RELATION_TYPE_USERS = "users"; private final static String RELATION_TYPE_USERS = "users";
public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse) { public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse) throws NumberFormatException, ConvertException, Exception {
return NextNode(listRouter, obj, isFirse, false); return NextNode(listRouter, obj, isFirse, false);
} }
// 执行下一个节点 // 执行下一个节点
public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse, boolean isAuditNext) { public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse, boolean isAuditNext) throws NumberFormatException, ConvertException, Exception {
Router router; Router router;
if (listRouter != null && listRouter.size() != 0) { if (listRouter != null && listRouter.size() != 0) {
...@@ -261,39 +261,6 @@ public class RouterUtils { ...@@ -261,39 +261,6 @@ public class RouterUtils {
} }
private static boolean stringCompare(String s1,String s2,String symbol) {
double d1;
double d2;
switch (symbol) {
case "<":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == -1) return true;
break;
case "<=":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == -1 || NumberUtil.compare(d1,d2) == 0) return true;
break;
case "=":
if (s2.equals(s1)) return true;
break;
case ">":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == 1) return true;
break;
case ">=":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == 0 || NumberUtil.compare(d1,d2) == 1) return true;
break;
}
return false;
}
public static void getIsFlowChildren(List<Router> listRouter, List<FlowChildren> listFlowChildren) { public static void getIsFlowChildren(List<Router> listRouter, List<FlowChildren> listFlowChildren) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
Router router; Router router;
...@@ -320,7 +287,7 @@ public class RouterUtils { ...@@ -320,7 +287,7 @@ public class RouterUtils {
// 审批执行记录 持久化 // 审批执行记录 持久化
public static void insertogExecuteRecord(List<FlowChildren> listFlowChildren,Integer asId) { public static void insertogExecuteRecord(List<FlowChildren> listFlowChildren,Integer asId) throws Exception{
for (int i = 0,m = listFlowChildren.size() ; i < m; i++) { for (int i = 0,m = listFlowChildren.size() ; i < m; i++) {
if (UNEXECUTED.equals(listFlowChildren.get(i).getExecute())) { if (UNEXECUTED.equals(listFlowChildren.get(i).getExecute())) {
...@@ -429,7 +396,7 @@ public class RouterUtils { ...@@ -429,7 +396,7 @@ public class RouterUtils {
* @param opinion 意见 * @param opinion 意见
* @param sts 状态 1执行中 2通过 3拒绝 * @param sts 状态 1执行中 2通过 3拒绝
*/ */
public static void approving(List<FlowChildren> listFlowChildren,Integer asId,Integer executeRecordId, Integer executorId, String opinion,Integer sts,User redeployUser ) { public static void approving(List<FlowChildren> listFlowChildren,Integer asId,Integer executeRecordId, Integer executorId, String opinion,Integer sts,User redeployUser ) throws Exception {
boolean hasNextApprover = false; boolean hasNextApprover = false;
......
package cn.timer.api.utils.router.business;
import cn.hutool.json.JSONObject;
import cn.timer.api.dto.spmk.FromData;
/**
* 外出
* @author Tang
*
*/
public class GoOutBusiness extends SpmkAssoBusiness {
@Override
public void handleApprove(JSONObject jsonObj) throws Exception {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = jsonObj.get("orgCode",FromData.class).getValue();
// 发起人id
String id = jsonObj.get("id",FromData.class).getValue();
// 发起人名称
String initiator = jsonObj.get("initiator",FromData.class).getValue();
// 开始时间
String startTime = jsonObj.get("__startTime",FromData.class).getValue();
// 结束时间
String endTime = jsonObj.get("__endTime",FromData.class).getValue();
// 时长
String longTime = jsonObj.get("__longTime",FromData.class).getValue();
// 出差事由
String businessTrip = jsonObj.get("__businessTrip",FromData.class).getValue();
// 上传文件
String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue();
// 调 考勤管理 业务
}
}
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import java.text.ParseException;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.yggl.service.YgglService;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.DateFormatUtils;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -12,8 +19,11 @@ import lombok.Builder; ...@@ -12,8 +19,11 @@ import lombok.Builder;
@Builder @Builder
public class RegularizationBusiness extends SpmkAssoBusiness { public class RegularizationBusiness extends SpmkAssoBusiness {
@Autowired
private YgglService ygglService;
@Override @Override
public void handleApprove(JSONObject jsonObj) { public void handleApprove(JSONObject jsonObj) throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// 发起人企业id // 发起人企业id
String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); String orgCode = jsonObj.get("orgCode",FromData.class).getValue();
...@@ -32,16 +42,23 @@ public class RegularizationBusiness extends SpmkAssoBusiness { ...@@ -32,16 +42,23 @@ public class RegularizationBusiness extends SpmkAssoBusiness {
// 发起人id // 发起人id
String id = jsonObj.get("id",FromData.class).getValue(); Integer id = Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 计划转正时间
String confirmationTime = jsonObj.get("confirmationTime",FromData.class).getValue();
// 实际转正时间 // 实际转正时间
String newConfirmationTime = jsonObj.get("__newConfirmationTime",FromData.class).getValue(); String newConfirmationTime = jsonObj.get("__newConfirmationTime",FromData.class).getValue();
// 备注 // 备注
String Remarks = jsonObj.get("Remarks",FromData.class).getValue(); String Remarks = jsonObj.get("Remarks",FromData.class).getValue();
YgzzDto ygzzDto = YgzzDto.builder()
.empNum(id)
.zzTime(DateFormatUtils.getDateByString(confirmationTime))
.sjzzTime(DateFormatUtils.getDateByString(newConfirmationTime))
.zzRemark(Remarks)
.build();
// 调 员工管理 业务 // 调 员工管理 业务
ygglService.applicationRegularization(ygzzDto);
} }
} }
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import java.text.ParseException;
import org.springframework.beans.factory.annotation.Autowired;import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.yggl.service.YgglService;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.utils.DateFormatUtils;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -12,13 +18,16 @@ import lombok.Builder; ...@@ -12,13 +18,16 @@ import lombok.Builder;
@Builder @Builder
public class ResignationBusiness extends SpmkAssoBusiness { public class ResignationBusiness extends SpmkAssoBusiness {
@Autowired
private YgglService ygglService;
@Override @Override
public void handleApprove(JSONObject jsonObj) { public void handleApprove(JSONObject jsonObj) throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// 发起人企业id // 发起人企业id
String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); Integer orgCode = Integer.parseInt(jsonObj.get("orgCode",FromData.class).getValue());
// 发起人id // 发起人id
String id = jsonObj.get("id",FromData.class).getValue(); Integer id = Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称 // 发起人名称
String initiator = jsonObj.get("initiator",FromData.class).getValue(); String initiator = jsonObj.get("initiator",FromData.class).getValue();
...@@ -30,10 +39,18 @@ public class ResignationBusiness extends SpmkAssoBusiness { ...@@ -30,10 +39,18 @@ public class ResignationBusiness extends SpmkAssoBusiness {
String ReasonForResignation = jsonObj.get("__ReasonForResignation",FromData.class).getValue(); String ReasonForResignation = jsonObj.get("__ReasonForResignation",FromData.class).getValue();
// 备注 // 备注
String Remarks = jsonObj.get("Remarks",FromData.class).getValue(); String Remarks = jsonObj.get("Remarks",FromData.class).getValue();
// 上传文件
String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue();
LzygQueryDto dto = LzygQueryDto.builder()
.orgCode(orgCode)
.empNum(id)
.lzTime(DateFormatUtils.getDateByString(terminationDate))
.lzyy(ReasonForResignation)
.lzbz(Remarks)
.build();
// 调 员工管理 业务 // 调 员工管理 业务
ygglService.applicationResignation(dto);
} }
} }
...@@ -11,6 +11,6 @@ import lombok.Data; ...@@ -11,6 +11,6 @@ import lombok.Data;
@Data @Data
public abstract class SpmkAssoBusiness { public abstract class SpmkAssoBusiness {
public abstract void handleApprove(JSONObject jsonObj); public abstract void handleApprove(JSONObject jsonObj) throws Exception;
} }
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -12,13 +16,16 @@ import lombok.Builder; ...@@ -12,13 +16,16 @@ import lombok.Builder;
@Builder @Builder
public class TransferPositionBusiness extends SpmkAssoBusiness { public class TransferPositionBusiness extends SpmkAssoBusiness {
@Autowired
ZzglBmgwMService zzglBmgwMService;
@Override @Override
public void handleApprove(JSONObject jsonObj) { public void handleApprove(JSONObject jsonObj) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// 发起人企业id // 发起人企业id
String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); Integer orgCode = Integer.parseInt(jsonObj.get("orgCode",FromData.class).getValue());
// 发起人id // 发起人id
String id = jsonObj.get("id",FromData.class).getValue(); Integer id = Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称 // 发起人名称
String initiator = jsonObj.get("initiator",FromData.class).getValue(); String initiator = jsonObj.get("initiator",FromData.class).getValue();
...@@ -27,7 +34,7 @@ public class TransferPositionBusiness extends SpmkAssoBusiness { ...@@ -27,7 +34,7 @@ public class TransferPositionBusiness extends SpmkAssoBusiness {
// 申请原因 // 申请原因
String ReasonForApplication = jsonObj.get("__ReasonForApplication",FromData.class).getValue(); String ReasonForApplication = jsonObj.get("__ReasonForApplication",FromData.class).getValue();
// 调入部门 // 调入部门
String TransferInDepartment = jsonObj.get("__TransferInDepartment",FromData.class).getValue(); Integer TransferInDepartment = Integer.parseInt(jsonObj.get("__TransferInDepartment",FromData.class).getValue());
// 调入岗位 // 调入岗位
String TransferInPosition = jsonObj.get("__TransferInPosition",FromData.class).getValue(); String TransferInPosition = jsonObj.get("__TransferInPosition",FromData.class).getValue();
// 生效日期 // 生效日期
...@@ -37,7 +44,13 @@ public class TransferPositionBusiness extends SpmkAssoBusiness { ...@@ -37,7 +44,13 @@ public class TransferPositionBusiness extends SpmkAssoBusiness {
// 上传文件 // 上传文件
String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue();
UpEmpDeptDto upEmpDeptDto = UpEmpDeptDto.builder()
.dpetId(TransferInDepartment)
.isdg(1)
.build();
// 调 员工管理 业务 // 调 员工管理 业务
zzglBmgwMService.applicationTransferPosition(id, orgCode, upEmpDeptDto);
} }
} }
<?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.clazz.CommonAreaMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.clazz.CommonArea" >
<id column="code_id" property="codeId" />
<result column="parent_id" property="parentId" />
<result column="city_name" property="cityName" />
</resultMap>
<resultMap id="BaseResultMap_b" type="cn.timer.api.bean.clazz.CommonArea" >
<id column="code_id" property="codeId" />
<result column="parent_id" property="parentId" />
<result column="city_name" property="cityName" />
<collection column="CommonArea_c_code_id" property="commonAreas" ofType="cn.timer.api.bean.clazz.CommonArea"
resultMap="cn.timer.api.dao.clazz.CommonAreaMapper.BaseResultMap" columnPrefix="CommonArea_c_">
</collection>
</resultMap>
<resultMap id="BaseResultMap_Tree" type="cn.timer.api.bean.clazz.CommonArea" >
<id column="code_id" property="codeId" />
<result column="parent_id" property="parentId" />
<result column="city_name" property="cityName" />
<collection column="CommonArea_b_code_id" property="commonAreas" ofType="cn.timer.api.bean.clazz.CommonArea"
resultMap="cn.timer.api.dao.clazz.CommonAreaMapper.BaseResultMap_b" columnPrefix="CommonArea_b_">
</collection>
</resultMap>
<sql id="Base_Column_List">
code_id,
parent_id,
city_name
</sql>
<sql id="Base_Column_List_Alias">
code_id CommonArea_code_id,
parent_id CommonArea_parent_id,
city_name CommonArea_city_name
</sql>
<sql id="Base_Column_List_Alias_a">
a.code_id code_id,
a.parent_id parent_id,
a.city_name city_name
</sql>
<sql id="Base_Column_List_Alias_b">
b.code_id CommonArea_b_code_id,
b.parent_id CommonArea_b_parent_id,
b.city_name CommonArea_b_city_name
</sql>
<sql id="Base_Column_List_Alias_c">
c.code_id CommonArea_b_CommonArea_c_code_id,
c.parent_id CommonArea_b_CommonArea_c_parent_id,
c.city_name CommonArea_b_CommonArea_c_city_name
</sql>
<select id="AllAreaForTree" resultMap="BaseResultMap_Tree">
SELECT
<include refid="Base_Column_List_Alias_a" />,
<include refid="Base_Column_List_Alias_b" />,
<include refid="Base_Column_List_Alias_c" />
FROM common_area a
LEFT JOIN common_area b ON a.code_id = b.parent_id
LEFT JOIN common_area c ON b.code_id = c.parent_id
WHERE a.parent_id = 0
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.clazz.CommonArea">
INSERT INTO common_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != codeId'>
code_id,
</if>
<if test ='null != parentId'>
parent_id,
</if>
<if test ='null != cityName'>
city_name
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != codeId'>
#{codeId},
</if>
<if test ='null != parentId'>
#{parentId},
</if>
<if test ='null != cityName'>
#{cityName}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM common_area
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.clazz.CommonArea">
UPDATE common_area
<set>
<if test ='null != codeId'>code_id = #{codeId},</if>
<if test ='null != parentId'>parent_id = #{parentId},</if>
<if test ='null != cityName'>city_name = #{cityName}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM common_area
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM common_area
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM common_area
</select>
-->
</mapper>
\ No newline at end of file
...@@ -16,11 +16,33 @@ ...@@ -16,11 +16,33 @@
<result column="current_approver" property="currentApprover" /> <result column="current_approver" property="currentApprover" />
<result column="history_approver" property="historyApprover" /> <result column="history_approver" property="historyApprover" />
<result column="asso_type" property="assoType" /> <result column="asso_type" property="assoType" />
<result column="digest" property="digest" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="end_time" property="endTime" /> <result column="end_time" property="endTime" />
<result column="digest" property="digest" /> <result column="digest" property="digest" />
</resultMap> </resultMap>
<resultMap id="BaseResultMap_As" type="cn.timer.api.bean.spmk.SpmkApproveSummary" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="emp_num" property="empNum" />
<result column="title" property="title" />
<result column="department_name" property="departmentName" />
<result column="initiator" property="initiator" />
<result column="create_time" property="createTime" />
<result column="approve_name" property="approveName" />
<result column="sts" property="sts" />
<result column="current_approver" property="currentApprover" />
<result column="history_approver" property="historyApprover" />
<result column="asso_type" property="assoType" />
<result column="update_time" property="updateTime" />
<result column="end_time" property="endTime" />
<result column="digest" property="digest" />
<result column="gw_name" property="gwName" />
<result column="bm_id" property="bmId" />
<result column="bm_name" property="bmName" />
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, id,
org_code, org_code,
...@@ -75,7 +97,7 @@ ...@@ -75,7 +97,7 @@
digest SpmkApproveSummary_digest digest SpmkApproveSummary_digest
</sql> </sql>
<select id="selectPageByQuery" resultMap="BaseResultMap" > <select id="selectPageByQuery" resultMap="BaseResultMap_As" >
SELECT SELECT
<include refid="Base_Column_List_a" />, <include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name, (SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name,
...@@ -90,8 +112,7 @@ ...@@ -90,8 +112,7 @@
a.id like CONCAT(#{param.query},'%') a.id like CONCAT(#{param.query},'%')
) )
</if> </if>
<if test="param.sts != null">
<if test="param.sts != null and param.sts != ''">
and a.sts = #{param.sts} and a.sts = #{param.sts}
</if> </if>
<if test="param.startTime != null and param.startTime != ''"> <if test="param.startTime != null and param.startTime != ''">
...@@ -112,7 +133,7 @@ ...@@ -112,7 +133,7 @@
</select> </select>
<select id="selectPageByQueryForEmpNum" resultMap="BaseResultMap" > <select id="selectPageByQueryForEmpNum" resultMap="BaseResultMap_As" >
SELECT SELECT
<include refid="Base_Column_List_a" />, <include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name, (SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name,
...@@ -133,7 +154,7 @@ ...@@ -133,7 +154,7 @@
and a.emp_num = #{param.empNum} and a.emp_num = #{param.empNum}
</if> </if>
<if test="param.sts != null and param.sts != ''"> <if test="param.sts != null">
and a.sts = #{param.sts} and a.sts = #{param.sts}
</if> </if>
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="eclipse" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">
<classpath>
<dir name="C:/Users/Administrator/git/8timerapiv200/target/classes">
</dir>
</classpath>
</application>
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