Commit 22760536 by tangzhaoqian

+1

parents 37b1a356 9fbba089
/**
* <p>Title: China.java</p>
* <p>Description: </p>
* @author dsc
* @date 2020年5月11日
* @version 1.0
*/
package cn.timer.api.bean.clazz;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
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;
/**
* <p>
* Title: China.java
* </p>
* <p>
* Description:
* </p>
*
* @author dsc
* @date 2020年5月11日
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("地区字典表(全)")
public class SysRegion extends Model<SysRegion>{
private static final long serialVersionUID = -3184372953004418673L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "区域主键", example = "1")
private Integer keyId;
@ApiModelProperty(value = "区域名称", example = "10")
private String regionName;
@ApiModelProperty(value = "区域编码", example = "1")
private String regionCode;
@ApiModelProperty(value = "地名简称", example = "1")
private String simpleName;
@ApiModelProperty(value = "区域等级", example = "1")
private Integer level;
@ApiModelProperty(value = "城市编码", example = "1")
private String cityCode;
@ApiModelProperty(value = "邮政编码", example = "1")
private String zipCode;
@ApiModelProperty(value = "组合名称", example = "1")
private String merName;
@ApiModelProperty(value = "经度", example = "1")
private Float lng;
@ApiModelProperty(value = "纬度", example = "1")
private Float lat;
@ApiModelProperty(value = "拼音/英文名", example = "1")
private String enName;
}
......@@ -41,7 +41,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
private String name;
@ApiModelProperty(value = "请假单位 ", example = "1:按天请假;2:按半天;3:按小时")
private String company;
private Integer company;
@ApiModelProperty(value = "假期类型 ", example = "1:系统项;2:自定义项")
private Integer leaveType;
......
......@@ -41,7 +41,7 @@ public class KqglAssoOvertimeRules extends Model<KqglAssoOvertimeRules> {
private String name;
@ApiModelProperty(value = "应用范围", example = "1")
private Integer appliedScope;
private String appliedScope;
@ApiModelProperty(value = "工作日是否允许加班 0:否;1:是", example = "1")
private Integer isWorkovertime;
......
package cn.timer.api.controller.kqgl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
......@@ -177,9 +179,16 @@ public class TimeCardController {
overrules.setCreateTime(new Date().getTime());
overrules.setOrgCode(userBean.getOrgCode());
overrules.setCreateUserid(userBean.getEmpNum());
String[] launchs = overrules.getApplyrange();
String appliedscope = StringUtils.join(launchs, ",");
// rul.setAppliedScope(appliedscope);//应用范围
overrules.setAppliedScope(appliedscope);
KqglAssoOvertimeRules rul = KqglAssoOvertimeRules.builder().build();
// 克隆 KqglAssoOvertimeRulesDto对象 到 KqglAssoOvertimeRules对象
BeanUtil.copyProperties(overrules, rul , "starttime");
BeanUtil.copyProperties(overrules, rul , "starttime","applyrange");
if (!rul.insertOrUpdate())
return ResultUtil.error("操作失败");
......@@ -213,9 +222,14 @@ public class TimeCardController {
public Result<IndividualOvertimeRuleDto> getOvertimeRules(@PathVariable("id") Integer id) {
IndividualOvertimeRuleDto overrule = IndividualOvertimeRuleDto.builder().build();
KqglAssoOvertimeRules rules = KqglAssoOvertimeRules.builder().id(id).build().selectById();
overrule.setRules(rules);
String str = rules.getAppliedScope();
String[] arr = str.split(","); // 用,分割
KqglAssoOvertimeRulesDto ruldto = KqglAssoOvertimeRulesDto.builder().build();
ruldto.setApplyrange(arr);
BeanUtil.copyProperties(rules, ruldto , "starttime","applyrange");
overrule.setRules(ruldto);
List<KqglAssOvertimeVice> vice = new LambdaQueryChainWrapper<KqglAssOvertimeVice>(kqglassovertimevicemapper).eq(KqglAssOvertimeVice::getOvertimeRulesId, id).list();
overrule.setVice(vice);
overrule.setStarttime(vice);
return ResultUtil.data(overrule,"操作成功!");
}
......@@ -351,7 +365,7 @@ public class TimeCardController {
KqglAssoLeaveRules rules = KqglAssoLeaveRules.builder().id(id).build().selectById();
overrule.setRules(rules);
List<KqglAssoRulesVice> vice = new LambdaQueryChainWrapper<KqglAssoRulesVice>(kqglassorulesvicemapper).eq(KqglAssoRulesVice::getLeaveRulesId, id).list();
overrule.setVice(vice);
overrule.setRange(vice);
return ResultUtil.data(overrule,"操作成功!");
}
......@@ -639,6 +653,37 @@ public class TimeCardController {
}
/**
* 根据组织机构代码 获取加班基础设置信息
*/
@PostMapping(value = "/overtime_basic_information")
@ApiOperation(value = "32:根据组织机构代码 获取加班基础设置信息", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 32)
public Result<Object> overtimebasicinformation(@CurrentUser UserBean userBean) {
KqglAssoOvertimeBasics kqjdev = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(kqjdev, "操作成功!");
}
/**
* 查询列表-获取假期规则数据-分页
*/
@PostMapping(value = "/select_leave_rules")
@ApiOperation(value = "33:获取假期规则数据-分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 33)
public Result<Object> selectleaverules(@CurrentUser UserBean userBean, @RequestBody AttqueryCriteriaDto attquerycriteriadto) {
IPage<KqglAssoLeaveRules> page = new Page<KqglAssoLeaveRules>(
attquerycriteriadto.getCurrentPage() == null ? 1 : attquerycriteriadto.getCurrentPage(),
attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage());
attquerycriteriadto.setOrgCode(userBean.getOrgCode());
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
IPage<KqglAssoLeaveRules> pageAs = kqglassoleaverulesmapper.selectPage(page, new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, userBean.getOrgCode()));
List<KqglAssoLeaveRules> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
/**
* 查询列表-加班补偿方式
*/
@GetMapping(value = "/list_compensate")
......
......@@ -120,27 +120,37 @@ public class OSSController {
* DELETE
*
* @param moudle
* @param fileName
************/
@DeleteMapping(value = "/delSingle")
@ApiOperation(value = "删除单个(谨慎使用)", httpMethod = "DELETE", notes = "接口发布说明")
public Result<String> delSingle(@CurrentUser UserBean userBean, @RequestParam(required = false) String moudle,
@RequestParam(required = false) String fileName) {
String path = "8timer2.0/" + userBean.getOrgCode() + "/" + moudle + "/" + fileName;
oss.delSingleFile(path);
try {
String path = "8timer2.0/" + userBean.getOrgCode() + "/" + moudle + "/" + fileName;
oss.delSingleFile(path);
} catch (Exception e) {
e.getStackTrace();
}
return ResultUtil.success("删除成功");
}
@DeleteMapping(value = "/delFiles")
@ApiOperation(value = "删除多个(谨慎使用,谨慎使用)", httpMethod = "DELETE", notes = "接口发布说明")
public Result<List<String>> delFiles(@CurrentUser UserBean userBean, @RequestBody OssDto ossDto) {
List<String> list = null;
List<String> keys = null;
for (String fileName : ossDto.getFileNames()) {
keys = new ArrayList<String>();
String key = "8timer2.0/" + userBean.getOrgCode() + "/" + ossDto.getMoudle() + "/" + fileName;
keys.add(key);
try {
for (String fileName : ossDto.getFileNames()) {
keys = new ArrayList<String>();
String key = "8timer2.0/" + userBean.getOrgCode() + "/" + ossDto.getMoudle() + "/" + fileName;
keys.add(key);
}
list = oss.delFiles(keys, ossDto.isQuiet());
} catch (Exception e) {
e.getStackTrace();
}
List<String> list = oss.delFiles(keys, ossDto.isQuiet());
return ResultUtil.data(list, "删除成功");
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* <p>Title: SysRegionMapper.java</p>
* <p>Description: </p>
* @author dsc
* @date 2020年5月11日
* @version 1.0
*/
package cn.timer.api.dao.clazz;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.clazz.SysRegion;
/**
* <p>
* Title: SysRegionMapper.java
* </p>
* <p>
* Description:
* </p>
*
* @author dsc
* @date 2020年5月11日
* @version 1.0
*/
public interface SysRegionMapper extends BaseMapper<SysRegion> {
}
......@@ -17,8 +17,8 @@ import lombok.NoArgsConstructor;
public class IndividualOvertimeRuleDto {
@ApiModelProperty(value = "加班规则数据 ", example = "字段说明")
KqglAssoOvertimeRules rules;
KqglAssoOvertimeRulesDto rules;
@ApiModelProperty(value = "加班规则-扣除休息时间 ", example = "字段说明")
List<KqglAssOvertimeVice> vice;
List<KqglAssOvertimeVice> starttime;
}
......@@ -22,7 +22,7 @@ public class KqglAssoLeaveRulesDto {
private String name;
@ApiModelProperty(value = "请假单位 ", example = "1:按天请假;2:按半天;3:按小时")
private String company;
private Integer company;
@ApiModelProperty(value = "假期类型 ", example = "1:系统项;2:自定义项")
private Integer leaveType;
......
......@@ -21,7 +21,7 @@ public class KqglAssoOvertimeRulesDto {
private String name;
@ApiModelProperty(value = "应用范围", example = "1")
private Integer appliedScope;
private String appliedScope;
@ApiModelProperty(value = "工作日是否允许加班 0:否;1:是", example = "1")
private Integer isWorkovertime;
......@@ -97,6 +97,8 @@ public class KqglAssoOvertimeRulesDto {
@ApiModelProperty(value = "扣除休息时间段", example = "12:00-13:30")
private StartTimeRestDto[] starttime;
@ApiModelProperty(value = "应用范围", example = "[]")
private String[] applyrange;
}
\ No newline at end of file
......@@ -20,6 +20,6 @@ public class VacationInformationDto {
KqglAssoLeaveRules rules;
@ApiModelProperty(value = "假期规则-适用范围 ", example = "字段说明")
List<KqglAssoRulesVice> vice;
List<KqglAssoRulesVice> range;
}
......@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.timer.api.bean.sche.ScheduleTask;
public class CronUtil {
// 默认cron 10秒一次
private static String cron = "0/10 * * * * ?";
// 默认cron 30秒一次
private static String cron = "0 0 8 * * ?";
// private static String cron = "0 50 14 * * ?";
// 数据库cron
public static String getCron(String className, String methodName) {
......
......@@ -28,7 +28,7 @@ import cn.timer.api.utils.aliyun.AliyunSMS;
*
*/
@Component
@Lazy(false)
@Lazy
public class RemindUtil implements SchedulingConfigurer {
@Autowired
......
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