14 changed files with 387 additions and 54 deletions
@ -1,26 +0,0 @@ |
|||
package com.qs.serve.modules.portal; |
|||
|
|||
import com.qs.serve.common.model.dto.R; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
/** |
|||
* 门户:API通用接口 |
|||
* @author YenHex |
|||
* @since 2022/3/14 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/api/common") |
|||
public class CommonApi { |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.qs.serve.modules.portal.dto; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* 系统租户 实体类 |
|||
* @author YenHex |
|||
* @since 2022-03-01 |
|||
*/ |
|||
@Data |
|||
@TableName("sys_tenant") |
|||
public class SysTenant implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 租户id */ |
|||
@TableId(type = IdType.ASSIGN_UUID) |
|||
private String id; |
|||
|
|||
/** 租户名称 */ |
|||
@TableField(condition = SqlCondition.LIKE) |
|||
private String name; |
|||
|
|||
/** 校区电话 */ |
|||
private String callNum; |
|||
|
|||
/** 校区地址 */ |
|||
private String address; |
|||
|
|||
/** 创建时间 */ |
|||
@JsonIgnore |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 创建人 */ |
|||
@JsonIgnore |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新时间 */ |
|||
@JsonIgnore |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 更新人 */ |
|||
@JsonIgnore |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 删除标识 */ |
|||
@JsonIgnore |
|||
private Boolean delFlag; |
|||
} |
|||
|
@ -0,0 +1,100 @@ |
|||
package com.qs.serve.modules.visit.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import com.qs.serve.common.util.CopierUtil; |
|||
import com.qs.serve.common.util.StringUtils; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.visit.entity.VisitMain; |
|||
import com.qs.serve.modules.visit.service.VisitMainService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 系统 拜访 |
|||
* @author YenHex |
|||
* @since 2024-09-11 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("visit/main") |
|||
public class VisitMainController { |
|||
|
|||
private VisitMainService visitMainService; |
|||
|
|||
/** |
|||
* 翻页 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
public R<PageVo<VisitMain>> getPage(VisitMain param){ |
|||
LambdaQueryWrapper<VisitMain> lqw = new LambdaQueryWrapper<>(param); |
|||
PageUtil.startPage(); |
|||
List<VisitMain> list = visitMainService.list(lqw); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.VISIT, title = "拜访", biz = BizType.QUERY) |
|||
public R<VisitMain> getById(@PathVariable("id") String id){ |
|||
VisitMain visitMain = visitMainService.getById(id); |
|||
return R.ok(visitMain); |
|||
} |
|||
|
|||
/** |
|||
* 更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.VISIT, title = "拜访", biz = BizType.UPDATE) |
|||
public R<?> updateById(@RequestBody @Valid VisitMain param){ |
|||
param.setCheckState(null); |
|||
boolean result = visitMainService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.VISIT, title = "拜访", biz = BizType.INSERT) |
|||
public R<?> save(@RequestBody @Valid VisitMain param){ |
|||
boolean result = visitMainService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除 |
|||
* @param ids |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{ids}") |
|||
@SysLog(module = SystemModule.VISIT, title = "拜访", biz = BizType.DELETE) |
|||
public R<?> deleteById(@PathVariable("ids") String ids){ |
|||
List<Long> idsLong = StringUtils.splitIdLong(ids); |
|||
boolean result = visitMainService.removeByIds(idsLong); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,144 @@ |
|||
package com.qs.serve.modules.visit.entity; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 拜访 实体类 |
|||
* @author YenHex |
|||
* @since 2024-09-11 |
|||
*/ |
|||
@Data |
|||
@TableName("visit_main") |
|||
public class VisitMain implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 审批状态 */ |
|||
private Integer checkState; |
|||
|
|||
/** 部门id */ |
|||
@Length(max = 255,message = "部门id长度不能超过255字") |
|||
private String deptId; |
|||
|
|||
/** 部门昵称 */ |
|||
@Length(max = 255,message = "部门昵称长度不能超过255字") |
|||
private String deptName; |
|||
|
|||
/** 用户id */ |
|||
@Length(max = 255,message = "用户id长度不能超过255字") |
|||
private String userId; |
|||
|
|||
/** 用户编码 */ |
|||
@Length(max = 255,message = "用户编码长度不能超过255字") |
|||
private String userCode; |
|||
|
|||
/** 用户名称 */ |
|||
@Length(max = 255,message = "用户名称长度不能超过255字") |
|||
private String userName; |
|||
|
|||
/** 预约拜访日期 */ |
|||
@NotNull(message = "预约拜访日期不能为空") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
|||
private LocalDate preVisitDate; |
|||
|
|||
/** 实际来访时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
private LocalDateTime visitTime; |
|||
|
|||
/** 来访公司 */ |
|||
@Length(max = 255,message = "来访公司长度不能超过255字") |
|||
private String visitorCompany; |
|||
|
|||
/** 来访人姓名 */ |
|||
@Length(max = 255,message = "来访人姓名长度不能超过255字") |
|||
private String visitorName; |
|||
|
|||
/** 来访人电话 */ |
|||
@Length(max = 255,message = "来访人电话长度不能超过255字") |
|||
private String visitorMobile; |
|||
|
|||
/** 来访人数合计 */ |
|||
@Length(max = 255,message = "来访人数合计长度不能超过255字") |
|||
private String visitorSum; |
|||
|
|||
/** 来访内容 */ |
|||
@Length(max = 255,message = "来访内容长度不能超过255字") |
|||
private String visitorContext; |
|||
|
|||
/** 备注 */ |
|||
@Length(max = 255,message = "备注长度不能超过255字") |
|||
private String remark; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 删除标识 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private Boolean delFlag; |
|||
|
|||
|
|||
public static VisitMain toNewObject(VisitMain source){ |
|||
VisitMain main = new VisitMain(); |
|||
main.setId(source.getId()); |
|||
main.setCheckState(source.getCheckState()); |
|||
main.setDeptId(source.getDeptId()); |
|||
main.setDeptName(source.getDeptName()); |
|||
main.setUserId(source.getUserId()); |
|||
main.setUserCode(source.getUserCode()); |
|||
main.setUserName(source.getUserName()); |
|||
main.setPreVisitDate(source.getPreVisitDate()); |
|||
main.setVisitTime(source.getVisitTime()); |
|||
main.setVisitorCompany(source.getVisitorCompany()); |
|||
main.setVisitorName(source.getVisitorName()); |
|||
main.setVisitorMobile(source.getVisitorMobile()); |
|||
main.setVisitorSum(source.getVisitorSum()); |
|||
main.setVisitorContext(source.getVisitorContext()); |
|||
main.setRemark(source.getRemark()); |
|||
main.setCreateTime(source.getCreateTime()); |
|||
main.setCreateBy(source.getCreateBy()); |
|||
main.setUpdateTime(source.getUpdateTime()); |
|||
main.setUpdateBy(source.getUpdateBy()); |
|||
main.setDelFlag(source.getDelFlag()); |
|||
return main; |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.visit.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.visit.entity.VisitMain; |
|||
|
|||
/** |
|||
* 拜访 Mapper |
|||
* @author YenHex |
|||
* @date 2024-09-11 |
|||
*/ |
|||
public interface VisitMainMapper extends BaseMapper<VisitMain> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.visit.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.visit.entity.VisitMain; |
|||
|
|||
/** |
|||
* 拜访 服务接口 |
|||
* @author YenHex |
|||
* @date 2024-09-11 |
|||
*/ |
|||
public interface VisitMainService extends IService<VisitMain> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.visit.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.visit.entity.VisitMain; |
|||
import com.qs.serve.modules.visit.service.VisitMainService; |
|||
import com.qs.serve.modules.visit.mapper.VisitMainMapper; |
|||
|
|||
/** |
|||
* 拜访 服务实现类 |
|||
* @author YenHex |
|||
* @since 2024-09-11 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class VisitMainServiceImpl extends ServiceImpl<VisitMainMapper,VisitMain> implements VisitMainService { |
|||
|
|||
} |
|||
|
Loading…
Reference in new issue